skip to content

Security Scanning

The built-in scanners — SAST, DAST, dependency, secret and container scanning — whose findings surface as a widget in the merge request. The interview angle is enforcement: scan execution policies decide whether a finding blocks the merge or merely informs it.

on this pageshow

questions

6

In a GitLab merge request, what does the security scan report show, and why is a vulnerability already on main missing from it?

level: juniorimportance: must knowfreq 46%

answer

  1. a difference, not a full list
  2. source pipeline against target pipeline
  3. added, fixed, or not shown
  4. no baseline means everything is new

basics

~20 s

It shows what merging would change: findings the source branch adds and findings it fixes, compared against the target branch's security reports. A vulnerability present on both branches is unchanged by the merge, so the report leaves it out.

solid answer

~50 s

In GitLab Ultimate, the merge request's security scan report (on the **Reports** tab since GitLab 19.1) compares the security report artifacts from the source branch's latest pipeline with those from the target branch. A finding only on the source branch appears as **added**, one only on the target as **fixed**, and one on both is not shown, because merging changes nothing about it; when the target is the default branch, it is already tracked in the vulnerability report. GitLab looks through the 10 most recent target-branch commits for a pipeline with security reports; if it finds none, every finding is listed as new. Each report type lists the first 25 added and 25 fixed findings by severity, and **View all pipeline findings** shows the rest. On Free and Premium the scanners still run, but the results stay in JSON job artifacts.

go deeper

for a junior

Recall the three outcomes: added, fixed, and not shown when a finding is on both branches. Know that findings live on branches and vulnerabilities on the default branch.

for a middle

Explain where the target-branch baseline comes from, why a never-scanned target makes everything look new, and that scanners run in branch pipelines unless enabled for merge request pipelines.

for a senior

Treat the report as a review aid, not a gate: an empty or shrinking report can mean a scanner stopped running. Pair it with policies when a finding must block.

for a principal

Weigh what each tier gives a team: Ultimate turns raw JSON artifacts into a comparison reviewers actually read, and that visibility, not the scanners, is what changes merge decisions.

## Findings and vulnerabilities GitLab uses two words for what a security scanner reports, and the merge request report only makes sense once they are separated: - A **finding** is a potential vulnerability detected on a development branch, such as the source branch of a merge request. - A **vulnerability** is a weakness detected on the **default branch**. A finding becomes a vulnerability when its branch is merged into the default branch. - Vulnerabilities are listed in the project's **vulnerability report**, and their records persist until they are archived, even after the code that caused them is gone. - Findings are short-lived. They expire when the related job artifact expires, or a set period after the pipeline was created: 30 days on GitLab.com, and 90 days by default on GitLab Self-Managed and GitLab Dedicated, where an administrator can choose a value from 7 to 90 days. Every scanner job writes a **security report artifact**, a JSON file listing everything it found on that branch at that commit, whether the problem is new, old or already dismissed. ## How the comparison works The security scan report answers one question: *what would change if this branch were merged?* It compares the source branch's reports with the target branch's reports and sorts each finding into one of three outcomes. | Where the finding appears | What the report shows | |---|---| | Source branch only | **Added**: this merge request introduces it | | Target branch only | **Fixed**: this merge request removes it | | Both branches | Nothing: the merge does not change it | So if the target branch has `V1` and `V2` and the source branch has `V1` and `V3`, the report shows `V3` as added and `V2` as fixed, and does not mention `V1`. `V1` is real, but it is already on the target branch (and, when that is the default branch, in the vulnerability report); this merge request neither introduces it nor removes it. ## Where the baseline comes from The comparison needs a security report from the target branch as well. GitLab finds one like this: 1. It checks the 10 most recent commits on the target branch. 2. For each commit, it checks up to 10 of the most recent pipelines for a security report. 3. It uses the first valid report it finds, so a commit that skipped its pipeline does not break the comparison. 4. If no report is found at all, every finding on the source branch is listed as new. That last step is why GitLab tells you to enable security scanning on the default branch before relying on the merge request report. A freshly enabled scanner on a feature branch, compared with a target branch that has never been scanned, reports the whole backlog as if this merge request had introduced it. Most scanner templates run in **branch pipelines** by default. If a project uses merge request pipelines, those scanner jobs need the `AST_ENABLE_MR_PIPELINES` CI/CD variable set to `"true"`, or the `latest` template edition, to run there. ## What the report contains and where it sits - In GitLab 19.4 the report lives on the merge request's **Reports** tab, which became generally available in GitLab 19.1. Earlier releases showed the same comparison in the merge request widget. - For each report type (SAST, secret detection, dependency scanning, container scanning, DAST), it lists the first 25 added and the first 25 fixed findings, sorted by severity. - **View all pipeline findings** opens the full list for the source branch. - SAST results also appear inline in the merge request **Changes** view, marked beside the gutter. - A known limitation: findings that were already dismissed can still appear in the report. The merge request security report, the inline annotations, the pipeline **Security** tab and the vulnerability report are all **Ultimate** features. On Free and Premium, SAST, pipeline secret detection and container scanning still run and produce their JSON artifacts, but nobody sees a comparison in the merge request unless they download and read those files. ## Reading it during review - An **added** critical finding is the one to discuss: this change is introducing it. - A **fixed** finding is good news, but check that the fix is real and not just a scanner that stopped running on the source branch. - An empty report does not mean the branch is clean. It can mean that the scans did not run or produced no report. Check the pipeline's **Security** tab to see everything the branch contains. - Whether an added finding *blocks* the merge is a separate decision, made by a merge request approval policy, not by the report.

  • In GitLab, the target branch has never run a security scan. What does the merge request's security report show?
    Every finding on the source branch is listed as new, because GitLab found no target-branch report to compare against. It searches the 10 most recent target-branch commits, up to 10 pipelines each, before giving up. The fix is to run the same scanners on the default branch first, so later merge requests have a baseline.
  • Why might a GitLab finding seen on a feature branch last quarter be gone from that pipeline's Security tab?
    Findings expire: when the job artifact expires, or a set period after the pipeline was created, which is 30 days on GitLab.com and 90 days by default on Self-Managed and Dedicated (an administrator can set 7 to 90). Re-running the pipeline reproduces them. Vulnerabilities on the default branch are different; their records persist until archived.

  • The merge request security report lists every vulnerability in the project.
  • A vulnerability already on main shows up as new in every merge request.
  • A Free project gets the merge request security report as long as the scanners run.
  • An empty security report proves the source branch has no vulnerabilities.
  • A finding on a feature branch is already a vulnerability in the vulnerability report.

Assumes GitLab 19.4; the merge request security scan report moved to the Reports tab, generally available since 19.1, from the merge request widget.

open as a page

On GitLab Free, which built-in security scanners can a project run, and what does moving to Ultimate add?

level: middleimportance: must knowfreq 40%

basics

~20 s

Free runs SAST (Semgrep-based), pipeline secret detection, container scanning (built on Trivy) and IaC scanning, with results only as JSON job artifacts. Ultimate adds dependency scanning, DAST, secret push protection, merge request reports, the vulnerability report and security policies.

open as a page

In GitLab, how does secret push protection differ from pipeline secret detection, and why would a team run both?

level: middleimportance: should knowfreq 30%

basics

~20 s

Secret push protection (Ultimate) checks a push's changes before GitLab accepts them and rejects a push containing a secret. Pipeline secret detection (every tier) scans commits in a CI job after they land, catching what push protection missed.

open as a page

In GitLab's vulnerability report, what do Needs triage, Confirmed, Dismissed and Resolved mean, and why does a fixed vulnerability stay open?

level: middleimportance: should knowfreq 24%

basics

~20 s

Needs triage is a new vulnerability's starting status; Confirmed means verified; Dismissed means judged not worth fixing, with a reason; Resolved means fixed. A fix only logs No longer detected; a person or a vulnerability management policy must set Resolved.

open as a page

In GitLab Ultimate, how do scan execution policies and merge request approval policies work together so that a new critical finding needs a security approver?

level: seniorimportance: should knowfreq 27%

basics

~20 s

A scan execution policy forces scanners into every in-scope pipeline, overriding project configuration. A merge request approval policy reads the resulting reports and requires named approvers when a new critical appears. One guarantees the evidence; the other gates on it.

open as a page

In GitLab 19.4, a project still includes Jobs/Dependency-Scanning.gitlab-ci.yml. Which analyzer runs, and how do you move it to SBOM-based scanning?

level: middleimportance: nice to knowfreq 13%

basics

~20 s

The stable template still runs the Gemnasium-based analyzer, deprecated since GitLab 17.9 and never migrated automatically. Switch the include to Jobs/Dependency-Scanning.v2.gitlab-ci.yml, remove overrides of the gemnasium-* jobs, and point anything that referenced them at the new dependency-scanning job.

open as a page