Time
1 hour 52 minutes
Difficulty
Beginner
CEU/CPE
2

Video Transcription

00:00
in this. Next listen, we're gonna talk about how we can manage access keys and shared access signatures.
00:08
Our objectives include understanding what our access keys
00:12
understanding what our shared access signatures and, of course, jumping out and take a look at a demo of how we can use each of these and connecting to our storage account services.
00:24
First, let's talk about access keys,
00:26
access keys, authorized access to data inside the storage account and our services inside of it, like the blobs, cues, tables and file services. Each storage account comes with 2 512 bit storage account access keys,
00:40
and the reason we have to is you can have one given out to someone used inside an application over access, and then you can give them the 2nd 1 while you regenerate or revoke the 1st 1 This way, they never lose access to the storage account.
00:54
You know some best practices around these access keys is you want to avoid hard coating them inside an application or storing them somewhere inside of plain text.
01:02
The's access keys can be considered root access to your storage account, so enmity with ease access keys can have full access to your storage account and be able to manipulate the data or even remove it maliciously.
01:15
There is a recommendation to use azure active directory for authorization to your storage count, and that is something we looked at in a previous lesson. But access keys are perfectly valid for using and other scenarios.
01:26
And like we saw in a previous lesson, we can use the azure key vote to manage our keys and store them. They're an auto rotate our keys for us
01:34
now real quick. Here is a screenshot of what the key looks like inside a Roger portal. This is just one key. We have the key itself and then a connection stream we can use that has three key inside of it.
01:45
And here's just a quick example of where you would use an access key. In fact, we've seen it before in our previous lesson, when we connected our azure file share to our Windows server inside of that script, when we created the command key so we could reconnect to our foul share when we restarted the server.
02:04
The text here and pink is actually the access key to our storage account
02:07
that is something to consider is if you go to revoke a key or regenerate it, you have tow. Think about which services are connecting using that key and be able to update those using a new key.
02:23
Next, let's talk about shared access signatures.
02:25
This is a uniform resource identifier or your eye that grants access to our stores services. It's an alternative to access keys because instead of having full access to the storage account like our access keys have was shared access signatures, you can delegate specific permissions and also have them be time based,
02:44
so there are only valid for a certain period of time.
02:46
The SAS token that's a part of the your eye gives all the information to grant access to the user that has three shared access signature.
02:54
Now here's a quick example of a SAS token. This may look pretty confusing right now when we look at it, but let's jump into the next slide and let's break this down.
03:06
So let's break down each part of the your eye and take a look at each component.
03:09
The first line in the URL is the storage service girl. This is going to look pretty familiar. Based on previous lessons
03:16
in this example, the name of my storage account is my storage account. 92837 and we're looking at the Blob's service based on blob d'accord out windows dot net suffix.
03:27
Next is thes sign version, which is this the version of the storage service to use. Kind of like a tape EI version
03:34
SS inside the your eye stains four Sign services or which stories, servers and storage account we're gonna be using here be means blob. But we could also have the letter Q for Q Services T for table and F for file
03:47
he signed Resource Type specifies the resource type that is accessible in the account. Shared access signature as stains for the service level AP I sees for a container level and those for object level, we'll talk about these different kinds in the next slide.
04:01
The sun permission are the permissions that are allowed inside the your eye on this example. R N w stand for reading, right? But we could also have D for delete l for list or a for ad permissions
04:15
he signed. Expiry is the time when the excess signature becomes invalid and along that signs start is when the access signature becomes valid. This is an optional parameter, but if it's not specified, the start time is to be assumed when the service receives the request.
04:30
Starting in times must be written as UTC time and I s 0 86 So one format.
04:34
The sign protocol specifies the permitted protocol that could be used inside the request. Here we have https, but H t T P could be included as well. However, only using http is not a valid option.
04:48
And finally we have the signature and this is part of the your eye that is used to authorize the request in the shared access signature.
04:57
Now, we just mentioned signed resource type. So what type of shared access signatures can we have?
05:01
First, we have an account level which delegates access to all the different storage services inside the storage account.
05:08
We have our service level type, which specifies a single resource like the blob que table or file service insider storage account.
05:15
Finally have user delegation where we can secure the token with Azure 80 credentials. However, this is only supported for our blob's service.
05:25
That doesn't for some of our concepts. Let's jump out to the azure portal where we're gonna take a look at a demo. We're going to rotate our shared access key
05:32
will connect to Storage Explorer using the access key.
05:35
Look at creating a shared access signature and how we can use that signature to connect a storage, explore and view our limited permissions. Let's jump out to the azure portal now
05:46
back here in R J B T 2020 storage account. Let's go under settings and check out access keys.
05:54
And here we have to access keys and like you mentioned in the slides, you have to so you can give someone the second key while you regenerate the 1st 1 This make sure they maintain access to the storage account, and no service interruptions occur.
06:08
Now take a look at key to hear It starts with 22 plus VH. So let's see what happens when we try to regenerate this key.
06:15
Next to Key to let's click this circle of arrows.
06:18
It is going to say if you regenerate this one, anything using it is going to lose access. We'll go ahead and click on OK
06:25
and are key to value has changed and now starts with D. H u R Q.
06:30
This just shows how easy does to regenerate those keys, but you want to make sure you put some proper lifecycle management around it, so you don't lose access to something when you do this.
06:39
Now let's copy this first access key here, and let's jump back over to the Storage Explorer and see how we can connect to our storage account using it
06:46
back in storage Explorer. I'm still connected to my pay as you go subscription using my Azure 80 credentials. So I want to go ahead and remove. This connection here
06:56
will go under this account tab VCR's description here. Let's go and click on Remove.
07:00
We'll select yes,
07:02
and we'll click. Apply just to make sure it takes effect.
07:04
Now our subscription is gone and access to our storage account. So let's click on this connection icon. Hear it brings up the Connect to Asher storage, and we're going to select the option to use a storage account name and key.
07:17
We'll click on next. We'll give it a display name. I'm going to give it the name of the storage account and I'm gonna to specify in the display name we're connecting. Using an access key will enter the storage account name and our storage account key will have the option of selecting which azure region were connecting to what we saw this previously. And our storage Explorer lesson was gonna leave it at the commercial Azur.
07:38
Oh, click on next,
07:39
review our summary and go and click on Connect
07:43
over here on the left. Under storage accounts, we now have the J. P. T 2020 access key. And if we expand it, we can see we still have access to all our blob containers and file shares
07:53
so you can see instead of using our azure active directory credentials, we can just use an access key to gain access to our storage account and all of its services gonna go ahead and detached to this connection because we're gonna create another one using our shared access signatures and see how that works. Let's jump back over to the azure portal
08:13
back in the azure portal under settings. Let's go check out shared access signature.
08:18
And this is a great form where we can create our shared access signature. Your I in order to create a connection that is limited based on what we configure. First, let's take a look at allowed services. We can configure the shared access signature to only access certain services. So I'm gonna uncheck file Q and table as I only want to connect to my blob's service.
08:37
Next, we have the allowed resource type of service container, an object. This just specifies if you want to connect to the account service or maybe just specifically to the container or objects in them
08:48
going to go ahead and leave this selected at all three.
08:50
And the real power comes in to allow permissions. We have read, write, delete list at and create wheels. Have updating process for other services. For this example, I only want to allow this shared access senator to read and list objects inside our container, so I'm gonna uncheck the rest of these options.
09:07
Another great thing is our starting expiration times a default eight hours and when you can also specify the time zone
09:13
this allows this year L to expire at some point,
09:18
we can also specify allowed I P addresses so we only allow connections from these I p addresses
09:24
and are configured protocols. Probably good idea to only leave this at https.
09:28
And finally, we have our signing key. These are actually our access keys that we just looked at. And we can use these to sign the shared excess signature.
09:37
Gonna go ahead and leave it at key one.
09:39
And let's generate our shared access, Signature and connections drink.
09:43
We scroll down, we have our connection string here. Maybe we could use this inside an application. We have our SAS token, which just represents all the options we configure it above. And we also looked at this in our slides and broke down What? Each part, if it means.
09:56
And finally, we have our blob's service, SAS CRL, which includes the name of the storage account.
10:01
I'm gonna go ahead and copy this to the clipboard. Let's switch back to the Storage Explorer and connect using it
10:07
back in Storage Explorer. Let's go ahead and click on the Connect icon again and in our connector azure storage. Let's use the option of a shared access signature.
10:16
We'll go ahead and give it a display name again. I'll give it the name J P T. 2020 an s a s
10:22
and let's paste in our euro. We'll go ahead and click on next
10:26
reviewer summary and click on Connect
10:28
and again under storage accounts. We have our
10:31
connected storage account, but we don't have access to the blob container. This is because the shared access signature when we configured it, we said We only want to connect to the blob service
10:41
so you can see how we can already use this to limit access based on the your I.
10:46
Let's go into the vacation pics container. If you remember, we said, we only want to read our list items. Let's go and select one of these files and try to delete it and see what happens.
10:56
And down here, under activities we can see we got a failed to delete it based on insufficient credentials. So our shared access signature is working. We said services using this shared access signature can only reader list items not delete or do anything else. And we can just see here that it is working as intended.
11:13
Let's jump back to the slides and wrap this up
11:16
that does it for this lesson where we took a look at access keys for our storage accounts,
11:20
how we can configure limited permissions using shared access signatures.
11:24
And finally, a demos where we rotated those keys and created shared access signatures and demonstrate how we can connect with them using Storage Explorer Coming up next, we're going to take a look at the final lesson in this module. We're going to configure a network security and secure transfers. See you in the next episode.

Up Next

Azure Storage Accounts

In this course we will cover the different configuration options when creating storage accounts, how to secure data in the accounts, and finally how to upload and manage data in the storage account services.

Instructed By

Instructor Profile Image
Jeff Brown
Instructor