🔐 Identity & Access Management
IAM tương đương AWS IAM + GCP IAM + Azure AD. JWT, RBAC, ABAC, MFA TOTP, refresh-token rotation, service principals, workload identity, bucket-scoped key.
Năng lực
Authentication
Email/password + MFA TOTP, refresh-token rotation. SSO OIDC/SAML (configurable).
RBAC + ABAC
Role catalog (admin, operator, viewer, custom). Action × Resource matrix; ABAC theo project/owner/tag.
Project Scoping
Header X-Project-ID isolate tài nguyên giữa team — tương đương GCP Project.
Service Principal
Long-lived credential cho workload tự động hoá; rotate khoá tự động.
Workload Identity
POST /api/v1/auth/workload-token — short-lived JWT cho service-to-service, không lưu key cứng.
Bucket-scoped Key
API key có scope đến đúng 1 bucket cụ thể (least-privilege), gateway middleware validate.
Delegation
Workflow uỷ quyền + parent_role_id inheritance. Endpoint /projects/:id/members/delegate.
KeyVault / KMS
keyvault-service :8089 — secrets, keys, certificates; envelope encryption; rotate on schedule.
Audit Trail
Mọi sensitive action ghi vào audit-service immutable; ISO 27001 ready, SIEM streaming khả dụng.
Mô hình token
# Đăng nhập
POST /api/v1/auth/login → { access_token (15m), refresh_token (7d) }
# Refresh
POST /api/v1/auth/refresh → access_token mới + refresh_token mới (rotation)
# Workload identity (service-to-service)
POST /api/v1/auth/workload-token
{ "service_principal_id": "...", "scope": ["bucket:logs-prod:read"] }
→ JWT (5–15m)
Bucket-scoped Key — ví dụ
# Tạo API key gắn scope vào bucket
POST /api/v1/iam/keys
{ "name":"prod-logs-reader", "policies":[
{ "action":"object:read", "resource":"bucket:logs-prod/*" }
]}
# Authorize
POST /api/v1/iam/authorize-bucket
{ "key_id":"...", "bucket":"logs-prod", "actions":["read","list"] }
Đối chiếu yêu cầu khách hàng
| Yêu cầu GHN | Đáp ứng |
|---|---|
| Service Account / Workload Identity | POST /api/v1/auth/workload-token |
| Khắc phục giới hạn 5 Access Key | Bucket-scoped key, không giới hạn cứng |
| Key chỉ có quyền 1 bucket cụ thể | End-to-end: IAM authorize-bucket + gateway middleware |
| Role IAM sâu hơn | Delegation + parent_role_id inheritance |