Automated application security testing forms the technical backbone of modern application defense. Security engineers do not manually read every one of the 500,000 lines of code in a modern enterprise repository; they configure and tune specialized automated scanners—SAST, DAST, and SCA—to highlight critical vulnerabilities and track remediation metrics.
Semgrep is a modern, ultra-fast static analysis engine that searches code syntax using familiar programming language patterns rather than brittle regular expressions. Here is a custom Semgrep rule that detects unparameterized SQL queries in Python:
rules:
- id: detect-raw-sql-concatenation
languages: [python]
message: "Potential SQL Injection detected: Avoid string formatting in db.execute!"
severity: ERROR
pattern: db.execute(f"SELECT ... {$VAR} ...")
OWASP ZAP is the world's most widely deployed open-source dynamic web application security scanner. Unlike static analysis, ZAP operates from the outside:
# Run headless ZAP baseline scan against a web app in Docker
docker run -t ghcr.io/zaproxy/zaproxy:stable zap-baseline.py -t https://staging.example.com -r zap_report.html
Broaden your defensive and offensive security knowledge across our curriculum:
Embedding security scanners into GitHub Actions workflows without slowing developers.
Extending application code scans to operating system packages inside Docker.
Comparing dynamic application scanning (DAST) with infrastructure scanning.
CLI flags and configuration syntax for Semgrep, ZAP, Trivy, and SonarQube.