Prompt
I'm building an internal developer platform and need access control for secrets
Latest observation
Oct 25, 2026
OpenAI APIWeb search: off
For an internal developer platform, the safest pattern is to treat secrets access as a separate authorization domain from general app permissions.
Recommended model
1) Use RBAC for coarse-grained access
Define roles like:
- Secret Viewer: can list metadata, not values
- Secret Reader: can read secret values
- Secret Writer: can create/update secrets
- Secret Admin: can manage policies, rotation, deletion
This works well for broad team-based permissions.
2) Add ABAC/policy checks for context
RBAC alone is often too coarse. Add attribute-based checks such as:
- environment:
dev,staging,prod - service/team ownership
- namespace/project
- request source: human vs CI/CD vs workload identity
- time-bound approvals for production access
- break-glass elevation
Example policy idea:
- Developers can read secrets in
dev - Only service accounts can read
staging - Production secrets require approval or a short-lived elevated token
3) Separate metadata access from secret value access
Let users list:
- secret name
- version
- last rotated
- owner
- tags
But gate the actual value behind a stricter permission. This prevents accidental disclosure.
4) Prefer short-lived identities over static credentials
Use:
- OIDC/SAML for humans
- workload identity for services
- short-lived tokens issued by your control plane
- just-in-time access for sensitive secrets
Avoid long-lived shared API keys where possible.
5) Audit everything
Log:
- who accessed what
- when
- from where
- why/approval ticket
- whether value was returned or denied
Make audit logs immutable and searchable.
6) Enforce least privilege and scoping
Scope access by:
- org
- project
- environment
- secret path/prefix
- secret label/tag
Example:
payments/*secrets only visible to the payments teamprod/payments/db-passwordonly accessible to the payments service account
7) Add policy workflows for high-risk access
For production or break-glass access:
- require approval
- set expiration
- notify owners on use
- revoke automatically after TTL
Practical policy structure
A simple model:
- Principal: user, service account, pipeline
- Resource: secret or secret namespace
- Action: list, read, write, delete, rotate, approve
- Conditions: environment, team, time, MFA, approval status
Example:
ALLOW read secret
IF principal.team == resource.team
AND resource.env != "prod"
ALLOW read secret
IF principal.type == "service_account"
AND principal.service == resource.service
AND resource.env == "prod"
ALLOW read secret
IF resource.env == "prod"
AND approval.active == true
AND token.ttl < 15m
Implementation tips
- Use a policy engine like OPA, Cedar, or similar
- Store secrets encrypted with a KMS/HSM
- Prefer envelope encryption
- Consider per-tenant/per-environment keys
- Use vault-style leasing and dynamic secrets where possible
Common pitfalls
- Giving humans direct read access to production secrets
- Using the same identity for all workloads
- Overloading Kubernetes RBAC for secret authorization alone
- Logging secret values accidentally
- No separation between “can see secret exists” and “can read it”
If you want, I can also provide:
- a concrete permission schema,
- an OPA/Cedar policy example, or
- a reference architecture for an IDP secrets service.