Repository navigation
Add review_sarif for SARIF 2.1.0 CI code scanning - #171
Open
thongtuehuu-cyber wants to merge 1 commit into
Open
thongtuehuu-cyber wants to merge 1 commit into
thongtuehuu-cyber wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
proofline.review_sarif(outcome, *, include_resolved=False)to render aReviewOutcomeas a deterministic SARIF 2.1.0 document ready for GitHub Code Scanning (github/codeql-action/upload-sarif) and other SARIF-compatible CI consumers.Why & Who This Helps
runs[0].invocations[0].executionSuccessfulistrueonly whenoutcome.status == "COMPLETED"andoutcome.gapsis empty. AnyINCOMPLETE,FAILED,STOPPED,TIMED_OUT, or gap-bearing review setsexecutionSuccessful: falseand emits structuredtoolExecutionNotificationsso CI never misinterprets an incomplete run as zero risk.How It Was Built
proofline/sarif.py(zero new dependencies, strictly typed, compliant withscripts/contracts.pyvocabulary rules):CustomerFinding) with severity (SERIOUS/HIGH->error,WARNING/MEDIUM->warning), rule IDs (rule_refsorproofline/<risk_domain>), primaryrepository_filelocations +relatedLocations, and retainedfinding_fingerprint(partialFingerprints, omitted when absent — never synthesized).RESOLVEDfindings by default (include_resolved=Trueopts in), omits[withheld: environment value]findings with an explicit warning notification, and rejects..path traversal in artifact URIs.review_sariffromproofline/__init__.py.tests/test_sarif.pycovering ENV findings,include_resolved, incomplete/gap notifications, CODE-lane fallback, withheld findings, path traversal rejection, and input validation.Verification
python scripts/generate.py --check(exit 0)python scripts/contracts.py(exit 0)python -m ruff check .&python -m ruff format --check .(exit 0)python -m mypy proofline scripts— 0 issues in 254 source files (exit 0)python -m pytest -q— 240 passed (exit 0)