Hi, everybody. Welcome to the online version of my talk at the DEF CON Cloud Village. Cloud defaults are easy, not secure. I am Igal Flegman. And I am an identity security engineer with years of experience creating identity and PKI services at Microsoft. And then after a few years, I left and cofounded KETOS, where we create identity and PKI solutions for customers. And my Twitter is igal underscore FS. So if you have any questions, feel free to send them my way that way. So we're going to start the talk with a quick video of me creating a VM in Azure. 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. So as you can see, Azure enabled me to create a VM in a few seconds. However, there were two big misconfigurations there. And I'm just going to talk a little bit about all the things we're going to talk. And in the Vegas talk, I was able to ask the people what they thought the things were. 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. So we're going to talk about default passwords and open ports. If you guessed default password and open port for what were my misconfigurations, you got them correct. And I'm going to jump into details in a few minutes. And then there's insecure cryptographic defaults, as well as subdomain takeover. So let's get jump into it with default passwords. So default passwords is something that is kind of getting fixed and hopefully will be fully fixed in a few months. This one actually used to drive me crazy, finally got fixed. 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. Now that's fixed and you can only use Azure Active Directory, which congrats on fixing. And however, VMs are still not there. So for VMs, you still have to create a default password or a default SSH key. You can use the same for all your VMs, kind of like making it a got a key for all your VMs. You can start using AD auth. It's still sometimes in preview. They pull it out of preview and so on, but it's getting there. And hopefully there's going to be a point where you can just create a VM and not have a local credential. So we're getting there. And then open ports. So as you saw in the video, the port was default to be open. So I didn't have to select anything. I actually would have to have gone into networking and make it to close that port. And there was a quick warning saying like, hey, your port is open. 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. Like whatever. Or I'll say, hey, I'll close it later. That's future me problem. Then forget and leave it open. And it could be solved really easy. It could be solved by either defaulting to your current IP address or even better using Azure networking JIT. So this is something I asked in Vegas. And I was like, does anybody know what Azure networking JIT is? And only one person, the whole audience, knew that it is a solution that creates just-in-time access in the network. So basically your RDP port is always closed. You go to Azure. You request access for let's say 20 minutes. And it will open your RDP port just to your IP address. 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. You put those two together, default passwords and open ports, and it's a disaster . 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. And I like saying that if your password is one in a million, they're going to break in twice a year. And unfortunately, we have seen that with a lot of companies that leave ports open or there's a network misconfiguration. 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. But that password stayed there and that gives you root access to the machine. So it is very important to make sure we close our ports. And we also use security in depth by creating that identity perimeter to lock down those VMs. So the next thing is weak SSH cryptographic defaults. So in here we have the kind of like Mozilla scoring and it gives it a D. And the reason for it is, as I said in the title, cloud defaults are made to be easy. So we have password enabled. We have a bunch of key exchange algorithms that are kind of obsolete, but they leave them open. 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. Like I can't SSH into my Azure machine to then learn that they're running Windows XP. So they prefer kind of like opening it up, being a little less secure. And people that are conscious about this disable these algorithms to be more secure. And we observe the same with TLS cryptographic defaults in the web applications. So if you run an Azure web application and you just open TLS 1.2, you might think like, all right, we're good. We close 1.1. We close 1.0. We're only using 1.2. 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. And those ones are enabled for the same reason. If you have a Windows 7 or 8 computer, they wouldn't be able to do the secure one. 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. 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. So it is actually the best way to kind of like protect your application while also optimizing it. 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. So now we're going to do a second video. 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. So I'm going to use my Coding Flamingo, which is my YouTube channel, and I'm just going to create Defcon C name. 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. So in here, I just have to type Defcon.CodingFlamingo.com, and it's going to validate that it's pointing to the host name. And now I can add it. And the cool thing about Azure and cloud is that it can also create a TLS certificate for me. So I don't have to worry about TLS. I don't have to worry about rotating it. All I have to do is create an app service managed certificate, select the domain I want. It's going to check that it's pointing there and it's going to create it. 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. 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. And as you can see, it actually has a certificate in there. And now I'm just going to go and delete the application. And so here I went and deleted the application. And here I actually ask once again to the people in the audience, what was the problem with this video? 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. They just checked that you were pointing at it. And I was like, yep, you kind of ruined it because you did it too quickly. And I thought it was going to take a little bit while. I still owe that guy a drink, but yeah, that's basically what happened. 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. That's how the CNAME works and the actual DNS and all Azure was verifying is that this is pointing to this. But as I deleted it, there was no warning or anything of like, hey, this is still pointing to this. And so anybody else can go create Defcon.2.azurewebsites.com, register that domain and impersonate CodingFlamingo.com. And we actually when we found this, we actually searched and we found over 35,000 domains that had that problem. So the problem with this, you might be thinking like, well, like, what can I do with that? First of all, you can take over the domain. 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. And the best part out of it is since it's using the same domain, so like, you know, computers read right to left. So it's still using CodingFlamingo.com. It doesn't matter what this subdomain is. Password managers will actually say like, oh, this is a legit domain. Let me put the password in. So if you have a password field, it will automatically fill it up. And if the attackers are smart, they can take the credential even if you don't click submit. So by just opening it, which if you're a trained user, you would still open it because it's a real domain. It's CodingFlamingo.com. Your credentials will be automatically entered and stolen. So it is kind of the goldmine for phishing and even your best trained users would fall for it. 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. So those are kind of like the cloud defaults that I focused on in this talk. Usually in here, I would open it for questions. And if you guys have any questions, feel free to send them over on Twitter, and I'll happily respond. So thank you so much for watching this video, and I hope you enjoy it and have a safe rest of the year.