Design a centralized permission and access control system for a cloud platform like Google Cloud Platform (GCP). The system should allow administrators to manage roles, permissions, and access policies for users, service accounts, and resources across multiple projects and services.
Functional Requirements (FR)
User & Identity Management
•Users, groups, and service accounts can be created, updated, or deleted.
•Each identity can be assigned roles at project, folder, or organization level.
Role & Permission Management
•Roles define a set of permissions (e.g., compute.instances.create, storage.buckets.read).
•Support predefined roles (admin, viewer, editor) and custom roles.
•Permissions can be granted or revoked dynamically.
Resource Hierarchy & Access Control
•Resources are organized hierarchically: Organization → Folder → Project → Resource.
•Permissions can inherit down the hierarchy unless explicitly overridden.
Policy Management
•Support IAM policies to bind users/groups/service accounts to roles.
•Policy evaluation must resolve effective permissions for a given identity.
•Allow audit logging of all access changes.
Access Enforcement
•Every service/resource must check access before performing operations.
•Support conditional access (e.g., time-bound, IP-based, MFA required).
Non-Functional Requirements (NFR)
•Scalability – Handle millions of identities and resources.
•Low Latency – Fast access checks for real-time API requests.
•Consistency – Policy changes propagate accurately across services.
•Audibility – Maintain logs for all permission changes and access attempts.
•Extensibility – Support new services, roles, and permission types easily.
•Security – Prevent privilege escalation and enforce least-privilege principle.
Core Components
Component Responsibilities
Identity Service Manage users, groups, and service accounts.
Role Service Define and manage predefined and custom roles.
Policy Service Maintain IAM policies and role bindings.
Resource Manager Maintain hierarchical resource structure and inheritance.
Access Evaluator Compute effective permissions for identities on resources.
Audit & Logging Record all permission changes and access attempts.
API Gateway / Enforcement Layer Enforce access control on service requests in real-time.
Data Flow Overview
1.Admin creates a user/service account and assigns it a role on a project or resource.
2.Policy Service stores the binding and propagates it to the Access Evaluator.
3.When the identity makes an API call, API Gateway queries the Access Evaluator.
4.Access Evaluator resolves permissions by combining role permissions and inheritance rules.
5.Request is either allowed or denied; access decision is logged in Audit Service.
Design Considerations
Policy Evaluation
•Must support inheritance, overrides, and conditions efficiently.
•Optimize for frequent reads (access checks) vs infrequent writes (policy updates).
Caching
•Cache effective permissions per identity for low-latency access checks.
•Invalidate cache on policy changes.
Consistency & Propagation
•Ensure eventual consistency across distributed services.
•Use distributed consensus or pub/sub to propagate policy updates.
Security
•Enforce least privilege principle.
•Prevent cycles in role bindings or inheritance.
Auditing & Monitoring
•Record all changes for compliance and security audits.
Example Scenario
•Alice (user) belongs to Project X.
•Project X has a resource: Storage Bucket B.
•Alice is assigned roles/storage.objectViewer.
•Alice attempts to upload a file → Access Evaluator denies since her role allows only read access.
•Audit logs record the denied action with timestamp and reason.
✅ This HLD problem tests:
•Ability to design access control systems at scale.
•Understanding of RBAC (Role-Based Access Control), inheritance, and policy evaluation.
•Considerations for scalability, consistency, caching, and security in cloud systems.