Skip to content

Security & Audit ​

DD's security stack consists of three independent but complementary components, covering the full chain from data redaction to audit traceability.

Components ​

ComponentResponsibilityTypical Use Case
SensitiveDataFilterAuto-detect and redact sensitive data in logsPrevent passwords, API keys, credit card numbers from leaking
AuditLoggerAsynchronously log security-related eventsCompliance audit, security analysis, intrusion detection
IntegritySignerHMAC signing to prevent log tamperingTamper detection, forensic evidence, compliance storage

How They Relate ​

text
Log write pipeline:

  Logger.InfoWith(...)
       │
       ├─→ SensitiveDataFilter ──→ Redact field values (password → [REDACTED])
       │         │
       │         └─→ AuditLogger ──→ Async record redaction events
       │
       └─→ Format output

  AuditLogger (optional IntegritySigner) ──→ HMAC-sign audit events (tamper protection)
  • SensitiveDataFilter intercepts sensitive data before logs are written
  • AuditLogger records security events asynchronously without impacting log performance
  • IntegritySigner is not wired into the regular log write path: it signs only audit events (via AuditConfig.IntegritySigner) or content you sign manually with Sign/SignFields

Quick Selection ​

NeedRecommended
Prevent password/key leakageSensitiveDataFilter
Prevent log flooding (DoS)SecurityConfig.RateLimitConfig — see Security Filtering
Record who did what and whenAuditLogger
Ensure logs haven't been tamperedIntegritySigner
Meet HIPAA/PCI-DSS complianceAll three together — see Compliance

Next Steps ​