Repository navigation
feat: secret detection and SBOM - #46
Merged
Merged
Conversation
5 tasks done
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
Two of the three points left open on #37: secret detection and SBOM generation. Both are offline.
test: define secret detection and SBOM behavior), implementation follows.plugins/secrets.py:literalswalks every string literal of the PyHIR with the name it is bound to (assignment target, keyword argument, dictionary key) and the enclosing function;SecretDetectoris a plugin base reporting at most one finding per literal, provider pattern first (hardcoded-secret, high confidence), then a credential-like name bound to a real value (hardcoded-credential, medium; placeholders, references and*_name-style bindings excluded), then an opaque high-entropy token on its own (high-entropy-string, low). Messages and metadata carry a redacted preview and never the secret.plugins/secrets/hardcoded_secrets: the shipped detector with AWS, GitHub, Slack, Stripe, Google, private key, JWT, SendGrid and Twilio formats and the usual credential names. Other plugins add providers by subclassing with their own patterns.dependency/sbom.py: a deterministic CycloneDX 1.5 document from the dependency graph, one component per requirement with its package URL and specifier, optional requirements marked, and the advisories affecting the requirements as vulnerabilities. It lives in the dependency layer because reporters may only see findings.ProjectAnalysisexposes the advisories it used;--sbom PATHwrites the document during a directory check.SECRET: str = "..."), which typed settings modules use; a bare declaration is a no-op.Still open on #37: live OSV and GHSA feeds and dependency policies, which need a decision on network access and advisory caching.
Refs #37