Skip to content

Commit

Permalink
chore: Move semgrep scanning to separate step
Browse files Browse the repository at this point in the history
  • Loading branch information
nmanoogian committed Apr 25, 2023
1 parent 5885ed6 commit 16ec162
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/salus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ on:
name: Salus security scan

jobs:
semgrep:
runs-on: ubuntu-latest
name: Semgrep
steps:
- uses: actions/checkout@v2
- name: Scan
id: scan
run: |
set -eo pipefail;
python3 -m pip install semgrep;
semgrep scan --error --config https://semgrep.dev/p/trailofbits --config semgrep_configs
salus_scan_job:
runs-on: ubuntu-latest
name: Salus Security Scan
Expand Down
14 changes: 0 additions & 14 deletions salus-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ active_scanners:
- Gosec
- PatternSearch
- RepoNotEmpty
- Semgrep
- GoOSV
- GoVersionScanner
- GoPackageScanner
Expand All @@ -24,19 +23,6 @@ active_scanners:
enforced_scanners: "all"

scanner_configs:
Semgrep:
matches:
- config: https://semgrep.dev/p/trailofbits
forbidden: true
- config: semgrep_configs/print.yaml
forbidden: true
exclude:
- pkg/printer
- pkg/utils/log.go
- config: semgrep_configs/writefile.yaml
forbidden: true
exclude:
- pkg/utils/io.go
GoVersionScanner:
error:
min_version: '1.18.0'
4 changes: 4 additions & 0 deletions semgrep_configs/print.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ rules:
- pattern-regex: fmt\.Print[a-z]*
- pattern-regex: fmt\.Fprint[a-z]*
severity: ERROR
paths:
exclude:
- /pkg/printer
- /pkg/utils/log.go
3 changes: 3 additions & 0 deletions semgrep_configs/writefile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ rules:
pattern-either:
- pattern: ioutil.WriteFile
severity: ERROR
paths:
exclude:
- /pkg/utils/io.go

0 comments on commit 16ec162

Please sign in to comment.