fix(security): scope Trivy private-key ignore to vendored openssl doc (false positive)#116
Open
seonghobae wants to merge 1 commit into
Open
fix(security): scope Trivy private-key ignore to vendored openssl doc (false positive)#116seonghobae wants to merge 1 commit into
seonghobae wants to merge 1 commit into
Conversation
Trivy's Secret scanner flags 2x HIGH AsymmetricPrivateKey (rule id:
private-key) in
packrat/lib/x86_64-pc-linux-gnu/3.4.1/openssl/doc/keys.html. That file is
vendored upstream documentation for the R "openssl" package; the PEM blocks
are EXAMPLE keys emitted by the doc's own write_pem() demonstration, not a
live credential. This is a false positive.
Add a path-scoped, documented suppression instead of globally disabling the
rule:
- .trivyignore.yaml scopes the `private-key` ignore to
packrat/lib/**/openssl/doc/keys.html only.
- trivy.yaml sets `ignorefile: .trivyignore.yaml` so the YAML ignore is
applied on a bare `trivy fs .` (Trivy 0.71.x auto-detects only a plain,
non-path-scoped .trivyignore).
Real private keys committed anywhere else in the repo still fail the scan
(verified: same key content at another path still reports HIGH).
Local verification (trivy 0.71.1, fresh DB):
trivy fs . --scanners vuln,secret,misconfig --severity CRITICAL,HIGH --ignore-unfixed
before: 2 HIGH private-key after: 0 (no new CRITICAL/HIGH introduced)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RTAMs4bpSZS77Xe3RQjv9P
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.
Finding
Trivy's Secret scanner reports 2× HIGH
AsymmetricPrivateKey(rule id:private-key) in:This file is vendored upstream documentation for the R
opensslpackage (checked in underpackrat/for reproducible builds). The PEM blocks are example keys printed by the doc's ownwrite_pem()demonstration — published upstream example material, not a live credential. It is a false positive.Fix
A path-scoped, documented suppression — not a global disable of the rule:
.trivyignore.yaml— ignores ruleprivate-keyforpackrat/lib/**/openssl/doc/keys.htmlonly.trivy.yaml— setsignorefile: .trivyignore.yamlso the YAML ignore applies on a baretrivy fs .. (Trivy 0.71.x auto-detects only a plain, line-based.trivyignore, which cannot scope a rule to a path; thetrivy.yamlcompanion is what enables path scoping without weakening detection elsewhere.)Real private keys committed anywhere else in the repo still fail the scan — verified by copying the same key content to another path, which still reports HIGH.
Local verification (Trivy 0.71.1, fresh vuln DB)
Command (identical before and after):
No application/build/runtime behavior is affected — only scanner configuration is added.
🤖 Generated with Claude Code