1 00:00:00,000 --> 00:00:04,920 To start our day, we've got a good friend of the Cloud Village speaking, Jenko Hong. 2 00:00:04,920 --> 00:00:11,400 Jenko is a principal researcher on Netscope's threat research team, focusing on cloud threats and identity abuse. 3 00:00:11,400 --> 00:00:20,960 In this talk, Jenko is going to cover research and tooling to improve cloud defenses in AWS, Azure, and GCP, using more stealthy measures which complement existing techniques. 4 00:00:20,960 --> 00:00:25,160 The title of the talk is Cloud Tripwires Fighting Stealth with Stealth. 5 00:00:25,160 --> 00:00:27,840 Everyone please give a warm welcome to Jenko. 6 00:00:29,140 --> 00:00:30,540 Thank you, Mike. 7 00:00:30,540 --> 00:00:34,900 And thank you, everyone, for coming Sunday morning. 8 00:00:35,080 --> 00:00:38,160 You look as tired as I feel. 9 00:00:38,360 --> 00:00:39,680 So thanks. 10 00:00:39,680 --> 00:00:41,480 Hope your con is going well. 11 00:00:42,700 --> 00:00:50,620 So as you might gather from the title, I'm talking about something a little less common, maybe a little less popular. 12 00:00:50,660 --> 00:00:51,780 Defense! 13 00:00:51,860 --> 00:00:53,980 Yeah, I've got my blue hat on. 14 00:00:54,060 --> 00:00:54,840 That's right. 15 00:00:54,840 --> 00:01:04,980 So we spend so much energy, and it's good energy, at DEF CON talking about research on the attack side, the red side. 16 00:01:04,980 --> 00:01:09,160 And ultimately, that helps us in the security community improve things, right? 17 00:01:09,160 --> 00:01:14,640 The vendors are a little bit slower than we'd like, but they ultimately do listen. 18 00:01:14,680 --> 00:01:24,980 So I'd like to sort of switch our brainpower, if you're willing, to the defense side, because I don't think we spend nearly as much time there. 19 00:01:25,380 --> 00:01:26,560 And we really need it. 20 00:01:26,560 --> 00:01:28,540 So I'm going to go through a few things. 21 00:01:28,540 --> 00:01:34,340 And I'm going to start with a demo, which I translated to screenshots just because of time constraints. 22 00:01:34,380 --> 00:01:39,480 And it's about a technique that is several years old. 23 00:01:39,480 --> 00:01:45,100 And if you're into Azure and Microsoft, and you don't know about Dr. 24 00:01:45,100 --> 00:01:46,900 Azure AD and Dr. 25 00:01:47,040 --> 00:01:49,580 Cinema, he's awesome. 26 00:01:49,580 --> 00:01:50,740 You should follow him. 27 00:01:50,740 --> 00:01:53,700 A lot of research has spawned off of that. 28 00:01:53,740 --> 00:01:59,020 His blog is sort of down because he's joined Microsoft from SecureWorks. 29 00:01:59,020 --> 00:02:15,740 But this is sort of an ode to something he published three and a half years ago, which is Microsoft's device code flow implementation being highly susceptible to phishing, as well as carry on lateral movement and privilege escalation. 30 00:02:15,740 --> 00:02:19,940 So I've got screenshots from a demo, and I'll talk you through it. 31 00:02:20,220 --> 00:02:25,480 And I basically want to point out how advanced and moving the research is. 32 00:02:25,480 --> 00:02:28,540 And even if it's three and a half years old, this is highly relevant. 33 00:02:28,540 --> 00:02:30,500 Not enough time is spent on this. 34 00:02:30,500 --> 00:02:35,100 So on the left, imagine you have a regular Microsoft user logging in. 35 00:02:35,100 --> 00:02:37,900 This is one of my throwaway accounts. 36 00:02:37,900 --> 00:02:39,760 And it actually has MFA on it. 37 00:02:39,760 --> 00:02:43,460 It's actually a global admin in Azure. 38 00:02:43,520 --> 00:02:49,960 It is cached, so I don't go through the MFA process, but normally I would. 39 00:02:50,000 --> 00:02:51,060 And I pop into Outlook. 40 00:02:51,060 --> 00:02:52,220 So nothing surprising there. 41 00:02:52,220 --> 00:02:59,140 On the right is the attacker executing device code flow in OAuth. 42 00:02:59,580 --> 00:03:03,920 Now, you may have to look at the slides to actually see it. 43 00:03:03,920 --> 00:03:06,460 I'll talk through the important points. 44 00:03:06,460 --> 00:03:09,340 Device code flow is really easy to execute. 45 00:03:09,340 --> 00:03:19,200 This is payload of invoke rest method in PowerShell, which is as close to raw curl with post get that you can get. 46 00:03:19,200 --> 00:03:24,040 There are two attributes supplied to kick this off as an attacker, right? 47 00:03:24,040 --> 00:03:26,980 A valid application obviously would do the same. 48 00:03:27,060 --> 00:03:32,080 One is the resource, which in Microsoft land is the API being requested, API. 49 00:03:32,080 --> 00:03:40,180 The client ID in OAuth terms is the application client ID when you as a developer of an OAuth app register it in your tenant. 50 00:03:40,180 --> 00:03:41,540 You get a unique ID. 51 00:03:41,540 --> 00:03:42,800 I have two things. 52 00:03:42,800 --> 00:03:52,120 These are sitting in a loop querying Microsoft saying as soon as that user logs in, give me the OAuth tokens as soon as they approve. 53 00:03:52,320 --> 00:03:58,500 So popping on the left is the phishing email. 54 00:03:58,640 --> 00:04:02,660 I want you to just appreciate my HTML capabilities. 55 00:04:02,660 --> 00:04:06,620 So this is an Office 365 phish for extra storage. 56 00:04:06,620 --> 00:04:14,440 Promo code, which is the user code I got as an attacker from Microsoft, from the device code flow. 57 00:04:14,440 --> 00:04:17,160 That's the official Microsoft device code login. 58 00:04:17,160 --> 00:04:18,480 There's nothing funny there. 59 00:04:18,480 --> 00:04:22,380 This is exactly what you would see in any device code phish. 60 00:04:22,380 --> 00:04:25,780 So if the user follows it, they pop in the code I sent. 61 00:04:25,780 --> 00:04:28,020 They go through normal login. 62 00:04:28,020 --> 00:04:32,180 It's cached, but again, normally this would be an MFA login, right? 63 00:04:32,180 --> 00:04:35,600 So one of the things we'll get is bypass of MFA. 64 00:04:35,600 --> 00:04:38,540 We're going to have the user put in their one-time code. 65 00:04:38,540 --> 00:04:39,720 We don't have to intercept it. 66 00:04:39,720 --> 00:04:41,160 We don't have to do whatever. 67 00:04:41,220 --> 00:04:44,020 It's a one technique to bypass MFA. 68 00:04:44,560 --> 00:04:47,040 I want you to focus on this endgame. 69 00:04:47,040 --> 00:04:48,900 This is all the user sees. 70 00:04:49,140 --> 00:04:51,140 Are you trying to sign into Microsoft Office? 71 00:04:51,140 --> 00:04:52,480 Why does that text appear? 72 00:04:52,480 --> 00:04:54,480 Because I use the client ID. 73 00:04:54,480 --> 00:05:00,460 If I'd use my own ID, some app I created, I pick a name when I develop it and register it. 74 00:05:00,460 --> 00:05:02,740 And I can't choose Microsoft Office. 75 00:05:02,740 --> 00:05:05,960 They prevent you from doing common derivatives of their own products. 76 00:05:05,960 --> 00:05:07,980 But I chose their app ID. 77 00:05:07,980 --> 00:05:08,800 So great. 78 00:05:08,800 --> 00:05:12,760 This looks all official to the user, right? 79 00:05:12,780 --> 00:05:16,100 No reason not to trust it once you get to this process. 80 00:05:16,100 --> 00:05:17,260 The domain is Microsoft. 81 00:05:17,260 --> 00:05:19,400 Nothing funny there, right? 82 00:05:19,960 --> 00:05:21,780 What does the attacker see? 83 00:05:21,960 --> 00:05:26,160 So finally, after you set next on the left, you just get a simple confirmation. 84 00:05:26,160 --> 00:05:26,340 Good. 85 00:05:26,340 --> 00:05:27,100 You're done. 86 00:05:27,340 --> 00:05:28,700 What's the attacker see? 87 00:05:28,700 --> 00:05:34,200 Well, they return from that polling call and they get an OAuth token right there on the bottom. 88 00:05:34,200 --> 00:05:35,180 Access token. 89 00:05:35,180 --> 00:05:37,960 They also get scopes, which is part of OAuth. 90 00:05:37,960 --> 00:05:43,380 I want to point out that at no point to this up till now did the attacker have to specify scopes. 91 00:05:43,380 --> 00:05:48,180 In normal OAuth world, you specify scopes as an application. 92 00:05:48,180 --> 00:05:52,420 You are going to ask the user for their permissions for the such and such. 93 00:05:52,420 --> 00:05:55,760 These are directory scopes, graph API scopes. 94 00:05:55,760 --> 00:05:58,640 Microsoft decided to implement default scopes. 95 00:05:58,720 --> 00:05:59,800 That's stupid. 96 00:05:59,800 --> 00:06:02,240 That's not really common or part of OAuth. 97 00:06:02,240 --> 00:06:03,480 But they did it. 98 00:06:04,400 --> 00:06:07,600 I also get a refresh token, which is part of OAuth. 99 00:06:07,600 --> 00:06:13,400 The dirty secret is, everyone says temporary token systems are more secure because they're temporary. 100 00:06:13,400 --> 00:06:17,540 Yet we have a refresh token that for all intents and purposes is permanent. 101 00:06:17,540 --> 00:06:21,480 Yes, you can revoke it on the user side. 102 00:06:21,480 --> 00:06:34,700 But if you don't, if you use it like every four months, it just says fresh and you will have permanent access because, of course, third-party apps like your email client or something needs to continue to get email without having you re-log in. 103 00:06:35,300 --> 00:06:38,460 Back on the user side, they do have an Azure account. 104 00:06:38,460 --> 00:06:39,560 They happen to be global admin. 105 00:06:39,560 --> 00:06:40,780 Here's some resources. 106 00:06:41,220 --> 00:06:47,120 What the attacker is going to do with this graph API token is, of course, do graph calls. 107 00:06:47,120 --> 00:06:50,820 They will get the users out of AD because that's a Microsoft thing. 108 00:06:50,820 --> 00:06:53,520 You can enumerate users very easily. 109 00:06:53,860 --> 00:06:56,580 They will get email as well. 110 00:06:56,580 --> 00:06:58,340 Another graph API piece. 111 00:06:58,340 --> 00:07:01,960 Now, here's the kicker with this technique. 112 00:07:02,000 --> 00:07:04,440 Microsoft implemented a really bad thing. 113 00:07:04,440 --> 00:07:13,400 In OAuth land, you don't get to switch your permissions once you have a token without going back to the user to ask them for new permissions. 114 00:07:13,480 --> 00:07:22,620 This case, the attacker faking or impersonating Outlook asked for graph API and whatever scopes there were. 115 00:07:22,840 --> 00:07:32,840 Now, they're going to use the refresh token because Microsoft allows them to get a token, a new token with Azure access, which is what's highlighted there. 116 00:07:33,120 --> 00:07:40,100 That breaks the OAuth model and there's a reason why Microsoft did that besides being stupid. 117 00:07:40,100 --> 00:07:41,960 It's for SSO reasons. 118 00:07:42,600 --> 00:07:45,940 They're using OAuth for SSO, which is also stupid. 119 00:07:45,940 --> 00:07:50,520 Don't use authorization protocols for authentication, but they did it. 120 00:07:50,760 --> 00:07:55,800 So, because as an attacker, they're continuing on their flow, they've got a new token. 121 00:07:55,800 --> 00:07:59,560 It's Azure management API enabled. 122 00:07:59,560 --> 00:08:01,660 They can now enumerate all resources. 123 00:08:01,860 --> 00:08:03,380 Okay, it's the user's permissions. 124 00:08:03,380 --> 00:08:05,460 This case is global admin, so it's everything. 125 00:08:05,460 --> 00:08:06,480 Okay, great. 126 00:08:06,480 --> 00:08:10,380 We just went through this flow as a user and attacker. 127 00:08:10,400 --> 00:08:21,060 It's fairly complicated, but I want to point out that normally, if this weren't an attack, there's a step one, which is the user installs an app and then they're expecting all of this prompting. 128 00:08:21,060 --> 00:08:23,080 Well, we convert it to a phish. 129 00:08:23,080 --> 00:08:26,080 The attacker starts with step two. 130 00:08:26,080 --> 00:08:27,780 They're fully in control. 131 00:08:27,800 --> 00:08:34,280 And again, the client ID is not even something they had to create that traces back to them in the logs. 132 00:08:34,280 --> 00:08:37,980 It is Microsoft Office client ID. 133 00:08:38,680 --> 00:08:54,100 The other piece at the tail end was we switched permissions and did a lateral move, which could also call privilege escalation by trading our token, refreshing, and getting Azure management resource permissions. 134 00:08:55,120 --> 00:09:09,940 From a logging perspective, when you look at the logs, when the attacker script actually gets the first token that is logged, yay, when they refresh and pivot to Azure, it is not logged. 135 00:09:09,940 --> 00:09:17,700 You might guess that developers didn't want to busy up the logs with a refresh, which might have to happen like every hour. 136 00:09:17,700 --> 00:09:18,600 Who knows why? 137 00:09:18,600 --> 00:09:22,460 It's dumb because you're not seeing the lateral movement. 138 00:09:23,740 --> 00:09:30,060 The details of the actual log are what you get in the sign-in logs. 139 00:09:30,060 --> 00:09:30,880 It's not bad. 140 00:09:30,880 --> 00:09:35,020 It means you have a chance to mitigate this with conditional access policies. 141 00:09:35,020 --> 00:09:37,900 That is the recommended way to do it. 142 00:09:38,940 --> 00:09:41,760 Conditional access policies are a bit of a Swiss cheese thing. 143 00:09:41,760 --> 00:09:42,720 They are imperfect. 144 00:09:42,720 --> 00:09:46,780 If you do research, you'll find that there are ways still to bypass it. 145 00:09:46,780 --> 00:09:49,160 Knowing this, Microsoft didn't stand still. 146 00:09:49,160 --> 00:09:52,020 They added device code as an attribute. 147 00:09:52,020 --> 00:09:54,300 You can put that in conditional access policies. 148 00:09:54,300 --> 00:09:57,160 You can prevent all apps from using device code. 149 00:09:57,160 --> 00:10:02,180 That's not a bad idea, other than the fact that Azure CLI uses device code. 150 00:10:02,180 --> 00:10:05,620 So you're going to have to be creative to actually get the right policy. 151 00:10:05,620 --> 00:10:12,040 Second, there's an enumeration, a static list that they keep adding to of apps. 152 00:10:12,040 --> 00:10:16,560 Microsoft Office, the actual app ID I picked, is not in that list. 153 00:10:17,020 --> 00:10:28,600 It just means fine-grained control of conditional access policies with this app that I impersonated is still very, very tricky to get right, even if you know all of this. 154 00:10:28,800 --> 00:10:30,140 So there we have it. 155 00:10:30,140 --> 00:10:36,600 A three-and-a-half-year-old attack that is still popular, not well educated. 156 00:10:36,600 --> 00:10:44,560 So when we look at the big picture, let's just go to Microsoft, since we're bashing them a bit, and look at their unfortunate incidents. 157 00:10:44,560 --> 00:10:50,720 So we have Blizzard from March, a favorite nation-state, maybe along with China, Russian hackers. 158 00:10:50,720 --> 00:10:53,140 I'm sure you all have reviewed it. 159 00:10:53,140 --> 00:11:07,880 Some techniques are old, like password spraying, exchange or email as a target, proxies with a little twist of residential, and then OAuth apps coming more and more common if you've been reading the news. 160 00:11:07,880 --> 00:11:19,860 In there, maintain access, persistence, elevated access, privilege escalation, being a little clever, using a legacy app to create a new user account, and then bless another app, right? 161 00:11:19,860 --> 00:11:22,140 Leave your, you know, a little creativity. 162 00:11:22,960 --> 00:11:25,420 Let's switch to Storm last summer. 163 00:11:25,420 --> 00:11:28,340 Let's switch nation-state actors to China. 164 00:11:28,980 --> 00:11:43,140 Now we're going through a common attack vector of email again, but it's more complicated because underneath we have MSA tokens from the consumer side of email, and somehow there's a bug that allows that to sort of switch over to corporate email. 165 00:11:43,860 --> 00:11:47,900 At the end, I'm not here to say Microsoft's bad. 166 00:11:47,900 --> 00:11:49,700 They've got smart people. 167 00:11:49,800 --> 00:11:52,060 They've got legacy code and a big installed base. 168 00:11:52,060 --> 00:11:52,980 Defense is hard. 169 00:11:52,980 --> 00:12:06,200 When you look through Storm's techniques, anyone who's read, and I applaud Microsoft for disclosing their process, but if you read it closely, Microsoft got confused in their own analysis. 170 00:12:06,200 --> 00:12:12,060 They'd be like, oh, we think it's a race condition, and we think there's a crash dump, but we don't actually have that evidence. 171 00:12:12,160 --> 00:12:16,640 But it seems that, you know, out of code review, it seems very, very plausible. 172 00:12:16,680 --> 00:12:25,680 So steps one, two, three, four, five, it looks like a perfect storm that allowed this to, pun I guess intended, to actually happen. 173 00:12:25,680 --> 00:12:34,620 Obviously a very sophisticated APT-level nation-state actor, but the point is defense is hard, even for the best who have money and expertise. 174 00:12:35,060 --> 00:12:41,820 All this to say, before we talk about defense, the question is why do we even have to talk about new defense? 175 00:12:41,860 --> 00:12:46,420 Because attackers are winning, and we know which side of the field they're on, right? 176 00:12:46,780 --> 00:12:51,480 And it's not just buzzwords and headlines, which is easy to paint a story. 177 00:12:52,120 --> 00:13:06,740 What I appreciate about DEF CON is you meet some of the greatest researchers sharing their work, and here's just a smattering from the last couple years that I've just jotted down and are somewhat related to things I think about. 178 00:13:06,760 --> 00:13:10,180 Every year, there's another 20 of these. 179 00:13:10,180 --> 00:13:12,040 So enumeration without logging. 180 00:13:12,040 --> 00:13:20,020 I think Nick Frechette, big fan of his, he spoke last year, he spoke in that black hat, he spoke, he's speaking after me. 181 00:13:20,060 --> 00:13:25,020 AWS enumeration without logging and other sophisticated techniques. 182 00:13:25,020 --> 00:13:27,200 Obviously, we know about Rhino Labs. 183 00:13:27,200 --> 00:13:34,120 There's classic techniques, though, still sitting around to enumerate SharePoint URLs without authentication, right? 184 00:13:34,120 --> 00:13:39,960 Enumeration is tough to stop, even if the vendor plugs a hole. 185 00:13:39,960 --> 00:13:47,760 There's access and persistence in unmanaged, or at least less commonly thought of, full-blown virtual machine environments. 186 00:13:47,760 --> 00:13:48,220 Guess what? 187 00:13:48,220 --> 00:13:49,780 Cloud Shell runs in a VM. 188 00:13:49,780 --> 00:13:50,160 Guess what? 189 00:13:50,160 --> 00:13:52,960 The protections there are pretty low. 190 00:13:52,960 --> 00:13:54,140 Guess what? 191 00:13:54,500 --> 00:13:58,700 They want to push it for free to everyone because it's really easy. 192 00:13:58,700 --> 00:14:02,500 Pre-configured environment with a CLI set up and full access. 193 00:14:02,620 --> 00:14:11,860 So open ports have been spoken about by my colleague Hubert Lin at this DEF CON of how you can abuse that to get access to a whole bunch of services. 194 00:14:12,120 --> 00:14:19,660 We just went over number three a couple years ago, Matthew Bryant, server-side scripting in Google Apps. 195 00:14:19,660 --> 00:14:23,960 I didn't know that existed until he talked about that with loose permissioning, right? 196 00:14:23,960 --> 00:14:34,820 As if Microsoft didn't tell the world and Adobe that embedding scripting code and documents was a bad idea, Google had to go copy them and say, no, we're going to put it in the server. 197 00:14:34,820 --> 00:14:37,560 An ability to open a doc and execute code. 198 00:14:37,560 --> 00:14:39,600 What could go wrong, right? 199 00:14:40,720 --> 00:14:43,580 Five, service principles at this DEF CON. 200 00:14:43,580 --> 00:14:45,860 I loved Cloud Village talks. 201 00:14:45,860 --> 00:14:58,080 There were at least three, four people that I listed that were diving into Azure service principles, managed identities, enterprise apps, app registrations, cross-tenant access, and the admin roles. 202 00:14:58,120 --> 00:15:00,700 And there is so much there to mine. 203 00:15:00,700 --> 00:15:04,080 We're just scratching the surface of abuse there, right? 204 00:15:04,080 --> 00:15:08,040 It's being talked about a lot more, and a lot more is coming from that. 205 00:15:08,040 --> 00:15:27,260 And then, Asterix a couple years ago had a GCP attack where they used the temporary deletion of a project for 30 days to hide stuff, because once you deleted it, it disappeared from APIs and portal views, and in there was an OAuth app, so it's a persistence move. 206 00:15:27,260 --> 00:15:37,080 You need access, set it up, you undelete the project, you use the app for whatever privilege escalation, you delete it again, just make sure you come back in 30 days. 207 00:15:37,100 --> 00:15:51,160 And so, as I'm working this year's CTF a little bit, creating a challenge, Azure has a similar temporary delete status folder for Azure objects, including service principles, right? 208 00:15:51,160 --> 00:15:55,520 So, ability to hide code and privilege really easily, right? 209 00:15:55,520 --> 00:15:58,880 So, this is just off the top of my head. 210 00:15:58,880 --> 00:16:04,860 The point is, attackers are winning, they're smart, even our research shows that, right? 211 00:16:04,860 --> 00:16:06,460 Our greatest minds. 212 00:16:06,460 --> 00:16:26,380 So, you can feel like you're going to a gunfight , but the attacker is the one who has the gun, and you're walking uphill, they change the rules, the asymmetry, and what I mean by that is every dollar and every hour they spend causes like an order of magnitude on the defensive side. 213 00:16:26,880 --> 00:16:31,300 They have stealth, almost by the get-go and default. 214 00:16:31,540 --> 00:16:38,920 They take advantage of every single ability to execute code within our blue hat environments. 215 00:16:38,920 --> 00:16:54,940 That is, like, VMs, the obvious one, then there's serverless functions, then those things hiding as VMs, like Cloud Shell, or as I think Nick Frechette pointed out, VPC endpoints in AWS are just running on some kind of VM. 216 00:16:54,940 --> 00:17:04,080 OAuth apps, which is code, and privileges, and app scripting in Google, among other things, with a ton of backdoors. 217 00:17:04,080 --> 00:17:12,580 This ghost token, these OAuth apps, this code, and then, of course, they can attack the human layer, which we know is the weak link, right? 218 00:17:12,580 --> 00:17:20,500 All of this, while the defensive reality is you feel like you're fighting with a butter knife, okay? 219 00:17:21,280 --> 00:17:26,820 And unfortunately, here's where I think security, we've fallen into a rut. 220 00:17:26,820 --> 00:17:28,360 We don't challenge ourselves. 221 00:17:28,360 --> 00:17:32,520 I think security is too much done by checklist. 222 00:17:33,120 --> 00:17:34,460 You think about it. 223 00:17:34,460 --> 00:17:36,840 What's a good best practice by a vendor? 224 00:17:36,840 --> 00:17:44,280 It's a checklist of usually configuration, sometimes some detection, sometimes some remediation. 225 00:17:44,280 --> 00:17:47,800 So you feel good if that's your job, you're done with the list. 226 00:17:47,800 --> 00:17:50,760 Your boss is good, compliance will pass you. 227 00:17:50,760 --> 00:17:51,720 Are you really secure? 228 00:17:51,720 --> 00:17:53,020 We all know better. 229 00:17:53,020 --> 00:17:54,960 You have to actually think about it. 230 00:17:55,520 --> 00:18:04,160 But we don't really think about the design issues, software issues, the things that are causing havoc, like the demo screenshots. 231 00:18:04,580 --> 00:18:08,700 Is OAuth really designed well in Microsoft? 232 00:18:08,700 --> 00:18:10,080 The answer is no. 233 00:18:10,340 --> 00:18:15,760 So that should cause you a different stance rather than here's the best practice for securing Microsoft OAuth. 234 00:18:15,760 --> 00:18:18,580 Put in a conditional access policy and be done with it. 235 00:18:18,580 --> 00:18:21,340 No, you're still exposed, you know that, right? 236 00:18:21,540 --> 00:18:34,980 Staying behind the moat is this idea that it's great, we paint these analogies, the moat is our outer perimeter, then we hide behind it with a good drawbridge, we throw some alligators in the moat, we go with a high wall, put some archers on top. 237 00:18:35,300 --> 00:18:44,460 Okay, do that, but how about send some peasant spies out into the barbarian lands and do something a little more proactive? 238 00:18:44,600 --> 00:18:51,820 Because that's what the red team's doing, that's what the attackers are doing, that's what social engineering is doing, right? 239 00:18:51,820 --> 00:18:56,700 Why don't we borrow and apply the same brainpower on the blue side? 240 00:18:56,740 --> 00:19:00,540 Now, defense in depth leads to layered defenses, which is great. 241 00:19:00,540 --> 00:19:05,620 The problem is the implementation at the human level, I think, leads to isolation. 242 00:19:05,620 --> 00:19:15,760 My firewall team doesn't talk to the IPS team, which definitely doesn't talk to the malware team, much less my machine learning risk analysis sim team. 243 00:19:15,980 --> 00:19:19,860 So we've broken the problem into three discrete components. 244 00:19:19,860 --> 00:19:21,960 The attacker's like, you're a fool. 245 00:19:21,960 --> 00:19:30,960 I'll social engineer the network guy through the help desk, I'll pivot and I'll get app credentials and blah, blah, blah, and we have groups not talking to each other. 246 00:19:30,960 --> 00:19:38,160 The threat and attack vector and attack chain cuts across everything, but we're organized in layers that don't talk to each other. 247 00:19:38,160 --> 00:19:39,240 What's an example of that? 248 00:19:39,240 --> 00:19:41,840 Here's a minor one, which could be a major one. 249 00:19:41,840 --> 00:19:44,560 It shows itself in product features. 250 00:19:44,560 --> 00:19:52,320 Google Cloud has a session timeout for your cloud logins through the portal, as well as the tokens you might get. 251 00:19:52,320 --> 00:19:53,640 Good idea. 252 00:19:53,640 --> 00:19:55,800 Default sucks, but it's a good idea. 253 00:19:55,800 --> 00:19:59,120 Where is that located in API land or the portal? 254 00:19:59,120 --> 00:20:01,280 In Google Workspace. 255 00:20:01,340 --> 00:20:10,880 I get we have a common identity service, but that might be two separate groups in a large organization who don't talk to each other. 256 00:20:11,040 --> 00:20:15,460 Imagine an incident happens and you have to revoke access and force a revocation. 257 00:20:15,860 --> 00:20:21,660 Are you trusting the guy on the Google Cloud side to know where to go to set the timeout? 258 00:20:21,660 --> 00:20:26,680 Of course it's not going to happen, but this is the the world we have fallen into. 259 00:20:27,080 --> 00:20:28,040 Defenses are static. 260 00:20:28,040 --> 00:20:29,400 They don't change much. 261 00:20:29,640 --> 00:20:32,120 Same for all attackers and all environments. 262 00:20:32,120 --> 00:20:33,380 They tend to be pretty generic. 263 00:20:33,380 --> 00:20:37,240 Not completely, but we tend to be like, let's go through the checklist. 264 00:20:37,240 --> 00:20:37,720 We're done. 265 00:20:37,720 --> 00:20:38,580 Let's move on. 266 00:20:38,580 --> 00:20:40,500 And everything's in plain sight. 267 00:20:40,500 --> 00:20:42,860 So what could the future be? 268 00:20:42,860 --> 00:20:47,260 My whole premise is think more about design and less about checklists. 269 00:20:47,400 --> 00:20:49,200 Go towards the attacker. 270 00:20:49,200 --> 00:20:53,660 Yes, think in their mind and be in their shoes, but get closer to them. 271 00:20:53,660 --> 00:20:54,660 Do recon. 272 00:20:54,940 --> 00:20:56,740 Figure out how that fits. 273 00:20:57,260 --> 00:20:59,900 Cut across your organizational boundaries. 274 00:20:59,960 --> 00:21:03,540 If we're going to do stuff, we've got to start with engineering teams within organizations. 275 00:21:03,540 --> 00:21:07,220 They're developing crap and sending it through DevOps, right? 276 00:21:07,700 --> 00:21:10,960 Insecure apps are going to cause havoc on the ops side. 277 00:21:10,960 --> 00:21:13,460 And then you get to threat hunting and risk assessment. 278 00:21:13,460 --> 00:21:15,100 Everyone's got to be working together. 279 00:21:15,100 --> 00:21:20,580 Now I get this is stuff that we may not be able to control, but the advantage is I'm not trying to create a product. 280 00:21:20,580 --> 00:21:25,340 I'm trying to burn everything to the ground and rethink how would we do this better? 281 00:21:25,340 --> 00:21:27,940 And we would definitely address some of these. 282 00:21:27,940 --> 00:21:30,800 We would be dynamic and changing and make things stealthy. 283 00:21:30,800 --> 00:21:34,620 To the extent that it doesn't screw us up, we would be changing things. 284 00:21:34,620 --> 00:21:47,140 So attackers, the analogy would be change the bank vault code every day because if you get an ex-employee or a paid insider, it makes it harder for the thieves to break into your vault. 285 00:21:47,140 --> 00:21:49,720 Not perfect, I would rotate the key. 286 00:21:49,880 --> 00:21:52,080 Instead, we tend to be static, right? 287 00:21:52,080 --> 00:21:58,100 And all of this is about tailoring things to buy CSP because every CSP is different. 288 00:21:58,100 --> 00:22:01,600 AWS is different, obviously, than every other one. 289 00:22:01,600 --> 00:22:04,940 We would also tailor it to the attacker techniques. 290 00:22:04,940 --> 00:22:12,700 To the extent I can intuit attackers shifting their techniques in a fundamental way, I have to change and create new defenses. 291 00:22:13,500 --> 00:22:15,640 We do do some of that. 292 00:22:15,640 --> 00:22:17,180 It tends to just be reactive. 293 00:22:17,180 --> 00:22:19,520 Come to DEF CON, wait for someone to publish something. 294 00:22:19,520 --> 00:22:21,220 Oh, there's a CVE. 295 00:22:21,220 --> 00:22:21,580 I did. 296 00:22:21,580 --> 00:22:22,400 I mitigated it. 297 00:22:22,400 --> 00:22:23,100 Move on. 298 00:22:23,100 --> 00:22:24,840 I think we need to think more fundamentally. 299 00:22:25,940 --> 00:22:33,580 I think in the coming year will be a whole bunch of service principle attacks and related ones on Azure because that's the gold mine. 300 00:22:33,580 --> 00:22:36,200 It's complex and it's a way to escalate privileges. 301 00:22:36,200 --> 00:22:39,760 Let's get out of the curve, think about that design, put in defenses. 302 00:22:39,760 --> 00:22:41,020 Okay, enough of that. 303 00:22:41,020 --> 00:22:42,140 That's really high level. 304 00:22:42,140 --> 00:22:42,860 I get it. 305 00:22:42,860 --> 00:22:45,320 Let me tell you a story to try to make this real. 306 00:22:45,320 --> 00:22:47,120 It's an old school story. 307 00:22:47,120 --> 00:22:48,020 Unix. 308 00:22:48,180 --> 00:22:50,860 This is before Linus ate the world. 309 00:22:50,860 --> 00:22:52,260 So Solaris was still around. 310 00:22:52,260 --> 00:22:54,440 It was probably 20 years ago. 311 00:22:55,700 --> 00:23:01,480 The idea is if you have an inner sanctum kind of server, super important data. 312 00:23:01,480 --> 00:23:05,240 Maybe it's you know, Hunter Biden's real laptop. 313 00:23:05,600 --> 00:23:12,020 Maybe it's the Zelensky audio that got hidden or the video of Trump in Russia, whatever it is. 314 00:23:13,020 --> 00:23:14,920 You put in protection, right? 315 00:23:14,920 --> 00:23:15,940 Layer defenses. 316 00:23:15,940 --> 00:23:20,940 But you got to be thinking, what if someone breaches the ring zero? 317 00:23:21,000 --> 00:23:21,960 What am I going to do? 318 00:23:21,960 --> 00:23:23,160 How do I detect? 319 00:23:23,160 --> 00:23:25,500 And then how do I do? 320 00:23:25,500 --> 00:23:27,160 It's not really remediation. 321 00:23:27,160 --> 00:23:29,100 It's just save the jewels. 322 00:23:29,100 --> 00:23:32,900 How do I, you know, pull the plug, take it offline? 323 00:23:33,620 --> 00:23:37,540 So you think about, it's likely they'll be on a shell. 324 00:23:37,540 --> 00:23:42,960 Even if they have a sophisticated RCE, usually at some point the attacker is going to get shell. 325 00:23:43,440 --> 00:23:49,700 Then you think about, this is a story told by a really good CTO boss of mine. 326 00:23:49,880 --> 00:23:52,320 Then you think about the attacker, what they might do. 327 00:23:52,320 --> 00:23:56,560 Well, they're likely going to do LS in the first like two commands, right? 328 00:23:56,960 --> 00:24:01,040 And then you switch it up on the attacker. 329 00:24:01,620 --> 00:24:07,040 So instead of the real LS, you make it execute shut down now in some form. 330 00:24:07,040 --> 00:24:10,800 Now you might not do this crappy little shell script, but you get the idea. 331 00:24:10,800 --> 00:24:12,900 If you can read jokes in Unix, right? 332 00:24:12,900 --> 00:24:14,440 In bash or shell. 333 00:24:14,460 --> 00:24:20,800 The idea is you fool the attacker so that it not only detects it, it fixes the problem. 334 00:24:20,800 --> 00:24:22,100 Yes, it shuts it down. 335 00:24:22,100 --> 00:24:27,660 Someone has to probably physically or remote get into it, but just save the crown jewels. 336 00:24:28,840 --> 00:24:33,180 Now, that's all well and good, but you do have to use this, right? 337 00:24:33,180 --> 00:24:35,640 It's not just a fake trap. 338 00:24:35,640 --> 00:24:37,360 So what do the good guys do? 339 00:24:37,580 --> 00:24:38,780 They train themselves. 340 00:24:38,780 --> 00:24:42,840 Now, I know this is a little hard, but this is the true story. 341 00:24:42,840 --> 00:24:48,220 They learn how to do echo star and shell expansion as their poor man's LS. 342 00:24:48,220 --> 00:24:51,360 So for, you know, Unix guys, that's the story. 343 00:24:51,360 --> 00:24:58,200 True story, but what it represents is this idea of tripwires and this whole point. 344 00:24:58,200 --> 00:25:02,880 Can you identify choke points that are likely to be traversed by the bad guys? 345 00:25:02,880 --> 00:25:07,460 Can you create a tripwire that is stealthy that they will trip themselves? 346 00:25:07,500 --> 00:25:09,540 Three, can you create a grenade? 347 00:25:09,540 --> 00:25:23,540 And it could be something a little less than a grenade, like a video logging, whatever alert, but you get the idea, something for an action, but don't kill the good guys and don't confuse yourself. 348 00:25:23,540 --> 00:25:35,720 So in Unix land 20 years ago, this was an anecdote, but it sat in my mind for 20 years of how can we do this in the cloud? 349 00:25:35,900 --> 00:25:40,280 So I think I got about five minutes. 350 00:25:40,280 --> 00:25:42,880 So I'm going to have to get into the good stuff really quickly. 351 00:25:42,880 --> 00:25:44,240 You guys got to keep up. 352 00:25:44,240 --> 00:25:44,640 All right. 353 00:25:44,640 --> 00:25:50,460 There are some common techniques that I think we can incorporate in detection. 354 00:25:50,460 --> 00:25:57,320 The trouble with trying to stop an individual technique, as you've seen, is they're very sophisticated. 355 00:25:57,320 --> 00:25:58,320 They change. 356 00:25:58,320 --> 00:26:02,300 You stop Nick Frechette's cool, awesome enumeration technique. 357 00:26:02,300 --> 00:26:03,500 He's got another one. 358 00:26:03,500 --> 00:26:05,440 I guarantee it next year. 359 00:26:05,440 --> 00:26:06,300 He's that good. 360 00:26:06,300 --> 00:26:08,480 If you've been following him, it doesn't matter. 361 00:26:08,480 --> 00:26:13,560 Think about, you know, China, APT zero, we got smart guys. 362 00:26:13,880 --> 00:26:17,300 So instead I wanted to look at choke points. 363 00:26:17,300 --> 00:26:22,480 What do attackers, pen testers, and you guys feel free to disagree, think about it. 364 00:26:22,480 --> 00:26:25,680 What do you do once you get initial access? 365 00:26:26,020 --> 00:26:32,920 Even after you get privilege escalation, you often do more recon because you don't want to leave money on the table. 366 00:26:32,920 --> 00:26:34,060 You could. 367 00:26:34,200 --> 00:26:46,020 I'm not trying to solve every case, when you do discovery, you might, to take an AWS example, enumerate resources or security principles, right? 368 00:26:46,080 --> 00:26:48,080 What buckets are there? 369 00:26:48,200 --> 00:26:50,420 Do a list on buckets. 370 00:26:50,560 --> 00:26:52,960 And then go probe, right? 371 00:26:52,960 --> 00:27:05,840 You might be worried about being detected and think about what's in CloudTrail or not, but some of this is in CloudTrail and you're just going to be like, let me go slam into the Apple store, grab the stuff, I'll be out of here by the time they come, doesn't matter, 372 00:27:05,840 --> 00:27:06,560 right? 373 00:27:07,020 --> 00:27:07,980 Of course you will. 374 00:27:07,980 --> 00:27:09,260 What else might you do? 375 00:27:09,260 --> 00:27:20,240 You might check your own permissions, list your IM policies or equivalent, because that'll tell you what the admins granted that user. 376 00:27:20,240 --> 00:27:34,960 And there might be explicit listings of an AWS LAN generic sort of policy of, oh, I can do things like assume role, that's interesting, privilege escalation on, you know, such and such service. 377 00:27:34,960 --> 00:27:38,640 I can get and list this bucket called finance, right? 378 00:27:38,640 --> 00:27:39,820 So on and so forth. 379 00:27:39,820 --> 00:27:41,560 I might have wild cards. 380 00:27:41,560 --> 00:27:43,220 I've got stuff to work with. 381 00:27:43,220 --> 00:27:48,040 Directly try or do a little bit more discovery. 382 00:27:48,040 --> 00:27:49,500 So what's my premise? 383 00:27:49,500 --> 00:27:50,780 This is pretty common. 384 00:27:50,780 --> 00:27:54,440 Enumeration, resource access, security principle access. 385 00:27:55,520 --> 00:27:57,540 Back to tripwires. 386 00:27:57,540 --> 00:27:59,740 I'm going to set up some fake ones. 387 00:28:00,260 --> 00:28:08,760 Very enticing ones that are highly monitored, that are unlikely to be used by my good users or valid users. 388 00:28:08,760 --> 00:28:13,720 Simple enough concept, hard to implement without false positives, but it can be done. 389 00:28:13,720 --> 00:28:25,820 And my point is, if we don't start the hard thinking now, we'll just be in checklist security forever, which is good job security for everyone in the room, but not great for society at large. 390 00:28:25,900 --> 00:28:28,100 So what do I mean by that? 391 00:28:28,160 --> 00:28:35,800 I might allow finance acme.com, of course, to be a fake bucket, among others that they can enumerate. 392 00:28:35,800 --> 00:28:40,100 The real finance one is inaccessible or it's named something else. 393 00:28:40,100 --> 00:28:46,500 It's just one method among dozens I want to bring to even that playing field. 394 00:28:46,920 --> 00:28:53,060 If they assume role, I can see what roles this user is allowed to list. 395 00:28:53,060 --> 00:28:54,860 There might be the default admin. 396 00:28:56,700 --> 00:29:03,440 And so I might want to be smart about setting up fake roles that are real, but maybe with stunted permissions. 397 00:29:03,740 --> 00:29:06,020 And in explaining that, I want to point to tools. 398 00:29:12,880 --> 00:29:20,720 I will use a very nice, sophisticated technique to check if it can assume it and it's not logged. 399 00:29:21,540 --> 00:29:26,980 Well, if this is a popular tool, I'm not just going to get the benefit as a red teamer. 400 00:29:26,980 --> 00:29:29,540 I'm going to set up some fake ones based on this. 401 00:29:29,540 --> 00:29:37,840 Yes, admin I can get to on my own, but how about, I don't know why they have Aaron in there, but API gateway and AWS, I don't use this in my org. 402 00:29:37,840 --> 00:29:42,120 I'm going to set up some fake ones with restricted permissions, monitor the hell out of it. 403 00:29:42,120 --> 00:29:48,000 And my valid users shouldn't be running Paku internally. 404 00:29:48,160 --> 00:29:53,140 And so I'm thinking ahead, maybe this gives me low false positives. 405 00:29:53,140 --> 00:30:02,380 Someone who hits a account or Abram, as an example, might be a high true positive detection that I can act on. 406 00:30:02,380 --> 00:30:04,960 And it's just a tripwire that I've set up. 407 00:30:04,960 --> 00:30:06,460 Be tool specific. 408 00:30:06,680 --> 00:30:07,580 It's dumb. 409 00:30:07,580 --> 00:30:10,480 Why would I set up defenses ignoring all the tools? 410 00:30:10,480 --> 00:30:13,100 So the dictionary lists are a big one. 411 00:30:13,100 --> 00:30:17,300 Let's shift gears to compute, which is highly open-ended. 412 00:30:17,300 --> 00:30:22,100 This brings us into the old world that the fully open ports run any code. 413 00:30:22,100 --> 00:30:22,960 It's a nightmare, right? 414 00:30:22,960 --> 00:30:24,760 But of course it has to be provided. 415 00:30:24,880 --> 00:30:29,060 Netflix security team does awesome work and this is years old. 416 00:30:29,080 --> 00:30:31,840 And of course they have the resources to know how to implement this. 417 00:30:31,840 --> 00:30:33,980 So it's sort of guidance with a little bit of code. 418 00:30:34,220 --> 00:30:37,120 They took the normal process. 419 00:30:37,120 --> 00:30:39,480 This is a big attack vector. 420 00:30:39,480 --> 00:30:46,360 Grab the credentials of the EC2 instance if you can get on it or hit the metadata service, right? 421 00:30:46,360 --> 00:30:54,100 So normally application will hit that locally on the server and grab credentials and have it returned to them. 422 00:30:54,120 --> 00:30:59,600 But what Netflix did is said, uh-uh, I want to IP restrict that credential. 423 00:30:59,600 --> 00:31:04,580 So if it's used off board, I detect it or it won't work or I can monitor it. 424 00:31:04,580 --> 00:31:07,700 So instead they did some sophisticated things. 425 00:31:07,700 --> 00:31:11,320 They set up their own proxy, reworked IP tables. 426 00:31:11,360 --> 00:31:15,900 So any request to the metadata service hit their proxy right there in white. 427 00:31:16,520 --> 00:31:20,840 At boot up time, that proxy got the IP address of the EC2 instance. 428 00:31:20,840 --> 00:31:21,460 It did. 429 00:31:21,460 --> 00:31:23,360 They did something really clever. 430 00:31:23,400 --> 00:31:24,680 They assumed role. 431 00:31:24,680 --> 00:31:28,720 They set it up so they could assume the role of the EC2 instance in step three. 432 00:31:28,780 --> 00:31:30,080 They can wrap. 433 00:31:30,080 --> 00:31:36,000 When you do that, you can optionally set a policy when you assume a role and get those credentials back. 434 00:31:36,000 --> 00:31:40,540 So they've set an IP policy like this in red. 435 00:31:40,540 --> 00:31:42,500 And that IP is the EC2 instance. 436 00:31:42,500 --> 00:31:50,420 They effectively are getting temporary tokens that they created that are bound to the IP address. 437 00:31:50,520 --> 00:31:52,400 And they can do whatever they want with it. 438 00:31:52,400 --> 00:31:55,260 It can be a straight out deny, right? 439 00:31:55,480 --> 00:31:56,940 Very clever. 440 00:31:56,940 --> 00:31:58,260 Takes some work. 441 00:31:58,260 --> 00:31:59,740 Very clever. 442 00:32:00,120 --> 00:32:05,460 And it's doing to, it's going to mitigate breaching and compromise of your EC2 instance. 443 00:32:05,460 --> 00:32:09,840 I want to take that idea and be a little more subtle. 444 00:32:09,840 --> 00:32:11,240 I may not want to stop it. 445 00:32:11,240 --> 00:32:13,580 I just may want to log it, right? 446 00:32:13,580 --> 00:32:18,400 I know my policies and procedures are to do certain things, never go off board. 447 00:32:18,400 --> 00:32:25,740 But if someone steals it, I might want to just record their IP address and do something else with it and not just outright block them, right? 448 00:32:25,740 --> 00:32:27,780 I'm thinking defense and detection. 449 00:32:27,780 --> 00:32:32,120 I might want to give them some fishing line, let them do it. 450 00:32:32,120 --> 00:32:33,460 Or I might want to block them. 451 00:32:33,460 --> 00:32:37,280 My point is, we got to think about prevention in a new way. 452 00:32:37,280 --> 00:32:42,840 If you prevent something, I don't want you to drop that deny block on the floor. 453 00:32:42,840 --> 00:32:44,380 Think about firewalls. 454 00:32:44,380 --> 00:32:46,360 Gets really noisy on the perimeter. 455 00:32:46,460 --> 00:32:48,080 Denies usually are not logged. 456 00:32:48,080 --> 00:32:50,220 Because of that, they get dropped on the floor. 457 00:32:50,220 --> 00:32:53,760 They're also false positive land, like a Tor exit node. 458 00:32:53,760 --> 00:32:56,040 You get down on the firewall, what's the use of logging that? 459 00:32:56,040 --> 00:32:57,500 Are you going to really act on it? 460 00:32:57,500 --> 00:33:00,260 Better just to deny it and drop it. 461 00:33:00,260 --> 00:33:01,860 No, I want to change that. 462 00:33:01,860 --> 00:33:08,420 I want you to do the job, but I want to collect information that I got traffic from China or a Tor exit node. 463 00:33:08,420 --> 00:33:13,560 And if I ever see that elsewhere in my environment, that helps me. 464 00:33:13,960 --> 00:33:22,220 My defenses internal to the moat get helped by perhaps defensive measures outside at the perimeter. 465 00:33:23,060 --> 00:33:25,460 Really, really nuanced view. 466 00:33:25,560 --> 00:33:29,620 Let me cover one last cache, sort of external credential. 467 00:33:29,620 --> 00:33:31,480 I want to move forward towards attackers. 468 00:33:31,480 --> 00:33:33,740 I don't want to sit behind my moat. 469 00:33:33,740 --> 00:33:39,720 So, most of the external programs, including the CLIs, cache credentials. 470 00:33:39,840 --> 00:33:43,020 Most all of them, put them in clear text. 471 00:33:43,320 --> 00:33:47,540 You ask the vendors, they're sort of like, well, yeah, if you're in points, compromise, you're screwed. 472 00:33:47,540 --> 00:33:48,600 Sorry, good luck. 473 00:33:48,600 --> 00:33:51,340 You know, that's CrowdStrike's problem, not AWS's problem. 474 00:33:51,900 --> 00:33:55,340 That's what, don't use static API keys. 475 00:33:55,340 --> 00:33:56,500 Oh, great, thanks. 476 00:33:56,500 --> 00:33:58,780 But I do need something. 477 00:33:58,980 --> 00:34:04,160 So, in their SQLite database, this is Google, everyone's the same. 478 00:34:05,900 --> 00:34:09,580 What I want to do from a detection perspective is put fake credentials in there. 479 00:34:09,580 --> 00:34:15,520 If they actually work, are highly limited, they go to empty accounts, monitor the hell out of them. 480 00:34:15,620 --> 00:34:17,840 These survive updates, they're config. 481 00:34:17,840 --> 00:34:26,200 I can plant that one time on my admins who work from home or over whatever VPN, plant them. 482 00:34:26,600 --> 00:34:31,600 They'll probably stay live forever with the most tokens the way that they work. 483 00:34:31,940 --> 00:34:37,520 If they're ever compromised, and I detect that activity in an account, boom. 484 00:34:37,520 --> 00:34:39,960 Low chance of the admin using it, they'll be trained. 485 00:34:39,960 --> 00:34:49,200 But unless they're looking in their own config or listening configs, I want to think more like this, right? 486 00:34:49,200 --> 00:34:57,500 Choke points, tripwires, specific to the design of cloud providers, grenades or actions have to be really thought about carefully. 487 00:34:57,820 --> 00:35:00,140 And don't killing the good guys is probably the key here. 488 00:35:00,140 --> 00:35:06,460 Because even if you buy that there's ways to detect advanced attackers, the key is, how do you not screw yourself? 489 00:35:06,460 --> 00:35:13,240 Because you screw yourself, create work for yourself, if you're a blue hat, you're out of a job, your boss gets pissed, blah, blah, I get it. 490 00:35:13,240 --> 00:35:16,500 So what do message of the days do in honeypots? 491 00:35:16,500 --> 00:35:22,500 They probably in some way, disinvite or invite the bad guys or good guys, right? 492 00:35:22,500 --> 00:35:29,160 It says, hey, this is not allowed as a site, you really should log off the server, right? 493 00:35:29,160 --> 00:35:31,220 That's the message of the day in a honeypot. 494 00:35:31,220 --> 00:35:32,720 And the attacker ignores that. 495 00:35:32,720 --> 00:35:35,560 So when they do further activity, you have a higher probability. 496 00:35:35,560 --> 00:35:37,900 What's the example in S3 bucket? 497 00:35:37,900 --> 00:35:41,300 It's the top level file because everyone's going to enumerate from the top. 498 00:35:41,420 --> 00:35:49,560 So yeah, a valid user might go there, but I've got to read me that says, you know what, this is the old finance bucket and it's only, you know, authorized for finance personnel. 499 00:35:49,560 --> 00:35:51,880 If you're looking at it, you should really not look at it. 500 00:35:51,880 --> 00:36:05,520 Three levels deep in the path, I have all the interesting finance files with further warnings of, hey, this is not really current, you should ask your administrator for access to the current one, but this is current as of a month ago. 501 00:36:05,520 --> 00:36:13,200 And if there's enumeration down that path, ignoring the signs, then you have a higher probability. 502 00:36:13,240 --> 00:36:18,460 You add this into the mix to refine and lower your false positives, right? 503 00:36:18,460 --> 00:36:22,400 You take a simple access to a resource and you try to make it work for you. 504 00:36:22,760 --> 00:36:24,620 You restrict admin roles. 505 00:36:24,680 --> 00:36:25,940 What do I mean by that? 506 00:36:25,940 --> 00:36:30,240 It depends on CSP, but maybe you keep the real admin role. 507 00:36:30,240 --> 00:36:32,580 You create a custom role that has that privilege. 508 00:36:32,580 --> 00:36:34,420 That's what the valid users use. 509 00:36:34,420 --> 00:36:36,160 What do you do with the real admin role? 510 00:36:36,160 --> 00:36:37,100 You restrict it. 511 00:36:37,100 --> 00:36:42,340 If the CSP allows you to do it, take root, for example, in AWS, right? 512 00:36:42,340 --> 00:36:46,400 Common wisdom when you first get on AWS is root can do everything. 513 00:36:46,460 --> 00:36:55,800 Well, not actually, you can have a VPC or you can have a, at the org level, you can have a boundary control, right? 514 00:36:55,800 --> 00:36:59,100 That you implement that can prevent root from doing things. 515 00:36:59,160 --> 00:37:04,260 So if there's a capability, you can stunt the default admin roles. 516 00:37:04,340 --> 00:37:06,500 Use a copy or custom role. 517 00:37:06,640 --> 00:37:14,080 Now you have a way to distinguish valid users, don't kill them, versus attackers who always go after the default admin roles. 518 00:37:14,300 --> 00:37:15,500 Not doesn't work everywhere. 519 00:37:15,500 --> 00:37:17,640 You got to put your mind and design. 520 00:37:17,740 --> 00:37:19,200 So you keep doing these things. 521 00:37:19,200 --> 00:37:22,400 You also add in signing and tagging. 522 00:37:23,060 --> 00:37:28,600 Session tags in AWS, when you assume a role, you can basically pass along some tags. 523 00:37:28,740 --> 00:37:31,060 You can incorporate that into workflow. 524 00:37:31,160 --> 00:37:33,420 Valid users, pass in the right ID. 525 00:37:33,420 --> 00:37:40,680 It doesn't prevent them from assuming role, it just identifies them as, I know the current month's secret ID. 526 00:37:40,680 --> 00:37:44,940 Attacker wouldn't do that, they would get success, they would plow ahead. 527 00:37:45,000 --> 00:37:47,480 They're not stopped, they would plow ahead. 528 00:37:47,480 --> 00:37:51,240 They wouldn't bother backtracking trying to figure out if an ID is being used. 529 00:37:51,240 --> 00:37:55,160 Okay, that's the AWS session role. 530 00:37:55,160 --> 00:37:58,320 I got to wrap this up so I don't cut too much. 531 00:37:58,320 --> 00:38:00,100 So this is my last slide. 532 00:38:00,200 --> 00:38:01,900 What's the practical of all this? 533 00:38:01,900 --> 00:38:11,180 If you've heard the theory and you think there's a chance of this approach, there's some requirements for this to even see the light of day. 534 00:38:11,180 --> 00:38:12,880 So I'm starting in the middle. 535 00:38:13,180 --> 00:38:14,880 There's got to be comprehensive research. 536 00:38:14,880 --> 00:38:17,680 That's my job and anyone who's interested. 537 00:38:17,680 --> 00:38:25,880 You got to look at everything to try to see where are the choke points across APIs, not just the CSPs, but the app APIs. 538 00:38:26,180 --> 00:38:30,060 They have to actually work and not kill the good guys, efficacy. 539 00:38:30,220 --> 00:38:37,740 The cost of using this has to be low enough because none of us are going to do a lot of work for little return on the blue side. 540 00:38:37,920 --> 00:38:42,060 And it has to sort of pass that open source kind of sniff test. 541 00:38:42,060 --> 00:38:51,740 If you're a red hat and you know this is in place, are you still slowed down so that it's a more of a level playing field? 542 00:38:51,740 --> 00:38:58,300 And the point I would say is even if you know I have fake roles and resources in play, you don't know exactly which ones they are. 543 00:38:58,300 --> 00:39:01,620 And at a minimum, you are slowed down when you enumerate. 544 00:39:01,620 --> 00:39:06,040 And before you assume a role, you have to think about whether that's real or not. 545 00:39:06,040 --> 00:39:12,000 And you likely can't a priori know that if I've set up the environment right. 546 00:39:12,000 --> 00:39:13,640 You have to try it. 547 00:39:13,640 --> 00:39:19,220 And when you try it, I'm counting on I've set things up to distinguish you from a good guy. 548 00:39:19,560 --> 00:39:33,840 So practically speaking in next coming weeks, I'll be publicizing some tool set as a POC, some software to sort of show how you can implement these, do CRUD operations, report on and delete them. 549 00:39:34,400 --> 00:39:47,360 The idea that you could have a CLI that helps you with creation of tripwires and not have it be a hassle like wondering what the heck is in place, how do I delete it, did it actually work, and so on. 550 00:39:47,920 --> 00:40:00,180 But we have to keep publishing research, keep thinking about this, putting as much time and effort as we do on all the good stuff on the red side. 551 00:40:00,380 --> 00:40:04,300 So I think I'm over time and I apologize. 552 00:40:05,540 --> 00:40:06,360 That's the end. 553 00:40:06,360 --> 00:40:10,020 I would love if you have comments, even if that's the dumbest idea I've ever heard. 554 00:40:10,020 --> 00:40:13,800 Love to hear it because that just makes me work harder on this effort. 555 00:40:13,800 --> 00:40:20,260 It's a long -running research project and it's just something of we got to think different is the bottom line and we've got to try it. 556 00:40:20,260 --> 00:40:30,860 I'm convinced if we took the smart people at Khan, we would make greater strides than just a tool of the day which fixes an issue of the day on a checklist. 557 00:40:30,860 --> 00:40:31,780 Those are important. 558 00:40:31,780 --> 00:40:33,020 I'm not saying don't do it. 559 00:40:33,020 --> 00:40:40,340 I'm saying what prevents us from doing the same damn thing every Khan with just a different list. 560 00:40:40,660 --> 00:40:46,080 Only if we're as creative and smart on the sort of long term with some implementation. 561 00:40:46,080 --> 00:40:47,100 Thank you.