Skip to content

Commit

Permalink
feat: Add additional key in json output for namespace based rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Tengson committed Nov 15, 2023
1 parent b0451e9 commit bc6a1d5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hardeneks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ def ndd():
"namespace": rule.result.namespace,
"resolution": rule.url,
}
json_blob[rule._type][rule.pillar][rule.section][rule.message] = result
if rule._type == "namespace_based":
json_blob[rule._type][rule.pillar][rule.section][rule.result.namespace][rule.message] = result
else:
json_blob[rule._type][rule.pillar][rule.section][rule.message] = result
with open(json_path, "w", encoding="utf-8") as f:
json.dump(json_blob, f, ensure_ascii=False, indent=4)

Expand Down

0 comments on commit bc6a1d5

Please sign in to comment.