Best practices for secret management
Here are some general best practices that Google recommends when it comes to managing secrets:
- As with pretty much all services in Google Cloud, access to the Secret Manager API is protected by IAM. Follow the principle of least privilege when granting permissions to secrets to your applications.
- Divide applications and environments (staging/production) into independent projects. This can assist in segregating environments with IAM binding at the project level and guarantee that quotas are implemented independently.
- If necessary, establish a custom role or choose an existing role with the bare minimum of access. Think about who manages the secret (creates the secret, disables/enables it, or creates a new version) and who uses it, such as developers. You should have a separation of duties between these two roles, especially in production.
- Use secret-level IAM bindings or IAM conditions to limit access to the necessary subset of...