WEBVTT

00:00.000 --> 00:01.320
Hi, everybody.

00:01.320 --> 00:05.660
Welcome to the online version of my talk at the DEF CON Cloud Village.

00:05.660 --> 00:07.800
Cloud defaults are easy, not secure.

00:07.800 --> 00:09.360
I am Igal Flegman.

00:09.900 --> 00:17.260
And I am an identity security engineer with years of experience creating identity and PKI services at Microsoft.

00:17.260 --> 00:25.540
And then after a few years, I left and cofounded KETOS, where we create identity and PKI solutions for customers.

00:26.100 --> 00:28.660
And my Twitter is igal underscore FS.

00:28.660 --> 00:32.660
So if you have any questions, feel free to send them my way that way.

00:33.040 --> 00:38.160
So we're going to start the talk with a quick video of me creating a VM in Azure.

00:38.360 --> 00:49.220
And in here, I just want you to pay attention and see what are some of the misconfigurations that I created as being a novice user creating a Windows server in Azure.

01:05.890 --> 01:12.730
So as you can see, Azure enabled me to create a VM in a few seconds.

01:13.130 --> 01:16.490
However, there were two big misconfigurations there.

01:16.730 --> 01:20.030
And I'm just going to talk a little bit about all the things we're going to talk.

01:20.030 --> 01:25.170
And in the Vegas talk, I was able to ask the people what they thought the things were.

01:25.170 --> 01:30.570
And I didn't want to show all what we were going to talk about, because they would be able to guess real quick of what it was.

01:30.570 --> 01:33.830
So we're going to talk about default passwords and open ports.

01:33.830 --> 01:40.490
If you guessed default password and open port for what were my misconfigurations, you got them correct.

01:40.490 --> 01:43.770
And I'm going to jump into details in a few minutes.

01:44.310 --> 01:49.110
And then there's insecure cryptographic defaults, as well as subdomain takeover.

01:49.710 --> 01:52.370
So let's get jump into it with default passwords.

01:52.370 --> 01:57.950
So default passwords is something that is kind of getting fixed and hopefully will be fully fixed in a few months.

01:58.250 --> 02:02.610
This one actually used to drive me crazy, finally got fixed.

02:02.690 --> 02:13.650
Now when you create a SQL database, you have been able to use Azure Active Directory for a while, but you still had to set up a default username and password for the local account.

02:13.650 --> 02:19.450
Now that's fixed and you can only use Azure Active Directory, which congrats on fixing.

02:20.970 --> 02:23.670
And however, VMs are still not there.

02:23.670 --> 02:28.670
So for VMs, you still have to create a default password or a default SSH key.

02:28.870 --> 02:34.590
You can use the same for all your VMs, kind of like making it a got a key for all your VMs.

02:34.610 --> 02:36.690
You can start using AD auth.

02:36.690 --> 02:38.310
It's still sometimes in preview.

02:38.310 --> 02:41.430
They pull it out of preview and so on, but it's getting there.

02:41.430 --> 02:47.830
And hopefully there's going to be a point where you can just create a VM and not have a local credential.

02:48.730 --> 02:50.150
So we're getting there.

02:50.150 --> 02:51.470
And then open ports.

02:51.470 --> 02:55.730
So as you saw in the video, the port was default to be open.

02:55.730 --> 02:57.790
So I didn't have to select anything.

02:57.790 --> 03:03.450
I actually would have to have gone into networking and make it to close that port.

03:03.890 --> 03:06.630
And there was a quick warning saying like, hey, your port is open.

03:06.630 --> 03:12.850
But if I'm an engineer that has no clue about networking and I just have to deploy a website, they're like, oh, okay, cool.

03:12.850 --> 03:13.770
Like whatever.

03:13.910 --> 03:16.430
Or I'll say, hey, I'll close it later.

03:16.730 --> 03:17.950
That's future me problem.

03:17.950 --> 03:19.430
Then forget and leave it open.

03:19.810 --> 03:21.930
And it could be solved really easy.

03:21.930 --> 03:27.730
It could be solved by either defaulting to your current IP address or even better using Azure networking JIT.

03:27.730 --> 03:29.410
So this is something I asked in Vegas.

03:29.410 --> 03:33.170
And I was like, does anybody know what Azure networking JIT is?

03:33.170 --> 03:40.150
And only one person, the whole audience, knew that it is a solution that creates just-in-time access in the network.

03:40.150 --> 03:43.390
So basically your RDP port is always closed.

03:43.390 --> 03:44.550
You go to Azure.

03:44.630 --> 03:47.010
You request access for let's say 20 minutes.

03:47.010 --> 03:50.850
And it will open your RDP port just to your IP address.

03:50.970 --> 04:02.930
So if it's a solution that would be kind of talked about more, it would be great for all Azure customers to be able to close the ports and then just use just-in-time access to access the ports.

04:03.290 --> 04:07.650
You put those two together, default passwords and open ports, and it's a disaster .

04:07.970 --> 04:19.790
We actually ran a study where we opened some Azure machines and we left SSH open and we got an average of 2.25 million SSH attempts per year.

04:19.790 --> 04:25.470
And I like saying that if your password is one in a million, they're going to break in twice a year.

04:25.470 --> 04:32.290
And unfortunately, we have seen that with a lot of companies that leave ports open or there's a network misconfiguration.

04:32.410 --> 04:40.910
People are able to force in because the engineer quickly set up a password that was short and they're like, well, it doesn't matter because we're going to use something else.

04:40.910 --> 04:45.830
But that password stayed there and that gives you root access to the machine.

04:45.830 --> 04:49.290
So it is very important to make sure we close our ports.

04:49.350 --> 04:56.110
And we also use security in depth by creating that identity perimeter to lock down those VMs.

04:56.730 --> 05:02.050
So the next thing is weak SSH cryptographic defaults.

05:03.010 --> 05:08.170
So in here we have the kind of like Mozilla scoring and it gives it a D.

05:08.170 --> 05:13.130
And the reason for it is, as I said in the title, cloud defaults are made to be easy.

05:13.130 --> 05:14.710
So we have password enabled.

05:14.790 --> 05:22.370
We have a bunch of key exchange algorithms that are kind of obsolete, but they leave them open.

05:22.370 --> 05:29.970
So anybody from any computer, even if it's an old Windows machine, can SSH because they don't want to have the problem of someone calling support on me.

05:29.970 --> 05:34.750
Like I can't SSH into my Azure machine to then learn that they're running Windows XP.

05:35.030 --> 05:38.810
So they prefer kind of like opening it up, being a little less secure.

05:38.870 --> 05:45.790
And people that are conscious about this disable these algorithms to be more secure.

05:46.330 --> 05:51.050
And we observe the same with TLS cryptographic defaults in the web applications.

05:51.270 --> 05:56.850
So if you run an Azure web application and you just open TLS 1.2, you might think like, all right, we're good.

05:57.110 --> 05:58.090
We close 1.1.

05:58.090 --> 05:59.950
We close 1.0.

06:00.170 --> 06:01.390
We're only using 1.2.

06:01.390 --> 06:12.350
But actually, if you run a scanner, there's still 1.2 algorithms, cipher suites that are not good enough, that have been proven to be not as secure as we would want.

06:12.350 --> 06:14.310
And those ones are enabled for the same reason.

06:14.310 --> 06:20.430
If you have a Windows 7 or 8 computer, they wouldn't be able to do the secure one.

06:20.430 --> 06:28.310
So Azure kind of like leaves it open, just so you don't have the same call of like, hey, some of my users are reporting issues with my website.

06:28.590 --> 06:43.010
And if you want to close it, you have to get really deep into the configuration or just put an Azure Front Door, which is what I recommend, just because Azure Front Door not only helps you with this, but it also creates a WAF and you can have a CDN.

06:43.010 --> 06:48.530
So it is actually the best way to kind of like protect your application while also optimizing it.

06:48.530 --> 06:55.350
So that's something to keep in mind and make sure that you're running these kind of tests and making sure your organization is secure.

06:56.470 --> 06:59.170
So now we're going to do a second video.

06:59.770 --> 07:11.830
So in this demo, we're going to create... we already created a website, but now I wanted to point from my website because azurewebsites.com, it's not that great of a domain if you want to be memorable.

07:12.510 --> 07:18.710
So I'm going to use my Coding Flamingo, which is my YouTube channel, and I'm just going to create Defcon C name.

07:18.710 --> 07:24.850
So it will be Defcon.CodingFlamingo, and it's just going to point to that Azure websites and we'll be able to point it there.

07:30.530 --> 07:34.610
So in here, I just have to type Defcon.CodingFlamingo.com,

07:37.880 --> 07:40.840
and it's going to validate that it's pointing to the host name.

07:41.520 --> 07:43.120
And now I can add it.

07:43.140 --> 07:48.520
And the cool thing about Azure and cloud is that it can also create a TLS certificate for me.

07:48.520 --> 07:49.940
So I don't have to worry about TLS.

07:49.940 --> 07:51.860
I don't have to worry about rotating it.

07:53.340 --> 07:58.560
All I have to do is create an app service managed certificate, select the domain I want.

07:58.560 --> 08:02.100
It's going to check that it's pointing there and it's going to create it.

08:02.360 --> 08:13.200
Then I go to custom domains and I just have to bind that certificate to that domain and click save, which has been covered by my face, but I just click the save button down there.

08:14.920 --> 08:22.840
And now if we go to the actual website, so Defcon.CodingFlamingo.com, it's just going to work and it's going to send you to the same Azure website.

08:22.840 --> 08:25.660
And as you can see, it actually has a certificate in there.

08:32.970 --> 08:35.990
And now I'm just going to go and delete the application.

08:45.360 --> 08:47.960
And so here I went and deleted the application.

08:48.480 --> 08:56.940
And here I actually ask once again to the people in the audience, what was the problem with this video?

08:57.320 --> 09:06.320
And actually someone was really quick, raised his hand and he's like, the answer is they didn't actually check you on the website.

09:06.320 --> 09:08.980
They just checked that you were pointing at it.

09:08.980 --> 09:12.500
And I was like, yep, you kind of ruined it because you did it too quickly.

09:12.500 --> 09:14.440
And I thought it was going to take a little bit while.

09:14.500 --> 09:18.620
I still owe that guy a drink, but yeah, that's basically what happened.

09:18.660 --> 09:26.800
So basically how it works is we have our Defcon.CodingFlamingo and it's pointing to the Azure websites.net and then that returns the website.

09:26.800 --> 09:34.220
That's how the CNAME works and the actual DNS and all Azure was verifying is that this is pointing to this.

09:34.540 --> 09:39.480
But as I deleted it, there was no warning or anything of like, hey, this is still pointing to this.

09:40.580 --> 09:49.400
And so anybody else can go create Defcon.2.azurewebsites.com, register that domain and impersonate CodingFlamingo.com.

09:49.820 --> 09:58.820
And we actually when we found this, we actually searched and we found over 35,000 domains that had that problem.

09:58.820 --> 10:03.520
So the problem with this, you might be thinking like, well, like, what can I do with that?

10:03.680 --> 10:05.360
First of all, you can take over the domain.

10:05.360 --> 10:14.740
So if it's like coupons.CodingFlamingo.com, you can create a great phishing site and people will fall for it and create a website to impersonate the company.

10:15.160 --> 10:20.940
And the best part out of it is since it's using the same domain, so like, you know, computers read right to left.

10:20.940 --> 10:22.520
So it's still using CodingFlamingo.com.

10:22.520 --> 10:24.420
It doesn't matter what this subdomain is.

10:24.700 --> 10:27.640
Password managers will actually say like, oh, this is a legit domain.

10:27.640 --> 10:29.720
Let me put the password in.

10:29.720 --> 10:33.360
So if you have a password field, it will automatically fill it up.

10:33.440 --> 10:37.500
And if the attackers are smart, they can take the credential even if you don't click submit.

10:37.500 --> 10:42.760
So by just opening it, which if you're a trained user, you would still open it because it's a real domain.

10:42.760 --> 10:44.580
It's CodingFlamingo.com.

10:44.880 --> 10:48.520
Your credentials will be automatically entered and stolen.

10:48.520 --> 10:54.620
So it is kind of the goldmine for phishing and even your best trained users would fall for it.

10:54.620 --> 11:05.860
So for that one, let's make sure that we're being aware of that and making sure we are deleting those subdomains whenever an app is created and deleted.

11:06.840 --> 11:11.940
So those are kind of like the cloud defaults that I focused on in this talk.

11:13.460 --> 11:16.140
Usually in here, I would open it for questions.

11:16.620 --> 11:21.680
And if you guys have any questions, feel free to send them over on Twitter, and I'll happily respond.

11:21.680 --> 11:29.240
So thank you so much for watching this video, and I hope you enjoy it and have a safe rest of the year.

