start	end	text
0	1320	Hi, everybody.
1320	5660	Welcome to the online version of my talk at the DEF CON Cloud Village.
5660	7800	Cloud defaults are easy, not secure.
7800	9360	I am Igal Flegman.
9900	17260	And I am an identity security engineer with years of experience creating identity and PKI services at Microsoft.
17260	25540	And then after a few years, I left and cofounded KETOS, where we create identity and PKI solutions for customers.
26100	28660	And my Twitter is igal underscore FS.
28660	32660	So if you have any questions, feel free to send them my way that way.
33040	38160	So we're going to start the talk with a quick video of me creating a VM in Azure.
38360	49220	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.
65890	72730	So as you can see, Azure enabled me to create a VM in a few seconds.
73130	76490	However, there were two big misconfigurations there.
76730	80030	And I'm just going to talk a little bit about all the things we're going to talk.
80030	85170	And in the Vegas talk, I was able to ask the people what they thought the things were.
85170	90570	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.
90570	93830	So we're going to talk about default passwords and open ports.
93830	100490	If you guessed default password and open port for what were my misconfigurations, you got them correct.
100490	103770	And I'm going to jump into details in a few minutes.
104310	109110	And then there's insecure cryptographic defaults, as well as subdomain takeover.
109710	112370	So let's get jump into it with default passwords.
112370	117950	So default passwords is something that is kind of getting fixed and hopefully will be fully fixed in a few months.
118250	122610	This one actually used to drive me crazy, finally got fixed.
122690	133650	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.
133650	139450	Now that's fixed and you can only use Azure Active Directory, which congrats on fixing.
140970	143670	And however, VMs are still not there.
143670	148670	So for VMs, you still have to create a default password or a default SSH key.
148870	154590	You can use the same for all your VMs, kind of like making it a got a key for all your VMs.
154610	156690	You can start using AD auth.
156690	158310	It's still sometimes in preview.
158310	161430	They pull it out of preview and so on, but it's getting there.
161430	167830	And hopefully there's going to be a point where you can just create a VM and not have a local credential.
168730	170150	So we're getting there.
170150	171470	And then open ports.
171470	175730	So as you saw in the video, the port was default to be open.
175730	177790	So I didn't have to select anything.
177790	183450	I actually would have to have gone into networking and make it to close that port.
183890	186630	And there was a quick warning saying like, hey, your port is open.
186630	192850	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.
192850	193770	Like whatever.
193910	196430	Or I'll say, hey, I'll close it later.
196730	197950	That's future me problem.
197950	199430	Then forget and leave it open.
199810	201930	And it could be solved really easy.
201930	207730	It could be solved by either defaulting to your current IP address or even better using Azure networking JIT.
207730	209410	So this is something I asked in Vegas.
209410	213170	And I was like, does anybody know what Azure networking JIT is?
213170	220150	And only one person, the whole audience, knew that it is a solution that creates just-in-time access in the network.
220150	223390	So basically your RDP port is always closed.
223390	224550	You go to Azure.
224630	227010	You request access for let's say 20 minutes.
227010	230850	And it will open your RDP port just to your IP address.
230970	242930	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.
243290	247650	You put those two together, default passwords and open ports, and it's a disaster .
247970	259790	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.
259790	265470	And I like saying that if your password is one in a million, they're going to break in twice a year.
265470	272290	And unfortunately, we have seen that with a lot of companies that leave ports open or there's a network misconfiguration.
272410	280910	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.
280910	285830	But that password stayed there and that gives you root access to the machine.
285830	289290	So it is very important to make sure we close our ports.
289350	296110	And we also use security in depth by creating that identity perimeter to lock down those VMs.
296730	302050	So the next thing is weak SSH cryptographic defaults.
303010	308170	So in here we have the kind of like Mozilla scoring and it gives it a D.
308170	313130	And the reason for it is, as I said in the title, cloud defaults are made to be easy.
313130	314710	So we have password enabled.
314790	322370	We have a bunch of key exchange algorithms that are kind of obsolete, but they leave them open.
322370	329970	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.
329970	334750	Like I can't SSH into my Azure machine to then learn that they're running Windows XP.
335030	338810	So they prefer kind of like opening it up, being a little less secure.
338870	345790	And people that are conscious about this disable these algorithms to be more secure.
346330	351050	And we observe the same with TLS cryptographic defaults in the web applications.
351270	356850	So if you run an Azure web application and you just open TLS 1.2, you might think like, all right, we're good.
357110	358090	We close 1.1.
358090	359950	We close 1.0.
360170	361390	We're only using 1.2.
361390	372350	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.
372350	374310	And those ones are enabled for the same reason.
374310	380430	If you have a Windows 7 or 8 computer, they wouldn't be able to do the secure one.
380430	388310	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.
388590	403010	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.
403010	408530	So it is actually the best way to kind of like protect your application while also optimizing it.
408530	415350	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.
416470	419170	So now we're going to do a second video.
419770	431830	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.
432510	438710	So I'm going to use my Coding Flamingo, which is my YouTube channel, and I'm just going to create Defcon C name.
438710	444850	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.
450530	454610	So in here, I just have to type Defcon.CodingFlamingo.com,
457880	460840	and it's going to validate that it's pointing to the host name.
461520	463120	And now I can add it.
463140	468520	And the cool thing about Azure and cloud is that it can also create a TLS certificate for me.
468520	469940	So I don't have to worry about TLS.
469940	471860	I don't have to worry about rotating it.
473340	478560	All I have to do is create an app service managed certificate, select the domain I want.
478560	482100	It's going to check that it's pointing there and it's going to create it.
482360	493200	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.
494920	502840	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.
502840	505660	And as you can see, it actually has a certificate in there.
512970	515990	And now I'm just going to go and delete the application.
525360	527960	And so here I went and deleted the application.
528480	536940	And here I actually ask once again to the people in the audience, what was the problem with this video?
537320	546320	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.
546320	548980	They just checked that you were pointing at it.
548980	552500	And I was like, yep, you kind of ruined it because you did it too quickly.
552500	554440	And I thought it was going to take a little bit while.
554500	558620	I still owe that guy a drink, but yeah, that's basically what happened.
558660	566800	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.
566800	574220	That's how the CNAME works and the actual DNS and all Azure was verifying is that this is pointing to this.
574540	579480	But as I deleted it, there was no warning or anything of like, hey, this is still pointing to this.
580580	589400	And so anybody else can go create Defcon.2.azurewebsites.com, register that domain and impersonate CodingFlamingo.com.
589820	598820	And we actually when we found this, we actually searched and we found over 35,000 domains that had that problem.
598820	603520	So the problem with this, you might be thinking like, well, like, what can I do with that?
603680	605360	First of all, you can take over the domain.
605360	614740	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.
615160	620940	And the best part out of it is since it's using the same domain, so like, you know, computers read right to left.
620940	622520	So it's still using CodingFlamingo.com.
622520	624420	It doesn't matter what this subdomain is.
624700	627640	Password managers will actually say like, oh, this is a legit domain.
627640	629720	Let me put the password in.
629720	633360	So if you have a password field, it will automatically fill it up.
633440	637500	And if the attackers are smart, they can take the credential even if you don't click submit.
637500	642760	So by just opening it, which if you're a trained user, you would still open it because it's a real domain.
642760	644580	It's CodingFlamingo.com.
644880	648520	Your credentials will be automatically entered and stolen.
648520	654620	So it is kind of the goldmine for phishing and even your best trained users would fall for it.
654620	665860	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.
666840	671940	So those are kind of like the cloud defaults that I focused on in this talk.
673460	676140	Usually in here, I would open it for questions.
676620	681680	And if you guys have any questions, feel free to send them over on Twitter, and I'll happily respond.
681680	689240	So thank you so much for watching this video, and I hope you enjoy it and have a safe rest of the year.
