pub struct AuditConfig {Show 14 fields
pub enabled: bool,
pub log_path: String,
pub signed: bool,
pub integrity_key: Option<SecretRef>,
pub rotation_policy: RotationPolicy,
pub max_file_size: u64,
pub retention_count: u32,
pub log_to_db: bool,
pub overflow_policy: OverflowPolicy,
pub max_rows: Option<u64>,
pub alarm_threshold: u32,
pub alarm_action: String,
pub auditable_events: Vec<String>,
pub rotation_check_interval_secs: Option<u64>,
}Expand description
[audit] section — audit trail configuration.
[audit]
enabled = true
log_path = "/var/log/kipuka/audit.log"
signed = true
rotation_policy = "daily"
overflow_policy = "halt"
max_rows = 1000000Fields§
§enabled: boolEnable audit logging. Default: true.
log_path: StringPath to the audit log file.
When using database-backed audit (log_to_db = true), this path
is used for the file-based backup copy.
signed: boolEnable keyed (HMAC) integrity protection of the audit hash chain.
Every audit row stores record_hash = H(prev_hash || record_bytes),
forming a tamper-evident chain (NIAP CA PP FAU_STG.1). When signed
is false (the default), H is plain SHA-256 — this detects in-place
edits, deletions, and reordering as long as the chain head is anchored
out-of-band. When signed is true, H is HMAC-SHA256 keyed by
integrity_key, which additionally prevents an
attacker who can write to the database from forging a valid chain.
integrity_key: Option<SecretRef>Secret reference for the HMAC integrity key (required when
signed = true).
Resolved at startup via the standard SecretRef backends
(env:, file:, keyring:, systemd-creds:). Never store the raw
key inline in the config file.
rotation_policy: RotationPolicyLog rotation policy.
max_file_size: u64Maximum rotation file size in bytes (when rotation_policy = "size").
Default: 100 MiB.
retention_count: u32Number of rotated log files to retain. Default: 10.
log_to_db: boolStore audit events in the database in addition to the log file.
overflow_policy: OverflowPolicyOverflow policy when audit storage is full (FAU_STG.4).
max_rows: Option<u64>Maximum number of audit rows in the database.
When this limit is reached, the overflow_policy determines
whether old rows are dropped or EST operations are halted.
None means no limit (rely on disk space monitoring).
alarm_threshold: u32Number of consecutive security violations before the alarm action fires (FAU_ARP.1).
Default: 10.
alarm_action: StringAction taken when the alarm threshold is reached.
"syslog"— emit a syslog alert."halt"— halt EST operations.
Default: "syslog".
auditable_events: Vec<String>NIAP CA PP FAU_GEN.1: list of auditable event types.
When non-empty, only these event types are recorded. When empty (default), all events are audited.
rotation_check_interval_secs: Option<u64>Override the interval (in seconds) between rotation checks.
When None (the default), the interval is derived from the
rotation_policy: 3600s for size, 86400s for daily/weekly.
Implementations§
Trait Implementations§
Source§impl Clone for AuditConfig
impl Clone for AuditConfig
Source§fn clone(&self) -> AuditConfig
fn clone(&self) -> AuditConfig
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 AuditConfig
impl Debug for AuditConfig
Source§impl Default for AuditConfig
impl Default for AuditConfig
Source§impl<'de> Deserialize<'de> for AuditConfig
impl<'de> Deserialize<'de> for AuditConfig
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>,
Auto Trait Implementations§
impl Freeze for AuditConfig
impl RefUnwindSafe for AuditConfig
impl Send for AuditConfig
impl Sync for AuditConfig
impl Unpin for AuditConfig
impl UnsafeUnpin for AuditConfig
impl UnwindSafe for AuditConfig
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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