Security Model
DSM includes production-oriented security primitives for replication traffic.
Core Protections
- HMAC message signing
- nonce-based replay protection
- cluster admission validation
- sender rate limiting and temporary bans
- optional payload encryption inside secure envelopes
- minimum accepted key version for downgrade protection
Spring Boot Properties
Security is configured under dsm.security.*.
Key properties:
dsm.security.enableddsm.security.cluster-secretdsm.security.min-acceptable-key-versiondsm.security.nonce.window-sizedsm.security.nonce.max-clock-driftdsm.security.nonce.max-tracked-sendersdsm.security.rate-limit.max-consecutive-failuresdsm.security.rate-limit.ban-durationdsm.security.encryption.enableddsm.security.encryption.algorithmdsm.security.encryption.key-derivation-salt
Payload Encryption
Payload encryption is disabled by default. When enabled, DSM encrypts secure-envelope payloads with a built-in AEAD algorithm such as ChaCha20-Poly1305 or AES-256-GCM.
Encryption mode is strict:
- a node requiring encryption rejects plaintext inbound envelopes before HMAC verification with
DSM-2006 - a plaintext-only node rejects encrypted inbound envelopes because it has no compatible decryptor
- mixed-mode clusters should be rolled carefully, not left to silently downgrade
Sender Protection
Replay protection is bounded per sender. dsm.security.nonce.max-tracked-senders caps retained sender windows and uses LRU eviction when the cap is reached.
Repeated verification failures are handled before expensive decrypt/HMAC work:
max-consecutive-failurescontrols when a sender is temporarily bannedban-durationcontrols how long the ban lasts- banned senders surface as
DSM-2007
Operational Advice
- treat the cluster secret as production credential material
- rotate keys through controlled rollout plans
- keep
serviceIdstable because it is part of the isolation model - monitor authentication failures and replay rejections through
DsmMetrics - alert on encryption downgrade rejections and sender bans
Metrics Hooks
The metrics SPI includes callbacks for:
- auth failures
- replay rejections
- encryption downgrade rejections
- sender bans
- nonce sender evictions
- admission denials
- service ID mismatches
- dropped messages
That lets platform teams connect security events to existing dashboards and alerts.