Using secret store
As alternative to the usage of placing secrets into an IConfiguration
instance in your application, the Arcus.Security.Core
package provides a alternative concept called 'secret store'.
We provide an approach similar to how IConfiguration
is built, but with a focus on secrets. You can pick and choose the secret providers you want to use and we'll get the job done!
Once register, you can fetch all secrets by using ISecretProvider
which will get secrets from all the different registered secret providers.
💡 See this section if you want to use the secret store functionality within Azure Functions.
Why would I use it?​
Why would you use our Arcus secret store instead of just using the Azure SDK directly to access Azure Key Vault secrets?
The Arcus secret store has some advantages over using the Azure SDK or configuration directly:
✔ Caching
- We provide caching so the secret providers will not be called upon every secret retrieval. This helps you avoiding hitting service limitations and we provide asynchronous cache invalidation.
✔ Plug & play
- We support using multiple and combinations of secret providers so with a single secret retrieval can query multiple secret providers (also multiple Azure Key Vaults).
✔ Design for security
- While using configuration for storing secrets can be good for development it is not a safe approach. With the secret store, we provide a single place to retrieve secrets instead of scattering the integration across the application.
- Separating configuration data and sensitive secrets is key in developing secure projects. Vulnerabilities gets introduced when secrets are seen as data and are included in logs, for example. Or when expired secrets doesn't get transient handling upon retrieval.
✔ Extensibility
- Arcus secret store is highly extensible and can be extended with your own custom secret providers, in-memory secret providers for testing...
Built-in secret providers​
Several built in secret providers available in the package.
And several additional providers in separate packages.
If you require an additional secret providers that aren't available here, please this document that describes how you can create your own secret provider.