Infraista DocsDocs
Developer toolsCode Security

Scans and the gate

How Code Security scans a commit, compares it with the branch it targets, decides whether the gate passes or fails, and grades each repository from A to F.

A scan checks one commit of a repository with the scanners you turned on. Its gate decides whether the infraista/security check passes.

When scans run

  • Push to the default branch, or to a branch matching the repository's extra patterns.
  • Pull request opened, updated or reopened, when pull requests are on.
  • Nightly, on the default branch, at the time you chose.
  • Scan now or Re-run scan from the console, the Pipelines step, or the API.

A scan already queued or running for the same commit is reused instead of starting another.

New, existing and fixed

Each scan compares its findings with a base:

  • on a branch, the previous finished scan of that branch;
  • on a pull request, the newest scan of the branch it targets.

A finding is new when the base didn't have it, existing when it did, and fixed when the base had it and this commit doesn't. A branch's first scan counts everything as existing. A finding stays open while any branch or pull request still has it, and reopens if it comes back.

The gate

The gate fails on what the change adds, so old findings never block a new change. By default:

WhereFails on
Default branch, pull requests, release/*New Critical or High findings, any secret, denied licenses
All other branchesNew Critical findings, any secret
  • Secrets fail the gate wherever the policy's Secrets box is ticked, even when someone ignored the finding, until the secret is removed from the code.
  • Ignored findings don't count, except secrets.
  • AI code review findings never count.

Change these rules in Policies. A repository's own settings can only make the gate stricter.

The scan page shows the gate result and the reasons, such as "2 new High, 1 secret", with links to the findings that block.

A repository's Scans tab listing scans with their trigger, branch or pull request, gate result and new findingsA repository's Scans tab listing scans with their trigger, branch or pull request, gate result and new findings

Grades

Each repository gets a grade from its open findings on the default branch (ignored findings don't count). The organization grade is its lowest repository grade.

GradeMeaning
ANo open Critical or High
BNo Critical, 1–2 High
C1 Critical, or 3–5 High
D2 or more Critical, or 6 or more High
FAn exposed secret
A repository's overview with its grade, gate status, findings by scanner and the latest scansA repository's overview with its grade, gate status, findings by scanner and the latest scans

Repository settings

On a repository's Settings tab you can change:

  • Branches & triggers: extra branches or patterns, pull requests, and the nightly scan time.
  • Scanners: at least one scanner (or AI review) must be on.
  • Paths to ignore: glob patterns such as docs/** or test/fixtures/*.json, for all scanners or one. Ignored paths aren't scanned, so they never create findings.
  • Gate additions, the Status check name, and Alerts.
  • Pause scanning: skips all scans until you resume. The check then reports "Skipped", so a required check won't block merges. Findings and settings are kept.
  • Disconnect repository: stops scanning it and deletes its findings, scans, logs and history now, including ignores. The repository itself isn't changed.

Changes apply from the next scan.

A repository's Settings tab with branches and triggers, scanners, paths to ignore and gate settingsA repository's Settings tab with branches and triggers, scanners, paths to ignore and gate settings

On this page