Documentation
¶
Overview ¶
Package secretscan detects likely secrets in file content and flags sensitive filenames before they are staged into git. It is deliberately conservative: high-confidence provider patterns and sensitive filenames always fire, while the generic high-entropy check is gated by an allowlist so that everyday source code stays quiet.
Index ¶
Constants ¶
View Source
const ( RuleGitHubToken = "github-token" RuleAWSAccessKey = "aws-access-key" RulePrivateKey = "private-key" RuleSlackToken = "slack-token" RuleGoogleAPIKey = "google-api-key" RuleStripeKey = "stripe-key" RuleHighEntropyValue = "high-entropy-value" RuleSensitiveFilename = "sensitive-filename" )
Rule identifiers reported in Finding.Rule.
Variables ¶
This section is empty.
Functions ¶
func HasFindings ¶
HasFindings reports whether Scan would flag the given content or path.
Types ¶
type Finding ¶
type Finding struct {
// Rule is a short, stable identifier for the rule that matched
// (for example "github-token" or "sensitive-filename").
Rule string
// Detail is a human-readable description shown to the user. It never
// includes the secret value itself, only the rule and location.
Detail string
// Line is the 1-based line number for content matches, or 0 for a
// match based on the filename alone.
Line int
}
Finding describes one reason a file was flagged.
Click to show internal directories.
Click to hide internal directories.