mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-24 04:14:18 +00:00
fix(sdk): drop partialFingerprints from SARIF output
Let github/codeql-action/upload-sarif compute fingerprints from file content instead of using Prowler UIDs, which conflict with GitHub's expected format.
This commit is contained in:
3 files changed
+5
-5
No files matched your search
@@ -72,9 +72,6 @@ class SARIF(Output):
|
||||
"ruleIndex": rule_index,
|
||||
"level": SEVERITY_TO_SARIF_LEVEL.get(severity, "note"),
|
||||
"message": {"text": finding.status_extended},
|
||||
"partialFingerprints": {
|
||||
"primaryLocationLineHash": finding.uid,
|
||||
},
|
||||
}
|
||||
|
||||
location = self._build_location(finding)
|
||||
|
||||
@@ -9,6 +9,7 @@ from prowler.config.config import (
|
||||
json_asff_file_suffix,
|
||||
json_ocsf_file_suffix,
|
||||
orange_color,
|
||||
sarif_file_suffix,
|
||||
)
|
||||
from prowler.lib.logger import logger
|
||||
from prowler.providers.github.models import GithubAppIdentityInfo, GithubIdentityInfo
|
||||
@@ -207,6 +208,10 @@ def display_summary_table(
|
||||
print(
|
||||
f" - HTML: {output_directory}/{output_filename}{html_file_suffix}"
|
||||
)
|
||||
if "sarif" in output_options.output_modes:
|
||||
print(
|
||||
f" - SARIF: {output_directory}/{output_filename}{sarif_file_suffix}"
|
||||
)
|
||||
|
||||
else:
|
||||
print(
|
||||
|
||||
@@ -40,7 +40,6 @@ class TestSARIF:
|
||||
assert result["ruleIndex"] == 0
|
||||
assert result["level"] == "error"
|
||||
assert result["message"]["text"] == "S3 bucket is not encrypted"
|
||||
assert result["partialFingerprints"]["primaryLocationLineHash"] is not None
|
||||
|
||||
def test_transform_pass_finding_excluded(self):
|
||||
finding = generate_finding_output(status="PASS", severity="high")
|
||||
@@ -234,7 +233,6 @@ class TestSARIF:
|
||||
assert "ruleIndex" in result
|
||||
assert "level" in result
|
||||
assert "message" in result
|
||||
assert "partialFingerprints" in result
|
||||
assert "locations" in result
|
||||
|
||||
loc = result["locations"][0]["physicalLocation"]
|
||||
|
||||
Reference in new issue
Block a user