pub struct SecretEntry {
pub pattern: String,
pub kind: String,
pub category: String,
pub label: Option<String>,
pub values: Vec<String>,
pub min_length: Option<usize>,
pub max_length: Option<usize>,
pub threshold: Option<f64>,
pub charset: Option<String>,
}Expand description
A single secret entry as stored in the (plaintext) secrets file.
After decryption the entries are parsed from JSON, YAML, or TOML and
converted into ScanPatterns.
Implements Drop via Zeroize to scrub sensitive pattern data
from memory when no longer needed (S-1 fix).
Fields§
§pattern: StringThe pattern string (regex or literal text).
For kind: allow entries this is the single allowlist pattern.
Omit when using values instead.
kind: String"regex", "literal", "allow", "entropy", or "field-name".
"field-name" entries are not compiled into scanner patterns — they
are extracted separately and injected into structured-processor profiles
as field-name signals. The pattern field is a case-insensitive
regex matched against bare field/key names; threshold controls the
entropy gate (defaults to 3.5 bits/char when omitted).
category: StringCategory string. Supported values:
email, name, phone, ipv4, ipv6, credit_card, ssn,
hostname, mac_address, container_id, uuid, jwt,
auth_token, file_path, windows_sid, url, aws_arn,
azure_resource_id, or custom:<tag>.
label: Option<String>Human-readable label for stats reporting. Defaults to a truncated
version of pattern if omitted.
values: Vec<String>Multiple allowlist patterns for kind: allow entries.
When non-empty, used instead of pattern. Allows a single entry to
allowlist many values compactly:
[[secrets]]
kind = "allow"
values = ["localhost", "true", "false", "null", "0.0.0.0"]min_length: Option<usize>Minimum token length to consider (default: 20).
max_length: Option<usize>Maximum token length to consider (default: 200).
threshold: Option<f64>Shannon entropy threshold in bits per character (default: 4.5). Tokens whose entropy is at or above this value are flagged.
charset: Option<String>Character set the token must consist of exclusively.
"alphanumeric" (default), "base64", "hex", or "any".
Trait Implementations§
Source§impl Clone for SecretEntry
impl Clone for SecretEntry
Source§fn clone(&self) -> SecretEntry
fn clone(&self) -> SecretEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SecretEntry
impl Debug for SecretEntry
Source§impl<'de> Deserialize<'de> for SecretEntry
impl<'de> Deserialize<'de> for SecretEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Drop for SecretEntry
impl Drop for SecretEntry
Auto Trait Implementations§
impl Freeze for SecretEntry
impl RefUnwindSafe for SecretEntry
impl Send for SecretEntry
impl Sync for SecretEntry
impl Unpin for SecretEntry
impl UnsafeUnpin for SecretEntry
impl UnwindSafe for SecretEntry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more