mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-08 07:18:47 +00:00
ci: add secret scanning
This commit is contained in:
14
.github/workflows/python-ci.yml
vendored
14
.github/workflows/python-ci.yml
vendored
@@ -9,6 +9,20 @@ on:
|
|||||||
- cron: '0 3 * * *'
|
- cron: '0 3 * * *'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
secret-scan:
|
||||||
|
name: Secret Scan
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event_name == 'pull_request' || github.event_name == 'schedule'
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Run gitleaks
|
||||||
|
uses: gitleaks/gitleaks-action@v2
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
GITLEAKS_CONFIG: .gitleaks.toml
|
||||||
|
|
||||||
build:
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
8
.gitleaks.toml
Normal file
8
.gitleaks.toml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
title = "SeedPass gitleaks config"
|
||||||
|
|
||||||
|
[allowlist]
|
||||||
|
description = "Paths and patterns to ignore when scanning for secrets"
|
||||||
|
# Add file paths that contain test data or other non-sensitive strings
|
||||||
|
paths = []
|
||||||
|
# Add regular expressions that match false positive secrets
|
||||||
|
regexes = []
|
17
docs/secret-scanning.md
Normal file
17
docs/secret-scanning.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Secret Scanning
|
||||||
|
|
||||||
|
SeedPass uses [Gitleaks](https://github.com/gitleaks/gitleaks) to scan the repository for accidentally committed secrets. The scan runs automatically for pull requests and on a nightly schedule. Any findings will cause the build to fail.
|
||||||
|
|
||||||
|
## Suppressing False Positives
|
||||||
|
|
||||||
|
If a file or string triggers the scanner but does not contain a real secret, add it to the allowlist in `.gitleaks.toml`.
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[allowlist]
|
||||||
|
# Ignore specific files
|
||||||
|
paths = ["path/to/file.txt"]
|
||||||
|
# Ignore strings that match a regular expression
|
||||||
|
regexes = ["""dummy_api_key"""]
|
||||||
|
```
|
||||||
|
|
||||||
|
Commit the updated `.gitleaks.toml` to stop future alerts for the allowed items.
|
Reference in New Issue
Block a user