DevSecOps Tools Tested: 4 Proven Scanners and What They Miss
Lists of DevSecOps tools tell you what each product claims to find. A more useful question is what each one actually catches on the same code, and what slips past all of them. I built a small Flask app with six problems planted on purpose (a hardcoded token, SQL built from user input, debug mode left on, old dependencies, a Dockerfile that runs as root and a public S3 bucket in Terraform) and ran four free DevSecOps tools against it: gitleaks 8.30.1, semgrep 1.185.0, Trivy 0.76.2 and the OWASP ZAP baseline scan. Each tool found something the others missed.

Contents
The test repository
The repository is small on purpose, so every finding from the DevSecOps tools can be traced to one planted line. The app had two routes. /user built its SQL query by concatenating the name parameter, the source contained a token in the GitHub personal access token format (fake, generated for the lab), and the last line was app.run(host="0.0.0.0", port=5000, debug=True). Next to it: requirements.txt pinned to flask==2.2.2, werkzeug==2.2.2 and requests==2.25.0; a Dockerfile based on python:3.13 with no USER; and infra/main.tf with an S3 public access block where every setting was false.
DevSecOps tools for secrets: gitleaks
Secret: REDACTED
RuleID: github-pat
File: /repo/app.py
Line: 5
2:59AM WRN leaks found: 1
gitleaks recognised the token by its format and reported the exact line, with the value redacted thanks to --redact. I used gitleaks dir to scan files; on a real repository, also scan the Git history, because a secret removed in the latest commit is still in the history. Run it as a pre-commit hook so the token never gets pushed. See the gitleaks README for both modes. A leaked token must be revoked, not just deleted from the code.
Static analysis: semgrep
With the public p/python rule pack, semgrep flagged the injection and the debug setting:
❯❯❱ python.flask.security.injection.tainted-sql-string.tainted-sql-string
11┆ rows = db.execute("SELECT * FROM users WHERE name = '" + name + "'").fetchall()
❯❱ python.flask.security.audit.debug-enabled.debug-enabled
19┆ app.run(host="0.0.0.0", port=5000, debug=True)
It also raised avoid_app_run_with_bad_host for binding to all interfaces. Of the DevSecOps tools here, this is the one that finds bugs in your own code, so it belongs in every pull request. The semgrep documentation covers writing your own rules for patterns specific to your codebase.
DevSecOps tools for dependencies and configuration: Trivy
trivy fs read requirements.txt:
Total: 16 (UNKNOWN: 0, LOW: 2, MEDIUM: 11, HIGH: 3, CRITICAL: 0)
│ flask │ CVE-2023-30861 │ HIGH │ fixed │ 2.2.2 │ 2.3.2, 2.2.5 │ flask: Possible disclosure of permanent session cookie due │
Each finding names the fixed version, so the fix is usually a version bump. trivy config checked the Dockerfile and Terraform in the same repository:
DS-0002 (HIGH): Specify at least 1 USER command in Dockerfile with non-root user as argument
AWS-0086 (HIGH): Public access block does not block public ACLs
In total 2 failures in the Dockerfile and 7 in main.tf, five of them HIGH. One tool covering dependencies, Dockerfiles and infrastructure code makes Trivy a good first scanner for small teams. For Terraform there are also dedicated tools; the Terraform AI checks post runs checkov and tflint on the same kind of S3 code.
Dynamic scanning: OWASP ZAP baseline
The ZAP baseline scan crawled the running app and reported only HTTP header issues:
WARN-NEW: Missing Anti-clickjacking Header [10020] x 1
WARN-NEW: X-Content-Type-Options Header Missing [10021] x 1
WARN-NEW: Server Leaks Version Information via "Server" HTTP Response Header Field [10036] x 3
WARN-NEW: Content Security Policy (CSP) Header Not Set [10038] x 2
FAIL-NEW: 0 FAIL-INPROG: 0 WARN-NEW: 7 WARN-INPROG: 0 INFO: 0 IGNORE: 0 PASS: 61
No SQL injection and no warning about debug mode from this one of the DevSecOps tools. That is by design: the ZAP baseline documentation says the script runs the spider and then "waits for the passive scanning to complete", and that it "doesn't perform any actual 'attacks'". It is safe to run in a pipeline, and it will not find injection bugs. That needs ZAP's active scan, against a test environment you own.
What the DevSecOps tools did not show
One request with a quote in the parameter showed how bad the app really was:
<title>sqlite3.OperationalError: no such table: users
// Werkzeug Debugger</title>
The response was the Werkzeug debugger page, with the full traceback and the source line of /app/app.py. semgrep had flagged debug=True as one finding among several; at runtime it was the most dangerous problem in the app. The Flask debugging documentation warns: "The debugger allows executing arbitrary Python code from the browser. It is protected by a pin, but still represents a major security risk." Scanners produce lists; someone still has to decide which item is the emergency.
Running DevSecOps tools without drowning in findings
Four scanners on a 20-line app already produced dozens of findings, most of them header warnings and medium-severity CVEs. On a real codebase the number is much larger, and a pipeline that fails on everything gets switched off within a week. Start with a short list that blocks the build: leaked secrets, critical and high dependency CVEs with a fixed version, and the injection rules. Report the rest without failing. Review the report weekly, and tighten the gate as the backlog shrinks.
Which DevSecOps tools to start with
| Problem planted | gitleaks | semgrep | Trivy | ZAP baseline |
|---|---|---|---|---|
| Hardcoded token | found | - | - | - |
| SQL injection | - | found | - | not found |
| Debug mode on | - | found | - | not found |
| Old dependencies | - | - | found (16) | - |
| Root Dockerfile | - | - | found | - |
| Public S3 settings | - | - | found | - |
| Missing HTTP headers | - | - | - | found (7) |
A dash means the tool does not look for that kind of problem. The practical order: gitleaks as a pre-commit hook, semgrep and Trivy on every pull request, ZAP baseline against staging, and a human review of what they report. Add the image scan from the Docker hardened images tests before deployment. To wire scanners into a Jenkins pipeline, see deploying a Node.js project with Jenkins. The tools the old version of this post listed (Snyk, Aqua, SonarQube, Vault, Prowler) cover some of the same categories plus secrets management and cloud posture; whichever you consider, try it against a test repository like this one first.
Comments
Post a Comment