Skip to content

Add secret scan for pull requests#30937

Open
miyadav wants to merge 2 commits intoopenshift:mainfrom
miyadav:secretscan
Open

Add secret scan for pull requests#30937
miyadav wants to merge 2 commits intoopenshift:mainfrom
miyadav:secretscan

Conversation

@miyadav
Copy link
Copy Markdown
Member

@miyadav miyadav commented Mar 26, 2026

PTAL when time permits , if this is needed .

 `miyadav@miyadav-mac origin % gitleaks detect --source . --config .gitleaks.toml

    ○
    │╲
    │ ○
    ○ ░
    ░    gitleaks

12:43PM WRN warning: exhaustive rename detection was skipped due to too many files.
12:43PM WRN warning: you may want to set your diff.renameLimit variable to at least 44984 and retry the command.
12:43PM INF 24622 commits scanned.
12:43PM INF scanned ~3517769273 bytes (3.52 GB) in 2m11s
12:43PM WRN leaks found: 80`

All the warning were really old and are not relevant , but it might be a good way to protect any future misses.

Validated by making pr to my master fork

Assisted-by: claudecode

@openshift-ci-robot
Copy link
Copy Markdown

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 26, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: miyadav
Once this PR has been reviewed and has the lgtm label, please assign xueqzhan for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot requested review from deads2k and p0lyn0mial March 26, 2026 12:59
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 26, 2026

Walkthrough

Adds repository secret-scanning: a GitHub Actions workflow to run Gitleaks on PRs and pushes to main/release-*, a .gitleaks.toml configuration with allowlists/exclusions, and a .github/SECRET_SCANNING.md guide documenting CI behavior, local usage, and remediation.

Changes

Cohort / File(s) Summary
CI workflow
/.github/workflows/secret-scan.yml
Adds "Secret Scan" GitHub Actions workflow: runs on push to main and pull_request targeting main/release-*, sets minimal permissions, checks out full history, runs gitleaks/gitleaks-action@v2 with GITLEAKS_ARGS="--log-opts='main..HEAD'", enables comments, and uploads results.sarif on failure.
Gitleaks config
/.gitleaks.toml
Adds .gitleaks.toml with useDefault = true, path-based allowlists (tests, vendor, examples, generated, binaries, lock files), regex allowlist entries for common placeholders, and stopwords to ignore known false-positive tokens.
Documentation
/.github/SECRET_SCANNING.md
Adds guidance describing CI scan scope and triggers, local scan commands (staged, full, file-level), remediation steps for true positives and false positives, allowlist/inline override guidance, and troubleshooting notes for CI vs local differences.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
.github/workflows/secret-scan.yml (1)

26-26: Consider pinning GitHub Actions to specific commit SHAs.

The workflow pins actions to major versions (@v4, @v2, @v3) rather than specific commit SHAs. For security-critical workflows like secret scanning, pinning to immutable commit SHAs prevents potential supply chain attacks if action repositories are compromised.

🔒 Proposed fix to pin actions to commit SHAs

Example approach (you'll need to look up current commit SHAs):

       - name: Checkout code
-        uses: actions/checkout@v4
+        uses: actions/checkout@<SHA>  # v4.x.x
         with:
           fetch-depth: 0

       - name: Run Gitleaks
-        uses: gitleaks/gitleaks-action@v2
+        uses: gitleaks/gitleaks-action@<SHA>  # v2.x.x
         env:

       - name: Upload SARIF report
         if: failure()
-        uses: github/codeql-action/upload-sarif@v3
+        uses: github/codeql-action/upload-sarif@<SHA>  # v3.x.x

You can find the current commit SHAs for these actions at:

Also applies to: 31-31, 39-39

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/secret-scan.yml at line 26, The workflow pins actions to
mutable tags (e.g., the uses entries like "actions/checkout@v4", the gitleaks
and codeql action uses) which risks supply-chain changes; update each "uses:"
line in the secret-scan.yml that references actions/checkout, gitleaks
(gitleaks-action), and github/codeql-action to use the corresponding immutable
commit SHA (replace `@vX` with @<full-commit-sha>) for every occurrence (lines
where "uses:" appears for these actions) and verify the SHAs by fetching the
current tags/commits from the action repos before committing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/SECRET_SCANNING.md:
- Line 10: Update the inaccurate speed claim in the SECRET_SCANNING.md entry
that currently reads "**Speed:** ~4 seconds for full repository scan": either
change it to a realistic statement such as "**Speed:** typically completes in a
few minutes (observed ~2m11s for a 3.5GB repo)" or remove the specific numeric
duration and replace with "fast" / "typically completes in a few minutes"; edit
the exact string in the file so the README no longer claims "~4 seconds".
- Line 19: Update the phrase "High entropy strings" to the hyphenated compound
modifier "High-entropy strings" in the markdown content (the heading/line
currently reading "High entropy strings") so it reads "High-entropy strings"
wherever it's used as a modifier before a noun; locate the exact phrase in the
SECRET_SCANNING.md content and replace it with the hyphenated version to satisfy
grammar/static analysis rules.

In @.gitleaks.toml:
- Around line 39-41: The current gitleaks exclusion pattern '''\.md$''' is too
broad; update .gitleaks.toml to narrow or remove this rule by either deleting
the '''\.md$''' entry, replacing it with a whitelist of safe markdown filenames
(e.g., README.md|CHANGELOG.md) in the pattern, or keeping the exclusion but
adding a note in SECRET_SCANNING.md documenting the risk of secrets in markdown
and instructing developers to avoid pasting secrets into .md files; target the
pattern string '''\.md$''' when making the change.

---

Nitpick comments:
In @.github/workflows/secret-scan.yml:
- Line 26: The workflow pins actions to mutable tags (e.g., the uses entries
like "actions/checkout@v4", the gitleaks and codeql action uses) which risks
supply-chain changes; update each "uses:" line in the secret-scan.yml that
references actions/checkout, gitleaks (gitleaks-action), and
github/codeql-action to use the corresponding immutable commit SHA (replace `@vX`
with @<full-commit-sha>) for every occurrence (lines where "uses:" appears for
these actions) and verify the SHAs by fetching the current tags/commits from the
action repos before committing.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0bbfdd85-f3e2-4eac-945b-6c1a28daa529

📥 Commits

Reviewing files that changed from the base of the PR and between 54062fe and 7e1a811.

📒 Files selected for processing (3)
  • .github/SECRET_SCANNING.md
  • .github/workflows/secret-scan.yml
  • .gitleaks.toml

- Database credentials and connection strings
- OAuth and JWT tokens
- Generic secrets (password=, api_key=, etc.)
- High entropy strings (randomized secrets)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Minor grammar: Use hyphenated compound modifier.

"High entropy strings" should be hyphenated as "high-entropy strings" when used as a compound modifier before a noun. As per static analysis tools.

📝 Suggested fix
 - Generic secrets (password=, api_key=, etc.)
-- High entropy strings (randomized secrets)
+- High-entropy strings (randomized secrets)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- High entropy strings (randomized secrets)
- High-entropy strings (randomized secrets)
🧰 Tools
🪛 LanguageTool

[grammar] ~19-~19: Use a hyphen to join words.
Context: ...crets (password=, api_key=, etc.) - High entropy strings (randomized secrets) ##...

(QB_NEW_EN_HYPHEN)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/SECRET_SCANNING.md at line 19, Update the phrase "High entropy
strings" to the hyphenated compound modifier "High-entropy strings" in the
markdown content (the heading/line currently reading "High entropy strings") so
it reads "High-entropy strings" wherever it's used as a modifier before a noun;
locate the exact phrase in the SECRET_SCANNING.md content and replace it with
the hyphenated version to satisfy grammar/static analysis rules.

Comment on lines +39 to +41
# Documentation
'''\.md$''',
]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Consider narrowing the markdown exclusion.

Excluding all .md files from secret scanning may be too broad. While most documentation is safe, developers might accidentally paste real secrets into markdown files (e.g., in README examples, troubleshooting guides, or inline code blocks). Consider either:

  1. Removing this exclusion entirely and relying on stopwords/regex allowlist
  2. Only excluding specific safe markdown files like README.md or CHANGELOG.md
  3. Keeping it but clearly documenting this risk in the SECRET_SCANNING.md guide
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.gitleaks.toml around lines 39 - 41, The current gitleaks exclusion pattern
'''\.md$''' is too broad; update .gitleaks.toml to narrow or remove this rule by
either deleting the '''\.md$''' entry, replacing it with a whitelist of safe
markdown filenames (e.g., README.md|CHANGELOG.md) in the pattern, or keeping the
exclusion but adding a note in SECRET_SCANNING.md documenting the risk of
secrets in markdown and instructing developers to avoid pasting secrets into .md
files; target the pattern string '''\.md$''' when making the change.

@openshift-ci-robot
Copy link
Copy Markdown

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

♻️ Duplicate comments (1)
.github/SECRET_SCANNING.md (1)

19-19: ⚠️ Potential issue | 🟡 Minor

Use hyphenated compound modifier.

Line 19 should read “High-entropy strings” for correct compound-modifier grammar.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/SECRET_SCANNING.md at line 19, Replace the phrase "High entropy
strings" with the hyphenated compound modifier "High-entropy strings" in the
.github/SECRET_SCANNING.md content (locate the line containing the exact phrase
"High entropy strings") to correct the grammar.
🧹 Nitpick comments (1)
.github/SECRET_SCANNING.md (1)

107-109: Mark exclusions list as non-exhaustive to prevent doc drift.

This list is a subset of .gitleaks.toml exclusions (e.g., lockfiles, testdata/, *_test.go, bindata.go are also excluded). Consider labeling it as examples or expanding it.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/SECRET_SCANNING.md around lines 107 - 109, Update the "**Excluded
paths:**", "**Excluded patterns:**" and "**Rules:**" lines so the exclusions
list is explicitly non‑exhaustive—e.g., prepend a short note like "Examples
only; not exhaustive" or "Subset of .gitleaks.toml exclusions" next to those
headings and/or change the section title to "Examples of exclusions" to avoid
doc drift; reference the existing headings "**Excluded paths:**", "**Excluded
patterns:**", and "**Rules:**" when making this small wording change so readers
know this is only a subset of the full .gitleaks.toml exclusions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/SECRET_SCANNING.md:
- Line 11: The statement "**Action: Blocks PR merge if secrets are detected**"
overstates behavior; update that sentence to clarify it reflects CI/checks
behavior rather than an absolute guarantee—replace the line text with something
like "**Action:** CI check fails (may block PR merge depending on branch
protection and required checks)" so it accurately notes that merge blocking
depends on repository branch protection and required CI checks; edit the exact
string shown on the existing line to the clarified wording.
- Line 8: The README line "**Runs on:** All pull requests and pushes to `main`
and `release-*` branches" is out of sync with the secret scan workflow; update
the text in SECRET_SCANNING.md to match the actual trigger in secret-scan.yml
(e.g., change to "pushes to `main` only" or explicitly list the triggers used),
or alternatively modify secret-scan.yml to include `push` on `release-*` and
`pull_request` if you want the doc to remain as-is; edit the specific line
containing that sentence in SECRET_SCANNING.md (or the `on:` block in
secret-scan.yml) so both sources state the same trigger scope.
- Line 9: The current sentence "**What it scans:** Only new commits in your PR"
is inaccurate given the workflow uses fetch-depth: 0 with gitleaks-action@v2
which causes a full git-history scan; update the doc to state that
gitleaks-action@v2 with fetch-depth: 0 scans the full repository history by
default, or change the workflow to scan only PR commits by adding the
GITLEAKS_ARGS environment variable with --log-opts="main..HEAD" to the
gitleaks-action@v2 step; reference gitleaks-action@v2, fetch-depth: 0,
GITLEAKS_ARGS and --log-opts="main..HEAD" when making the change.

---

Duplicate comments:
In @.github/SECRET_SCANNING.md:
- Line 19: Replace the phrase "High entropy strings" with the hyphenated
compound modifier "High-entropy strings" in the .github/SECRET_SCANNING.md
content (locate the line containing the exact phrase "High entropy strings") to
correct the grammar.

---

Nitpick comments:
In @.github/SECRET_SCANNING.md:
- Around line 107-109: Update the "**Excluded paths:**", "**Excluded
patterns:**" and "**Rules:**" lines so the exclusions list is explicitly
non‑exhaustive—e.g., prepend a short note like "Examples only; not exhaustive"
or "Subset of .gitleaks.toml exclusions" next to those headings and/or change
the section title to "Examples of exclusions" to avoid doc drift; reference the
existing headings "**Excluded paths:**", "**Excluded patterns:**", and
"**Rules:**" when making this small wording change so readers know this is only
a subset of the full .gitleaks.toml exclusions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3754582e-7e01-4226-9827-9e4b551988a9

📥 Commits

Reviewing files that changed from the base of the PR and between 7e1a811 and 75e4903.

📒 Files selected for processing (3)
  • .github/SECRET_SCANNING.md
  • .github/workflows/secret-scan.yml
  • .gitleaks.toml
✅ Files skipped from review due to trivial changes (2)
  • .gitleaks.toml
  • .github/workflows/secret-scan.yml

## How It Works

### Automated CI Scanning
- **Runs on:** All pull requests and pushes to `main` and `release-*` branches
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix trigger scope statement to match workflow config.

Line 8 says pushes to main and release-*, but .github/workflows/secret-scan.yml currently triggers push only on main. Please align the doc (or workflow) to avoid misleading contributors.

Proposed doc fix
-- **Runs on:** All pull requests and pushes to `main` and `release-*` branches
+- **Runs on:** Pull requests targeting `main` and `release-*`, and pushes to `main`
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **Runs on:** All pull requests and pushes to `main` and `release-*` branches
- **Runs on:** Pull requests targeting `main` and `release-*`, and pushes to `main`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/SECRET_SCANNING.md at line 8, The README line "**Runs on:** All pull
requests and pushes to `main` and `release-*` branches" is out of sync with the
secret scan workflow; update the text in SECRET_SCANNING.md to match the actual
trigger in secret-scan.yml (e.g., change to "pushes to `main` only" or
explicitly list the triggers used), or alternatively modify secret-scan.yml to
include `push` on `release-*` and `pull_request` if you want the doc to remain
as-is; edit the specific line containing that sentence in SECRET_SCANNING.md (or
the `on:` block in secret-scan.yml) so both sources state the same trigger
scope.

- **Runs on:** All pull requests and pushes to `main` and `release-*` branches
- **What it scans:** Only new commits in your PR (not the entire git history)
- **Speed:** ~4 mins for full repository scan
- **Action:** Blocks PR merge if secrets are detected
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Avoid overstating merge-blocking behavior.

Line 11 implies guaranteed merge blocking, but that depends on branch protection/required checks outside this file. Safer wording is that CI fails when findings are detected.

Proposed doc fix
-- **Action:** Blocks PR merge if secrets are detected
+- **Action:** Fails the secret-scan CI check if secrets are detected
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/SECRET_SCANNING.md at line 11, The statement "**Action: Blocks PR
merge if secrets are detected**" overstates behavior; update that sentence to
clarify it reflects CI/checks behavior rather than an absolute guarantee—replace
the line text with something like "**Action:** CI check fails (may block PR
merge depending on branch protection and required checks)" so it accurately
notes that merge blocking depends on repository branch protection and required
CI checks; edit the exact string shown on the existing line to the clarified
wording.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (3)
.github/SECRET_SCANNING.md (3)

19-19: ⚠️ Potential issue | 🟡 Minor

Hyphenate compound modifier.

Line 19 should be “High-entropy strings.”

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/SECRET_SCANNING.md at line 19, Update the phrase "High entropy
strings (randomized secrets)" to use a hyphenated compound modifier: change it
to "High-entropy strings (randomized secrets)" so the compound adjective before
the noun is correctly hyphenated.

8-8: ⚠️ Potential issue | 🟡 Minor

Trigger scope is still inaccurate.

Line 8 says pushes run on main and release-*, but workflow config shows push runs on main only. Please align the sentence with .github/workflows/secret-scan.yml.

Suggested doc edit
-- **Runs on:** All pull requests and pushes to `main` and `release-*` branches
+- **Runs on:** Pull requests targeting `main` and `release-*`, and pushes to `main`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/SECRET_SCANNING.md at line 8, Update the sentence "**Runs on:** All
pull requests and pushes to `main` and `release-*` branches" in
SECRET_SCANNING.md to match the actual workflow trigger by removing `release-*`
so it reads "**Runs on:** All pull requests and pushes to `main`" (ensure the
wording exactly aligns with the triggers defined in secret-scan.yml).

11-11: ⚠️ Potential issue | 🟡 Minor

Avoid absolute “blocks merge” wording.

Line 11 should describe CI check failure; whether merge is blocked depends on branch protection settings.

Suggested doc edit
-- **Action:** Blocks PR merge if secrets are detected
+- **Action:** Fails the secret-scan CI check (may block merge depending on branch protection)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/SECRET_SCANNING.md at line 11, Change the phrasing on the line
currently reading "**Action:** Blocks PR merge if secrets are detected" to
indicate the CI check fails rather than asserting merges are blocked
unconditionally; update the text to something like "**Action:** Fails CI check
if secrets are detected (merge behavior depends on branch protection settings)"
so the doc reflects that actual merge blocking depends on repository branch
protection rules and not the scanner itself.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/SECRET_SCANNING.md:
- Line 10: The "Speed: ~4 mins for full repository scan" line conflicts with the
preceding "PR-commit scanning" scope; update the sentence that currently reads
"Speed: ~4 mins for full repository scan" so it either (a) specifies the time
for PR-commit scans (e.g., "Speed: ~4 mins per PR-commit scan") to match the
described mode, or (b) clearly documents both modes (e.g., "Speed: ~4 mins per
PR-commit scan; full repository scans may take longer") thereby removing scope
confusion—locate and edit the exact phrase "Speed: ~4 mins for full repository
scan" to one of these clarified variants.
- Line 9: The Gitleaks scan range is hardcoded to use GITLEAKS_ARGS:
--log-opts="main..HEAD", which mis-scans PRs targeting release-* branches;
update the workflow to use the repository base ref variable by replacing the
fixed "main..HEAD" with a base-ref-aware range such as
"${GITHUB_BASE_REF}..HEAD" (or add conditional logic to fall back to main when
GITHUB_BASE_REF is empty), and update the GITLEAKS_ARGS reference and any
documentation in SECRET_SCANNING.md to reflect this change so scans truly cover
only the PR commits.

---

Duplicate comments:
In @.github/SECRET_SCANNING.md:
- Line 19: Update the phrase "High entropy strings (randomized secrets)" to use
a hyphenated compound modifier: change it to "High-entropy strings (randomized
secrets)" so the compound adjective before the noun is correctly hyphenated.
- Line 8: Update the sentence "**Runs on:** All pull requests and pushes to
`main` and `release-*` branches" in SECRET_SCANNING.md to match the actual
workflow trigger by removing `release-*` so it reads "**Runs on:** All pull
requests and pushes to `main`" (ensure the wording exactly aligns with the
triggers defined in secret-scan.yml).
- Line 11: Change the phrasing on the line currently reading "**Action:** Blocks
PR merge if secrets are detected" to indicate the CI check fails rather than
asserting merges are blocked unconditionally; update the text to something like
"**Action:** Fails CI check if secrets are detected (merge behavior depends on
branch protection settings)" so the doc reflects that actual merge blocking
depends on repository branch protection rules and not the scanner itself.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 676ab0ec-0a05-4712-9114-844473ada441

📥 Commits

Reviewing files that changed from the base of the PR and between 75e4903 and 7e1a551.

📒 Files selected for processing (2)
  • .github/SECRET_SCANNING.md
  • .github/workflows/secret-scan.yml
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/secret-scan.yml


### Automated CI Scanning
- **Runs on:** All pull requests and pushes to `main` and `release-*` branches
- **What it scans:** Only new commits in your PR via `gitleaks-action@v2` with `GITLEAKS_ARGS: --log-opts="main..HEAD"` (not the entire git history despite `fetch-depth: 0`)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify trigger targets and gitleaks range args from workflow.
# Expected: pull_request includes main/release-*; gitleaks arg is hardcoded main..HEAD.

set -euo pipefail

echo "== Workflow trigger block =="
sed -n '1,40p' .github/workflows/secret-scan.yml

echo
echo "== Gitleaks step and args =="
rg -n -C3 'gitleaks-action@v2|GITLEAKS_ARGS|log-opts' .github/workflows/secret-scan.yml

Repository: openshift/origin

Length of output: 1711


🏁 Script executed:

cat -n .github/SECRET_SCANNING.md | head -20

Repository: openshift/origin

Length of output: 1069


🏁 Script executed:

# Check for any conditional logic in the workflow that might adjust gitleaks args based on target branch
rg -n 'if:|env\.|GITLEAKS_ARGS' .github/workflows/secret-scan.yml

Repository: openshift/origin

Length of output: 178


Gitleaks scan range is hardcoded to main..HEAD, which fails for release-* PRs.

Line 9 claims "Only new commits in your PR," but GITLEAKS_ARGS: --log-opts="main..HEAD" is hardcoded with no branch-awareness. For PRs targeting release-*, this scans commits from main that aren't in the target branch—not just PR commits. Either document this limitation or switch to ${GITHUB_BASE_REF}..HEAD for base-ref-aware scanning.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/SECRET_SCANNING.md at line 9, The Gitleaks scan range is hardcoded
to use GITLEAKS_ARGS: --log-opts="main..HEAD", which mis-scans PRs targeting
release-* branches; update the workflow to use the repository base ref variable
by replacing the fixed "main..HEAD" with a base-ref-aware range such as
"${GITHUB_BASE_REF}..HEAD" (or add conditional logic to fall back to main when
GITHUB_BASE_REF is empty), and update the GITLEAKS_ARGS reference and any
documentation in SECRET_SCANNING.md to reflect this change so scans truly cover
only the PR commits.

### Automated CI Scanning
- **Runs on:** All pull requests and pushes to `main` and `release-*` branches
- **What it scans:** Only new commits in your PR via `gitleaks-action@v2` with `GITLEAKS_ARGS: --log-opts="main..HEAD"` (not the entire git history despite `fetch-depth: 0`)
- **Speed:** ~4 mins for full repository scan
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Speed line conflicts with stated scan mode.

Line 10 references “full repository scan,” but Line 9 describes PR-commit scanning. Reword this to avoid mixing two different scan scopes.

Suggested doc edit
-- **Speed:** ~4 mins for full repository scan
+- **Speed:** Typically completes in a few minutes (depends on commit range and repository size)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **Speed:** ~4 mins for full repository scan
- **Speed:** Typically completes in a few minutes (depends on commit range and repository size)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/SECRET_SCANNING.md at line 10, The "Speed: ~4 mins for full
repository scan" line conflicts with the preceding "PR-commit scanning" scope;
update the sentence that currently reads "Speed: ~4 mins for full repository
scan" so it either (a) specifies the time for PR-commit scans (e.g., "Speed: ~4
mins per PR-commit scan") to match the described mode, or (b) clearly documents
both modes (e.g., "Speed: ~4 mins per PR-commit scan; full repository scans may
take longer") thereby removing scope confusion—locate and edit the exact phrase
"Speed: ~4 mins for full repository scan" to one of these clarified variants.

@openshift-ci-robot
Copy link
Copy Markdown

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 26, 2026

@miyadav: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-ovn-fips 7e1a551 link true /test e2e-aws-ovn-fips

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants