Merge pull request 'Chore: Add Betterleaks secret scanning to commits and CI' (#55) from chore/add-secret-scanning into main
Deploy k8s Infra / Pulumi Preview (push) Skipped
Deploy k8s Apps / Pulumi Preview (push) Skipped
Deploy Monitoring / Pulumi Preview (push) Skipped
Deploy k8s Infra / Pulumi Deploy (push) Successful in 46s
Deploy k8s Apps / Pulumi Deploy (push) Successful in 41s
Deploy Monitoring / Pulumi Deploy (push) Successful in 42s
Secret Scan / Betterleaks (push) Successful in 5s

This commit was merged in pull request #55.
This commit is contained in:
claude-bot Bot committed 2026-11-23 00:16:16 +01:00
commit 855d1cce85
7 files changed
+52 -3

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
# Old Gitea token in deleted .env.local. Confirmed revoked (API returned 401) on 2026-11-22.
8c69ec772ab5f0df73fa2614e5b8b22adb9bbd15:.env.local:gitea-access-token:2
+1 -1
View File
@@ -7,7 +7,7 @@ on:
- main - main
paths: paths:
- "03-k8s-infra/**" - "03-k8s-infra/**"
- ".gitea/workflows/**" - ".gitea/workflows/03-deploy-k8s-infra.yaml"
pull_request: pull_request:
branches: branches:
- main - main
+1 -1
View File
@@ -7,7 +7,7 @@ on:
- main - main
paths: paths:
- "04-k8s-apps/**" - "04-k8s-apps/**"
- ".gitea/workflows/**" - ".gitea/workflows/04-deploy-k8s-apps.yaml"
pull_request: pull_request:
branches: branches:
- main - main
+1 -1
View File
@@ -7,7 +7,7 @@ on:
- main - main
paths: paths:
- "05-monitoring/**" - "05-monitoring/**"
- ".gitea/workflows/**" - ".gitea/workflows/05-deploy-monitoring.yaml"
pull_request: pull_request:
branches: branches:
- main - main
+34
View File
@@ -0,0 +1,34 @@
name: Secret Scan
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
env:
BETTERLEAKS_VERSION: "1.10.1"
BETTERLEAKS_SHA256: c174b42d7aa60caf58c0c3e555c0e4bed01fe6b0d99a412bce777b5af4ce913e
jobs:
scan:
name: Betterleaks
runs-on: ubuntu-latest
steps:
- name: Checkout Full History
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Betterleaks
run: |
curl -fsSL -o /tmp/betterleaks.tar.gz \
"https://github.com/betterleaks/betterleaks/releases/download/v${BETTERLEAKS_VERSION}/betterleaks_${BETTERLEAKS_VERSION}_linux_x64.tar.gz"
echo "${BETTERLEAKS_SHA256} /tmp/betterleaks.tar.gz" | sha256sum -c -
tar -xzf /tmp/betterleaks.tar.gz -C /tmp betterleaks
- name: Scan Git History
run: /tmp/betterleaks git . --redact --verbose --no-banner --no-color --log-opts="--all -m -p -U0"
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
# Git pre-commit hook: blocks a commit if its staged changes contain a secret.
#
# Activate once per clone: git config core.hooksPath .githooks
# Skip in an emergency: git commit --no-verify
if ! command -v betterleaks >/dev/null 2>&1; then
echo "pre-commit: betterleaks is not installed, so staged changes can't be scanned" >&2
exit 1
fi
exec betterleaks git --pre-commit --staged --redact --no-banner --no-color .
+2
View File
@@ -6,3 +6,5 @@ bin/
Pulumi.dev.yaml Pulumi.dev.yaml
sdks/ sdks/
.env .env
.env.*
!.env.example