Skip to content

Commit

Permalink
Add security tag to sarif output (#321)
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Brown <eric.brown@securesauce.dev>
  • Loading branch information
ericwb authored Mar 5, 2024
1 parent 9480250 commit 83996e3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions precli/renderers/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
from precli.renderers import Renderer


SCHEMA_URI = (
"https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/"
"sarif-schema-2.1.0.json"
)
SCHEMA_URI = "https://json.schemastore.org/sarif-2.1.0.json"
TS_FORMAT = "%Y-%m-%dT%H:%M:%SZ"


Expand Down Expand Up @@ -63,13 +60,16 @@ def create_rule_array(self, run: Run):
for rule in run.tool.rules:
reporting_descriptor = sarif_om.ReportingDescriptor(
id=rule.id,
name=rule.__class__.__name__,
help_uri=rule.help_url,
message_strings={
"errorMessage": sarif_om.MultiformatMessageString(
"default": sarif_om.MultiformatMessageString(
text=rule.message
)
},
name=rule.__class__.__name__,
properties={
"tags": ["security"],
},
)
rules.append(reporting_descriptor)

Expand Down

0 comments on commit 83996e3

Please sign in to comment.