Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
d4b9aa3
fix(compliance): add secret-scan job, pin dtolnay action, exempt inte…
github-actions[bot] May 12, 2026
360c86a
fix(ci): add GITLEAKS_LICENSE for org repo and document requirement
github-actions[bot] May 12, 2026
751e8aa
fix(ci): use gitleaks CLI instead of action to avoid org license requ…
github-actions[bot] May 12, 2026
4b60fc4
chore: apply manual instructions [skip ci-relay]
donpetry-bot Jun 8, 2026
5a13786
Merge branch 'main' into claude/issue-259-20260512-1836
don-petry Jun 8, 2026
3f89760
Merge branch 'main' into claude/issue-259-20260512-1836
don-petry Jun 8, 2026
afcc62c
Merge branch 'main' into claude/issue-259-20260512-1836
don-petry Jun 8, 2026
5f299e3
chore: apply manual instructions [skip ci-relay]
donpetry-bot Jun 8, 2026
5d3709c
Merge branch 'main' into claude/issue-259-20260512-1836
don-petry Jun 9, 2026
9200df0
chore: apply manual instructions [skip ci-relay]
donpetry-bot Jun 9, 2026
02bdf9e
chore: apply manual instructions [skip ci-relay]
donpetry-bot Jun 9, 2026
c289054
Merge branch 'main' into claude/issue-259-20260512-1836
don-petry Jun 10, 2026
cdf7ad1
Merge branch 'main' into claude/issue-259-20260512-1836
don-petry Jun 10, 2026
5a1498b
Merge branch 'main' into claude/issue-259-20260512-1836
don-petry Jun 10, 2026
57e2e09
Merge branch 'main' into claude/issue-259-20260512-1836
don-petry Jun 10, 2026
68bf222
fix(ci): auto-fix for SonarCloud Code Analysis [skip ci-relay]
donpetry-bot Jun 10, 2026
751228f
Merge branch 'main' into claude/issue-259-20260512-1836
don-petry Jun 10, 2026
eaf5fb2
Merge branch 'main' into claude/issue-259-20260512-1836
don-petry Jun 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,20 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- name: Checkout (full history)
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Run gitleaks
uses: gitleaks/gitleaks-action@e0c47f4f8be36e29cdc102c57e68cb5cbf0e8d1e # v3.0.0
- name: Install gitleaks
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}
GITLEAKS_CONFIG: .gitleaks.toml
GITLEAKS_ARGS: detect --source . --redact --verbose --exit-code 1
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release download v8.30.1 --repo gitleaks/gitleaks --pattern 'gitleaks_8.30.1_linux_x64.tar.gz' --output /tmp/gitleaks.tar.gz
echo "551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb /tmp/gitleaks.tar.gz" | sha256sum -c
tar -xzf /tmp/gitleaks.tar.gz -C /tmp gitleaks
sudo mv /tmp/gitleaks /usr/local/bin/gitleaks

- name: Run gitleaks
run: gitleaks detect --source . --redact --verbose --exit-code 1
7 changes: 3 additions & 4 deletions scripts/compliance-audit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,10 @@ check_action_pinning() {
# Find uses: directives that are NOT SHA-pinned
# SHA-pinned: uses: owner/action@<40+ hex chars>
# Exclude docker:// and ./ references
# Exclude internal reusable workflow calls to petry-projects/.github and
# petry-projects/.github-private — per ci-standards.md#action-pinning-policy,
# these use deliberate tag refs (@v1, @v2, @main) and are explicitly exempt.
# Exclude $ORG/.github reusable workflow refs — these use tag refs
# (@v1, @v2, @main) by design per ci-standards.md#action-pinning-policy
local unpinned
unpinned=$(echo "$decoded" | grep -E '^[[:space:]]*-?[[:space:]]*uses:[[:space:]]+[^#]*@' | grep -vE '@[0-9a-f]{40}' | grep -vE '(docker://|\.\/)' | grep -vE 'uses:[[:space:]]+petry-projects/(\.github|\.github-private)/' || true)
unpinned=$(echo "$decoded" | grep -E '^[[:space:]]*-?[[:space:]]*uses:[[:space:]]+[^#]*@' | grep -vE '@[0-9a-f]{40}' | grep -vE '(docker://|\.\/)' | grep -vE "uses:[[:space:]]+$ORG/\\.github(-private)?/\\.github/workflows/" || true)

if [ -n "$unpinned" ]; then
local count
Expand Down
6 changes: 4 additions & 2 deletions scripts/lib/push-protection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,10 @@ pp_check_secret_scan_ci_job() {
return
fi

# Match actual action references, not bare mentions in comments or docs.
if ! echo "$ci_content" | grep -qE 'uses:[[:space:]]*(gitleaks/gitleaks-action|zricethezav/gitleaks-action)@'; then
# Accept either the gitleaks action or the gitleaks CLI (inline or block run:).
# The action requires a paid org license (gitleaks.io); the CLI installed via
# binary download is a license-free alternative.
if ! echo "$ci_content" | grep -qE '(^[[:space:]]*-?[[:space:]]*uses:[[:space:]]*(gitleaks/gitleaks-action|zricethezav/gitleaks-action)@|gitleaks[[:space:]]+detect([[:space:]]|$))'; then
add_finding "$repo" "push-protection" "secret_scan_ci_job_present" "error" \
"\`ci.yml\` does not contain a job using \`gitleaks\` — add the secret-scan job from the standard" \
"$PP_STANDARD_REF#required-ci-job"
Expand Down
29 changes: 20 additions & 9 deletions standards/push-protection.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ secret-scan:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- name: Checkout (full history)
# Pin to SHA per Action Pinning Policy (ci-standards.md#action-pinning-policy).
Expand All @@ -225,17 +224,29 @@ secret-scan:
with:
fetch-depth: 0

- name: Run gitleaks
# Pinned to SHA per Action Pinning Policy (ci-standards.md#action-pinning-policy).
# Refresh with: gh api repos/gitleaks/gitleaks-action/git/refs/tags/v2 --jq '.object.sha'
# then dereference if it points at an annotated tag.
uses: gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7 # v2.3.9
with:
args: detect --source . --redact --verbose --exit-code 1
- name: Install gitleaks
# Download the pre-built binary and verify its SHA256 checksum.
# To upgrade: download the new checksums.txt from the gitleaks release page,
# update the version tag and the sha256 hash below.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release download v8.30.1 --repo gitleaks/gitleaks --pattern 'gitleaks_8.30.1_linux_x64.tar.gz' --output /tmp/gitleaks.tar.gz
echo "551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb /tmp/gitleaks.tar.gz" | sha256sum -c
tar -xzf /tmp/gitleaks.tar.gz -C /tmp gitleaks
sudo mv /tmp/gitleaks /usr/local/bin/gitleaks

- name: Run gitleaks
run: gitleaks detect --source . --redact --verbose --exit-code 1
```

> **Why CLI instead of `gitleaks/gitleaks-action`?** The action's v2 release
> requires a paid license for GitHub organization repos. The CLI (installed via
> a direct binary download with SHA256 verification) is free, fully pinned, and
> runs the same scan. If you have a license, you can use the action instead —
> add `GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}` to the `env:` block
> alongside `GITHUB_TOKEN`.

The job MUST:

- Use `fetch-depth: 0` so the full git history is scanned, not just the
Expand Down
Loading