SBN

Why SAST and DAST Aren’t Enough for Secrets Security

Why SAST and DAST Aren't Enough for Secrets Security

If you run an application security program in 2026, secrets detection can look like a solved line item. Your static analysis suite ships rules for hardcoded credentials. Your code platform's built-in scanner flags API keys on push. So when someone asks if SAST and DAST are enough for secrets security, the reasonable response is: yes. 

That answer holds only if a leaked credential behaves like any other finding. Spoiler alert: it doesn't.

Static application security testing (SAST) and dynamic application security testing (DAST) find code an attacker could exploit: an injection path, say, or a broken access control. Every finding is a prediction about what a capable adversary might eventually do. A valid leaked secret requires no prediction. It is access that already works, and it spreads far beyond the code those tools scan.

Nobody has to find a flaw or write an exploit. They copy the key and log in. Last year, leaked credentials showed up in 39% of breaches. Potential risk and active access are different problems, and tools built for the first were never meant to carry the second.

What static application security testing (SAST) and DAST do well

Static and dynamic analysis earned their place in the stack by answering a foundational question: where can this code be made to do something it was never meant to do?

Why SAST and DAST Aren't Enough for Secrets Security

SAST tools inspect source code before an artifact is built, catching injection flaws and unsafe patterns while they are still cheap to fix. DAST tools probe the running application from the outside, surfacing runtime and configuration problems no static scan can see. Together, they take on much of the OWASP Top 10, and nothing in this article argues for removing either.

They also complement each other by design; most of the SAST vs. DAST question comes down to vantage and timing. SAST is white box testing. It reads the program's internals and can sit directly in the IDE, which keeps the feedback loop short. DAST is black box testing. It attacks from the outside the way a pentester would, agnostic to the stack underneath. One catches what the other can't.

A hardcoded secret sits outside that scope entirely. It can leave the application's behavior completely unchanged. The code compiles, tests pass, and the build goes green, while a live production key moves through places it was never meant to end up.

A vulnerability is a prediction. A valid secret is access.

Severity models score vulnerabilities by how likely an exploit is. A valid secret needs no exploit, so the same models undercount it.

Take a SQL injection finding. Serious, worth fixing fast, and still conditional: an attacker has to find the endpoint and turn the flaw into a working attack. A live cloud key in a config file skips every step of that.

Not every leaked secret is still valid, though. Knowing which ones still work is among the harder questions in this discipline, and a code scanner has no way to find out. More on that below.

Secrets are a credential problem that lives in code

Application security tools manage code risk. A leaked secret is an exposed credential, which makes it an access problem from the moment it leaves the developer's editor. The two disciplines sit side by side the way a web application firewall and an identity program sit side by side. Neither substitutes for the other.

So when a security team says their SAST suite already scans for secrets, the right response is agreement. It probably does. Pattern-matching a connection string is within reach of any static analyzer, and scanning git history has become table stakes for the secrets scanners built for the job.

Detection was never where this argument gets decided. Detection without remediation is just noise.

The code-risk playbook assumes the finding and the fix both live in the codebase, and that the developer who introduced the issue owns the resolution. Both assumptions fail for credentials.

Secrets don't stay in repositories

Secrets sprawl across every surface developers touch, and most of those surfaces sit outside anything a SAST or DAST scan will ever read. The tooling's scope ends at the application. The sprawl doesn't.

Why SAST and DAST Aren't Enough for Secrets Security
a typical reflex when committing a secret

The public numbers are only the visible edge. In 2025, 28.6 million new secrets hit public GitHub, up 34% year over year, and internal repositories are six times more likely than public ones to contain hardcoded secrets.

Inside a repository, platform scanning holds up. A pushed API key, connection string, or private token should be detected as early as possible. But the repository is only one stop in a secret's journey, and rarely the last.

A pipeline echoes credentials into its own logs. Someone attaches a config file to a Jira ticket. A database goes down at 2 a.m., and the key gets pasted into the incident channel. Each copy is as live as the original, and 28% of secrets incidents now originate entirely outside code repositories, in collaboration and productivity tools.

And the sprawl does not stop with collaboration tools:

The Shai-Hulud 2 supply chain attack gave researchers a rare look at what compromised developer machines actually hold: each live secret appeared in eight locations on average across the same machine, and 59% of the compromised systems were continuous integration and continuous delivery (CI/CD) runners rather than laptops. No amount of tuning puts these surfaces in scope for an application test.

The same boundary problem shows up in adjacent security categories. Software composition analysis (SCA) and interactive application security testing (IAST) widen the lens to dependencies and runtime instrumentation, but they are still testing the application. Cloud posture tools extend visibility further, into the misconfigured role and the exposed bucket. But they stop at the boundary they were built for: cloud configuration and permissions. They can show what an identity can reach. They cannot show everywhere its credentials have already escaped.

Git history still hides what code review cleans up

A code review compares the proposed state of a branch against the current one. Git retains every intermediate commit, including the one where a secret was hardcoded and then removed before the pull request. The cleaned-up diff passes review while the credential stays in the history, clone after clone.

Secrets detection has to inspect not just what the code looks like now, but what it carried before and where that history has traveled. Once a secret enters git history, it can move with every clone, fork, mirror, and personal repository, including places the organization does not fully control.

The pattern is familiar. A developer opens a feature branch and hardcodes an API key to move fast, as in commit C in the tree below. The feature works, the branch gets tidied, the key becomes an environment variable, and the pull request shows nothing amiss. Commit C still holds the key. Squashing the branch on merge doesn’t undo that. The commit persists on the remote and travels with every fork and mirror.

<!– PRODUCTION NOTE: keep the original git-tree diagram, re-export in current brand. –>

Purpose-built secrets scanners have treated history as a first-class surface for years. A SAST pass still reads only the current state of the codebase. Git history was never the surface it was built to inspect.

The gap in addressing security vulnerabilities shows up after detection

When a static analyzer flags an injection bug, the developer edits the code, and the finding closes. When a scanner flags a leaked credential, editing the code changes nothing, because the credential may still be live everywhere it was ever copied. Remediation means revoking and reissuing it without breaking whatever depends on it, and that work crosses team boundaries a code fix doesn't touch.

At detection time, four questions decide everything, and a code scanner can answer none of them:

  • Is the credential still valid?
  • What does it grant access to?
  • Where else does it exist?
  • Who owns it?

Without those answers, the alert stalls. The actual fix is operational. Revoke and reissue the credential, then update every consumer that depends on it. The replacement belongs in a vault rather than in another file. None of that resembles editing a line and merging a pull request, and none of it lands on a single developer.

The industry's track record on this follow-through is the most damning number in GitGuardian's research. Of the secrets confirmed valid in 2022, 64% were still exploitable in January 2026, four years after they first leaked, most often because teams lack a repeatable path from alert to revocation. The exposure may have been detectable, but the credential stayed usable. That is the difference between finding one instance of a secret and neutralizing the credential everywhere it has spread.

Context is the layer a code scanner can't produce

Prioritizing a leaked secret requires knowing whether it is valid, what it authenticates to, where else it appears, how long it has been exposed, and who owns it. A static analyzer models a secret as a string in a file, because that is what it sees. Answering those questions requires modeling it as a credential with state, checked against the provider that issued it.

Validity alone doesn't settle priority either. Roughly 46% of critical secrets have no vendor-provided validation mechanism, so exploitability has to be assessed from contextual signals: where the secret sits, what consumes it downstream, whether a copy already lives in a secrets manager, and whether the exposure is internal or public.

This is the layer the GitGuardian platform operates in. Validity is checked against the issuing provider, occurrences are mapped across repositories and the non-code surfaces above, ownership is attributed, and priority reflects real exposure.

Secrets are how non-human identities (NHIs) authenticate, and a program that treats them with that weight looks very different from a scanning feature bolted onto a code-quality tool.

Keep SAST and DAST, and close the gap they leave

Nothing here retires a scanner. Static and dynamic testing remain the right tools for the problem they were designed for, and the teams running them should keep investing in them.

The same is true for repository-native secret scanning and cloud posture management. They add important coverage, but each operates inside a boundary: the repository, the application, or the cloud environment. Credential exposure does not respect those boundaries.

A valid leaked secret is access that already works. It may be copied across code, history, logs, tickets, messages, images, runners, and developer machines long before anyone opens a remediation ticket.

The next time someone says the SAST suite already covers secrets, agree with them. Then ask whether it found every copy, identified the owner, and got the credential revoked before anyone else could use it.

Public GitHub is the one surface you can check in minutes, and the one an attacker checks first.  See what's already exposed.

Why SAST and DAST Aren't Enough for Secrets Security

FAQs

What is the difference between SAST and DAST?

SAST (static application security testing) analyzes source code before the application runs, catching issues like SQL injection and access control mistakes early. DAST (dynamic application security testing) tests the running application from the outside, surfacing runtime and configuration flaws SAST cannot see. SAST is white box testing and DAST is black box testing. They are complementary, and most application security programs run both.

Do SAST and DAST detect hardcoded secrets?

Many SAST suites and code platforms now pattern-match hardcoded credentials, so they detect some secrets. But detection is only the first step. SAST and DAST cannot tell you whether a secret is still valid, what it grants access to, where else it has spread, or who owns it, and they do not scan the collaboration tools, pipelines, and registries where secrets also accumulate. Detection without that context and remediation leaves the access open.

Why aren't SAST and DAST enough for secrets security?

SAST and DAST manage code risk: weaknesses an attacker might exploit in the future. A leaked credential is active access risk that works right now, with no exploit required, and it spreads far beyond the repository and stays valid until someone revokes it. Those are different problems, and code scanners were never built to validate, locate, prioritize, and rotate live credentials across every surface where they leak.

Where do secrets leak outside of source code?

Secrets sprawl into every surface developers touch: CI/CD logs and pipeline variables, Jira tickets and Slack messages, container registries and image layers, infrastructure-as-code templates, AI tooling and MCP configuration files, and employees' personal GitHub repos. In 2025, 28% of secret incidents originated entirely outside code repositories, so scanning only the repo misses a large share of exposure.

How do you remediate a leaked secret?

Editing the code does not fix it, because the credential stays valid wherever it was copied. Real remediation is to revoke the leaked credential at the provider, reissue a replacement, update every consumer that depends on it, and store the new secret in a vault rather than in code. Because this crosses security, development, and operations, it needs validity, usage, and ownership context to move quickly.


The post Why SAST and DAST Aren't Enough for Secrets Security appeared first on GitGuardian Blog – Take Control of Your Secrets Security.

Avatar photo

Thomas Segura

What You Need to Scale AppSec Thomas Segura - Content Writer @ GitGuardian Author Bio Thomas has worked both as an analyst and as a software engineer consultant for various big French companies. His passion for tech and open source led him to join GitGuardian as technical content writer. He focuses now on clarifying the transformative changes that cybersecurity and software are going through. Website:https://www.gitguardian.com/ Twitter handle: https://twitter.com/GitGuardian Linkedin: https://www.linkedin.com/company/gitguardian Introduction Security is a dilemma for many leaders. On the one hand, it is largely recognized as an essential feature. On the other hand, it does not drive business. Of course, as we mature, security can become a business enabler. But the roadmap is unclear. With the rise of agile practices, DevOps and the cloud, development timeframes have been considerably compressed, but application security remains essentially the same. DevSecOps emerged as an answer to this dilemma. Its promise consists literally in inserting security principles, practices, and tools into the DevOps activity stream, reducing risk without compromising deliverability. Therefore there is a question that many are asking: why isn't DevSecOps already the norm? As we analyzed in our latest report DevSecOps: Protecting the Modern Software Factory, the answer can be summarized as follows: only by enabling new capacities across Dev, Sec and Ops teams can the culture be changed. This post will help provide a high-level overview of the prerequisite steps needed to scale up application security across departments and enable such capabilities. From requirements to expectations Scaling application security is a company-wide project that requires thorough thinking before an y decision is made. A first-hand requirement is to talk to product and engineering teams to understand the current global AppSec maturity. The objective at this point is to be sure to have a comprehensive understanding of how your products are made (the processes, tools, components, and stacks involved). Mapping development tools and practices will require time to have the best visibility possible. They should include product development practices and the perceived risk awareness/appetite from managers. One of your objectives would be to nudge them so they take into account security in every decision they make for their products, and maybe end up thinking like adversaries. You should be able to derive security requirements from the different perceptual risks you are going to encounter. Your job is to consolidate these into a common set for all applications, setting goals to align the different teams collaborating to build your product(s). Communicating transparently with all relevant stakeholders (CISO, technical security, product owner, and development leads) about goals and expectations is essential to create a common ground for improvement. It will be absolutely necessary to ensure alignment throughout the implementation too. Open and accessible guardrails Guardrails are the cornerstone of security requirements. Their nature and implementation are completely up to the needs of your organization and can be potentially very different from one company to the other (if starting from scratch, look no further than the OWASP Top10). What is most important, however, is that these guardrails are open to the ones that need them. A good example of this would be to centralize a common, security-approved library of open-source components that can be pulled from by any team. Keep users' accessibility and useability as a priority. Designing an AppSec program at scale requires asking “how can we build confidence and visibility with trusted tools in our ecosystem?”. For instance, control gates should never be implemented without considering a break-glass option (“what happens if the control is blocking in an emergency situation?”). State-of-the-art security is to have off-the-shelf secure solutions chosen by the developers, approved by security, and maintained by ops. This will be a big leap forward in preventing vulnerabilities from creeping into source code. It will bring security to the masses at a very low cost (low friction). But to truly scale application security, it would be silly not to use the software engineer's best ally: the continuous integration pipeline. Embed controls in the CI/CD AppSec testing across all development pipelines is the implementation step. If your organization has multiple development teams, it is very likely that different CI/CD pipelines configurations exist in parallel. They may use different tools, or simply define different steps in the build process. This is not a problem per se, but to scale application security, centralization and harmonization are needed. As illustrated in the following example CI/CD pipeline, you can have a lot of security control steps: secrets detection, SAST, artifact signing, access controls, but also container or Infrastructure as Code scanning (not shown in the example) (taken from the DevSecOps whitepaper) The idea is that you can progressively activate more and more control steps, fine-tune the existing ones and scale both horizontally and vertically your “AppSec infrastructure”, at one condition: you need to centralize metrics and controls in a stand-alone platform able to handle the load corresponding to your organization’s size. Security processes can only be automated when you have metrics and proper visibility across your development targets, otherwise, it is just more burden on the AppSec team's shoulders. In turn, metrics and visibility help drive change and provide the spark to ignite a cultural change within your organization. Security ownership shifts to every engineer involved in the delivery process, and each one is able to leverage its own deep (yet partial) knowledge of the system to support the effort. This unlocks a world of possibilities: most security flaws can be treated like regular tickets, rule sets can be optimized for each pipeline based on criticality, capabilities or regulatory compliance, and progress can be tracked (saved time, avoided vulnerabilities etc.). In simpler terms, security can finally move at the DevOps speed. Conclusion Security can’t scale if it’s siloed, and slowing down the development process is no longer an option in a world led by DevOps innovation. The design and implementation of security controls are bound to evolve. In this article, we’ve depicted a high-level overview of the steps to be considered to scale AppSec. This starts with establishing a set of security requirements that involve all the departments, in particular product-related ones. From there it becomes possible to design guardrails to make security truly accessible with a mix of hard and soft gates. By carefully selecting automated detection and remediation that provide visibility and control, you will be laying a solid foundation for a real model of shared responsibility for security. Finally, embedding checks in the CI/CD system can be rolled out in multiple phases to progressively scale your security operations. With automated feedback in place, you can start incrementally adjusting your policies. A centralized platform creates a common interface to facilitate the exchange between application security and developer teams while enforcing processes. It is a huge opportunity to automate and propagate best practices across teams. Developers are empowered to develop faster with more ownership. When security is rethought as a partnership between software-building stakeholders, a flywheel effect can take place: reduced friction leads to better communication and visibility, automating of more best practices, easing the work of each other while improving security with fewer defects. This is how application security will finally be able to scale through continuous improvement.

thomas-segura has 68 posts and counting.See all posts by thomas-segura