File tree Expand file tree Collapse file tree 2 files changed +65
-0
lines changed
Expand file tree Collapse file tree 2 files changed +65
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Semgrep
2+
3+ # Run workflow each time code is pushed to your repository.
4+ on :
5+ push :
6+ branches :
7+ - main
8+ pull_request :
9+ branches :
10+ - main
11+ jobs :
12+ build :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout code
16+ uses : actions/checkout@v3
17+
18+ - name : Install Semgrep
19+ run : pip install semgrep
20+
21+ - name : Run Semgrep
22+ run : |
23+ semgrep --config .semgreprules/customRule.yml --config auto --severity ERROR --sarif . > results.sarif
24+
25+ - name : Upload SARIF file
26+ uses : github/codeql-action/upload-sarif@v3
27+ with :
28+ # Path to SARIF file relative to the root of the repository
29+ sarif_file : results.sarif
30+
31+ - name : Upload results
32+ uses : actions/upload-artifact@v4
33+ with :
34+ name : semgrep-results
35+ path : results.sarif
Original file line number Diff line number Diff line change 1+ rules :
2+ - id : check-sensitive-info
3+ message : >-
4+ Potential sensitive information found: $1
5+ severity : ERROR
6+ languages :
7+ - yaml
8+ - go
9+ - javascript
10+ - java
11+ - python
12+ - golang
13+ - docker
14+ patterns :
15+ - pattern-regex : (?i)\b(api[_-]key|api[_-]token|api[_-]secret[_-]key|api[_-]password|token|secret[_-]key|password|auth[_-]key|auth[_-]token|AUTH_PASSWORD)\s*[:=]\s*(['"]?)((?!YOUR_EXCLUSION_PATTERN_HERE)[A-Z]+.*?)\2
16+
17+ - id : check-logger-appconfig
18+ message : >-
19+ Potential Logging configuration found: $1
20+ severity : ERROR
21+ languages :
22+ - yaml
23+ - go
24+ - javascript
25+ - java
26+ - python
27+ - golang
28+ - docker
29+ patterns :
30+ - pattern-regex : log\.Logger\(\).*(appConfig).*
You can’t perform that action at this time.
0 commit comments