Checks
Secrets and sensitive files
6 min read
A token pasted into a configuration file and committed by mistake stays in the repository history,
even if the file is fixed later. Versora looks for secrets in what's about to go into the commit and
in what's about to leave in the push, and warns you first. It also warns you when a file that
usually holds secrets (such as a .env or an SSH key) is added to the repository.
The value found never appears in full: the app only shows a masked version, with the beginning (so
you can recognize the token type), eight dots and, for long values, the last two characters, such as
glpa••••••••Qx. The number of dots is always the same, so the length isn't revealed.
- Automatically, before every commit (what's staged) and every push (the commits the remote doesn't have yet).
- Palette (Ctrl+P): "Check staged changes", to check without committing.
- Preferences (Ctrl+,) › Checks › Secrets group.
- Only the added lines: on commit, the new staged lines; on push, the new lines of the commits that aren't on the remote yet. An old secret, already in the history, isn't reported again on every commit.
- On push, at most the 300 most recent unpushed commits ("1200 commits aren't on origin yet; only the 300 most recent were checked.").
- Files over 5 MB don't have their content scanned; the large files check takes care of them ("1 file over 5 MB didn't have its content checked: …").
- At most 200 findings appear at once; the rest becomes a note ("12 more findings not listed.").
With the Versora rules (built in, nothing to install), the app looks for, among others:
- GitLab tokens (personal access, deploy, pipeline trigger, runner registration and authentication, CI/CD job, feed, incoming email, Kubernetes agent, OAuth application, SCIM, feature flags);
- GitHub tokens (personal access, fine-grained access, OAuth, app, refresh);
- AWS keys, Google keys (API key and OAuth client secret) and Azure keys (storage account, Azure AD client secret, SAS signature);
- Slack tokens (bot, user, app, webhook), npm, PyPI and Docker Hub tokens, and Stripe, SendGrid, OpenAI and Anthropic keys;
- private keys, JWTs, passwords in connection strings and assignments like
password = "…".
With Sensitive files on, the app warns you when one of these files is added: environment
variables file (.env), private SSH key, credentials file, PEM key or certificate (.pem),
certificate with private key (.pfx, .p12), Java keystore (.jks), PuTTY private key, KeePass
password database and Terraform state. The finding says "File added — make sure it really belongs
in the repository."
If something is found, the Before committing (or Before pushing) dialog shows the Possible secrets (2) block. Each finding shows:
- what it is (for example, "GitLab personal access token") and where (
config/app.yml:12); - on push, the commit it's in ("in a1b2c3d");
- the masked value (tooltip "Masked value");
- the Ignore this finding button.
Below the list comes the advice: "Move the value out of the file (environment variable, secrets vault) and, if it has already been used or pushed, revoke it." On push, also: "If it's in an existing commit, you need to rewrite the local history before pushing." With gitleaks, you see "Checked by gitleaks."
- Click Back.
- Move the value out of the file (use an environment variable or a secrets vault).
- If the secret has already been used somewhere or sent to a server, revoke it and generate a new one.
- On commit: stage the fix and commit again.
- On push: the secret is in an existing commit. Fix the commit before pushing (for example, with interactive rebase or "Commit as fixup of…"; see History) and push again.
- Click Ignore this finding on the finding.
- The Ignore this finding dialog shows the fingerprint that will be written to the
.gitleaksignoreat the repository root and explains that the finding will no longer be reported by Versora or gitleaks. - Confirm. The finding changes to "Ignored — written to .gitleaksignore". With all of them ignored, the block becomes "Possible secrets — all ignored" and the main button goes back to Commit (or Push).
- The new or changed
.gitleaksignoreappears in your changes. Commit it so it applies to your team too.
Caution
Only use "Ignore this finding" when you're sure it isn't a real secret. The .gitleaksignore file goes into the repository and applies to everyone.
| Engine | How it works |
|---|---|
| Versora rules | built in, nothing to install |
| gitleaks | the gitleaks installed in PATH; gitleaks' own rules and settings apply |
The page shows whether gitleaks was found ("gitleaks 8.21.2 found in PATH…" or "To use gitleaks, install it and make sure it's in PATH."). Just installed it? Use Look for gitleaks again, at the end of the page.
With either option, the app respects the repository files:
.gitleaks.toml: the allowlists (what isn't a secret) and its own rules. If the file defines rules without[extend], only its rules apply, as in gitleaks..gitleaksignore: the fingerprints of accepted findings.
When a finding was discarded by these lists, the check says how many, for example: "Nothing found in 3 staged files (findings allowed by .gitleaks.toml/.gitleaksignore: 2)."
| Option | What it does | Default |
|---|---|---|
| Before committing › Look for secrets | Checks what's staged. | on |
| Before pushing › Look for secrets | Checks the commits the remote doesn't have yet. | on |
| Sensitive files › Warn when they're added | Warns about .env, SSH keys, certificates (.pem, .pfx, .p12), .jks, Terraform state… | on |
| Engine | Versora rules or gitleaks. | Versora rules |
| Checks enabled here › Secrets and sensitive files | Turns it off only in this repository. | on |
The check only reads: the added lines of the staged changes (as in a git diff --cached) or of the
commits the remote doesn't have. With gitleaks, the app runs gitleaks on that content. Ignore this
finding adds a line to .gitleaksignore (and creates the file, if needed).
The changed .gitleaksignore is a regular change in the working directory: to go back, discard the
change to the file or delete the line before you commit it (see Changes).
- "The secrets check failed: …": the app tells you and goes on with the operation; the reason comes at the end.
- "gitleaks wasn't found in PATH; Versora's rules were used instead.": you chose gitleaks, but it isn't installed or isn't in PATH.
- "gitleaks exited with an error: …" and "Couldn't run gitleaks: …": gitleaks failed; check the installation.
- ".gitleaks.toml: rule "…" uses an unsupported expression and was ignored." and "Couldn't read .gitleaks.toml (…); its allowlists were ignored.": the file has something the app doesn't understand; the rest still applies.
- "Invalid fingerprint.": the line to write to
.gitleaksignoreisn't valid.
- Company policy (
secrets_scan):requiredkeeps the check always on, on commit and on push, and the page says "Secret scanning is set by your company: always on, on commit and on push.";offturns it off ("Secret scanning was turned off by your company."). See Administrators. - GitLab push rules: the server's
prevent_secretsis mentioned in Preferences › Push rules, but secrets are checked by this check.