Skip to content

Commit

Permalink
Add security tag to sarif output
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Brown <[email protected]>
  • Loading branch information
ericwb committed Mar 5, 2024
1 parent 9480250 commit a3b33cd
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 a3b33cd

Please sign in to comment.