Secret findings
When the Secret scan finds something that looks like a credential, key or token in a merge request, it reports a finding. This page is about working with one: reading it, deciding whether it is real, and getting the merge request through. The scan itself and its settings are on Secret scan.
What a finding shows
On the merge request page, the Secret scan card says N potential secret(s) detected with the number of files scanned, and lists each finding:
| Part | Shows |
|---|---|
| Severity | Critical, High, Medium or Low, from the rule that matched (private keys and cloud provider credentials, such as AWS, Google Cloud, Azure, Alibaba Cloud, DigitalOcean and Yandex Cloud keys, are Critical; API keys, passwords, access tokens and Merge Pilot's password, secret, connection-string and Bearer rules are High). The list is ordered by it; it does not change whether the finding holds the merge |
file:line | Where the secret is. For a secret in a commit message, the merge request's title or description, the "file" is commit <sha>, merge request title or merge request description |
| Description | What the rule looks for, such as Database connection string with embedded password |
| Rule ID | The rule that matched, such as aws-access-token or mp-password-assignment (Merge Pilot's own rules start with mp-) |
The secret itself is never shown or stored: not on the page, not in the VCS comment, not in the audit log, not in the API. Only the rule, file, line, severity and a fingerprint are kept: a hash of the rule and the value, which identifies the same value found again (an exception accepts a finding by it) without keeping the value. Open the file at that line in the merge request to see what was found.
Below the findings the card may show:
- Not everything could be scanned, with The VCS listed only part of the changed files. or No diff was available for N file(s): and their names;
- Allowed by the author (gitleaks:allow, not counted): lines the author marked (see False positives);
- Scan failed: … when the scan could not finish.
In the VCS, the comment Merge Pilot: Secret Scan lists the findings grouped by severity (file, line, rule) and ends with Please review and remove any hardcoded secrets before merging. It is kept up to date as the merge request changes, and is not written in watched repositories.
The finding is also counted in the Secrets column of the Merge requests list, and, when the findings change, Secrets found in a merge request is sent to the company's notification routes that receive it.
Does it hold the merge?
It depends on the change policy that covers the merge request (row Secret scan):
| Mode | A finding |
|---|---|
| Enforce | Holds the merge: the control fails with N possible secret(s) found in the change. until a new commit (or a re-scan) has no findings |
| Report | Is shown, marked (report only); the merge can go ahead |
| Off | The merge request is not scanned |
Every finding counts the same, whatever its severity. See Secret scan → What the control says.
A real secret
Removing the line in a new commit clears the finding: the next scan reads the merge request's added lines at its latest commit, and the line is no longer added. But the secret has already been pushed: it is in the branch's history and was visible to anyone who could read the repository. Merge Pilot does not revoke anything. Treat a real finding as leaked:
- Revoke or rotate the credential where it was issued.
- Remove it from the change, and keep it out of the code (a secret store or a CI/CD variable).
- Push the fix. The scan runs again on the new commit.
False positives
Findings are not dismissed in Merge Pilot. A known false positive is kept from holding a change in one of four ways:
| Way | Covers | Who |
|---|---|---|
A gitleaks:allow comment on the line, for example token = "abc123" # gitleaks:allow | That line, while the company's "gitleaks:allow" comments setting is Honour, and report (the default). The finding is then listed under Allowed by the author, not counted, and written to the audit log as secrets_allowed_inline | The change's author, with a new commit |
| Allowed paths | Every file matching a pattern (test fixtures, for example) | Company admin, on the company's Scanning tab (or a policy, through the API) |
| Allowed rules | Every finding of one rule | The same |
| An exception: Accept on the finding (see Exceptions) | The same value, by its fingerprint, in this repository or in every project, for a limited time. For every project, the dialog warns that the same value is then accepted in any repository and file of the company | Policy manager, company admin, platform admin |
Placeholders such as ${VAR}, <password> or changeme are not reported by Merge Pilot's own rules in the first place. See Secret scan → Allowing a finding.
With "gitleaks:allow" comments set to Ignore them, a gitleaks:allow comment changes nothing and the finding counts.
When there are many findings
The scan stores at most Max findings per scan findings (50 by default; company Scanning tab → Secrets), the first ones by file, line and rule. The count (N potential secret(s) detected) and the decision use all of them; the page and the comment list only the stored ones. The page says Showing N of M findings: Merge Pilot keeps at most N per scan (Company → Scanning → Secrets, Max findings per scan)., and the comment says Showing N of M findings: Merge Pilot keeps at most N per scan. Remove these and push again to see the rest. The rest are not kept anywhere: fix the ones shown and push, and the next scan lists what is left. Findings beyond the stored ones cannot be accepted either: when some of them hold the change, the reason says how many (N of them are beyond the findings kept per scan: raise the secret scan's findings kept (Company → Scanning) and rescan to see and accept them.).
When the scan cannot finish
When the VCS cannot be reached, a file cannot be read or a call takes longer than the External call timeout (seconds), the scan fails: the card shows Scan failed: … with the reason, and the control fails with The secret scan failed: …. A failed scan is never reported as clean, so in Enforce the merge stays held.
What happens next is the company's When the scan cannot finish setting (a policy can override it):
| Choice | What happens |
|---|---|
| Fail, rescan by hand (default) | The scan stays failed until someone selects Re-scan on the Secret scan card, or a new commit is pushed |
| Fail, retry automatically | The scan is queued again after a pause, the next time the merge request is processed, until it completes |
A VCS rate limit is not a failure: the scan waits for the limit to reset. Files the VCS sends no diff for are a separate case, decided by Files the VCS sends no diff for (Warn, do not hold or Hold the change). See Secret scan → Settings.
Re-scan is available to everyone in the company except auditors (POST /api/v1/merge-requests/{id}/rescan with {"scan": "secret"}; audit secret_rescan).
API
The merge request (GET /api/v1/merge-requests/{id}) carries secret_scan: status (pending, completed, failed), total_count (every finding of the scan), stored_count (those kept in findings), findings (each with rule_id, description, file, start_line, severity, fingerprint), suppressed (the lines allowed by the author), unscanned, truncated, files_scanned and error. See Secret scan → API.
Audit
| Action | When |
|---|---|
secrets_detected | The scan found possible secrets, different from the previous scan's |
secrets_allowed_inline | Lines were allowed with gitleaks:allow, different from the previous scan's |
secret_rescan | Someone started a re-scan |
See Audit log → Scans.
Related pages
- Secret scan: modes, what is scanned, every setting.
- Scanning → Secrets: the company's settings.
- Security overview.
Video tutorials
Short videos of this feature working on real GitLab and Jira projects. English audio, English and Turkish subtitles. All video tutorials →