From 33455bd3bc18efd5e99133af2e07faa94c4657cd Mon Sep 17 00:00:00 2001 From: Rich Piazza Date: Mon, 19 Aug 2024 15:45:28 -0400 Subject: [PATCH] deterministic-id-checker --- determinsitic-id-checker.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 determinsitic-id-checker.py diff --git a/determinsitic-id-checker.py b/determinsitic-id-checker.py new file mode 100644 index 00000000..9f45a020 --- /dev/null +++ b/determinsitic-id-checker.py @@ -0,0 +1,15 @@ +import json +import stix2 + +def main(): + with open("sco-examples-bundle.json", "r", encoding="utf-8") as examples: + all_examples = json.load(examples) + for obj in all_examples: + existing_id = obj["id"] + del obj["id"] + stix_obj = stix2.parse(obj) + print(f"id {existing_id} should be {stix_obj['id']}") + + +if __name__ == "__main__": + main() \ No newline at end of file