pub struct AuditEvent {
pub timestamp: DateTime<Utc>,
pub event_type: EventType,
pub user: String,
pub target: Option<String>,
pub metadata: Option<Value>,
pub hmac: String,
}Expand description
監査イベント
監査ログの個別エントリを表します。 各エントリにはHMAC-SHA256による署名が含まれ、改ざん検知が可能です。
Fields§
§timestamp: DateTime<Utc>イベントのタイムスタンプ(UTC)
event_type: EventTypeイベント種別
user: Stringユーザー/プロセス識別子
target: Option<String>対象パス(該当する場合)
metadata: Option<Value>追加のメタデータ
hmac: StringHMAC-SHA256署名(hex文字列)
Implementations§
Source§impl AuditEvent
impl AuditEvent
Sourcepub fn backup_started(
target: impl Into<String>,
user: impl Into<String>,
) -> Self
pub fn backup_started( target: impl Into<String>, user: impl Into<String>, ) -> Self
バックアップ開始イベントを作成
Sourcepub fn backup_completed(
target: impl Into<String>,
user: impl Into<String>,
metadata: Value,
) -> Self
pub fn backup_completed( target: impl Into<String>, user: impl Into<String>, metadata: Value, ) -> Self
バックアップ完了イベントを作成
Sourcepub fn backup_failed(
target: impl Into<String>,
user: impl Into<String>,
error: impl Into<String>,
) -> Self
pub fn backup_failed( target: impl Into<String>, user: impl Into<String>, error: impl Into<String>, ) -> Self
バックアップ失敗イベントを作成
Sourcepub fn restore_started(
target: impl Into<String>,
user: impl Into<String>,
) -> Self
pub fn restore_started( target: impl Into<String>, user: impl Into<String>, ) -> Self
復元開始イベントを作成
Sourcepub fn restore_completed(
target: impl Into<String>,
user: impl Into<String>,
metadata: Value,
) -> Self
pub fn restore_completed( target: impl Into<String>, user: impl Into<String>, metadata: Value, ) -> Self
復元完了イベントを作成
Sourcepub fn restore_failed(
target: impl Into<String>,
user: impl Into<String>,
error: impl Into<String>,
) -> Self
pub fn restore_failed( target: impl Into<String>, user: impl Into<String>, error: impl Into<String>, ) -> Self
復元失敗イベントを作成
Sourcepub fn cleanup_started(user: impl Into<String>, days: u32) -> Self
pub fn cleanup_started(user: impl Into<String>, days: u32) -> Self
クリーンアップ開始イベントを作成
Sourcepub fn cleanup_completed(user: impl Into<String>, metadata: Value) -> Self
pub fn cleanup_completed(user: impl Into<String>, metadata: Value) -> Self
クリーンアップ完了イベントを作成
Sourcepub fn cleanup_failed(user: impl Into<String>, error: impl Into<String>) -> Self
pub fn cleanup_failed(user: impl Into<String>, error: impl Into<String>) -> Self
クリーンアップ失敗イベントを作成
Sourcepub fn security_warning(
message: impl Into<String>,
user: impl Into<String>,
) -> Self
pub fn security_warning( message: impl Into<String>, user: impl Into<String>, ) -> Self
セキュリティ警告イベントを作成
Sourcepub fn permission_denied(
path: impl Into<String>,
user: impl Into<String>,
) -> Self
pub fn permission_denied( path: impl Into<String>, user: impl Into<String>, ) -> Self
権限拒否イベントを作成
Sourcepub fn compute_hmac(&self, secret: &[u8]) -> String
pub fn compute_hmac(&self, secret: &[u8]) -> String
HMAC-SHA256を計算
Sourcepub fn verify_hmac(&self, secret: &[u8]) -> bool
pub fn verify_hmac(&self, secret: &[u8]) -> bool
HMACを検証
Trait Implementations§
Source§impl Clone for AuditEvent
impl Clone for AuditEvent
Source§fn clone(&self) -> AuditEvent
fn clone(&self) -> AuditEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AuditEvent
impl Debug for AuditEvent
Source§impl<'de> Deserialize<'de> for AuditEvent
impl<'de> Deserialize<'de> for AuditEvent
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AuditEvent
impl RefUnwindSafe for AuditEvent
impl Send for AuditEvent
impl Sync for AuditEvent
impl Unpin for AuditEvent
impl UnwindSafe for AuditEvent
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.