Fix is_secret three-state check and use [[ ]] in detect_secrets_baseline.sh - #105
Merged
Merged
Conversation
- Add separate Check 2 for confirmed real secrets (is_secret: True), distinct from unaudited findings (is_secret absent); addresses the edge case where confirmed secrets would not cause a CI failure - Replace all [ ] conditionals with [[ ]] to satisfy SonarCloud - Renumber former Check 2 (new secrets scan) to Check 3 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jordanpadams
requested review from
nutjob4life and
tloubrieu-jpl
as code owners
August 3, 2026 16:21
Restructure into named functions with clear responsibilities: - find_detect_secrets: locates the binary - build_exclude_args: assembles --exclude-files flags - baseline_fingerprints / baselines_match: clean baseline comparison using a heredoc Python block instead of inline escaped one-liners - count_findings: shared helper for unaudited/confirmed checks - check_unaudited_findings, check_confirmed_secrets, check_new_secrets: each check is its own function with a descriptive name - run_ci_checks: top-level that reads like a table of contents - case statement replaces if/elif chain for the entry point Also adds set -euo pipefail, named constants for BASELINE and BASELINE_IGNORE, inline comments on each GLOBAL_EXCLUDES entry, and a usage guard for unknown arguments. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…_match Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
nutjob4life
approved these changes
Aug 3, 2026
nutjob4life
left a comment
Member
There was a problem hiding this comment.
Code delta: ✓
Approval: ✅
Caveat: based on visual inspection only
Note: the \.git.* regex might work better as '(^|/)\.git/' so .github/* gets scanned too
Avoids blocking .github/workflows/ and other .github/ paths from secrets scanning. Suggested by @nutjob4life in PR review. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds IDE directories (.vscode, .eclipse, .idea, .settings, .metadata), Java IDE project files (.iml, .classpath, .launch, etc.), Maven/Gradle internals, and compiled output extensions to prevent detect-secrets from scanning generated or editor-owned files that cannot contain real secrets. Also adds .envrc to .gitignore to prevent local direnv files from being tracked. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Ports two fixes from NASA-PDS/s3-browser-cloudfront#193 (per review by @nutjob4life) to the Java template.
Changes
1.
is_secretthree-state fixThe
is_secretfield in a detect-secrets baseline is effectively three-state:true— audited and confirmed as a real secretfalse— audited and marked as a false positiveThe previous Check 1 only caught unaudited findings (absent
is_secret). A confirmed real secret (is_secret: true) would silently pass. This PR splits Check 1 into two separate checks:is_secretabsent)is_secret: true)2.
[ ]→[[ ]]All single-bracket
[ ]conditionals replaced with double-bracket[[ ]]to satisfy SonarCloud.AI Assistance Disclosure
Estimated % of code influenced by AI: 90%
🤖 Generated with Claude Code