/** * False-positive filters for the redaction rule table. * * MIT License * * Copyright (c) 2026 jkt-check * * Derived from dsh-secret-scrub v0.1.2 (MIT, Copyright (c) 2026 jkt-check). * Modified by gythialy, 2026-10-19: converted to TypeScript for dsh-sensitive-guard; * placeholders and values are now supplied by the engine. The full MIT text is in * ./rules.ts and THIRD_PARTY_NOTICES.md. * * @module dsh-sensitive-guard/redact/filters */ /** * Luhn checksum over the digits of one credit-card candidate; the pattern's * single space/dash group separators are stripped first. */ export declare function luhnValid(candidate: string): boolean; /** * Whether one `env-var-secret` match should be redacted. The pattern accepts * any uppercase assignment (keeping the regex linear), so this filter owns * both name checks: the name must carry a sensitive keyword as a whole * `_`-delimited segment — `AWS_SECRET_ACCESS_KEY` and `MY_API_KEY` are * secrets, `KEYBOARD`, `MONKEY`, `APIKEY`, and `KEYS` are not — and a * deny-listed safe name survives. The match keeps its full assignment shape * (`export NAME=value`), so the name is everything before the first `=`, * minus the `export` keyword. */ export declare function isSecretEnvAssignment(match: string): boolean; /** * Whether one `key-assignment` match should be redacted. The pattern accepts * any `name=value` shape (keeping the regex linear, like `env-var-secret`), * so this filter owns every semantic check: * * - the name must carry a sensitive keyword as a whole `_`-delimited segment * (case-insensitive: `deepseek_api_key` and `MY_Token` are secrets, * `monkey`, `keyboard`, and `apikey` are not); * - a deny-listed safe name survives (compared uppercase, so the lowercase * form of `PASSWORD_STORE_DIR` is safe too); * - a PEM armor value (`PUBLIC_KEY=-----BEGIN …`) is not a secret; * - a dotted identifier chain value (`password=req.body.password`, * `token=response.data.token`) is a code traversal, not a credential. The * rejection only applies when EVERY `.`-separated segment is at most 20 * chars (identifier length): a longer tail is a random token, not a * property path (`doppler_token=dp.pt.…` stays a secret). An * `eyJ`-prefixed JWT value keeps its dots and stays a candidate; * - the value must mix at least two character classes with four or more * distinct characters, and a pure-letter value must be at least 24 chars — * shorter pure-letter values are usually identifiers (`token=computeToken()`), * not credentials. */ export declare function isSensitiveKeyAssignment(match: string): boolean; /** * Post-filter for the `high-entropy` fallback; each rejection reason is * marked inline. Every check runs on the match alone, so a public-key PEM * body line (shareable by design) can still be redacted — the fallback is * the last resort and stays conservative. */ export declare function isHighEntropyToken(match: string): boolean; /** * Whether one `api-key` match should be redacted: the value — everything * after the first `=` or `:`, quotes stripped — must not be an obvious * documentation placeholder. */ export declare function isRealApiKeyAssignment(match: string): boolean; //# sourceMappingURL=filters.d.ts.map