GitHub Actions
findings:read in addition to the three scopes the
policy gate uses.
GitHub code scanning is included for public repositories and needs GitHub
Code Security (formerly Advanced Security) for private ones. That is GitHub’s
requirement, not TRUSTIVAN’s.
The scan runs on the TRUSTIVAN deployment, which clones the repository
itself. For a private repository, store a git credential first:
Scan a private repository.
From the command line
--sarif is accepted by both scan and gate, and implies waiting for the
scan to finish:
--sarif - writes the log to standard output. gate writes the log before it
acts on the verdict, so a blocked build still produces one. Neither command
writes a log for a scan that failed: an empty log would tell the code host the
commit is clean.
Other code hosts take the same file. GitLab reads SARIF through its own
converters, and Azure DevOps through the SARIF SAST Scans Tab extension; those
two paths have not been exercised by TRUSTIVAN’s tests.
From the API
GET /api/v1/scans/{id}/sarif needs findings:read and answers
application/sarif+json. A scan that is still queued or running answers 409.
What is in the log
A secret finding’s result carries the detector and the location, never the
secret: TRUSTIVAN does not store the value.
Limits
- 5,000 results per log. Past that the least severe are dropped and
runs[0].properties.truncatedistrue. GitHub’s own limit is 25,000 results per run. - Suppressed findings are left out, and counted in
omittedSuppressedOrResolved. Suppress a finding in TRUSTIVAN and the next upload closes its alert on GitHub. - Export only. TRUSTIVAN does not import SARIF from another tool.
- Paths are what the scanner recorded. For a repository scan they are relative to the repository root, which is what GitHub needs to place an annotation. For an image scan they are paths inside the image and annotate nothing in a pull request; those results appear in the code scanning list only.
- The log’s structure is validated against the OASIS SARIF 2.1.0 schema in TRUSTIVAN’s test suite. An upload to GitHub is not part of that suite.