From ad9e40910702038f32283d430615871fe3f92cc0 Mon Sep 17 00:00:00 2001 From: Scott Date: Mon, 10 Aug 2026 19:41:40 -0400 Subject: [PATCH 1/2] chore: harden repo hygiene and CI security --- .github/workflows/security.yml | 14 ++++++++++++++ .gitignore | 8 ++++++++ .pre-commit-config.yaml | 9 +++++++++ 3 files changed, 31 insertions(+) create mode 100644 .github/workflows/security.yml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml new file mode 100644 index 0000000..377509d --- /dev/null +++ b/.github/workflows/security.yml @@ -0,0 +1,14 @@ +name: Security +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] +jobs: + secret-scan: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: gitleaks/gitleaks-action@v2 + with: + args: detect --no-git diff --git a/.gitignore b/.gitignore index aaadf73..dee634c 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,11 @@ go.work.sum # Editor/IDE # .idea/ # .vscode/ +__pycache__/ +node_modules/ +build/ +.pytest_cache/ +.idea/ +.vscode/ +*.pyc +*.log diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..a467548 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,9 @@ +repos: + - repo: local + hooks: + - id: no-plaintext-secrets + name: block plaintext secrets + entry: bash -c 'if grep -RInE "(sk_live_|sk_test_|ghp_|AIza|BEGIN RSA)" . --exclude-dir=.git --exclude-dir=node_modules --exclude-dir=vendor --exclude-dir=dist --exclude-dir=build --exclude-dir=test --exclude-dir=tests --exclude-dir=fixtures --exclude-dir=examples --exclude-dir=docs 2>/dev/null; then exit 1; fi' + language: system + pass_filenames: [] + always_run: true From e58afeb1ab28bb8a72b4f343e73721297d5073bb Mon Sep 17 00:00:00 2001 From: Scott Hardie Date: Mon, 10 Aug 2026 21:12:29 -0400 Subject: [PATCH 2/2] fix(ci): authenticate gitleaks pull-request scans --- .github/workflows/security.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index 377509d..f5b77a4 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -1,14 +1,21 @@ name: Security on: push: - branches: [ main, master ] + branches: [main, master] pull_request: - branches: [ main, master ] + branches: [main, master] + +permissions: + contents: read + pull-requests: read + jobs: secret-scan: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: gitleaks/gitleaks-action@v2 with: - args: detect --no-git + fetch-depth: 0 + - uses: gitleaks/gitleaks-action@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}