How To: Use secret scoping
You can read guidance on setting up secret store components to configure a secret store for an application. Once configured, by default any secret defined within that store is accessible from the Dapr application.
To limit the secrets to which the Dapr application has access to, you can define secret scopes by adding a secret scope policy to the application configuration with restrictive permissions. Follow to define an application configuration.
The secret scoping policy applies to any secret store, whether that is a local secret store, a Kubernetes secret store or a public cloud secret store. For details on how to set up a read How To: Retrieve a secret
Watch this for a demo on how to use secret scoping with your application.
To add this configuration follow the steps below:
Define the following appconfig.yaml
configuration and apply it to the Kubernetes cluster using the command kubectl apply -f appconfig.yaml
.
For applications that need to be denied access to the Kubernetes secret store, follow these instructions, and add the following annotation to the application pod.
With this defined, the application no longer has access to any secrets in the Kubernetes secret store.
This example defines configuration for secret store named vault
. The default access to the secret store is deny
, whereas some secrets are accessible by the application based on the allowedSecrets
list. Follow to apply configuration to the sidecar.
Define the following :
This example uses a secret store that is named vault
. The above configuration explicitly denies access to secret1
and secret2
from the secret store named vault while allowing access to all other secrets. Follow these instructions to apply configuration to the sidecar.
The allowedSecrets
and deniedSecrets
list values take priority over the policy.
- Overview of