-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add security scanners to Github Actions
- Loading branch information
Vitaliy Saveliev
committed
Jun 24, 2024
1 parent
089f1b2
commit 7696fa6
Showing
2 changed files
with
69 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Secure | ||
|
||
on: push | ||
|
||
jobs: | ||
# Sample GitHub Actions: | ||
# https://semgrep.dev/docs/semgrep-ci/sample-ci-configs#sample-github-actions-configuration-file | ||
semgrep: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: semgrep/semgrep | ||
permissions: | ||
contents: read | ||
security-events: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: semgrep scan --sarif --output=semgrep.sarif --error | ||
env: | ||
SEMGREP_RULES: >- | ||
p/bandit | ||
p/command-injection | ||
p/comment | ||
p/cwe-top-25 | ||
p/default | ||
p/gitlab | ||
p/gitlab-bandit | ||
p/gitleaks | ||
p/insecure-transport | ||
p/owasp-top-ten | ||
p/python | ||
p/r2c-best-practices | ||
p/r2c-bug-scan | ||
p/r2c-security-audit | ||
p/secrets | ||
p/security-audit | ||
p/xss | ||
- uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: semgrep.sarif | ||
if: always() | ||
|
||
# Samples GitHub Actions: | ||
# https://github.com/aquasecurity/trivy-action | ||
trivy: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
security-events: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: aquasecurity/trivy-action@master | ||
with: | ||
scan-type: 'fs' | ||
format: 'sarif' | ||
output: 'trivy.sarif' | ||
exit-code: '1' | ||
severity: 'CRITICAL,HIGH' | ||
- uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: trivy.sarif | ||
if: always() |
13 changes: 8 additions & 5 deletions
13
.github/workflows/checks.yml → .github/workflows/verify.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters