Analyze source code and binaries without running the app—fast feedback for developers.
SAST tools parse your codebase (and sometimes bytecode or IR) and apply rules or data-flow analysis to find patterns such as SQL injection sinks, hard-coded secrets, weak randomness, or unsafe deserialization. Because nothing is executed, SAST can run in CI on every pull request.
Tip
Tune severity and suppressions with security team review—noise kills adoption.| Feature | Why it matters |
|---|---|
| IDE integration | Fix before push |
| SARIF output | Unified ingestion in GitHub/GitLab/Azure DevOps |
| Custom rules | Encode org-specific dangerous APIs |
| Baseline / diff | Block only new issues on legacy codebases |
| Secret detection | Often bundled or paired with dedicated secret scanners |
| Tool | Notes |
|---|---|
| Semgrep | Fast, rule-as-code; strong for polyglot monorepos |
| SonarQube / SonarCloud | Security + quality; quality gates in CI |
| Checkmarx | Enterprise SAST; deep analysis options |
| Micro Focus Fortify | Enterprise; audit-heavy environments |
name: sast
on:
pull_request:
branches: [ main ]
jobs:
semgrep:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
docker run --rm -v "$PWD:/src" returntocorp/semgrep semgrep scan \
--config auto --error --sarif --output semgrep.sarif /src
- uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: semgrep.sarif
Illustrative only—pin versions and align with your org’s approved scanners.