mirror of
https://github.com/MISP/misp-galaxy.git
synced 2024-11-25 16:27:19 +00:00
chg: [tools] fix the attribution confidence level
This commit is contained in:
parent
095b0a4d81
commit
6e19d21d3a
1 changed files with 5 additions and 1 deletions
|
@ -16,7 +16,11 @@ with open(args.filename) as json_file:
|
||||||
for value in data['values']:
|
for value in data['values']:
|
||||||
if value.get('meta'):
|
if value.get('meta'):
|
||||||
if not value.get('meta').get('attribution-confidence') and (value.get('meta').get('cfr-suspected-state-sponsor') or value.get('meta').get('country')):
|
if not value.get('meta').get('attribution-confidence') and (value.get('meta').get('cfr-suspected-state-sponsor') or value.get('meta').get('country')):
|
||||||
value.get('meta')['attribution-confidence'] = 50
|
value.set('meta')['attribution-confidence'] = "50"
|
||||||
|
elif value.get('meta').get('attribution-confidence') and (value.get('meta').get('cfr-suspected-state-sponsor') or value.get('meta').get('country')):
|
||||||
|
value.get('meta')['attribution-confidence'] = str(value.get('meta').get('attribution-confidence'))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
with open(args.filename, 'w') as json_file:
|
with open(args.filename, 'w') as json_file:
|
||||||
json.dump(data, json_file, indent=2, sort_keys=True, ensure_ascii=False)
|
json.dump(data, json_file, indent=2, sort_keys=True, ensure_ascii=False)
|
||||||
|
|
Loading…
Reference in a new issue