Design a system for managing access to a warehouse, with zones, roles, and an audit of every operation.
Asked at
AI answer
Architecture
- Identity Provider is responsible for employee authentication (SSO, MFA) and issues a short-lived token containing the user ID and status.
- Access Control Service accepts requests to enter zones and perform operations on resources. It checks the applicable rules and returns an
allow/denydecision with a reason. - Management Service allows administrators to create zones, assign roles, and issue temporary permissions.
- Audit Service reliably stores every decision and administrative change.
- Access points—door controllers or terminals—call the service over a secure channel. A safe policy is defined in advance for network outages: for example, critical zones remain locked, while authorized temporary passes are available locally for a limited time.
Access Model
Zones and resources are described in a registry. Roles define typical permissions, such as warehouse clerk, inventory auditor, and administrator; assigning a role to a user is limited by zone and validity period. Checks take into account not only the role, but also the context: whether the employee is active, the shift time, the status of the access badge, and whether the operation is permitted in that zone. This combines RBAC with constrained attributes (ABAC).
Example rule: “A warehouse clerk may enter zone A during their shift and perform receiving operations, but may not change access settings.” The principle is least privilege; denial is the default outcome.
API and Storage
Key request: POST /access-decisions with user_id, zone_id, action, resource_id, and the device ID. The response contains the decision, decision_id, and reason. Role and rule changes are made through a separate administrative API with authorization checks and confirmation for critical changes.
A relational database stores users, zones, roles, assignments, rules, and their validity periods. Rule changes are versioned. Only computed permissions with a short TTL may be cached, with mandatory invalidation when access is revoked.
Auditing and Operations
For each request, record the time, user, zone, action, device, result, reason, policy version, and correlation_id. The log also includes entries and exits, denials, role changes, and administrative actions. Events are sent asynchronously to a separate storage system with restricted access, integrity controls, and a retention policy; the log cannot be modified through the application's regular interface. Loss of an audit record must trigger an alert, and critical operations must not proceed without confirmed auditing.
The service must be idempotent for repeated requests from devices, provide latency and failure metrics, support redundancy, and have a verifiable recovery procedure. Tests should cover the “user—role—zone—operation” matrix, permission expiration and revocation, concurrent policy changes, and operation during connectivity loss.
Also asked at IBS
- Suppose a virtual machine has no CPU load and no RAM pressure, but its load average is huge and the server is really lagging. Where would you look, and what might be the problem?
- How do you perform a forensic analysis of a compromised container that was deleted but whose Linux audit logs were retained?
- How do you use SELinux or AppArmor for container profiles in a production environment to restrict access to the host file system?
- What is the difference between bridging, masquerading, and routing in the context of Docker/Kubernetes networking?
- Which TCP parameters (sysctl) do you change for low-latency, high-load HTTP services?
Similar questions
- Design a system for managing access to a sports complex, with memberships and offline access control.
- Design a system for managing access to office buildings, including guests, parking, and calendar integrations.
- Design a system for managing access to laboratories, including equipment, training, bookings, and incidents.
- Design a procurement management system for a large company with approvals, limits, and auditing.
- Design a distributed system for managing access to parking facilities with subscriptions, one-time visits, and offline terminals.