SAST vs DAST

What is the difference between SAST and DAST?

SAST vs DAST comes down to what each one looks at. SAST (static application security testing) reads the source code without running it and points to the vulnerable line. DAST (dynamic application security testing) attacks the running application from outside, as an attacker would, and sees only what the app exposes, not the code behind it.

Updated

Side by side

SASTDAST
What it testsSource code, bytecode or binariesA running application or API
When it runsFrom the first commit, on every changeOnce a build is deployed to a test environment
What it needsAccess to the codeA URL, and often test accounts
What it reportsThe file and lineThe request and response that showed the flaw
Blind spotsDeployment, configuration, runtime behaviorCode paths the crawler never reaches
Typical noiseFalse positives on code an attacker cannot reachFewer false positives, more missed flaws

Which one to pick

Most teams that can run both do. SAST is cheap to run early and tells the developer exactly where to look. DAST confirms what is reachable in a real deployment and catches configuration problems no code scan sees. If you have to start with one, start where your risk is: a team that ships its own code every day gets the most from SAST in the pull request, and a team running software it did not write gets more from DAST.

A middle path: proving static findings

The usual SAST weakness is noise: it reports what might be exploitable. pokayoke is a SAST service for GitHub that runs exploits against your code and against a hardened copy to prove what it can, and marks each finding proven or not. A finding confirmed only by reading the code is labelled that way. It still works from the code, so it does not replace a DAST scan of your deployed environment.