1 00:00:00,000 --> 00:00:01,480 Hey everyone, thanks for coming. 2 00:00:02,260 --> 00:00:05,640 Okay, so let's just get into it. 3 00:00:05,640 --> 00:00:08,600 Using Pareto's principle for securing AWS with SCPs. 4 00:00:08,720 --> 00:00:11,280 So, let me turn on my remote, that would help. 5 00:00:14,300 --> 00:00:15,560 Alright, cool. 6 00:00:15,560 --> 00:00:21,840 So a little about me, I like AWS, I've been doing security for a while, whatever, blah blah blah, I took some tests, that's not a big deal. 7 00:00:21,920 --> 00:00:23,560 I'm also really into coffee. 8 00:00:23,560 --> 00:00:25,820 This is my real coffee set at home. 9 00:00:25,960 --> 00:00:33,080 So if you want to talk about single origins and pour overs and recipes, I could talk ad nauseum about that. 10 00:00:33,260 --> 00:00:44,540 I also run a podcast called Getting into InfoSec and it's designed to help folks get into security and by interviewing folks that are out there and see how they got in, cause everybody's path into security is different. 11 00:00:45,120 --> 00:00:51,440 And then I also wrote a book as well because, well, you know, it's just kind of helping solve the problem as well. 12 00:00:51,440 --> 00:00:55,780 So, like if you sat down with me for like an hour over coffee, what would I tell you? 13 00:00:55,780 --> 00:00:56,940 This is what I would tell you. 14 00:00:57,200 --> 00:01:02,240 And I like Hawaiian shirts, so on Fridays at work, you see me, uh, I'll probably be wearing a Hawaiian shirt. 15 00:01:02,240 --> 00:01:04,100 So that's a little about me. 16 00:01:05,420 --> 00:01:06,080 Cool. 17 00:01:06,180 --> 00:01:09,120 So, uh, I have no idea about you guys. 18 00:01:09,120 --> 00:01:14,460 Uh, this is the first time that the Cloud Village existed, so I just want to get to know everyone out there a little bit. 19 00:01:14,460 --> 00:01:19,060 How many folks out there manage AWS accounts, uh, 10 or less? 20 00:01:19,060 --> 00:01:20,400 10 or less AWS accounts? 21 00:01:20,680 --> 00:01:21,480 Okay. 22 00:01:21,480 --> 00:01:24,400 How many manage 25 or more accounts? 23 00:01:25,040 --> 00:01:25,700 All right. 24 00:01:25,700 --> 00:01:26,360 All right. 25 00:01:26,360 --> 00:01:28,640 And how many manage 75 or more accounts? 26 00:01:29,340 --> 00:01:30,160 All right. 27 00:01:30,160 --> 00:01:30,660 Very cool. 28 00:01:30,660 --> 00:01:31,320 Very cool. 29 00:01:31,320 --> 00:01:31,780 Okay. 30 00:01:32,240 --> 00:01:36,700 And how many of you guys are using AWS organizations and SCPs? 31 00:01:37,980 --> 00:01:38,620 Okay. 32 00:01:38,620 --> 00:01:39,080 Cool. 33 00:01:39,080 --> 00:01:39,780 Cool. 34 00:01:40,200 --> 00:01:43,040 So, um, what's Pareto's principle, right? 35 00:01:43,040 --> 00:01:47,560 The idea is that with just a little bit of work, you can accomplish a lot of work. 36 00:01:47,560 --> 00:01:48,060 Okay. 37 00:01:48,060 --> 00:01:49,320 Or a lot of results. 38 00:01:49,480 --> 00:01:54,540 So 20% of effort and you get 80% of the results. 39 00:01:54,580 --> 00:01:56,620 Um, and that's where SCPs come in. 40 00:01:56,620 --> 00:01:57,620 They're just beautiful. 41 00:01:57,620 --> 00:02:02,340 So with only a little bit of, um, code, right? 42 00:02:02,340 --> 00:02:06,440 A few lines of configuration, you can really apply a lot of security to a lot of your accounts. 43 00:02:06,560 --> 00:02:09,240 Uh, but there's a lot of steps that are required before that. 44 00:02:09,520 --> 00:02:15,940 And also we'll talk a little about cloud security issues for those that are, uh, you know, not too familiar about AWS. 45 00:02:15,940 --> 00:02:18,040 Again, just trying to level set here. 46 00:02:18,340 --> 00:02:20,480 So what are some common issues, right? 47 00:02:20,480 --> 00:02:33,540 IAM, having keys and source code, um, having really egregious permissions on, um, boxes, like for say, you know, EC2 star or IAM star, uh, storage, leaky buckets, right? 48 00:02:33,540 --> 00:02:34,760 We've heard too many stories. 49 00:02:34,760 --> 00:02:35,940 Logging, right? 50 00:02:35,940 --> 00:02:45,140 I mean, really what AWS is, is you're giving the like infinite amount of resources globally, right? 51 00:02:45,180 --> 00:02:46,520 To an engineer. 52 00:02:46,700 --> 00:02:51,280 And this is what you have, but this is what you end up with, right? 53 00:02:51,480 --> 00:02:56,720 Uh, it's just, it's, it's, um, you know, AWS has a shared security model. 54 00:02:56,720 --> 00:03:02,300 We all know about it, but still it makes it very easy for someone to just trip over themselves. 55 00:03:04,320 --> 00:03:06,460 And so, you know, we have leaky buckets. 56 00:03:06,460 --> 00:03:10,960 Uh, I think we all know , or we may know about all these leaky buckets that are out there. 57 00:03:11,000 --> 00:03:15,920 Uh, someone even created a GitHub page that lists all the S3 bucket leaks out there. 58 00:03:15,920 --> 00:03:16,600 Very convenient. 59 00:03:16,860 --> 00:03:23,080 If you're trying to prove your case or just keep track and they're just, you know, it goes on and on and on and on. 60 00:03:23,320 --> 00:03:28,700 And someone said that there was like 9 billion data records of S3, uh, from S3 bucket leaks. 61 00:03:29,700 --> 00:03:30,660 Same thing. 62 00:03:30,660 --> 00:03:31,940 IAM is the new perimeter. 63 00:03:32,040 --> 00:03:35,000 So, you know, no longer is it network security. 64 00:03:35,000 --> 00:03:36,800 It's more IAM. 65 00:03:37,540 --> 00:03:41,360 Um, everybody might've heard of a Capital One breach recently. 66 00:03:41,800 --> 00:03:48,580 So, um, you know, a lot of things went wrong there, but you know, we don't want permissions like EC2 star, IAM star. 67 00:03:48,580 --> 00:03:50,840 I have actually seen this out there. 68 00:03:51,720 --> 00:04:00,180 Um, I have seen public machines that are running WAFs with EC2 star on them and I'm like having a heart attack. 69 00:04:00,540 --> 00:04:19,520 Um, and you know, in this case, you know, I was at a company once where, uh, someone emailed their IAM keys to someone else and I'm not sure how the keys got compromised, but $40,000 later, uh, a lot of EC2 instances were deployed and, um, it was not, 70 00:04:19,520 --> 00:04:20,160 it was not fun. 71 00:04:20,160 --> 00:04:24,080 AWS did reverse it, but still we don't want to be in that situation. 72 00:04:25,680 --> 00:04:26,800 Yeah. 73 00:04:27,140 --> 00:04:29,480 Uh, who here has heard of Codespaces? 74 00:04:31,120 --> 00:04:33,040 Oh, alright. 75 00:04:33,040 --> 00:04:42,200 So, Codespaces was like a GitHub like, uh, company that provided, as you can see, rock solid and secure affordable hosting. 76 00:04:42,300 --> 00:04:45,820 So we all know it's secure because it says it's secure, right? 77 00:04:45,820 --> 00:04:52,060 So, um, this was their website on June 14th, 2014. 78 00:04:53,960 --> 00:04:57,520 This was their website on June 18th, 2014. 79 00:04:58,660 --> 00:05:07,140 Their root keys got compromised and the attacker basically deleted all their backups, all their instances, everything. 80 00:05:07,140 --> 00:05:09,120 And they literally went out of business overnight. 81 00:05:09,640 --> 00:05:10,060 Okay. 82 00:05:10,060 --> 00:05:14,160 So this is a target for us, for AWS folks, for cloud folks. 83 00:05:14,160 --> 00:05:15,080 This is our target. 84 00:05:15,080 --> 00:05:16,480 We need to know this. 85 00:05:16,480 --> 00:05:17,820 Uh, it's a part of our history. 86 00:05:17,820 --> 00:05:21,620 And so it's something that, uh, I recommend everyone go ahead and look up. 87 00:05:21,620 --> 00:05:25,700 I pulled this from, uh, archive.org and you can do that same as well. 88 00:05:27,240 --> 00:05:31,300 So, why AWS organizations and SCP? 89 00:05:32,100 --> 00:05:32,860 Okay. 90 00:05:32,980 --> 00:05:33,660 So, uh, the reason why AWS organizations and SCP? 91 00:05:33,660 --> 00:05:41,140 So basically with a few lines of configuration or quote unquote code, we can enable a lot of change and a lot of protection in our accounts. 92 00:05:41,740 --> 00:05:53,620 Um, but the reason I did this talk is because, so SCP has been around for a little bit and I'm still not seeing too many organizations taking, taking advantage of it, at least to their full extent. 93 00:05:53,620 --> 00:05:56,200 I think people are a little afraid of SCP. 94 00:05:56,600 --> 00:06:07,300 Um, but it's a really good way to guard your security, um, and, and protect yourself, uh, if you have things even securely configured properly. 95 00:06:10,840 --> 00:06:13,100 So I'll talk a little about multi-account strategy. 96 00:06:13,100 --> 00:06:15,620 It's kind of, uh, a foundation to this. 97 00:06:15,780 --> 00:06:22,240 So if you are, um, using multiple accounts, you want to take advantage of the multi-account strategy. 98 00:06:22,240 --> 00:06:24,920 You want to have a logging account for your, your logs to go to. 99 00:06:24,920 --> 00:06:25,600 Okay. 100 00:06:25,680 --> 00:06:30,420 Uh, you want to have a security account for your security ops and your tools to run from. 101 00:06:30,440 --> 00:06:37,580 Uh, you want to have, you know, networking where you can do your transit gateways and things like that, shared services and, and on and on and on. 102 00:06:37,580 --> 00:06:41,980 So it's really important to do, uh, take advantage of the multi-account strategy. 103 00:06:42,160 --> 00:06:49,260 Uh, AWS, you know, first started off, I don't think they realized how, how, how big this would explode. 104 00:06:49,300 --> 00:06:52,880 And so they've, you know, incorporated some multi-account stuff. 105 00:06:52,880 --> 00:06:57,600 It's still, um, you know, I would look it up. 106 00:06:57,600 --> 00:07:00,660 It's, it's, it's part of the well, well-architected framework. 107 00:07:00,740 --> 00:07:03,580 Um, I'm not going to talk anything negative right now. 108 00:07:03,580 --> 00:07:10,780 So, um, so once you have this set up, okay, then you can take advantage, full advantage of AWS organizations. 109 00:07:11,280 --> 00:07:13,540 So it kind of works on top of that. 110 00:07:13,580 --> 00:07:15,660 Uh, you have your master account. 111 00:07:16,060 --> 00:07:23,820 Um, if anyone's familiar with any sort of directory, you have different OUs and you could have sub-OUs and you could apply policies at the OU level. 112 00:07:23,820 --> 00:07:28,880 So this is really how, um, security control policies work. 113 00:07:30,780 --> 00:07:31,680 Okay. 114 00:07:31,680 --> 00:07:35,700 And so this is kind of a quick outline of what I'm going to talk about. 115 00:07:35,780 --> 00:07:43,120 Um, you know, if you're coming in starting with AWS organizations and SCPs from scratch, okay. 116 00:07:44,540 --> 00:07:47,120 So we have the master account. 117 00:07:47,120 --> 00:07:50,200 Everything starts with the master account. 118 00:07:50,760 --> 00:07:58,040 Um, how many, not to embarrass you, but how many, how many here have master accounts with resources in them? 119 00:07:58,780 --> 00:07:59,920 You don't have to raise your hand. 120 00:07:59,920 --> 00:08:00,440 It's okay. 121 00:08:00,520 --> 00:08:06,820 So, um, so having a master account with resources is bad. 122 00:08:06,820 --> 00:08:08,200 You don't want to do that. 123 00:08:08,440 --> 00:08:09,560 Um, why? 124 00:08:09,560 --> 00:08:14,000 Because when you're going to apply a policy, you don't want to apply the policy at the master level. 125 00:08:14,000 --> 00:08:16,160 You want to apply it at a different OU level. 126 00:08:16,320 --> 00:08:19,600 And so you want a master account that's empty and has no resources. 127 00:08:19,600 --> 00:08:28,780 So that's really your biggest step in all this is getting, uh, creating a master account, moving your consolidated billing to another, uh, to that account. 128 00:08:28,840 --> 00:08:31,180 Um, there's a few steps involved. 129 00:08:31,180 --> 00:08:41,260 Uh, one, call your rep, um, create the account, create an S3 bucket for that account where your consolidated billing reports can go to, uh, and create a support account. 130 00:08:41,500 --> 00:08:48,080 And if you have, if you're on an enterprise, uh, level support plan, then definitely your rep will take care of most of this for you. 131 00:08:48,420 --> 00:08:52,360 Um, in one organization, it took a month for us to get this done. 132 00:08:52,720 --> 00:08:55,980 Uh, we had to sign a new contract, had to go through legal, blah, blah, blah, blah, blah. 133 00:08:55,980 --> 00:08:57,240 I'm like, what is this? 134 00:08:57,240 --> 00:08:58,180 Why is this? 135 00:08:58,180 --> 00:08:59,520 And they had to sign it with ink. 136 00:08:59,520 --> 00:09:00,520 It wasn't DocuSign. 137 00:09:00,520 --> 00:09:01,340 I was like, really? 138 00:09:01,960 --> 00:09:04,460 So, um, it was quite interesting. 139 00:09:04,560 --> 00:09:10,540 Um, but after you have the new AWS account, then you can create the org and link and unlink accounts. 140 00:09:10,540 --> 00:09:13,840 And it's pretty straightforward from that, from there. 141 00:09:14,620 --> 00:09:15,740 And here you are. 142 00:09:15,740 --> 00:09:19,700 So, so now once you have your master account, you create the organization. 143 00:09:19,700 --> 00:09:20,260 Okay. 144 00:09:20,340 --> 00:09:22,740 Uh, organizations has two modes. 145 00:09:22,740 --> 00:09:32,120 Uh, there's billing mode and then the full access, the full features mode, which lets you take advantage of service control policies and, and everything I'm going to talk about today. 146 00:09:32,880 --> 00:09:41,320 So if you have an organization already and you have a master account with no resources, then go ahead and make sure your organizations is enabled for full features. 147 00:09:41,320 --> 00:09:47,580 It's just, uh, a really quick, uh, CLI command, or you can go into console and, and, and do it there as well. 148 00:09:47,720 --> 00:09:53,280 You also might need to increase your, um, limits on AWS organizations as well. 149 00:09:53,280 --> 00:09:58,540 So, um, I have 10 here because that's what I was doing in my experimental account. 150 00:09:58,620 --> 00:10:03,180 Um, but yeah, so you might want to look into that as well. 151 00:10:04,620 --> 00:10:05,280 Okay. 152 00:10:05,280 --> 00:10:08,100 So here I, I've created an organization. 153 00:10:08,100 --> 00:10:09,280 Um, I'm logged in. 154 00:10:09,280 --> 00:10:10,860 I created a couple of different OUs. 155 00:10:10,860 --> 00:10:12,120 It's like super easy. 156 00:10:13,160 --> 00:10:18,420 And hopefully everyone has a, uh, a dev staging and prod environment. 157 00:10:18,420 --> 00:10:23,640 Uh, and hopefully not everyone is doing everything in, in one account or, or prod, right? 158 00:10:23,800 --> 00:10:26,320 So, uh, this is the ideal way. 159 00:10:26,500 --> 00:10:29,420 Um, so I created a prod staging and dev account. 160 00:10:29,680 --> 00:10:34,660 I also created an other account because there's a few accounts that I just didn't know where they should go. 161 00:10:34,660 --> 00:10:43,720 So, um, you might have a subsidiary that you're, you know, they want to have their own, uh, deal with AWS and they don't want you messing with that. 162 00:10:43,720 --> 00:10:46,440 So, you know, other would might, might be a good place to put it. 163 00:10:47,220 --> 00:10:48,660 And you can have sub OUs. 164 00:10:48,660 --> 00:10:51,720 Uh, there's no need to create just three top level, um, OUs. 165 00:10:51,720 --> 00:10:53,660 You could have, uh, many different sub OUs. 166 00:10:53,660 --> 00:10:56,640 It's really up to you how complicated you want it to go. 167 00:10:56,640 --> 00:11:00,620 The only one that really would be outside is the, is your root account or your master account. 168 00:11:00,620 --> 00:11:02,660 And that would be in the root OU. 169 00:11:02,920 --> 00:11:04,060 Pretty straightforward. 170 00:11:05,140 --> 00:11:08,400 And then just go ahead and, and enable your service control policies. 171 00:11:08,400 --> 00:11:08,860 It's okay. 172 00:11:08,860 --> 00:11:10,020 Nothing's going to happen here. 173 00:11:10,020 --> 00:11:11,880 Just go ahead and enable it. 174 00:11:13,120 --> 00:11:13,960 All right. 175 00:11:14,180 --> 00:11:16,080 So applying SEPs. 176 00:11:20,250 --> 00:11:21,290 Okay. 177 00:11:21,930 --> 00:11:25,070 Be really careful about SEPs. 178 00:11:25,070 --> 00:11:27,310 Um, I did say it's okay to enable them. 179 00:11:27,310 --> 00:11:27,850 Yes. 180 00:11:27,850 --> 00:11:34,510 But when you're going to apply them, take the usual methods about applying into dev, applying into pro, uh, staging and then prod. 181 00:11:34,510 --> 00:11:37,070 Uh, you, these things are really powerful. 182 00:11:37,070 --> 00:11:38,510 Uh, they're instantaneous. 183 00:11:38,810 --> 00:11:43,570 And when you apply it at the OU level, it takes effect for all your accounts under your OU. 184 00:11:43,570 --> 00:11:47,150 So, you know, take that into consideration. 185 00:11:47,450 --> 00:11:50,630 Uh, and please for, for, please don't deploy things on Friday. 186 00:11:50,630 --> 00:11:51,570 Just, just don't do it. 187 00:11:51,570 --> 00:11:52,230 Okay. 188 00:11:57,000 --> 00:11:57,820 Um, okay. 189 00:11:57,820 --> 00:12:05,820 So in AWS organizations, this is not SEP directly, but when you have your master account set up, this is a really nice feature to take advantage of. 190 00:12:05,820 --> 00:12:07,240 Just create a cloud trail. 191 00:12:07,240 --> 00:12:14,560 If you don't have one already, create a cloud trail in your master account and it will automatically apply to all your, uh, your whole organization. 192 00:12:14,740 --> 00:12:18,980 So you will only see this configuration when you're doing it from your master account. 193 00:12:20,060 --> 00:12:23,780 And so of course, have that bucket in a separate account for logging. 194 00:12:23,780 --> 00:12:24,460 Okay. 195 00:12:24,560 --> 00:12:29,220 Uh, and the reason it's in a separate account for logging is for integrity purposes, limited access. 196 00:12:29,220 --> 00:12:31,900 You don't want everyone to have access to that, to that logging account. 197 00:12:32,140 --> 00:12:37,440 And so you go ahead and set this up and you remember the name of your cloud trail. 198 00:12:37,440 --> 00:12:45,520 And I'll, I'll the next one here, we have an SEP that now prevents anyone from stopping and deleting that trail. 199 00:12:45,520 --> 00:12:46,020 Okay. 200 00:12:46,020 --> 00:12:51,780 This is all available on, on AWS, uh, on their examples page, where you could also, you know, I'll publish the slides. 201 00:12:51,780 --> 00:12:58,640 But here, what I'm referring to is, uh, the specific cloud trail name that you specified. 202 00:12:58,740 --> 00:13:05,700 And the reason is that say you have other groups out there that maybe want to have their own cloud trail or want to do whatever. 203 00:13:06,060 --> 00:13:13,020 Um, and you can let them, they can create their own cloud trails if they want, they can delete it, they could do whatever, but don't touch this cloud trail. 204 00:13:13,020 --> 00:13:17,580 So, uh, with this SEP, it'll, it'll allow you to stop. 205 00:13:17,580 --> 00:13:23,680 And you can see here, uh, I'm logged in as, as root, as admin, and I'm trying to disable it. 206 00:13:23,760 --> 00:13:25,800 And it says, you know, unnecessary permissions. 207 00:13:26,160 --> 00:13:27,460 So it works. 208 00:13:28,740 --> 00:13:29,540 Yes. 209 00:13:36,710 --> 00:13:37,690 That's right. 210 00:13:39,450 --> 00:13:39,870 Yeah. 211 00:13:39,870 --> 00:13:41,470 I'll be happy to take questions at the end. 212 00:13:43,870 --> 00:13:51,090 So, uh, again, so, you know, we're trying, so VPC flow logs, right? 213 00:13:51,090 --> 00:13:55,490 You want to protect those, uh, possibly if you really rely on them from a security purpose. 214 00:13:55,670 --> 00:14:04,850 Um, so go, you know, this is, uh, um, a log group, uh, sorry, service control policy that will protect them and, and, and prevent someone from deleting them. 215 00:14:04,890 --> 00:14:06,870 And, you know, you could tune to your liking, right? 216 00:14:06,870 --> 00:14:13,050 Do you want to specify specific, uh, VPC flow log as you, you could, you could really play with it as much as you like. 217 00:14:14,970 --> 00:14:15,890 Okay. 218 00:14:17,730 --> 00:14:24,410 A lot of times you have resources only in US West and East, for example, or two or three regions. 219 00:14:24,670 --> 00:14:28,830 There's no reason to have all your regions enabled. 220 00:14:28,830 --> 00:14:36,990 And so this will kind of limit your attack surface on where regions would be set up and your attack could come from outside or inside. 221 00:14:37,090 --> 00:14:52,730 I mean, a lot of times employees, I don't want to say a lot of times, sometimes an employee could, uh, set up an instance in, I don't know, London or, or Asia, um, with GPU instances and just do some crypto mining and no one would know about it until much later. 222 00:14:52,910 --> 00:15:01,230 Um, you know, it really depends how good your monitoring is, how mature your environment is for, uh, for looking at resources outside your environment. 223 00:15:01,230 --> 00:15:08,130 So again, this is not rocket science, uh, but this will limit your, uh, attack surface. 224 00:15:08,510 --> 00:15:23,130 So it's a really good way to just, Hey, I don't think we'll ever have a need for US, uh, um, US West one or anything outside of the US, whatever you can use, you know, you could just play with this, uh, to your liking. 225 00:15:23,190 --> 00:15:27,150 I did have, oh, so one note is I put like easy to describe, for example. 226 00:15:27,150 --> 00:15:34,270 So if I want to have a tool or if there's a tool that's going to do easy to describe, uh, then I could run it and it won't break that tool. 227 00:15:34,270 --> 00:15:43,170 So if you have monitoring tools, then you want to add a couple not actions here, uh, so that your tools won't break something to take into consideration. 228 00:15:44,430 --> 00:15:50,090 And so this is an example of, uh, trying to launch something from a region that is not on that list. 229 00:15:53,510 --> 00:15:57,590 Uh, the next thing is limiting the type of instances that are running in your environment. 230 00:15:57,590 --> 00:15:59,050 And there's two ways to do it. 231 00:16:00,170 --> 00:16:02,350 You could do a permit list and I'll show you both. 232 00:16:02,790 --> 00:16:08,370 In this case, um, I am denying these particular instance types, right? 233 00:16:08,370 --> 00:16:12,030 Um, is there a need for your organization to use a P3 instance, right? 234 00:16:12,030 --> 00:16:13,410 With like four GPUs? 235 00:16:13,410 --> 00:16:14,530 I don't know. 236 00:16:14,550 --> 00:16:16,170 Um, probably not. 237 00:16:16,170 --> 00:16:27,290 So in this case, we're limiting the type of instances, uh, so that either accidentally or maliciously, we don't launch instances that are going to cost us thousands and thousands of dollars. 238 00:16:30,490 --> 00:16:35,570 And, and, and I want to, uh, draw attention to the string like, uh, condition here. 239 00:16:35,570 --> 00:16:39,370 It lets you use, um, it lets you use a, a wildcard condition. 240 00:16:39,370 --> 00:16:41,210 So it's, it's pretty, pretty versatile. 241 00:16:42,910 --> 00:16:44,370 Here's one of allowing it. 242 00:16:44,370 --> 00:16:47,910 So, you know, I'm limiting to just general purpose, uh, instances. 243 00:16:47,910 --> 00:16:51,570 So here we have a, a bunch of instances listed. 244 00:16:51,610 --> 00:16:54,950 We have A, T, M and, um, M5 and M4. 245 00:16:55,270 --> 00:16:58,150 And so, okay, that's all instances we need, right? 246 00:16:58,150 --> 00:16:59,450 It depends on your organization. 247 00:16:59,450 --> 00:17:03,030 You could actually, uh, add more to this. 248 00:17:03,030 --> 00:17:05,250 You could limit it to particular AMIs if you want. 249 00:17:05,250 --> 00:17:10,330 You could limit, you know, you could have, uh, you can make this as restrictive as you want. 250 00:17:10,330 --> 00:17:12,370 You can have multiple SCPs. 251 00:17:12,370 --> 00:17:15,790 So you have this one for, for instance types and then another one for AMI. 252 00:17:15,790 --> 00:17:25,190 And of course it takes, uh, the IAM precedence where it compiles all the permissions and takes the least, um, or the most restrictive permission out of everything. 253 00:17:28,910 --> 00:17:31,430 Here's a good one, uh, limiting root actions, right? 254 00:17:31,430 --> 00:17:34,890 You want to deny root actions across your, your accounts. 255 00:17:35,010 --> 00:17:38,090 Um, and so this is a really good way to do so. 256 00:17:38,090 --> 00:17:44,930 Uh, using the principle ARN and, um, you literally as root, you can't do anything. 257 00:17:44,930 --> 00:17:48,350 I'm logged in as root and I can't even do a describe on instances. 258 00:17:48,350 --> 00:17:49,430 I can't launch anything. 259 00:17:49,430 --> 00:17:50,970 I, I can't do a single thing. 260 00:17:51,250 --> 00:17:53,030 So it's really, really powerful. 261 00:17:53,910 --> 00:17:56,310 Um, this is one of my favorites. 262 00:17:56,830 --> 00:18:04,090 So, you know, if you have that founder that still has access to the root account, um, which happens a lot , right? 263 00:18:04,090 --> 00:18:07,450 The founder, because the email was created with their credit card and their email address . 264 00:18:07,850 --> 00:18:12,230 So, uh, I would, I would recommend, you know, you talk to them first before doing this. 265 00:18:12,230 --> 00:18:13,530 It might be a good idea. 266 00:18:13,710 --> 00:18:15,550 Um, you do want to keep your job. 267 00:18:18,350 --> 00:18:19,210 Here's another one. 268 00:18:19,210 --> 00:18:21,090 Uh, you want to enable encryption. 269 00:18:21,090 --> 00:18:28,050 So, uh, you know, you don't want to allow any objects to be put into your S3 buckets, uh, unless they're meeting this criteria. 270 00:18:28,050 --> 00:18:33,750 And in this case, the criteria is that it's encrypted with AES 256, for example. 271 00:18:37,510 --> 00:18:40,670 Same thing with S3, uh, public access. 272 00:18:40,670 --> 00:18:42,290 Uh, here's another one. 273 00:18:42,290 --> 00:18:46,150 So I'm still experimenting with this a little bit. 274 00:18:46,230 --> 00:18:50,690 So, um, but it, it seems to be working. 275 00:18:51,730 --> 00:18:52,690 Okay. 276 00:18:52,690 --> 00:18:54,030 So troubleshooting. 277 00:18:54,450 --> 00:18:59,330 Um, there's a lot of troubleshooting that I went through, um, in this. 278 00:18:59,330 --> 00:19:09,690 I definitely recommend you take a deep reading of IAM and IAM syntax, especially when you're looking at the conditional operators and, and trying to put a list of things. 279 00:19:09,770 --> 00:19:16,130 Um, so it's, it's quite tricky, um, especially in this condition map, trying to define it. 280 00:19:16,130 --> 00:19:21,670 Uh, but you know, it's, um, it's all based on IAM, so it's pretty straightforward. 281 00:19:24,540 --> 00:19:32,020 And you know, just some little like things, even I was trying to do a, uh, little Easter egg as far as a version number. 282 00:19:32,020 --> 00:19:35,520 And, uh, turns out that, you know, AWS doesn't like that. 283 00:19:35,520 --> 00:19:37,460 Does anyone know what that date is? 284 00:19:41,680 --> 00:19:42,960 Oh, right. 285 00:19:42,960 --> 00:19:43,280 Yeah. 286 00:19:43,280 --> 00:19:44,220 The date, it's supposed to be. 287 00:19:44,220 --> 00:19:44,540 Yes. 288 00:19:44,540 --> 00:19:47,440 But, uh, that day right there, November 5th, 1955. 289 00:19:47,440 --> 00:19:48,660 Does anybody know that date? 290 00:19:51,240 --> 00:19:51,820 Yes. 291 00:19:51,820 --> 00:19:52,880 Back to the future. 292 00:19:53,000 --> 00:19:53,780 Pretty good. 293 00:19:53,780 --> 00:19:53,980 Yeah. 294 00:19:53,980 --> 00:19:55,280 I was watching at the time. 295 00:19:55,540 --> 00:19:57,840 Actually, I have a few dates throughout the presentation. 296 00:19:58,060 --> 00:20:03,120 Um, little Easter eggs from different things throughout movie history. 297 00:20:06,340 --> 00:20:07,200 So, yeah. 298 00:20:07,200 --> 00:20:08,320 And then same thing here. 299 00:20:08,320 --> 00:20:12,300 Um, if you want to deny a role, uh, then you could specify the role. 300 00:20:12,400 --> 00:20:19,480 But then if you want to, uh, specify an actual IAM user, you will need to use the condition string not like. 301 00:20:20,180 --> 00:20:22,860 Um, that was quite annoying as well. 302 00:20:22,980 --> 00:20:25,340 So, that's something there. 303 00:20:25,340 --> 00:20:29,080 Uh, this is a really cool website I found after doing a lot of this stuff anyway. 304 00:20:29,360 --> 00:20:31,480 Um, it's asecure.cloud. 305 00:20:31,480 --> 00:20:44,960 Uh, uh, the person that's created this is amazing and, and, uh, they have, uh, service control policies, uh, fi- security groups, a lot of different things that will let you even, uh, put confirmation templates together and just deploy. 306 00:20:45,100 --> 00:20:49,180 Uh, of course, you know, deploy cautiously to, uh, dev. 307 00:20:49,540 --> 00:20:53,480 But, um, it's a good library of a lot of different service control policies. 308 00:20:53,480 --> 00:20:57,360 Uh, the ones I showed you are the ones that, that, that I created and kind of implemented. 309 00:20:57,800 --> 00:21:04,860 Um, but that person has a lot of ones like, uh, like, uh, preventing people from deleting KMS keys, for example, right? 310 00:21:04,900 --> 00:21:06,280 Uh, that's a really good one. 311 00:21:06,480 --> 00:21:13,660 Um, so , I mean, imagine if, if, if someone deleted your KMS keys, you can no longer, uh, decrypt your information. 312 00:21:13,660 --> 00:21:17,040 So, uh, it's quite, quite precarious. 313 00:21:17,120 --> 00:21:18,000 And that's about it. 314 00:21:18,000 --> 00:21:19,380 This is my contact info. 315 00:21:19,520 --> 00:21:24,380 Um, I blog about stuff on AWS, uh, quite some time, uh, you know, frequently. 316 00:21:24,820 --> 00:21:27,720 And, uh, I'd like to open up for questions if there's any questions. 317 00:21:27,720 --> 00:21:28,380 Yes? 318 00:21:28,380 --> 00:21:38,100 I thought the SCP about blocking, uh, but what do you do about the active applied SCPs? 319 00:21:38,100 --> 00:21:38,500 That's right. 320 00:21:38,620 --> 00:21:40,280 During, uh, Yeah. 321 00:21:40,280 --> 00:21:40,920 Yeah. 322 00:21:40,980 --> 00:21:41,260 Yeah. 323 00:21:41,260 --> 00:21:42,480 That's, that's exactly right. 324 00:21:42,480 --> 00:21:46,280 You'd have, so you'd have to take that into consideration, uh, for things. 325 00:21:46,280 --> 00:21:51,100 I mean, I think AWS is working solely to limit those root actions. 326 00:21:51,100 --> 00:21:55,060 I'm kind of annoyed that there are still things that you need root for, but yeah, that's exactly right. 327 00:21:55,080 --> 00:21:55,880 Yes? 328 00:21:55,900 --> 00:21:59,400 How do you handle issues where things might overrun information 329 00:22:02,590 --> 00:22:02,990 ? 330 00:22:03,010 --> 00:22:07,670 Is there something which tells you, like, you have overrun the information or sends it to somebody? 331 00:22:08,590 --> 00:22:18,030 So the question is, uh, if I get it right, and the previous question was, um, do you have to, when you want to do things that require root action, uh, we, again, have to remove the service control policy. 332 00:22:18,030 --> 00:22:19,170 So that was a previous question. 333 00:22:19,170 --> 00:22:22,010 And this question is, what do you do about over-permissioning? 334 00:22:22,010 --> 00:22:22,150 Yeah . 335 00:22:22,150 --> 00:22:22,830 Like, how do you, 336 00:22:32,640 --> 00:22:32,980 like... 337 00:22:33,340 --> 00:22:33,880 Oh yeah. 338 00:22:33,880 --> 00:22:40,740 There are a few, uh, tools out there that would, that will give you, um, a list of permissions that are recently used by particular users. 339 00:22:40,740 --> 00:22:42,920 And AWS has some out of the box, actually, as well. 340 00:22:43,160 --> 00:22:43,880 Yes? 341 00:22:44,620 --> 00:22:52,440 Um, so you showed one of the slides here, the master account as well, as a trail. 342 00:22:52,440 --> 00:22:53,140 Yes. 343 00:22:53,220 --> 00:22:54,640 Every sub-member can... 344 00:22:54,640 --> 00:22:55,420 That's right. 345 00:22:55,420 --> 00:22:56,700 Does that mean that you can do 346 00:23:00,560 --> 00:23:05,440 , like, if you want to catch a contact or so on and so forth? 347 00:23:05,440 --> 00:23:07,120 It only applies to CloudTrail. 348 00:23:07,220 --> 00:23:08,780 Only CloudTrail? 349 00:23:08,780 --> 00:23:08,780 Only CloudTrail . 350 00:23:08,780 --> 00:23:12,700 So that , that screen there was a typical CloudTrail creation screen. 351 00:23:13,040 --> 00:23:18,940 Uh, but you only, you have that extra dialogue box for, um, when it's being done from the master account. 352 00:23:18,940 --> 00:23:26,100 And so all the settings that you have there are going to create a CloudTrail in each new account, or each account, uh, and any new accounts. 353 00:23:26,420 --> 00:23:27,740 Existing as well as new? 354 00:23:27,740 --> 00:23:28,340 That's right. 355 00:23:28,340 --> 00:23:30,040 All regions on all accounts? 356 00:23:30,040 --> 00:23:31,600 Well, depending on how you configure it. 357 00:23:31,600 --> 00:23:33,980 So if you configure for all regions, then yeah, that'll apply. 358 00:23:34,020 --> 00:23:35,560 But it'll apply for the same bucket. 359 00:23:35,900 --> 00:23:40,620 And, uh, the great part is for new accounts that are created later, which is, uh, like a, uh, a lifesaver. 360 00:23:40,660 --> 00:23:41,280 Yes. 361 00:23:41,280 --> 00:23:44,710 That bucket doesn't have to be the same. 362 00:23:44,890 --> 00:23:45,650 That's right. 363 00:23:45,650 --> 00:23:46,310 That's right. 364 00:23:46,930 --> 00:23:47,550 Yes. 365 00:23:47,610 --> 00:23:59,110 Um, one sort of observation we've, when we went to, uh, organizations, we also had to work with our procurement team to prevent anyone with a P-card from being able to pay for an AWS account. 366 00:23:59,110 --> 00:24:03,670 Because we had a couple hundred of those done scattered everywhere to pull them in. 367 00:24:03,670 --> 00:24:07,390 So if you're going to go organizations, make friends with procurement. 368 00:24:07,410 --> 00:24:07,730 Yes . 369 00:24:07,730 --> 00:24:08,070 Yes. 370 00:24:08,090 --> 00:24:16,330 Procurement is, uh, there are a couple of tools out there actually that I found, uh, that will, um, help you find shadow IT, uh, accounts out there. 371 00:24:16,330 --> 00:24:26,230 So they'll hook up into your Expensify and to your expensing tools and look at your credit card, uh, expenses and identify, oh, someone created an AWS account. 372 00:24:26,230 --> 00:24:27,150 Oh, look at this. 373 00:24:27,150 --> 00:24:29,850 And they'll identify this, uh, shadow IT stuff for you. 374 00:24:29,890 --> 00:24:30,990 So I find that. 375 00:24:30,990 --> 00:24:37,570 And it's, it's really interesting because, uh, we ran into issues where AWS didn't have permission to do things with that account. 376 00:24:37,570 --> 00:24:38,770 You probably ran into the same thing. 377 00:24:38,850 --> 00:24:43,030 Uh, and so you had to get the account owner to give you permission to handle that account. 378 00:24:43,430 --> 00:24:44,170 Yes. 379 00:24:44,310 --> 00:24:53,330 In situations where most of your developers share the same permissions level, how do you stop them or what mechanisms would you be able to use to stop them from just editing that and 380 00:24:59,910 --> 00:25:00,810 Oh yeah. 381 00:25:00,810 --> 00:25:01,910 Don't give them that permission. 382 00:25:02,070 --> 00:25:08,470 So that, that, that, that, that is, um, only that you can only do that from the master account. 383 00:25:08,730 --> 00:25:15,150 So in any case, you want to limit access to your master account to only limited few people who could apply those SAPs. 384 00:25:15,430 --> 00:25:16,810 So it's an administrative thing. 385 00:25:16,810 --> 00:25:23,990 So, you know, a limit, I mean, in general, a general rule of thumb is limit master account access to only a few admins. 386 00:25:24,070 --> 00:25:25,730 Is that, is that answer your question? 387 00:25:27,290 --> 00:25:32,170 The question was, how do you limit access from people changing the flags on SAPs? 388 00:25:32,170 --> 00:25:34,870 And the idea would be to limit access. 389 00:25:34,950 --> 00:25:35,810 Uh, yes. 390 00:25:41,830 --> 00:25:42,850 Say again? 391 00:25:45,190 --> 00:25:46,650 Oh, security hub. 392 00:25:47,090 --> 00:25:50,730 Um, I've played with it, um, with guard duty. 393 00:25:50,730 --> 00:25:51,890 I mean, I've used it. 394 00:25:51,890 --> 00:26:00,410 So, um, it won't monitor everything, but, um, in this, what I'm talking about, I guess is more prevention. 395 00:26:00,410 --> 00:26:03,810 So kind of setting up guardrails to prevent, uh, things from happening. 396 00:26:03,810 --> 00:26:13,690 So if you're noticing things, you could use SAPs to prevent things, but you want to get at the root cause of what's, what's happening in your environment. 397 00:26:14,770 --> 00:26:15,470 Yes. 398 00:26:25,300 --> 00:26:26,780 Privileged IAM accounts. 399 00:26:27,160 --> 00:26:35,520 So the question is, do you have, do you recommend any tools to, uh, manage privileged IAM accounts, um, in AWS? 400 00:26:35,520 --> 00:26:45,960 Uh, there's a couple, I mean, there's a couple tools out of the box, uh, from AWS that will have you run permissions and show you what permissions, uh, IAM users are using, uh, out of the box. 401 00:26:45,960 --> 00:26:50,480 And so you can, um, do an audit of that. 402 00:26:50,580 --> 00:26:54,000 Um, I recommend, you know, just as a best practice, having different roles. 403 00:26:54,040 --> 00:27:05,540 You know, you have a developer, maybe a super developer, uh, your network admin, uh, IAM admin, um, you know, a few, very few super admins, right? 404 00:27:05,640 --> 00:27:15,420 Um, and then try to use automation so that things are run and pushed through Terraform and GitHub so that there's an audit, audit log and audit trail of what's done. 405 00:27:15,480 --> 00:27:24,760 And so if you can see things done through a GitHub commit, um, and it's been approved, that PR has been approved, then you have some sort of audit trail and some permissions. 406 00:27:24,760 --> 00:27:25,660 Does that answer your question? 407 00:27:26,740 --> 00:27:27,560 Kind of, right? 408 00:27:28,320 --> 00:27:28,880 Yes. 409 00:27:40,780 --> 00:27:42,040 Uh, that could be a thing. 410 00:27:42,200 --> 00:27:42,880 That could be a thing. 411 00:27:42,880 --> 00:27:50,000 I haven't used it, but I think that could, that'd be a great, uh, that, I mean, the, I think the, the, you're unlimited in, in what you could do. 412 00:27:50,080 --> 00:27:50,640 Yes. 413 00:27:50,640 --> 00:27:56,780 Can you use SEPs to force tagging, uh, and like a tagging schema that you want to use? 414 00:27:57,600 --> 00:27:59,960 Um , I don't know. 415 00:28:01,720 --> 00:28:09,200 Or just in general for accounts for how folks are like, say, I want to always have an owner tag. 416 00:28:09,200 --> 00:28:16,260 I can imagine you can, I believe you must have an owner tag. 417 00:28:16,260 --> 00:28:18,480 You must have a description tag. 418 00:28:18,480 --> 00:28:19,160 Yeah. 419 00:28:19,160 --> 00:28:22,160 I, I, so the question is, can you use SEPs to enforce tags? 420 00:28:22,160 --> 00:28:23,240 I believe you can. 421 00:28:23,240 --> 00:28:32,660 Um, so basically what I would imagine is, uh, you know, when, when, when you have an EC2 run, uh, put a condition to require a tag, for example. 422 00:28:32,760 --> 00:28:35,400 Um, but I haven't created one, but yeah, I would imagine so. 423 00:28:36,120 --> 00:28:36,880 Yes. 424 00:28:42,940 --> 00:28:48,500 Um, so there's a few tools out there. 425 00:28:48,500 --> 00:28:50,440 Um, I guess ask me afterwards. 426 00:28:50,440 --> 00:28:51,180 I can, I can answer. 427 00:28:51,180 --> 00:28:58,080 There's a few out of the box from, uh, CloudTrail, I'm sorry, from AWS that will let you take a look at permissions. 428 00:28:58,080 --> 00:28:58,920 Are you talking about permissions? 429 00:28:59,200 --> 00:29:00,220 Permissions question? 430 00:29:09,050 --> 00:29:15,450 So if I understand the question, what tools are there available to take a look at permissions and audit, audit logs, or just permissions? 431 00:29:15,590 --> 00:29:21,130 So with audit logs, I mean, so CloudTrail you have now, uh, a lot of the IAM logs are going in CloudTrail. 432 00:29:21,130 --> 00:29:24,850 You could use any sort of tool, uh, Alex, Splunk, Sumo Logic. 433 00:29:24,890 --> 00:29:27,430 Uh, there's a few, there's a bunch out there. 434 00:29:27,470 --> 00:29:33,510 Um, yeah, I don't recommend specific vendors, uh, necessarily. 435 00:29:33,510 --> 00:29:34,970 So yeah, 436 00:29:46,610 --> 00:29:48,330 there are. 437 00:29:48,330 --> 00:29:52,830 So the question is, are there anomaly tools, uh, out there that look for anomalies? 438 00:29:52,830 --> 00:29:55,210 Well, there's GuardDuty out of the box, uh, for AWS. 439 00:29:55,210 --> 00:29:56,930 I don't work for AWS by the way. 440 00:29:57,070 --> 00:30:01,550 Um, there are other tools that will ingest your logs and look for anomalies. 441 00:30:01,550 --> 00:30:04,170 A lot of times you have to write, uh, those out. 442 00:30:04,230 --> 00:30:09,730 Uh, but yeah, I mean, security hub and GuardDuty and that whole like ecosystem, that's AWS's recommendation. 443 00:30:10,310 --> 00:30:10,970 Yes. 444 00:30:23,330 --> 00:30:25,530 Uh, yeah, I'm going to be posting these slides. 445 00:30:25,530 --> 00:30:27,010 So yeah, these slides will be posted. 446 00:30:27,010 --> 00:30:27,670 Yes. 447 00:30:29,150 --> 00:30:35,110 I have, um, but I say with a sigh. 448 00:30:35,430 --> 00:30:43,450 So, um, it's, it's, um, I don't know if I want to go on record, but yeah, I've used AWS. 449 00:30:45,130 --> 00:30:46,550 I've used AWS config. 450 00:30:46,550 --> 00:30:49,530 The question is, have you used AWS config and what are your thoughts on that? 451 00:30:49,650 --> 00:30:51,690 Um, I have thoughts on that. 452 00:30:51,830 --> 00:30:57,070 Um, I think, you know, it works for, for some organizations. 453 00:30:57,370 --> 00:30:58,830 Um, it's something good. 454 00:30:58,830 --> 00:31:00,950 I think it's better than nothing. 455 00:31:01,210 --> 00:31:08,290 Um, but I think with the convergence of a lot of tools that are coming out there, there's a lot of overlap that I'm seeing. 456 00:31:08,330 --> 00:31:14,150 So, and that's the hard thing with AWS is like, you know, you'll find someone that creates a tool, either open source or commercial. 457 00:31:14,150 --> 00:31:24,950 And then AWS comes with something, but then it's kind of half-assed like everything else that comes out of AWS when, you know, when it comes out, uh, it's kind of like, uh, AWS kind of beta tests things on, on the public. 458 00:31:24,950 --> 00:31:27,250 And then, you know, six months later, it's kind of better.