Skip to content

Picket.Rules API

Generated from XML documentation for Picket.Rules.

Picket.Rules.AllowlistCondition

Describes how checks inside a secret allowlist are combined.

  • And - Allows a finding only when every configured check matches.
  • Or - Allows a finding when any configured check matches.

Picket.Rules.AllowlistRegexTarget

Describes the finding field tested by allowlist regexes.

  • Line - Tests the full source line containing the finding.
  • Match - Tests the full regex match.
  • Secret - Tests the captured secret value.

Picket.Rules.PicketBuiltInDetectorNames

Defines the stable names of Picket’s built-in structured detectors.

  • IsKnown(string name) - Returns whether a name identifies a built-in detector.
  • CodexCredentials - Gets the detector for Codex credential JSON documents.
  • DockerRegistryCredentials - Gets the detector for Docker registry credential JSON documents.
  • GcpServiceAccountKey - Gets the detector for GCP service-account key JSON documents.
  • JwkPrivateKey - Gets the detector for private JSON Web Keys.
  • KubernetesSecret - Gets the detector for Kubernetes Secret YAML documents.
  • McpServerCredentials - Gets the detector for credentials in Model Context Protocol server configurations.
  • NpmCredentials - Gets the detector for npm configuration credentials.

Picket.Rules.PicketRulePackNames

Provides stable identifiers for the built-in Picket rule packs.

  • Default - Identifies Picket’s high-confidence native default rule pack.
  • Experimental - Identifies Picket’s opt-in rule pack for detectors that are still being tuned.
  • Gitleaks - Identifies the pinned Gitleaks-compatible rule pack.
  • Strict - Identifies Picket’s opt-in rule pack for broader, more aggressive detection.

Picket.Rules.RuleSet

Immutable collection of secret detection rules.

RuleSet(
IReadOnlyList<SecretRule> rules,
IReadOnlyList<SecretAllowlist> allowlists,
bool regexesPrevalidated
)

Immutable collection of secret detection rules.

  • Allowlists - Gets global allowlists used to suppress findings.
  • RegexesPrevalidated - Gets a value indicating whether rule and allowlist regexes are already validated and can be compiled lazily.
  • Rules - Gets the rules in deterministic evaluation order.
  • MaxRuleCount - Gets the maximum number of rules accepted in a single rule set.

Picket.Rules.SecretAllowlist

Describes Gitleaks-compatible allowlist checks for suppressing findings.

SecretAllowlist(
string description,
AllowlistCondition condition,
IReadOnlyList<string> commits,
IReadOnlyList<string> pathPatterns,
AllowlistRegexTarget regexTarget,
IReadOnlyList<string> regexPatterns,
IReadOnlyList<string> stopWords
)

Describes Gitleaks-compatible allowlist checks for suppressing findings.

Create(
string description,
AllowlistCondition condition,
IReadOnlyList<string> commits,
IReadOnlyList<string> pathPatterns,
AllowlistRegexTarget regexTarget,
IReadOnlyList<string> regexPatterns,
IReadOnlyList<string> stopWords
)

Creates an allowlist and validates that it has at least one check.

  • Commits - Gets commit SHA values that are allowed.
  • Condition - Gets the condition used to combine configured checks.
  • Description - Gets the human-readable allowlist description.
  • PathPatterns - Gets path regex patterns that are allowed.
  • RegexPatterns - Gets content regex patterns that are allowed.
  • RegexTarget - Gets the finding field tested by regex patterns.
  • StopWords - Gets case-insensitive stopwords matched against the secret.

Picket.Rules.SecretRequiredRule

Describes a Gitleaks-compatible supporting rule required by a primary rule.

  • SecretRequiredRule(string id, int? withinLines, int? withinColumns) - Describes a Gitleaks-compatible supporting rule required by a primary rule.
  • Id - Gets the required rule identifier.
  • WithinColumns - Gets the maximum column distance from the primary finding, or for no column constraint.
  • WithinLines - Gets the maximum line distance from the primary finding, or for no line constraint.

Picket.Rules.SecretRule

Describes a byte-oriented secret detection rule.

SecretRule(
string id,
string description,
string pattern,
int secretGroup,
double entropy,
string pathPattern,
IReadOnlyList<SecretAllowlist> allowlists,
IReadOnlyList<string> keywords,
IReadOnlyList<string> tags,
bool skipReport,
IReadOnlyList<SecretRequiredRule> requiredRules,
string severity,
string confidence,
string rulePack,
string provider,
string documentationUrl,
IReadOnlyList<string> validation,
IReadOnlyList<string> revocation,
bool deprecated,
IReadOnlyList<string> examples,
IReadOnlyList<string> negativeExamples,
double randomnessThreshold,
string detector
)

Describes a byte-oriented secret detection rule.

Create(
string id,
string description,
string pattern,
int secretGroup,
double entropy,
string pathPattern,
IReadOnlyList<SecretAllowlist> allowlists,
IReadOnlyList<string> keywords,
IReadOnlyList<string> tags,
bool skipReport,
IReadOnlyList<SecretRequiredRule> requiredRules,
string severity,
string confidence,
string rulePack,
string provider,
string documentationUrl,
IReadOnlyList<string> validation,
IReadOnlyList<string> revocation,
bool deprecated,
IReadOnlyList<string> examples,
IReadOnlyList<string> negativeExamples,
double randomnessThreshold,
string detector
)

Creates a rule and normalizes optional collection arguments.

  • Allowlists - Gets per-rule allowlists used to suppress findings.
  • Confidence - Gets the native confidence value for reports and triage.
  • Deprecated - Gets a value indicating whether the rule is deprecated.
  • Description - Gets the user-facing rule description.
  • Detector - Gets the optional built-in structured detector name.
  • DocumentationUrl - Gets the rule documentation or remediation URL.
  • Entropy - Gets the minimum Shannon entropy required for the secret. Zero disables entropy filtering.
  • Examples - Gets positive examples that must produce findings for this rule during rule QA.
  • Id - Gets the stable rule identifier.
  • Keywords - Gets case-insensitive keywords used for candidate prefiltering.
  • NegativeExamples - Gets negative examples that must not produce findings for this rule during rule QA.
  • PathPattern - Gets the optional path regex pattern in the compatibility dialect.
  • Pattern - Gets the content regex pattern in the compatibility dialect. Empty means path-only.
  • Provider - Gets the owning provider or credential family.
  • RandomnessThreshold - Gets the minimum native randomness score required for a finding. Zero disables score filtering.
  • RequiredRules - Gets supporting rules required before a primary finding is reported.
  • Revocation - Gets stable revocation template identifiers supported by the rule.
  • RulePack - Gets the native rule pack that supplied the rule.
  • SecretGroup - Gets the capture group that contains the secret. Zero means the whole match.
  • Severity - Gets the native severity value for reports and triage.
  • SkipReport - Gets a value indicating whether normal findings for this rule are suppressed.
  • Tags - Gets rule classification tags.
  • Validation - Gets stable validation template identifiers supported by the rule.