cisagov / cset

Cybersecurity Evaluation Tool
MIT License
1.36k stars 240 forks source link

Preserve Assessment GUIDs on Import #3973

Closed Marcus-Goectau closed 1 week ago

Marcus-Goectau commented 1 week ago

๐Ÿ—ฃ Description

If an assessment already exists with the same GUID (i.e. you are re-importing an assessment you just exported), then the assessment will be cloned with a new GUID value. However, if no assessment already exists with the same GUID, the GUID linked to the exported assessment should carry over when imported. The overwrite functionality is a specific use case for CRRM, where imports will create/update assessments instead of always creating new assessments like in CSET. If CSET ever wanted to have some sort of option to toggle on and off overwriting import overwriting, that is always be an option now.

๐Ÿ’ญ Motivation and context

This change is important for the functionality of CRRM, where assessment importing acts as an update/overwrite mechanism instead of cloning. Preserving the GUIDS on import is the only way we can determine if an import should create a brand new upload record or overwrite an existing one.

๐Ÿงช Testing

Tested locally and the existing import behavior of CSET should remain unchanged.

โœ… Pre-approval checklist

โœ… Pre-merge checklist

โœ… Post-merge checklist