Dev.to Security 🔐 Cybersecurity 👁 0 📖 1 min read

Designing eventual-consistency credential revocation for a multi-site enterprise access control system across KSA branches

Hi folks, We're building the backend orchestration layer for a multi-site physical access control system spanning 4 regional offices in Saudi Arabia (Riyadh HQ, Jeddah, Dammam, and NEOM site trailers — ~380 doors total,

Hi folks,

We're building the backend orchestration layer for a multi-site physical access control system spanning 4 regional offices in Saudi Arabia (Riyadh HQ, Jeddah, Dammam, and NEOM site trailers — ~380 doors total, mixing BLE/NFC mobile credentials and biometric terminals).

Because of in-country data residency and audit requirements (Saudi PDPL / NCA controls), everything runs on-prem across private MPLS links rather than a public multi-tenant SaaS cloud.

Current Architecture

  • HQ Core (Riyadh): 3-node Kubernetes cluster (Ubuntu 22.04), PostgreSQL 16 (primary event/audit ledger), Redis Streams, and a Go-based sync service pushing policy deltas to enterprise access controllers.
  • Branch Edge Nodes: Lightweight Debian 12 gateways at each site caching active badge/mobile credential ACLs locally so doors still grant/deny in <150 ms if the MPLS WAN drops.
  • Identity Source: Synced every 5 minutes from corporate Active Directory / HR offboarding webhooks.

Where We're Hitting Edge Cases

We're running into a classic CAP / revocation-propagation problem when handling offboarding or lost-phone mobile credential revocations across branches:

  1. Outbox / Sync Drift After WAN Drops: When a remote branch gateway loses WAN connectivity for 20–30 minutes and reconnects, replaying queued CREDENTIAL_REVOKED and ACCESS_GROUP_UPDATED deltas alongside thousands of buffered DOOR_ACCESS_EVENT logs occasionally creates out-of-order state if an employee was moved between clearance groups right before the outage.
  2. Audit Timestamp Skew: Offline controllers buffer entry logs locally; if NTP drifts slightly on an isolated security VLAN, reconciling entry/exit anti-passback rules across adjacent gates produces false anti-passback lockouts.

Questions for the Community

  1. For edge gateways that must stay authoritative offline, would you enforce monotonically versioned policy snapshots per site (e.g., an epoch/Lamport counter per branch) over idempotent event replay, or use NATS JetStream / Kafka leaf nodes at each branch?
  2. How are you handling time-sensitive credential revocations (e.g., terminating a contractor immediately across all sites) without blocking normal badge throughput during WAN reconnection storms?

Would love to hear patterns that have held up in production for distributed edge/IoT access setups.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.