Documentation
¶
Overview ¶
Package scan finds likely secrets in transcripts before they move.
It uses a small set of strict rules (API keys, tokens, private keys) written for hopsesh, and can produce a redacted copy. Results are shown to the user in the plan; nothing is ever sent anywhere.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Rules = []Rule{ {"anthropic-api-key", regexp.MustCompile(`sk-ant-[A-Za-z0-9_\-]{20,}`)}, {"openai-api-key", regexp.MustCompile(`sk-(?:proj|svcacct|admin)-[A-Za-z0-9_\-]{30,}|sk-[A-Za-z0-9]{20}T3BlbkFJ[A-Za-z0-9]{20}`)}, {"github-token", regexp.MustCompile(`gh[pousr]_[A-Za-z0-9]{36,}|github_pat_[A-Za-z0-9_]{60,}`)}, {"aws-access-key-id", regexp.MustCompile(`\b(?:AKIA|ASIA|ABIA|ACCA)[0-9A-Z]{16}\b`)}, {"google-api-key", regexp.MustCompile(`AIza[0-9A-Za-z_\-]{35}`)}, {"slack-token", regexp.MustCompile(`xox[baprs]-[0-9A-Za-z\-]{10,}`)}, {"stripe-secret-key", regexp.MustCompile(`(?:sk|rk)_live_[0-9A-Za-z]{24,}`)}, {"huggingface-token", regexp.MustCompile(`\bhf_[A-Za-z0-9]{34,}\b`)}, {"openrouter-api-key", regexp.MustCompile(`\bsk-or-v1-[0-9a-f]{64}\b`)}, {"groq-api-key", regexp.MustCompile(`\bgsk_[A-Za-z0-9]{48,}\b`)}, {"xai-api-key", regexp.MustCompile(`\bxai-[A-Za-z0-9]{70,}\b`)}, {"private-key", regexp.MustCompile(`-----BEGIN (?:[A-Z]+ )*PRIVATE KEY-----`)}, {"jwt", regexp.MustCompile(`\beyJ[A-Za-z0-9_\-]{10,}\.eyJ[A-Za-z0-9_\-]{10,}\.[A-Za-z0-9_\-]{10,}`)}, {"bearer-token", regexp.MustCompile(`(?i)\bbearer\s+[A-Za-z0-9._~+/\-]{24,}=*`)}, }
Functions ¶
Types ¶
type Finding ¶
type Finding struct {
Rule string `json:"rule"`
Line int `json:"line"`
Preview string `json:"preview"`
}
Finding is one likely secret. Preview never contains the secret itself.
type Rule ¶
type Rule struct {
ID string
// contains filtered or unexported fields
}
Rule is one secret pattern. The patterns follow the high-confidence rules popularised by gitleaks (MIT); they are written independently here and kept deliberately strict to avoid flooding users with false positives.