From f12df578abe271670b43282d3cf249552debdb47 Mon Sep 17 00:00:00 2001 From: Christophe Vandeplas Date: Tue, 19 Dec 2023 15:57:20 +0100 Subject: [PATCH] fix: [code] Fix MISP Galaxy value without ID --- CODE/generate_DISARM_MISP_galaxy.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CODE/generate_DISARM_MISP_galaxy.py b/CODE/generate_DISARM_MISP_galaxy.py index 00645d4..2906e54 100755 --- a/CODE/generate_DISARM_MISP_galaxy.py +++ b/CODE/generate_DISARM_MISP_galaxy.py @@ -50,12 +50,12 @@ class DisarmGalaxy: 'uuid': str(uuid.uuid5(uuid.UUID("9319371e-2504-4128-8410-3741cebbcfd3"), 'disarm-cluster-techniques')), 'values': [], 'version': 1} - + values = [] df = self.disarm.df_techniques for i in range(len(df)): t = { 'uuid': str(uuid.uuid5(uuid.UUID("9319371e-2504-4128-8410-3741cebbcfd3"), df.values[i][0])), - 'value': f"{df.values[i][0]} - {df.values[i][1]}", + 'value': f"{df.values[i][1]}", 'description': df.values[i][4], 'meta': { 'external_id': df.values[i][0], @@ -68,8 +68,8 @@ class DisarmGalaxy: } } - cluster['values'].append(t) - + values.append(t) + cluster['values'] = sorted(values, key=lambda x: x['meta']['external_id']) self.write_json_file(os.path.join(self.out_path, 'clusters', 'disarm-techniques.json'), cluster) pass