Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 16 additions & 0 deletions .github/workflows/secrets-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: secrets_scan
on:
push:
pull_request:
workflow_dispatch:

jobs:
scan:
name: gitleaks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: scan for secrets (gitleaks)
run: docker run -v "$PWD:/code" -w /code ghcr.io/gitleaks/gitleaks:v8.30.1 dir -v --baseline-path /code/gitleaks-baseline.json

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Docker image pinned to mutable tag, not digest

ghcr.io/gitleaks/gitleaks:v8.30.1 uses a semver tag, which can be overwritten on the registry at any time. For a security-scanning step this creates a supply-chain risk: a compromised or repointed tag would silently replace the scanner with untrusted code. Pin to the image digest instead, e.g. ghcr.io/gitleaks/gitleaks:v8.30.1@sha256:<digest>.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/secrets-scan.yml
Line: 16

Comment:
**Docker image pinned to mutable tag, not digest**

`ghcr.io/gitleaks/gitleaks:v8.30.1` uses a semver tag, which can be overwritten on the registry at any time. For a security-scanning step this creates a supply-chain risk: a compromised or repointed tag would silently replace the scanner with untrusted code. Pin to the image digest instead, e.g. `ghcr.io/gitleaks/gitleaks:v8.30.1@sha256:<digest>`.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +14 to +16

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 dir mode skips git history; fetch-depth: 0 is unused overhead

The dir subcommand scans only the files present in the working tree. Any secret committed to a prior commit and then removed (or never appearing in the final tree state) will not be detected, even though fetch-depth: 0 fetches the complete history. For SOC 2 coverage, the git subcommand (or detect --source .) scans every commit in range and would catch secrets that existed even briefly. If dir mode is intentional (simpler baseline management), fetch-depth: 0 can be dropped to fetch-depth: 1 to avoid cloning the full history needlessly.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/secrets-scan.yml
Line: 14-16

Comment:
**`dir` mode skips git history; `fetch-depth: 0` is unused overhead**

The `dir` subcommand scans only the files present in the working tree. Any secret committed to a prior commit and then removed (or never appearing in the final tree state) will not be detected, even though `fetch-depth: 0` fetches the complete history. For SOC 2 coverage, the `git` subcommand (or `detect --source .`) scans every commit in range and would catch secrets that existed even briefly. If `dir` mode is intentional (simpler baseline management), `fetch-depth: 0` can be dropped to `fetch-depth: 1` to avoid cloning the full history needlessly.

How can I resolve this? If you propose a fix, please make it concise.

Loading
Loading