HomeVideos

Entra ID Integrated SFTP

Now Playing

Entra ID Integrated SFTP

Transcript

395 segments

0:00

Hi everyone. In this video, I want to

0:02

talk about the new Azure storage SFTP

0:05

capability that integrates with Entra

0:08

ID.

0:09

Because when I think about Azure

0:10

storage,

0:12

it's very much one of those foundational

0:15

solutions

0:16

that's used in so many places, so many

0:19

types of environment, and now I can use

0:21

it in an even more integrated way with

0:25

the idea of the SFTP

0:29

protocol. So, SSH file transfer

0:31

protocol.

0:33

And the whole goal around this is if

0:35

when I enable SFTP to talk to my storage

0:38

account as a client,

0:41

whatever that may be,

0:43

I can now just communicate using the

0:46

SFTP

0:48

protocol. I can use an SFTP client to

0:53

access, manage,

0:55

transfer

0:57

the various files.

1:00

Now, to do this, what I will require on

1:03

the storage account is actually a couple

1:05

of different things.

1:06

So, I have to have enabled the

1:08

hierarchical namespace on the storage

1:12

account. So, it's saying when we create

1:14

the storage account, we enable the

1:15

hierarchical namespace, we think about

1:17

it as the Azure Data Lake Storage Gen2.

1:20

We get true directories as part of it,

1:24

instead of hey, there's a virtual

1:25

directory, which is really just made up

1:28

as part of the file name and gets viewed

1:30

as directories.

1:32

So, I'm going to enable the hierarchical

1:33

namespace when I create the storage

1:35

account,

1:36

and then as needed, I turn on

1:40

this SFTP

1:44

capability. So, I can both enable

1:49

and I can disable it

1:53

really at will. And once I've enabled it

1:55

and it's a hierarchical namespace

1:56

storage account, then I just go and

1:58

connect to this over with the regular um

2:01

port 22,

2:04

and I'm using SFTP. So, it's going to be

2:06

really, really useful

2:08

when I have some application

2:11

that's used to talking using SFTP, and I

2:14

don't want to have to refactor, I don't

2:16

want to re-architect anything. I just

2:18

want to go and move to start using Azure

2:20

um storage for that.

2:22

So, as I talked about, hey, it's a

2:24

hierarchical namespace storage account,

2:26

and then I go and enable or disable it.

2:28

Now, there is a fee for enabling SFTP.

2:33

So, if I jump over,

2:35

we can see right here

2:37

to turn on SFTP,

2:40

you get charged, in this case for this

2:42

region, 30 cents an hour. So, it's not

2:45

something I would just go and turn on

2:46

for the fun of it. I would enable it

2:48

when I have a very specific need. If I

2:50

look at my storage account,

2:52

we can see that yes, this storage

2:54

account is hierarchical namespace. I see

2:57

enabled.

2:59

And then if I scroll down and look at my

3:01

settings,

3:04

we have SFTP.

3:07

And then once I'm within SFTP, I have

3:09

gone ahead and enabled it, which is why

3:12

you now see I have an option to disable

3:14

it. So, I can really go ahead and enable

3:17

and disable this at will.

3:21

Now, one of the challenges we faced with

3:24

this

3:25

is when it first came out, and I could

3:27

still do it, but obviously I have to

3:29

authenticate.

3:31

And the way this

3:33

one option is

3:35

is it leveraged local users.

3:40

So, at a per storage account level, I

3:43

would go and define the different users,

3:46

and I would define the very specific

3:48

ACLs they would have, and I could have

3:51

up to 50,000 of those.

3:53

And then I would authenticate as one of

3:55

those local accounts as I have an Azure

3:57

generated secret password

4:00

or an Azure generated certificate. You

4:03

couldn't bring your own.

4:04

And so, these are very long-lived

4:06

credentials that then you have to manage

4:09

separately from any existing identity

4:13

that you're used to. I think of Entra.

4:16

And they didn't adhere to any of the

4:19

regular storage permission models, so

4:20

you couldn't use role-based access

4:21

control, couldn't use attribute based

4:24

access control. This was super painful.

4:27

Imagine someone leaves. Hey, I forgot to

4:30

disable this account, they have a

4:31

backdoor to access the storage account.

4:34

When someone onboards, I have to go and

4:36

create the account. If I want a partner

4:38

to be able to use it, I have to go and

4:39

create an account. If I want to audit

4:41

it,

4:42

well, it's not part of my regular Entra

4:44

sign-in logs. I can't track it very

4:46

well.

4:47

And then if you start thinking about

4:49

what organizations really want to do

4:50

today, which is MFA, which is passkeys,

4:55

which is conditional access, I can't do

4:58

anything with these per storage account

5:01

local users. It's really not a good

5:04

solution.

5:06

And so, as you would expect, the

5:07

solution now

5:10

is I do have the ability, if we think

5:13

about our Entra tenant

5:16

that is trusted by the subscription,

5:20

well, I can now leverage those. So, the

5:23

users, for example in here,

5:27

I now just at a regular way was I get

5:31

granted

5:33

roles on the storage account. So, they

5:35

use those data plane roles that we have.

5:38

Um storage blob data contributor, for

5:41

example. I just grant them at the

5:43

various levels, and they'll be

5:45

respected. I can also use the attribute

5:47

based access control. So, it's not

5:49

separate sets of accounts, it's not

5:51

separate special ACLs. It's now going to

5:53

use the identities I have, it's going to

5:56

use the existing data plane permissions

5:58

model we have. And if this was an

6:00

external account, think a partner,

6:02

that's going to work as well.

6:06

Now, a challenge though is I'm connected

6:08

by an SFTP client. Uh could be the one

6:11

that's built into Windows, it could be

6:12

PuTTY.

6:14

They don't understand Entra ID.

6:17

So, what's going to happen is the way

6:19

we're actually going to authenticate

6:21

is using

6:25

OpenSSH tokens.

6:29

Um Entra already supports those as an

6:32

authentication method.

6:35

And so, what's going to happen is your

6:36

application or process,

6:39

it will authenticate to Entra,

6:42

and then generate an OpenSSH token.

6:45

Think Think about it as a certificate,

6:47

which I'll download and use as part of

6:50

the authentication.

6:53

Now, at time of recording, this is a

6:54

preview feature. So, in my subscription,

6:57

when you have preview features,

6:59

I would have had to have enabled SFTP

7:01

Entra ID support. You're going to have

7:03

to go and do that.

7:05

Now, I could generate my own

7:07

certificate. Remember, a certificate is

7:09

a private key part that stays with you,

7:11

you never share, and a public key part.

7:14

I can use the SSH keygen, and it has to

7:17

be the RSA to go and create it, but I

7:19

don't have to do that.

7:21

The AZ CLI, for example, with the

7:23

PowerShell modules which enable me to do

7:25

this, will go and create the certs as

7:27

well for you. So, what I want to do is

7:30

walk through just showing you this in

7:32

action.

7:34

So, if I really quickly open up my

7:37

terminal,

7:38

and we'll jump over to it.

7:41

I'm actually switching back to dark

7:42

mode, or you won't see the commands

7:43

properly.

7:45

So, I'm going to use the AZ CLI. I'm in

7:47

PowerShell, but if we look at my AZ

7:49

version,

7:50

I'm just running 2.85, so at the time of

7:53

recording, that's the latest one.

7:56

I've already authenticated, but before I

7:58

show you that, there is an extension I

8:00

need today for SFTP.

8:03

So, if I do AZ extension show,

8:09

you can see I do have that extension

8:11

installed as well. So, you would have to

8:12

use the AZ extension add {dash} {dash}

8:15

name SFTP to get this installed in your

8:18

environment.

8:21

Now, because I've already authenticated,

8:24

the next thing I have to do is just go

8:27

ahead

8:28

and create this OpenSSH token

8:32

to connect to Azure.

8:35

And I can do it all in one command. So,

8:37

if I do the AZ SFTP

8:41

cert file. Now, I'm in PowerShell, so my

8:45

um path structure with the

8:47

slashes is a little bit different,

8:49

depending on if you're CLI or Linux or

8:51

whatever, but this will just put it in

8:53

my local folder.

8:56

So, I'll go ahead and just run that, and

8:57

it's completed.

8:59

And if I now look,

9:01

was it actually created three files?

9:04

So, what I have here

9:06

is the public key, the private key for

9:11

my regular cert,

9:13

and then

9:15

the OpenSSH cert, so the token I'm

9:18

actually going to use as part of PuTTY.

9:21

Now, if you already had a certificate

9:24

you wanted to use, I could have just

9:26

added that as part of the cert command,

9:29

and it would have just been a {dash}

9:30

{dash} public key file and the public

9:32

key file I wanted. So, it would have

9:34

been super easy.

9:35

I can actually go and look at what it

9:37

created. So, if I use Again, I'm in

9:40

Windows, but

9:42

you should be able to

9:44

use this on whatever.

9:47

I can go and look at my OpenSSH token,

9:50

and you can see the principal

9:52

down here, and it's only the first part.

9:55

I don't use the part after the @ sign

9:58

when I actually go and authenticate

10:00

using this certificate.

10:02

So, it's just the first part before the

10:04

domain name.

10:06

And then, I'm just going to

10:08

use this token through my SFTP client.

10:12

Now, obviously when we we actually go

10:14

and focus on this and use it,

10:17

I have to have a path.

10:19

So, for my client, I have to have a

10:21

network path to the storage account. So,

10:24

if there's a private endpoint it's

10:26

exposed on, I have to be on a network

10:27

that has an IP route and a DNS

10:29

resolution

10:31

to resolve to the private endpoint and

10:33

then talk to it.

10:34

If it's on the public network, well,

10:36

then I have to have opened up

10:39

the storage account's firewall to allow

10:42

my public-facing IP address to be

10:44

allowed to talk to it. So, they're all

10:46

things I would have had to have done.

10:48

But, with all that done,

10:51

now, if we jump back over to my terminal

10:54

again,

10:57

we can actually go ahead and connect.

11:00

So, what I'm going to do here

11:03

is I'm using the SFTP command.

11:06

I'm telling it details about the key

11:09

type I'm connecting to.

11:11

I'm telling it the certificate file.

11:17

So, that's that OpenSSH the public key

11:19

part.

11:20

And then, it's the name of the storage

11:21

account

11:23

.

11:24

my

11:25

authentication, my username, but

11:27

remember it doesn't have

11:29

the suffix part, the @savilltech.net.

11:32

And then, the rest of the command is

11:34

just

11:37

the storage account

11:40

DNS name. So, that's it.

11:42

So, I'm passing in

11:45

that OpenSSH. I'm going to say

11:47

yes.

11:49

And I'm now connected.

11:51

So, if I look around,

11:53

I can see there's an images folder.

11:54

Let's go and look in the images folder.

11:56

See what's in there.

11:58

Uh let's get the dog

12:00

cartoon.png

12:02

file.

12:05

And we'll exit.

12:08

And then,

12:10

we'll look at it.

12:11

And sure enough, I generate this quickly

12:14

this morning. This is the dog cartoon of

12:17

me and my four dogs lay lounging around.

12:19

My smile wasn't really that big. I don't

12:20

normally look like the Joker. But, you

12:23

can see there there's me interacting

12:25

um pretty easily

12:27

um with SFTP using

12:33

just a regular client.

12:37

It I can access any of the tiers, so

12:39

hot, cool, cold. It will write using the

12:41

default tier. That's a really important

12:44

though.

12:45

The cert I'm generating here is valid

12:48

for 65 minutes. And this is by design.

12:52

So, this is a 65-minute

12:58

lifetime.

12:59

Now, if I'm doing a write and it

13:01

expires, the existing write would

13:02

continue, but I'm going to implement

13:05

logic in my app to recheck

13:08

and get a new OpenSSH token

13:12

as it's expiring. And this is a very

13:14

familiar pattern. We use an access

13:16

token, they're normally short-lived to

13:18

around an hour. So, it's following that

13:20

same idea. So, this was compromised in

13:22

some way, it's very, very short-lived.

13:25

And most interactions when I think of

13:27

SFTP are short-lived, it's a burst of

13:30

activity. So, it's not really going to

13:32

be an issue. And then, the key point

13:34

here is, so I have authenticated, I've

13:37

got this OpenSSH token as my identity,

13:41

and then it's just the regular

13:44

data plane. Remember, it's a data plane

13:46

permission on the storage account that

13:48

now takes effect. So, if I was to go and

13:51

look

13:53

at my storage account, notice I've added

13:55

no local users here, but you saw me

13:56

access it. And to prove I'm not tricking

13:59

you, if I look at the container,

14:02

you'll see it's the same files that you

14:04

saw.

14:06

But, if I go and look at the access

14:08

control

14:10

and look at my role assignments,

14:13

what you'll see I added was a data plane

14:16

set of permissions.

14:18

So, I added

14:20

storage blob data contributor. And

14:22

that's the important part.

14:24

So, that's at the data plane, not the

14:26

control plane. So, that lets me actually

14:28

go ahead and interact

14:31

with the actual blobs within the storage

14:34

account. That's the critical part of

14:36

making that successful.

14:40

And those local users,

14:43

they will get phased out over time.

14:45

Like, there really isn't a good reason

14:48

to keep those. So, eventually, it's

14:50

still there today, you get a choice. I

14:52

can disable local users at the storage

14:54

account level, but they're going to get

14:55

phased out over time in in favor of

14:57

this. Remember, this doesn't have to be

14:58

a user.

15:00

In the documentation, it also talks

15:01

about how I would use a service

15:02

principal for this. So, there's other um

15:05

types of identity I can leverage.

15:08

And that's it. I mean, there you have

15:09

it. A really nice simplified way for

15:12

your applications that are used to using

15:14

SFTP to now work with Azure storage

15:17

without having to refactoring, without

15:19

dealing with another type of credential.

15:20

And I as an organization now just use my

15:23

existing mechanisms of identity

15:26

provisioning, of monitoring activity. I

15:29

get all the lovely stuff about Azure AD

15:31

governance and life cycle and

15:33

conditional access and uh risk, all of

15:36

those capabilities, the full

15:37

observability, uh I now just get. So, it

15:40

makes this a really nice a fitting

15:42

solution. Hope that's useful. Uh till

15:45

next video, take care.

Interactive Summary

The video introduces the new Azure storage SFTP capability, which integrates with Entra ID. This feature allows existing SFTP clients to interact with Azure storage accounts without requiring application refactoring, by leveraging OpenSSH tokens for authentication through Entra ID. The speaker highlights the benefits over the previous local user authentication, which lacked features like RBAC, MFA, and centralized management. To enable SFTP, a storage account must have hierarchical namespace enabled. The new method uses existing data plane roles for permissions and offers enhanced security and governance features by integrating with Entra ID capabilities.

Suggested questions

5 ready-made prompts