pub struct AuditLogger { /* private fields */ }
Expand description
Main audit logger implementation
Implementations§
Source§impl AuditLogger
impl AuditLogger
Sourcepub fn new(config: AuditConfig) -> Result<Self, CoreError>
pub fn new(config: AuditConfig) -> Result<Self, CoreError>
Sourcepub fn log_data_access(
&self,
userid: &str,
resourceid: &str,
action: &str,
description: Option<&str>,
) -> Result<(), CoreError>
pub fn log_data_access( &self, userid: &str, resourceid: &str, action: &str, description: Option<&str>, ) -> Result<(), CoreError>
Sourcepub fn log_security_event(
&self,
category: EventCategory,
action: &str,
userid: &str,
description: &str,
) -> Result<(), CoreError>
pub fn log_security_event( &self, category: EventCategory, action: &str, userid: &str, description: &str, ) -> Result<(), CoreError>
Sourcepub fn log_authentication(
&self,
userid: &str,
action: &str,
outcome: EventOutcome,
source_ip: Option<&str>,
) -> Result<(), CoreError>
pub fn log_authentication( &self, userid: &str, action: &str, outcome: EventOutcome, source_ip: Option<&str>, ) -> Result<(), CoreError>
Sourcepub fn log_configuration_change(
&self,
userid: &str,
config_item: &str,
old_value: Option<&str>,
newvalue: Option<&str>,
) -> Result<(), CoreError>
pub fn log_configuration_change( &self, userid: &str, config_item: &str, old_value: Option<&str>, newvalue: Option<&str>, ) -> Result<(), CoreError>
Sourcepub fn search_events(
&self,
start_date: DateTime<Utc>,
end_date: DateTime<Utc>,
category: Option<EventCategory>,
userid: Option<&str>,
) -> Result<Vec<AuditEvent>, CoreError>
pub fn search_events( &self, start_date: DateTime<Utc>, end_date: DateTime<Utc>, category: Option<EventCategory>, userid: Option<&str>, ) -> Result<Vec<AuditEvent>, CoreError>
Search audit events within a date range
§Errors
Returns an error if events cannot be searched or parsed.
Sourcepub fn get_statistics(&self, days: u32) -> Result<AuditStatistics, CoreError>
pub fn get_statistics(&self, days: u32) -> Result<AuditStatistics, CoreError>
Sourcepub fn log_event_with_verification(
&self,
event: AuditEvent,
) -> Result<(), CoreError>
pub fn log_event_with_verification( &self, event: AuditEvent, ) -> Result<(), CoreError>
Add an audit event method with integrity verification
§Errors
Returns an error if event verification or logging fails.
Sourcepub fn export_compliance_report(
&self,
start_date: DateTime<Utc>,
end_date: DateTime<Utc>,
compliance_mode: ComplianceMode,
) -> Result<ComplianceReport, CoreError>
pub fn export_compliance_report( &self, start_date: DateTime<Utc>, end_date: DateTime<Utc>, compliance_mode: ComplianceMode, ) -> Result<ComplianceReport, CoreError>
Export audit logs for compliance reporting
§Errors
Returns an error if the compliance report cannot be generated.
Auto Trait Implementations§
impl !Freeze for AuditLogger
impl RefUnwindSafe for AuditLogger
impl Send for AuditLogger
impl Sync for AuditLogger
impl Unpin for AuditLogger
impl UnwindSafe for AuditLogger
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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