mango-explorer/.github/workflows/semgrep-scan.yml

55 lines
1.6 KiB
YAML

# Flexible static application security testing based on various rulesets depending on
# various parameters such as language, dockerfile, etc.
name: Semgrep Scanner
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# schedule:
# - cron: '0 6 * * 1'
jobs:
semgrep:
name: Semgrep Scan
runs-on: ubuntu-latest
# Set permissions to allow writing security events
permissions:
security-events: write
# Skip any PR created by dependabot to avoid permission issues
if: (github.actor != 'dependabot[bot]')
steps:
- name: Checkout repository
uses: actions/checkout@v2
- uses: returntocorp/semgrep-action@v1
with:
config: >- # more at semgrep.dev/explore
p/docker
p/gitlab-bandit
# Instead of `config:`, use rules set in Semgrep App.
# Get your token from semgrep.dev/manage/settings.
# publishToken: ${{ secrets.SEMGREP_APP_TOKEN }}
# Never fail the build due to findings on pushes.
# Instead, just collect findings for semgrep.dev/manage/findings
# auditOn: push
# Upload findings to GitHub Advanced Security Dashboard [step 1/2]
generateSarif: "1"
# Change job timeout (default is 1800 seconds; set to 0 to disable)
# env:
# SEMGREP_TIMEOUT: 300
# Upload findings to GitHub Advanced Security Dashboard [step 2/2]
- name: Upload SARIF file for GitHub Advanced Security Dashboard
uses: github/codeql-action/upload-sarif@v1
if: always()
with:
sarif_file: semgrep.sarif