-
-
Save dgwhited/3e51826ad5b3fb29d476817f88ac7f7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from parliament import Policy | |
def run_parliament(policy_json, policy_name): | |
policy = Policy(policy_json) | |
policy.analyze() | |
# Assign finding details | |
findings = [ | |
{ | |
"issue": finding.issue, | |
"title": finding.title, | |
"severity": finding.severity, | |
"description": finding.description, | |
"detail": finding.detail, | |
"location": finding.location, | |
"policy_name": policy_name | |
} | |
for finding in policy.findings | |
] | |
# Deduplicate the findings for easy output | |
deduped_findings = [] | |
for f in findings: | |
if f not in deduped_findings: | |
deduped_findings.append(f) | |
return deduped_findings |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment