Table of contents
Title
Table of contents
Title

Secret Scanning

Updated

Secret scanning is the automated practice of searching code, configuration files, infrastructure and pipelines for credentials that should never have been stored there: passwords, API keys, cloud access keys, SSH private keys, OAuth tokens and connection strings. A credible program also reports whether each credential it finds is still live, and who has to act on it.

In November 2026, Microsoft Threat Intelligence reported attackers running an agentic AI framework called ARTEX against public GitHub repositories to hunt for exposed credentials. In one observed case, the agent went from searching GitHub for client secrets to exfiltrating data from Azure Key Vault in five minutes.

This page covers what secret scanning detects, where credentials leak beyond source code, why deleting one does not revoke it, and how Fluid Attacks checks whether a detected credential is still valid.

What is secret scanning?

Secret scanning searches the places where software is written, stored and discussed, looking for values that grant access to a system. It runs against repositories and their full commit history, configuration files, infrastructure-as-code templates, container images, CI/CD pipelines and collaboration tools.

It is a detection practice, not a storage practice. Finding a key tells you that exposure happened; it does not undo the exposure, and it does not replace a secrets manager. What secret scanning adds is a decision: this credential is here, it grants this, and it is or is not still working.

Fluid Attacks classifies the exposure as a security weakness in its own right. Weakness 009 covers repositories holding usernames, passwords, email addresses and IP addresses, and its remediation is to remove the values, change the affected credentials, and load the data from a key vault or an encrypted configuration file instead.

Secrets are not the same as sensitive data

Secret scanning looks for secrets, not for sensitive data. A secret grants access; sensitive data is the thing access protects. The distinction drives the response: a leaked customer record cannot be rotated, while a leaked API key can be invalidated in seconds and should be.

Type

What a leak means

API keys and tokens

An attacker calls the service as you, within that key's scope

Cloud access keys

Access to whatever the account or role allows

SSH private keys

Direct access to servers trusting the matching public key

Database connection strings

Read or write access to the data itself

Encryption keys and certificates

Decryption of protected data, or forged signatures

Sensitive data

Exposure that rotation cannot reverse

Hardcoded encryption keys are a case secret scanning treats differently from the rest. Weakness 142 covers keys stored in plain text rather than obtained from a source that guarantees confidentiality, and recommends loading them at runtime from a key vault service, an encrypted configuration file or administrative environment variables.

Why exposed secrets matter now

Secret scanning matters more now because exposed credentials stay usable until someone revokes them, while the window between exposure and abuse has collapsed. In November 2026, a Cloud Security Alliance (CSA) research note on agentic secret harvesting examined how automated agents moved from searching public repositories to Azure Key Vault exfiltration in five minutes, outpacing traditional rotation windows.

What changed recently is that attackers automated the hunt. The ARTEX activity Microsoft Threat Intelligence documented began in August 2026, with follow-on sign-ins as service principals observed from October 28, showing how quickly exposed secrets in public repositories turn into cloud access.

A private repository is not a boundary, which is the assumption secret scanning programs most often exist to correct. In 2016, attackers took AWS credentials from a private GitHub repository belonging to Uber engineers and downloaded the records of 57 million riders and drivers from an S3 bucket. Uber settled with all 50 US states for USD 148 million in 2018. The credential was what protected that data, and it sat in the code.

Secret scanning at Fluid Attacks

Fluid Attacks runs Secret Scanning as one technique inside a wider application security solution that also includes SAST, SCA, DAST and penetration testing. What follows is how secret scanning decides, what it produces, and where it stops.

What the scanner looks for, and how it decides

The scanner flags a value because of its shape, not its use. A string matching a known token format, a PEM block or a high-entropy value is reported wherever it appears, whether or not any program reads it. That is why it analyzes .env files, Kubernetes manifests, markdown documentation and commit history, none of which a language-aware analyzer parses.

Every detector is public. The rules catalog at db.fluidattacks.com lists 401 Secret Scanning rules, each with its own ID, severity score, target technology and CWE mapping.

Imagen (insertar aquí):   Nombre de archivo: ss-rules-catalog-total.png  ALT: Fluid Attacks rules catalog filtered to 401 Secret Scanning rules  (65 caracteres)

The public rules catalog lists 401 Secret Scanning detectors, each with its own ID, severity and CWE mapping.

Secret verification: knowing whether a credential is still live

Detection tells you a credential leaked. Secret verification tells you whether it still works, which is the difference between a backlog item and an incident. As the Fluid Attacks changelog records, the Secrets Scanner checks each detected credential against the API of its provider, showing whether the value is active or has already been rotated.

That capability is uneven by design, and the catalog says so. Filtering the same rules by validity check returns 195 of the 401 detectors. Those 195 confirm a live credential against its provider; the remaining 206 cannot, because not every service exposes a safe way to test a key without using it.

Secret Scanning rules with a live validity check in the catalog

195 of those 401 detectors carry a validity check, so the catalog itself shows which credentials can be confirmed live.

Where secret scanning runs, and what it produces

The scanner ships as a standalone binary rather than a container image, so it runs on any CI/CD provider without Docker, and it also ships as a GitHub Action.

Where it runs

What you get

Local command line

Findings in the working tree and history, before anything is pushed

Pull request checks

Annotations on the pull request, scoped to changed files

CI/CD pipelines

Differential or full scans, and a build that fails when the policy says so

Fluid Attacks platform

Severity, evidence and remediation guidance per finding

One operational detail is where tool rollouts usually drift. On authenticated runs, the scanner applies the path exclusions and the severity policy configured for the group, so a pipeline cannot quietly loosen the rules by editing its own configuration file.

Secret scanning in CI/CD without adding one more secret

Adding a scanner to a pipeline usually means storing one more long-lived token, which is a strange way to start a project about exposed credentials. Fluid Attacks avoids it: all systems that can issue OpenID Connect tokens can authenticate with no stored secret, and on GitHub Actions the scanner requests that token automatically.

name: Secret Scan
 
on: [push, pull_request]
 
permissions:
  id-token: write
  contents: read
 
jobs:
  secretScan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
 
      - name: Install ss
        run: curl -fsSL https://public.fluidattacks.com/ss/install.sh | sh
 
      - name: Run secret scan
        run: ss scan --group my-group --strict .
name: Secret Scan
 
on: [push, pull_request]
 
permissions:
  id-token: write
  contents: read
 
jobs:
  secretScan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
 
      - name: Install ss
        run: curl -fsSL https://public.fluidattacks.com/ss/install.sh | sh
 
      - name: Run secret scan
        run: ss scan --group my-group --strict .
name: Secret Scan
 
on: [push, pull_request]
 
permissions:
  id-token: write
  contents: read
 
jobs:
  secretScan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
 
      - name: Install ss
        run: curl -fsSL https://public.fluidattacks.com/ss/install.sh | sh
 
      - name: Run secret scan
        run: ss scan --group my-group --strict .
name: Secret Scan
 
on: [push, pull_request]
 
permissions:
  id-token: write
  contents: read
 
jobs:
  secretScan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
 
      - name: Install ss
        run: curl -fsSL https://public.fluidattacks.com/ss/install.sh | sh
 
      - name: Run secret scan
        run: ss scan --group my-group --strict .

The --strict flag stops the pipeline when the scanner finds something. Fluid Attacks recommends wiring the scanners into trunk-based or feature-based workflows, so scans run on changed files in a pull request or feature branch and new findings stay out of the codebase.

Where secret scanning stops and SAST begins

Detection by shape has a blind spot, and it is not the one most teams expect. A credential with no recognizable format — a weak password, a placeholder, a hardcoded initialization vector, a salt, an HMAC secret without a prefix — looks like an ordinary string, so pattern matching walks past it. SAST catches those, because it flags a value by where it ends up: a cryptographic key parameter, an authentication argument, an HTTP client constructor.

Dimension

SAST

Secret Scanning

What triggers detection

Where the value is used in the program

What the value looks like

Scope of analysis

Source code in supported languages

Every repository file, including configuration and commit history

Question it answers

Did someone write insecure code around a secret?

Did a credential leak into the repository?

Run only SAST and you miss credentials in .env files, infrastructure manifests, documentation and commit history, because SAST never reads those files. Run only secret scanning and you miss weak or placeholder credentials, and cryptographic misuse where the practice is wrong but the value is just a string.

The same caution applies to validity. A credential flagged by one of the 206 detectors without a verifier has not been confirmed dead; it is a credential nobody checked. Treat an unverified finding as live, and rotate on that assumption.

Go deeper: Fluid Attacks' documentation walks through how SAST and Secret Scanning classify the same hardcoded credential differently, with worked examples in Java, Scala and Python.

How does secret scanning work?

Secret detection combines several methods inside secret scanning, because no single one covers the range of things a credential can look like. Most secret scanning tools layer them and reconcile the results.

  • Pattern matching: regular expressions catch structured credentials with recognizable prefixes — an AWS key ID starting with AKIA, a GitHub token starting with ghp_, a JWT with its three dot-separated segments.

  • Entropy analysis: Shannon entropy measures randomness, so values from a CSPRNG score high. It catches unstructured keys no pattern anticipated, but also flags hashes and identifiers, so entropy analysis on its own is noisy.

  • Dictionaries and context: names such as password, token and api_key indicate intent, and the file type and surrounding code change how likely a match is to be real.

  • Machine learning: classifiers trained on confirmed secrets and confirmed false positives rank the candidates the rules above disagree about.

  • Live validation: the scanner calls the provider's API to confirm whether the credential still authenticates, the only method that separates an urgent finding from a stale one.

Every secret detection method trades precision against recall, which is what makes secret scanning hard to tune. Tighten the rules and real secrets slip through; loosen them and developers start ignoring the alerts, the worse failure because it is invisible.

Where to scan for secrets, and when

Point secret scanning everywhere a credential can come to rest, not only at the current state of the main branch: all branches and the full commit history, configuration and deployment files, infrastructure-as-code templates, container image layers, build logs, backups, and the collaboration tools where developers share snippets.

That last category is not a footnote for secret scanning. Developers routinely paste tokens, connection strings and configuration snippets into chat threads, issue trackers and wikis while debugging, so a program scoped to source repositories alone leaves a major channel of credential exposure unchecked.

Pipelines are part of the scope too, and not because anyone typed a key into a file. In March 2025, a compromised version of the tj-actions/changed-files GitHub Action, tracked as CVE-2025-30066, was used across more than 23,000 repositories. Fluid Attacks' analysis of the incident describes injected code extracting CI/CD secrets from the runner's memory and printing them into workflow run logs.

For secret scanning, timing matters as much as coverage. Pre-commit hooks catch a credential before it is committed, push protection blocks it before it reaches the remote, and pull request checks catch what the first two missed. Run secret scanning in both modes: historical scans clean up the past, real-time controls keep the present from adding to it.

Deleting a secret is not revoking it

Removing a credential from a file does not invalidate it, which is why secret scanning findings are not closed by a commit. The value stays in the commit history, in every clone and fork, in pipeline logs, in build caches and in whatever search index already crawled the repository. Microsoft's ARTEX advisory puts it directly: "Removing the content does not invalidate the credential or eliminate copies retained in edit history."

Fluid Attacks tracks this as a distinct weakness. Weakness 367 covers usernames, service credentials and access tokens found in the Git history, and lists two separate remediations, deliberately: remove the sensitive information from the history, and change the compromised access credentials. Doing only the first is the most common mistake in credential incident response, and it is why secret scanning has to cover history rather than the current tree alone.

Toyota shows what that gap costs when no secret scanning runs over history. A subcontractor uploaded part of the T-Connect source code to a public GitHub repository in December 2017, and it contained an access key to the server holding customer records. The key was reachable until September 15, 2022 — close to five years — exposing 296,019 email addresses. Toyota restricted the repository on discovery and changed the key two days later.

Four verbs get used interchangeably and mean different things. Secret scanning covers the first two.

Action

What it does

What it does not do

Detect

Finds the exposed credential

Change anything about its validity

Verify

Confirms whether the credential still authenticates

Stop it from working

Revoke

Invalidates the credential at the provider

Remove it from history, logs or clones

Rotate

Issues a replacement and retires the old value

Tell you whether the old value was used

Revocation is the only one of the four that ends the exposure. The others inform it or clean up after it.

Responding when a secret is found

When secret scanning returns a finding, revoke or rotate first, investigate second, clean up third. The order is not negotiable, because every minute spent rewriting history is a minute the credential still authenticates.

  1. Assess and act on the credential: establish what it grants, in which environment and with what permissions, then revoke it or issue a replacement. An administrative key in production and an expired test key are the same secret scanning finding with completely different urgency, which is why credential rotation decisions depend on verification.

  2. Investigate the usage: secret scanning tells you when the value entered the repository, so pull the provider's access logs for the exposure window and look for calls that did not come from your infrastructure. For a credential exposed for years, assume the window is the whole period.

  3. Clean up the traces: purge the value from the Git history, then check clones, forks, build logs, container images and tickets. Weakness 359 frames the same sequence — remove the hardcoded information and purge Git logs, change the compromised credentials, and load sensitive data from secure sources instead.

Fluid Attacks' review of the 2026 Binance incident makes the point from the attacker's side: once someone controls a developer's machine, credentials, API keys and tokens sitting in source code, configuration files or Git history turn that foothold into access to other systems.

Scanning is one layer; secrets management is the foundation

Secret scanning is a control for failures that already happened. Secrets management is what reduces how often they happen and how much each one costs. A program with only the first keeps finding the same class of finding forever.

Secret scanning reports the symptom; the foundation is a dedicated secrets manager — HashiCorp Vault, AWS Secrets Manager, Azure Key Vault, Google Secret Manager — with applications retrieving values at runtime rather than reading them from files in the repository. Around that: disciplined .gitignore rules, scoped credentials that grant only what a workload needs, and a rotation schedule that runs whether or not anything leaked.

Short-lived credentials are the strongest single change available. A token that expires in an hour is worth far less to an attacker than one that never expires, which is why workload identity federation through OpenID Connect beats a stored token for any system that supports it. Pair secret scanning with developer education, because most exposed credentials are not carelessness — they are a developer taking the fastest available path. Make the secure path the fastest one, and secret scanning has less to find.

Conclusions

Secret scanning earns its place in an application security program when it answers three questions rather than one. Not just "is there a credential in this repository," but "does it still work," "what does it open," and "what has to happen now."

The parts that make secret scanning work are unglamorous. Scan the full history, not just the current state. Extend coverage past the repository into pipelines and collaboration tools. Verify validity where the provider allows it, and treat anything unverified as live. Revoke before you rewrite history. And pair secret scanning with a secrets manager and short-lived credentials, because detection that is not followed by a change in how credentials are stored just produces a longer list each quarter.

Frequently asked questions

Does deleting a secret from a repository revoke it?

No. Deleting a credential from a file removes it from the current state of the code and nothing else. The value remains in the commit history, in clones and forks, in CI/CD logs and in any index that already crawled the repository, and it keeps authenticating until it is revoked or rotated at the provider. Fluid Attacks tracks credentials in Git history as a distinct weakness with two separate remediations: clean the history, and change the compromised credential.

How do you tell whether a leaked API key is still active?

By checking it against the issuing provider. A scanner with a validity check calls the provider's API with the detected credential and reports whether it still authenticates. Coverage is partial everywhere, because not every service exposes a safe way to test a key: 195 of the 401 Secret Scanning detectors in Fluid Attacks' public rules catalog carry a validity check, and the other 206 do not. A finding that could not be verified should be treated as live.

What is the difference between secret scanning and SAST?

Secret scanning finds credentials by their shape; SAST finds them by their use. Secret scanning flags a value that looks like a credential wherever it appears, including configuration files, documentation and commit history. SAST flags a value because of where it ends up in the program, such as a cryptographic key parameter, which catches weak or placeholder credentials with no recognizable format. Neither replaces the other.

Can secret scanning find credentials outside source code?

Yes, and it has to. Credentials regularly leak into collaboration channels, issue trackers and build outputs rather than staying inside source files. A complete secret scanning scope covers infrastructure-as-code templates, container images, pipeline logs, backups and messaging tools, alongside every branch and the full commit history of the repositories themselves.

Does Fluid Attacks verify whether a detected secret is still valid?

Yes, for the credential types where the provider allows it. The Fluid Attacks scanner checks each detected credential against the API of its provider to determine whether it is still active or has already been rotated, and the public rules catalog states which detectors include that check — 195 of 401 at present. The result feeds prioritization: an active administrative key and an already-rotated test key are the same detection with very different urgency.

Keep exposed credentials out of your pipelines

Fluid Attacks combines AI, scanners and pentesters to find exposed credentials in code, configuration and infrastructure as code, and to break the build before an insecure change ships. Start free trial · Contact us.

Get started with Fluid Attacks' Secret Scanning solution

Reduce risk without slowing delivery

Fast and accurate results from one continuous security program powered by AI, scanners, and pentesters.

Reduce risk without slowing delivery

Fast and accurate results from one continuous security program powered by AI, scanners, and pentesters.

Reduce risk without slowing delivery

Fast and accurate results from one continuous security program powered by AI, scanners, and pentesters.