Skip to content

Commit 9648b22

Browse files
committed
ci: add gitleaks and trufflehog secret scanning workflow
1 parent 3102fcd commit 9648b22

2 files changed

Lines changed: 50 additions & 0 deletions

File tree

.github/workflows/secret-scan.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Secret Scan
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
workflow_dispatch:
9+
schedule:
10+
- cron: '0 4 * * 1'
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
gitleaks:
17+
name: gitleaks
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Run gitleaks
26+
uses: gitleaks/gitleaks-action@v2
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
GITLEAKS_ENABLE_COMMENTS: 'false'
30+
31+
trufflehog:
32+
name: trufflehog
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v4
37+
with:
38+
fetch-depth: 0
39+
40+
- name: Run trufflehog
41+
uses: trufflesecurity/trufflehog@main
42+
with:
43+
extra_args: --results=verified,unknown

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,13 @@ flutter test
234234
dart pub publish --dry-run
235235
```
236236

237+
## Security Scanning
238+
239+
GitHub Actions secret scanning is enabled with both `gitleaks` and `trufflehog`.
240+
241+
- Workflow: `.github/workflows/secret-scan.yml`
242+
- Runs on pull requests, pushes to `main`, weekly schedule, and manual dispatch
243+
237244
## License
238245

239246
MIT

0 commit comments

Comments
 (0)