Prompt
How do I audit who accessed a secret and when?
Latest observation
Oct 25, 2026
OpenAI APIWeb search: off
It depends on where the secret lives, but the general answer is:
- Use a secret manager with audit logs
- Enable access logging at the service level
- Correlate logs with identity info (user, role, service account, IP, request ID)
- Review the audit trail in your SIEM/log platform
Common options:
-
AWS Secrets Manager / SSM Parameter Store
- CloudTrail records
GetSecretValue/GetParameter - Use CloudTrail Lake, Athena, or CloudWatch Logs to query who accessed what and when
- CloudTrail records
-
Azure Key Vault
- Enable Key Vault diagnostic logs
- Access events go to Azure Monitor / Log Analytics
-
Google Secret Manager
- Cloud Audit Logs show
accessSecretVersion - Query in Cloud Logging / BigQuery
- Cloud Audit Logs show
-
HashiCorp Vault
- Enable audit devices
- Logs include request path, entity, policy, time, and response metadata
-
Kubernetes Secrets
- By default, Kubernetes does not give strong per-secret access auditing
- Use API server audit logs, RBAC, and preferably external secret managers instead
Best practice:
- Grant access via IAM/RBAC roles, not individual users
- Log the requesting principal
- Set retention and tamper protection for audit logs
- Alert on unusual secret access patterns
If you tell me which platform you’re using (AWS, Azure, GCP, Vault, Kubernetes, etc.), I can give you the exact audit queries and setup steps.