mirror of
https://github.com/wickedyoda/public-setupfiles.git
synced 2026-11-16 13:31:56 -06:00
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:
1 parent
d385f4ad4c
commit
85a8df0417
4 files changed
+108
-10
No files matched your search
@@ -0,0 +1,46 @@
|
||||
name: Secret Scanning
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
# Run weekly on schedule for ongoing monitoring
|
||||
schedule:
|
||||
- cron: ['0 6 * * 1'] # Mondays at 06:00 UTC
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
jobs:
|
||||
trufflehog:
|
||||
name: Trufflehog Secret Scanning
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
# Fetch full history for thorough scanning
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Run Trufflehog
|
||||
uses: trufflesecurity/trufflehog@main
|
||||
with:
|
||||
# Scan the full repository path
|
||||
path: ./
|
||||
# Output results in SARIF format for GitHub code scanning
|
||||
format: sarif
|
||||
output: results.sarif
|
||||
# Fail the workflow if secrets are found
|
||||
fail: true
|
||||
# Use entropy-based detection in addition to regex patterns
|
||||
only-failed: false
|
||||
|
||||
- name: Upload Trufflehog results to GitHub Security tab
|
||||
if: always()
|
||||
uses: github/codeql-action/upload-security-sarif@v3
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
# Don't fail the build on upload issues (scanning might have passed)
|
||||
checkout_path: ./
|
||||
@@ -0,0 +1,31 @@
|
||||
name: ShellCheck
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
shellcheck:
|
||||
name: ShellCheck Linting
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Run ShellCheck on all shell scripts
|
||||
uses: ludeeus/action-shellcheck@2.1.0
|
||||
with:
|
||||
# Check all .sh files, excluding .git and vendor directories
|
||||
files: |
|
||||
*.sh
|
||||
**/*.sh
|
||||
# Exclude directories we don't want to lint
|
||||
exclude: |
|
||||
.git
|
||||
.idea
|
||||
.vscode
|
||||
Reference in new issue
Block a user