This repository contains reusable GitHub Actions workflows for security scanning.
Static code analysis using Semgrep and CodeQL.
Detect hardcoded secrets using TruffleHog.
Scan dependencies for vulnerabilities using Trivy. Combine with Dependabot for automatic updates (see dependabot-templates/).
Scan Infrastructure as Code for misconfigurations using Trivy.
Scan Docker images for vulnerabilities using Trivy.
All-in-one workflow that runs all security scans.
Create .github/workflows/security.yml in your repo:
name: Security
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
security:
permissions:
security-events: write
contents: read
uses: checkr/.github/.github/workflows/security-full.yml@main
with:
product: 'YourTeamName' # Set your team/product name
secrets:
ARMORCODE_API_KEY: ${{ secrets.CHECKR_GITHUB_SCAN_UPLOAD_ARMORCODE_KEY }}For more granular control:
name: Security
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
sast:
uses: checkr/.github/.github/workflows/sast.yml@main
with:
product: 'YourTeamName'
secrets:
ARMORCODE_API_KEY: ${{ secrets.CHECKR_GITHUB_SCAN_UPLOAD_ARMORCODE_KEY }}
secrets:
uses: checkr/.github/.github/workflows/secrets.yml@main
with:
product: 'YourTeamName'
secrets:
ARMORCODE_API_KEY: ${{ secrets.CHECKR_GITHUB_SCAN_UPLOAD_ARMORCODE_KEY }}
dependencies:
permissions:
security-events: write
contents: read
uses: checkr/.github/.github/workflows/dependencies.yml@main
with:
product: 'YourTeamName'
secrets:
ARMORCODE_API_KEY: ${{ secrets.CHECKR_GITHUB_SCAN_UPLOAD_ARMORCODE_KEY }}Important: Jobs that upload to GitHub Security need security-events: write permission.
For complete dependency security, enable Dependabot alongside Trivy:
- Go to repo Settings → Security → Enable Dependabot
- Or copy dependabot-templates/dependabot.yml to your repo
Why both?
- Trivy: Scans on PRs and blocks vulnerable dependencies
- Dependabot: Auto-creates PRs to fix vulnerabilities
See dependabot-templates/README.md for details.
All findings appear in Security tab under Code scanning alerts.