diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index fcca192..87953df 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -24,15 +24,24 @@ jobs: uses: zizmorcore/zizmor-action@45d7276c9ca790aabd705e31ca99c6185c3e76dd # v0.8.1 with: advanced-security: false - gitleaks: + betterleaks: runs-on: ubuntu-slim + permissions: + contents: read # needed to check out a private repo steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: - persist-credentials: false - fetch-depth: 0 - - name: Check gitleaks - uses: gitleaks/gitleaks-action@e0c47f4f8be36e29cdc102c57e68cb5cbf0e8d1e # v3.0.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITLEAKS_ENABLE_COMMENTS: false + persist-credentials: false + fetch-depth: 0 + # betterleaks has no official action or PyPI package, so it is built from source + - name: Install Go + uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0 + with: + go-version: stable + cache: false + - name: Install betterleaks + run: | + go install github.com/betterleaks/betterleaks@v1.10.1 + - name: Scan git history for secrets + run: | + "$(go env GOPATH)/bin/betterleaks" git --redact . diff --git a/Brewfile b/Brewfile index 0156559..6be88b6 100644 --- a/Brewfile +++ b/Brewfile @@ -1,5 +1,5 @@ brew "actionlint" -brew "gitleaks" +brew "betterleaks" brew "just" brew "markdownlint-cli2" brew "prek" diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 64b84e0..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). -Release notes are generated from labeled pull requests by Release Drafter. - -## [Unreleased] diff --git a/README.md b/README.md index f33044f..76fd185 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ template changes with `copier update`. * `uv` for dependencies and `just` as the command runner * ruff, ty, codespell, actionlint, and markdownlint for linting * pytest with coverage, Zensical docs with an API reference generated from docstrings -* pip-audit, gitleaks, and zizmor for security checks +* pip-audit, betterleaks, and zizmor for security checks * prek git hooks, GitHub Actions CI, Dependabot, Release Drafter, and a release workflow * A VS Code dev container @@ -82,7 +82,7 @@ Commands (requires `uv` and `just`; install `just` with `brew install just`, the * `just check` - render the demo project and run its lint, tests, docs build, pip-audit, and zizmor (used in CI) * `just actionlint` - lint the root and template GitHub workflows * `just zizmor` - audit the root and template GitHub workflows for security issues -* `just git-leaks` - scan staged changes for secrets with gitleaks +* `just betterleaks` - scan staged changes for secrets with betterleaks * `just prek` - run the git hooks on staged files ### Releases diff --git a/justfile b/justfile index f44696b..aec9488 100644 --- a/justfile +++ b/justfile @@ -8,8 +8,8 @@ default: actionlint: actionlint .github/workflows/*.yml template/.github/workflows/*.yml # Scan staged changes for secrets -git-leaks: - gitleaks git --pre-commit --staged --redact +betterleaks: + betterleaks git --pre-commit --staged --redact # Run the git hooks on staged files prek: prek diff --git a/prek.toml b/prek.toml index 3ec35b8..0dc7c87 100644 --- a/prek.toml +++ b/prek.toml @@ -35,10 +35,10 @@ hooks = [ pass_filenames = false }, { - id = "git-leaks", - name = "git leaks", + id = "betterleaks", + name = "betterleaks", language = "system", - entry = "gitleaks git --pre-commit --staged --redact", + entry = "just betterleaks", pass_filenames = false } ]