Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save joelowrance/53a41af9c683ab3e67181f18a2f3a112 to your computer and use it in GitHub Desktop.

Select an option

Save joelowrance/53a41af9c683ab3e67181f18a2f3a112 to your computer and use it in GitHub Desktop.
5- Configure and manage secrets in Azure Key Vault

Guidelines for using Azure Key Vault

Vaults

A secure container Container is a collection of keys and protected data (secrets) az keyvault create --resourcegroup whatever --name uniquename New-AzKeyVault for powershell

Keys

The main thing Apps dont access keys directly, they call methods on the keyvault service Keys can be single instance or versioned

Hardware Protected

Hardware security module - physical computing device that safeguards and manages digital keys

Software Protected

Generated with RSA and ECC algs. Stored at rest. Can monitor.

For production use, it's recommended to use HSM-protected keys and use software-protected keys in only test/pilot scenarios. There is an additional charge for HSM-backed keys per-month if the key is used in that month. The summary page has a link to the pricing details for Azure Key Vault.

Secrets

Small (<10k) blobs - pfx files, connection strings, app settings, etc

Key vault uses

Secrets management Key Management
Certificate management

Use it for configuration secrets, not for application data.

Best practices

Use RBAC to allow people access to manage. Control what users are allowed to access Store certs in vault Enable soft delete and purge protection.

Manage access to secrets, certificates, and keys

Authentication

Uses Azure AD.
No support for anon.

Authorization

Uses RBAC. Key Vault Contributor access to management features , but no access to data. Contributor full administration rights Can use the portal or CLI/REST to create policies

Restricting network access

Choose which networks can connect to your key vault.

Exercise - store secrets in Azure Key Vault

Get-AzKeyVault

Get-AzKeyVaultSecret -VaultName 'MyVault' -Name 'SecretName'

Manage certificates

Adding certificates to a Key Vault

Azure Key Vault manages X.509 based certificates that can come from several sources. Connect your key vault top a trusted issuer Key Vault will manage cert, will renew if it needs to

Azure App Service integration

Settings > TLS/SSL > Private Key Cert > Import Key Vault Cert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment