ci: add ShellCheck and Trufflehog secret scanning workflows

- Add .github/workflows/shellcheck.yml — blocking ShellCheck linting on all .sh files
- Add .github/workflows/secret-scanning.yml — blocking Trufflehog secret scanning on all files, runs weekly on schedule
- Update .github/secret_scanning.yml exclusions to include .github/wiki/
- Update .github/SECURITY_SCANS.md with new workflows and required checks
- Set branch protection on main to require: ShellCheck, CodeQL, Trufflehog Secret Scanning

Co-authored-by: Jarvis <jarvis@wickedyoda.local>
This commit is contained in:
WickedYodaandJarvis authored and GitHub committed 2026-09-04 13:01:50 -05:00
1 parent d385f4ad4c
commit 85a8df0417
4 files changed
+108 -10

No files matched your search

+26 -10
View File
@@ -4,21 +4,31 @@ This repository runs automated security scans on every pull request to `main`.
## What's Scanned
| Scan | Tool | Frequency | What It Checks |
|------|------|-----------|----------------|
| Secret Scanning | GitHub Secret Scanning | On push/PR + push protection | Detects leaked credentials, API keys, tokens in code, issues, PRs, wikis |
| ShellCheck | `ludeeus/shellicopter` (via `actions/checkout`) | On every PR/push | Security + linting issues in `.sh` scripts |
| CodeQL | GitHub CodeQL | On every PR/push | SAST for Python — detects injection, hardcoded secrets, insecure code patterns |
| Python Dependencies | `pip-audit` | On every PR/push | Known CVEs in `requirements.txt` files |
| Docker Images | Docker Scout | On every PR/push | Critical CVEs in Dockerfiles |
| Scan | Tool | Frequency | What It Checks | Blocking |
|------|------|-----------|----------------|----------|
| Secret Scanning | Trufflehog | On push/PR + weekly | Detects leaked credentials, API keys, tokens in all repository files | ✅ Yes |
| ShellCheck | ShellCheck | On every PR/push | Security + linting issues in `.sh` scripts | ✅ Yes |
| ShellCheck (Legacy) | ludeeus/shellicopter | On every PR/push | Additional shell script checks | ❌ No |
| CodeQL | GitHub CodeQL | On every PR/push | SAST for Python — detects injection, hardcoded secrets, insecure code patterns | ✅ Yes |
| Python Dependencies | `pip-audit` | On every PR/push | Known CVEs in `requirements.txt` files | ❌ No |
| Docker Images | Docker Scout (Trivy) | On every PR/push | Critical/HIGH CVEs in Dockerfiles | ❌ No |
## Workflow Files
- `.github/workflows/security-scans.yml` — ShellCheck, pip-audit, Docker Scout
- `.github/workflows/shellcheck.yml` — ShellCheck linting (blocking) on all `.sh` files
- `.github/workflows/secret-scanning.yml` — Trufflehog secret scanning (blocking) on all files, runs weekly
- `.github/workflows/security-scans.yml` — ShellCheck (legacy), pip-audit, Docker Scout
- `.github/workflows/codeql.yml` — CodeQL SAST analysis
- `.github/secret_scanning.yml` — Exclusions for secret scanning
- `.github/secret_scanning.yml` — GitHub-native secret scanning exclusion patterns
## Enabling Secret Scanning & Push Protection
## Required Checks on `main`
Branch protection requires the following checks to pass before merging:
- `ShellCheck` — shellcheck.yml workflow
- `CodeQL` — codeql.yml workflow
- `Trufflehog Secret Scanning` — secret-scanning.yml workflow
## Enabling Push Protection (GitHub-native)
1. Go to **Settings** → **Advanced Security** → **Enable** "Secret Protection"
2. Enable **"Push protection"** under Secret Protection
@@ -29,3 +39,9 @@ This repository runs automated security scans on every pull request to `main`.
## Failing Builds
When a security scan fails on a PR, GitHub will post check results directly on the PR. All contributors must address security findings before the PR can be merged (enforced via branch protection rules on `main`).
### Secret scanning failures
If Trufflehog detects a potential secret, the CI will fail and the `results.sarif` file will be uploaded to the **Security** tab. Review findings and either:
- Rotate the exposed secret immediately
- Add the path to `.github/secret_scanning.yml` exclusions if it's a false positive (e.g., an example file with placeholder values)