diff --git a/framework/python/src/common/session.py b/framework/python/src/common/session.py index 038a43879..d742a7177 100644 --- a/framework/python/src/common/session.py +++ b/framework/python/src/common/session.py @@ -448,19 +448,14 @@ def update_profile(self, profile_json): else: + old_name = risk_profile.name + risk_profile.update(profile_json, self._profile_format) # Check if name has changed if 'rename' in profile_json: - # Delete the original file - os.remove(os.path.join(PROFILES_DIR, risk_profile.name + '.json')) - # Find the index of the risk_profile to replace - index_to_replace = next( - (index for (index, d) in enumerate( - self._profiles) if d.name == profile_name), None) - - if index_to_replace is not None: - self._profiles[index_to_replace] = risk_profile + # Delete the original file + os.remove(os.path.join(PROFILES_DIR, old_name + '.json')) # Write file to disk with open( diff --git a/local/risk_profiles/Primary profile.json b/local/risk_profiles/Primary profile.json deleted file mode 100644 index f95947111..000000000 --- a/local/risk_profiles/Primary profile.json +++ /dev/null @@ -1 +0,0 @@ -{"name": "Primary profile", "version": "1.3-alpha", "created": "2024-06-27", "status": "Valid", "risk": "High", "questions": [{"question": "What type of device is this?", "answer": "IoT Gateway", "risk": "High"}, {"question": "How will this device be used at Google?", "answer": "Hey"}, {"question": "Is this device going to be managed by Google or a third party?", "answer": "Google", "risk": "Limited"}, {"question": "Will the third-party device administrator be able to grant access to authorized Google personnel upon request?", "answer": "Yes", "risk": "Limited"}, {"question": "Are any of the following statements true about your device?", "answer": [3], "risk": "Limited"}, {"question": "Which of the following statements are true about this device?", "answer": [5], "risk": "Limited"}, {"question": "Does the network protocol assure server-to-client identity verification?", "answer": "Yes", "risk": "Limited"}, {"question": "Click the statements that best describe the characteristics of this device.", "answer": [4], "risk": "High"}, {"question": "Are any of the following statements true about this device?", "answer": [0], "risk": "High"}]} \ No newline at end of file