Class AuditEvent
- Namespace
- Excalibur.Compliance
- Assembly
- Excalibur.Compliance.Abstractions.dll
Represents an auditable event in the system.
public sealed record AuditEvent : IEquatable<AuditEvent>
- Inheritance
-
AuditEvent
- Implements
- Inherited Members
Remarks
Audit events form a hash-chained, tamper-evident log for: - SOC2 compliance evidence - Security incident investigation - Data access tracking - Regulatory reporting
Audit events are immutable once created and should never contain sensitive data values (only references/identifiers).
Properties
Action
Gets the action that was performed (e.g., "Read", "Create", "Update", "Delete", "Login").
public required string Action { get; init; }
Property Value
ActorId
Gets the identifier of the actor (user, service, system) who performed the action.
public required string ActorId { get; init; }
Property Value
ActorType
Gets the type of actor (e.g., "User", "Service", "System").
public string? ActorType { get; init; }
Property Value
ApplicationName
Gets the application name that produced this audit event.
public string? ApplicationName { get; init; }
Property Value
Remarks
Enables filtering and chain scoping in shared audit backends. It is NOT populated for you: an event stored without one is stored with a null application name. Set it explicitly when a single audit backend is shared between applications.
CorrelationId
Gets the correlation ID linking related audit events.
public string? CorrelationId { get; init; }
Property Value
EventHash
Gets the hash of this audit event (set by the audit store).
public string? EventHash { get; init; }
Property Value
EventId
Gets the unique identifier for this audit event.
public required string EventId { get; init; }
Property Value
EventType
Gets the type/category of this audit event.
public required AuditEventType EventType { get; init; }
Property Value
IpAddress
Gets the IP address from which the action originated.
public string? IpAddress { get; init; }
Property Value
Metadata
Gets additional metadata as key-value pairs. Must not contain sensitive data values.
public IReadOnlyDictionary<string, string>? Metadata { get; init; }
Property Value
Outcome
Gets the outcome of the audited operation.
public required AuditOutcome Outcome { get; init; }
Property Value
PreviousEventHash
Gets the hash of the previous audit event in the chain. Null for the first event in the chain.
public string? PreviousEventHash { get; init; }
Property Value
Reason
Gets the reason or justification for the action.
public string? Reason { get; init; }
Property Value
ResourceClassification
Gets the data classification level of the accessed resource.
public DataClassification? ResourceClassification { get; init; }
Property Value
ResourceId
Gets the identifier of the resource being accessed or modified.
public string? ResourceId { get; init; }
Property Value
ResourceType
Gets the type of resource (e.g., "Customer", "Order", "Configuration").
public string? ResourceType { get; init; }
Property Value
SessionId
Gets the session ID associated with this event.
public string? SessionId { get; init; }
Property Value
TenantId
Gets the tenant identifier for multi-tenant isolation.
public string? TenantId { get; init; }
Property Value
Timestamp
Gets the timestamp when the event occurred.
public required DateTimeOffset Timestamp { get; init; }
Property Value
UserAgent
Gets the user agent or client application identifier.
public string? UserAgent { get; init; }