Functionality and Usage of Key Vault - AZ-900 Certification Course

John Savill's Technical Training
2 Jan 202207:37

Summary

TLDRThis lesson delves into Azure Key Vault, a secure service for managing application secrets, keys, and certificates. It emphasizes the importance of not hardcoding sensitive information in application code. The service supports three entities: secrets, keys for cryptographic operations, and certificates for lifecycle management and distribution. Azure Key Vault offers two authorization methods: traditional access policies and more granular role-based access control (RBAC). Managed identities are highlighted as a solution for authentication challenges, allowing apps to access Key Vault with built-in permissions. The video also mentions Key Vault's integration with Azure services for encryption.

Takeaways

  • πŸ”‘ Azure Key Vault is a service designed to securely store and manage secrets, keys, and certificates for applications.
  • πŸ“œ Secrets in Key Vault can be read and written, making them suitable for storing passwords or shared access signatures.
  • πŸ—οΈ Keys within Key Vault support cryptographic operations and can be generated or imported but cannot be exported.
  • πŸ“„ Certificates in Key Vault focus on lifecycle management and distribution, ensuring secure and efficient handling.
  • πŸ›‘οΈ High-security needs can be met by running Key Vault on top of HSMs (Hardware Security Modules) for enhanced protection.
  • πŸ”‘ Access to Key Vault is controlled through authentication and authorization, with two types: access policies and role-based access control (RBAC).
  • πŸ‘€ Access policies provide permissions for users but lack granularity, applying to all entities of a certain type within the vault.
  • πŸ“‹ RBAC offers granular permissions, allowing different users to have access to specific secrets, keys, or certificates with various actions.
  • πŸ‘₯ Role assignments can be made at the Key Vault level or at the individual entity level, providing precise control over access.
  • πŸ” Managed identities in Azure can be used to authenticate applications to Key Vault without storing passwords within the vault.
  • πŸ”„ Azure Key Vault is integrated with other Azure services, allowing for 'Bring Your Own Key' scenarios for encryption and enhanced security.

Q & A

  • What is Azure Key Vault and what is its primary purpose?

    -Azure Key Vault is a cloud service designed to securely store and manage cryptographic keys, secrets, and certificates. Its primary purpose is to provide a secure way to store sensitive information such as passwords, tokens, and database connection strings, without hard-coding them into application code.

  • Why is it not secure to put secrets directly into application code?

    -Putting secrets directly into application code is insecure because it increases the risk of accidental exposure or leaks. If the code is shared, accessed, or compromised, the secrets could be discovered by unauthorized parties.

  • What are the three types of entities supported by Azure Key Vault?

    -The three types of entities supported by Azure Key Vault are secrets, keys, and certificates. Secrets are readable and writable pieces of data like passwords or tokens. Keys are cryptographic keys that can be generated or imported and used within the vault but cannot be exported. Certificates are managed for lifecycle and distribution purposes.

  • What is the difference between a secret and a key in Azure Key Vault?

    -A secret in Azure Key Vault is a piece of data that can be both read and written, such as a password or a shared access signature. A key, on the other hand, is used for cryptographic operations and can be generated or imported into the vault but cannot be exported or taken out of the vault.

  • How does Azure Key Vault handle the lifecycle management of certificates?

    -Azure Key Vault provides lifecycle management for certificates, which includes issuing, renewing, and revoking certificates. It also handles the distribution of certificates to ensure they are accessible to the services that require them.

  • What is the role of Hardware Security Modules (HSMs) in Azure Key Vault?

    -Hardware Security Modules (HSMs) are physical devices designed for the secure storage and management of sensitive data. In Azure Key Vault, HSMs can be used to enhance the security of storing and managing secrets, keys, and certificates.

  • What are the two types of authorization methods available in Azure Key Vault?

    -The two types of authorization methods available in Azure Key Vault are access policies and role-based access control (RBAC). Access policies provide permissions at a more general level for all entities of a certain type within the vault. Role-based access control allows for more granular permissions, enabling different access levels for different entities within the same vault.

  • Why is role-based access control (RBAC) generally preferred over access policies in Azure Key Vault?

    -Role-based access control (RBAC) is generally preferred over access policies because it offers more granular permissions. With RBAC, different users or services can be given access to specific secrets, keys, or certificates within the same vault, providing a more flexible and secure access management system.

  • What is a Managed Identity in the context of Azure services?

    -A Managed Identity in Azure is an identity for an Azure service that is automatically managed by Azure. It provides a way for applications running in Azure to authenticate to other Azure services without the need for explicit credentials.

  • How can Managed Identity be used with Azure Key Vault?

    -Managed Identity can be used with Azure Key Vault by assigning the identity permissions to access specific secrets, keys, or certificates within the vault. This allows applications to authenticate using their built-in managed identity and access the resources they have been granted permissions to.

  • How does Azure Key Vault integrate with other Azure services for encryption purposes?

    -Azure Key Vault integrates with other Azure services for encryption by allowing users to 'bring your own key' (BYOK) for services like storage accounts or database encryption. The keys used for encryption are stored and managed within the user's Azure Key Vault, providing control over key rotation and revocation.

Outlines

00:00

πŸ”‘ Introduction to Azure Key Vault

The first paragraph introduces the Azure Key Vault service, which is designed to securely manage and store secrets, keys, and certificates. It explains the common issue of applications needing access to sensitive information without hardcoding them into the application code to avoid security risks. Azure Key Vault supports three types of entities: secrets, keys, and certificates, each with specific capabilities and permissions. Secrets can be read and written, keys can be generated and used for cryptographic operations but cannot be exported, and certificates are managed for lifecycle and distribution. The paragraph also touches on the option to run Azure Key Vault on top of HSMs (Hardware Security Modules) for enhanced security. It concludes with an explanation of authentication and authorization methods in Azure Key Vault, including the difference between access policies and role-based access control (RBAC), with a preference for the more granular RBAC.

05:02

πŸ‘€ Role-Based Access Control in Azure Key Vault

The second paragraph delves into the role-based access control (RBAC) feature of Azure Key Vault, providing a granular level of permissions that allows for different users to have access to different secrets, keys, or certificates within the same vault. It illustrates how individual access can be managed at the secret level, using 'Clark Kent' and 'Bruce Wayne' as examples to show how specific users can be given reader or user roles for particular secrets. The paragraph also addresses the common challenge of authenticating to the Key Vault, especially when the application's authentication credentials are to be stored within the Key Vault itself. It introduces the concept of 'Managed Identity' in Azure, which provides a built-in identity for compute resources that can be granted permissions in RBAC, thus solving the chicken-and-egg problem of authentication. Finally, it mentions that Azure Key Vault is often used in conjunction with other Azure services for encryption purposes, allowing for the management of encryption keys within the Key Vault.

Mindmap

Keywords

πŸ’‘Azure Key Vault

Azure Key Vault is a cloud service provided by Microsoft Azure for securely storing and managing cryptographic keys, secrets, and certificates. It is central to the video's theme, which is about the functionality and usage of this service for application security. The script mentions it as a solution for managing secrets like passwords and access tokens without hardcoding them into the application code, thus enhancing security.

πŸ’‘Secrets

In the context of Azure Key Vault, 'secrets' refer to sensitive data that can be stored and managed within the vault, such as passwords or shared access signatures. The script explains that secrets are entities that can be both read and written, emphasizing their role in application security by keeping them out of the application code to prevent leakage.

πŸ’‘Keys

The term 'keys' in the script relates to cryptographic keys that can be generated or imported into Azure Key Vault. These keys are used for performing cryptographic operations but are never exported from the vault, ensuring they remain secure. The script illustrates this by stating that keys 'live within that key vault' and must be used via the vault itself.

πŸ’‘Certificates

'Certificates' in the script are digital credentials used for SSL/TLS communication, authentication, and encryption. Azure Key Vault manages the lifecycle of these certificates, including renewal and distribution. The video emphasizes the importance of lifecycle management for certificates to maintain security and trust in web servers.

πŸ’‘Hardware Security Modules (HSMs)

Hardware Security Modules are physical devices designed to secure and manage digital keys. In the script, HSMs are mentioned as an option for running Azure Key Vault, providing a higher level of security for storing sensitive entities like secrets, keys, and certificates. They ensure the safekeeping of these entities by using dedicated hardware.

πŸ’‘Authentication

Authentication in the script refers to the process of verifying the identity of a user or application before granting access to Azure Key Vault. It is a fundamental aspect of security, ensuring that only authorized entities can interact with the vault. The video discusses the authentication process in the context of accessing and managing the key vault.

πŸ’‘Authorization

Authorization in the context of the video is about granting permissions to users or applications to access specific entities within Azure Key Vault. The script discusses two types of authorization methods in Azure Key Vault: access policies and role-based access control (RBAC), highlighting RBAC for its granular permissions.

πŸ’‘Access Policy

An 'access policy' in Azure Key Vault is a method of granting permissions to users or applications for accessing the vault's entities. The script explains that access policies are not granular, meaning they grant permissions for all entities of a certain type within the vault, rather than specific entities.

πŸ’‘Role-Based Access Control (RBAC)

RBAC is a more granular authorization method mentioned in the script, allowing for detailed permission settings for different users or applications on a per-entity basis within Azure Key Vault. It enables the assignment of specific roles and permissions, such as 'key vault reader' or 'key vault secrets user', providing precise control over access to secrets, keys, and certificates.

πŸ’‘Managed Identity

In the script, 'managed identity' refers to an identity tied to a compute resource instance in Azure, which can be used for authentication without the need for explicit credentials. It is highlighted as a common solution to the 'chicken and egg' problem of authenticating to Azure Key Vault, allowing applications to use their built-in identity to access the vault.

πŸ’‘Bring Your Own Key (BYOK)

The concept of 'Bring Your Own Key' is mentioned in the script in the context of using Azure Key Vault for encrypting services like storage accounts and databases. BYOK allows customers to manage their own encryption keys within the key vault, providing control over key rotation and revocation. The script illustrates this by explaining that when a customer brings their own key for encryption, it is actually stored and managed in Azure Key Vault.

Highlights

Azure Key Vault is designed for securely managing secrets, keys, and certificates for applications.

Secrets in Azure Key Vault can be read and written, such as passwords and shared access signatures.

Keys within Azure Key Vault support generation, import, and cryptographic operations without exportability.

Certificates in Azure Key Vault focus on lifecycle management and distribution.

High Security Module (HSM) support is available for enhanced security of sensitive entities.

Authentication is required to interact with Azure Key Vault as it is an Azure resource.

Azure Key Vault offers two authorization types: Access Policy and Role-Based Access Control (RBAC).

Access Policy provides permissions for all entities of a type within the vault, lacking granularity.

RBAC allows granular permissions, enabling different access to various secrets, keys, or certificates.

Managed Identity can be used for authentication, solving the chicken-and-egg problem of storing authentication secrets.

Azure Key Vault integrates with Azure services for encryption, allowing management of encryption keys.

Key Vault supports the rotation and revocation of keys, enhancing security practices.

Individual access control can be configured at the secret level for fine-grained permissions.

The transcript discusses the practical applications of Azure Key Vault in managing application secrets securely.

Differentiating between the old style Access Policy and the more granular RBAC in Azure Key Vault.

Role assignments and permissions are detailed at both the Key Vault and individual secret levels.

The importance of Azure Key Vault in distributing and managing certificates across web servers.

Azure Key Vault's role in the broader Azure ecosystem for secure and compliant key and secret management.

Transcripts

play00:01

in this lesson we're going to explore

play00:02

the functionality and usage of azure key

play00:05

vault

play00:06

now very often we're going to have some

play00:09

application

play00:13

that needs

play00:14

a secret it needs maybe a password

play00:18

maybe it needs some kind of shared

play00:21

access signature or token to access some

play00:24

other service maybe i need to go and

play00:26

access some database something else

play00:30

and we don't want to put those secrets

play00:33

within our application code it's going

play00:35

to get leaked it's not secure

play00:37

i might need

play00:39

keys i might need to store a private key

play00:41

and perform cryptographic operations

play00:44

then we have a whole set of web servers

play00:46

and i'm using certificates so i need to

play00:48

think about how do i distribute those

play00:49

certificates how do i manage the life

play00:52

cycle like renew them

play00:54

so azure keyboard

play00:56

is a service in azure that is designed

play00:59

for exactly this

play01:02

it supports three different types of

play01:05

entity

play01:06

so we have a secret

play01:09

so a secret is something that i can both

play01:12

read

play01:14

and write

play01:17

i.e it could be a password it could be

play01:20

some

play01:21

shared access signature but i can

play01:24

add that secret to the key vault and i

play01:26

can read it back out

play01:28

then there's the idea of keys

play01:31

now with a key i can generate it

play01:34

i can import it so i could bring in an

play01:37

existing

play01:38

i can perform cryptographic actions

play01:41

within the key vault

play01:43

but i cannot export it i cannot get it

play01:44

out

play01:45

it lives within that key vault

play01:48

and then i have to use it via the key

play01:50

vault

play01:51

then there's the idea of

play01:52

certificates this is really all about

play01:55

kind of the life cycle management

play01:58

of those certificates

play02:00

and also the distribution of them

play02:04

now for some of these entities i have

play02:06

the option of actually running this

play02:08

azure key vault and the storage and

play02:10

usage on top of hsms

play02:14

so hsms are actual hardware security

play02:17

modules designed for the storage and

play02:20

safe keeping

play02:21

of these types of entity that i want to

play02:24

protect so these three different types

play02:27

in terms of interacting with the key

play02:29

vault you obviously it's an azure

play02:30

resource so i have to authenticate to it

play02:33

and then i can be given permission

play02:35

to these now currently there's two

play02:38

different types of authorization in

play02:40

azure kevo

play02:41

if we jump over and look at a key vault

play02:44

what we can actually see

play02:46

is

play02:47

we have the old style so the old style

play02:52

is when i look at my security we have an

play02:56

access policy

play02:58

and so an access policy is really just

play03:00

about the idea i can add a certain user

play03:03

and i can specify what permissions they

play03:06

get

play03:07

but it's for each of the three types but

play03:09

it's not granular

play03:11

i don't have the ability

play03:14

to say well i get this permission to

play03:15

read a specific secret

play03:18

so i have the option of access policy

play03:22

but it's not granular

play03:24

it would be for everything of that type

play03:27

within the vault

play03:29

so in that model if i wanted people to

play03:32

only have access to certain secrets i'd

play03:34

have to put them in a different vault to

play03:36

give them that set of permissions

play03:38

or

play03:40

i can use role-based access control

play03:43

so in role-based access control that is

play03:45

granular so i can think about hey i get

play03:48

a great granularity

play03:50

that i could have lots of secret or keys

play03:52

or certificates in a single vote and

play03:55

give different people access to

play03:56

different secrets to different keys to

play03:59

different certificates and perform

play04:00

different actions

play04:01

whereas access policy

play04:03

it's really no granularity

play04:06

it's just hey everything

play04:08

within the vault of a certain type so

play04:11

generally we're going to prefer that

play04:12

role-based access control option and we

play04:14

can see that so if i jump over to my

play04:17

other keyboard

play04:19

here if i look at my access policy i've

play04:22

selected to use

play04:24

azure role-based access control so i'm

play04:26

not configuring any permissions here

play04:30

i use the regular access control

play04:33

and i do role assignments

play04:35

and within here i can see things like

play04:37

well there's a key vault administrator

play04:40

but then i actually have different

play04:43

permissions

play04:45

on the actual different entities

play04:46

themselves so at the key vault level

play04:48

well i can't really see very much

play04:51

because what i've done is i have

play04:53

different secrets

play04:54

and at an individual

play04:56

secret levels if i select secret one

play04:59

it has its own access control

play05:02

and here we can see on this particular

play05:04

secret hey clark kent

play05:07

was given

play05:09

the key vault reader role

play05:11

and i can also see for a key vault

play05:13

secrets user

play05:16

hey bruce wayne actually has the ability

play05:18

to use the secrets so this particular

play05:21

secret bruce wayne can use but not clark

play05:25

kent clark kent just says regular key

play05:27

vault reader at the kind of the azure

play05:28

resource manager level but doesn't have

play05:30

access to the secret itself

play05:32

if i looked at my other secret secret 2

play05:36

looked at its access control

play05:39

well then we'll see

play05:41

hey this time

play05:43

key vault secrets user

play05:46

is clark kent so clark kent can read

play05:49

this secret and not bruce wayne so we

play05:52

get this really nice granularity

play05:55

that we can do

play05:57

now

play05:58

one thing that's actually super common

play06:00

is obviously i have to authenticate to

play06:02

the keyboard in the first place i have a

play06:03

chicken and egg problem i can't store

play06:05

the password in the key vault that the

play06:07

app's going to use to authenticate to

play06:08

the keyboard

play06:10

so a very common

play06:11

combination of technologies is if this

play06:14

was running in azure there's something

play06:16

called managed identity

play06:18

so managed identity is an identity that

play06:22

is tied to

play06:24

a particular instance of a compute

play06:26

resource

play06:28

and then what i could actually do as

play06:29

part of this rbac for example or the

play06:31

policy

play06:32

i could give the apps managed identity

play06:35

which is built in it's just available as

play06:37

a token it can leverage

play06:39

i would give that identity so app one's

play06:43

managed identity some of these

play06:44

permissions

play06:49

so it's authenticated with its built-in

play06:51

managed identity

play06:52

and then it gets permissioned to

play06:54

whatever its identity was given access

play06:57

to

play06:58

so that's really the idea

play07:00

no azure key vault is also used by a lot

play07:02

of azure functionality a lot of services

play07:05

will let you bring your own key for

play07:07

example to encrypt a storage account um

play07:09

for a database encryption

play07:11

when you bring your own key what it's

play07:13

actually doing is it's that key is in

play07:16

your key vault so you have management of

play07:19

the key you can pick when to rotate it

play07:22

when to revoke it

play07:23

so if you do bring your own key what's

play07:25

actually happening is

play07:26

it's going to use azure key vault for

play07:28

that so hey if i have the need for

play07:30

secrets or keys or certificate

play07:32

management in azure

play07:34

i'm going to use azure keyboard

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
AzureSecurityKey VaultSecretsEncryptionCertificatesManaged IdentityRBACCryptographyCloud Services