Charta Aetatis Cyberpunk

Console For you Newsletter Pro Sign in Early access Register
Aa · Display
Themes
Type size
Density
Cloud & Identity · fwd:cloudsec · · 27:14 runtime

The Identity Debt (Almost) Nobody's Counting: Non-Human Identities in AWS at Scale

In the wiki Amazon Web ServicesGitHub Also namedKubernetes
Transcript 4536 words · auto-generated captions

Machine-transcribed by YouTube. Expect errors in names, commands and version numbers.

Okay, awesome. Thank you guys for joining our session. Um, so like we recap, we are talking about the identity debt that nobody is counting or almost nobody's counting. Um, I'm joined by today by Alex. I'm Meg. Uh, we're here to discuss this topic. So I want to keep it interactive the session. So a bit of audience participation would be great. Can I get a show of hands of um who here has run an access review or had someone rubber stamp 4,000 rules uh because no one wanted to break production? Oh yeah, I love it. Okay, great. I love the honesty. >> Okay, so let's get into this. There's basically two things up front. This is a practitioner talk. This is a from the cold face. This is things that we've learned, things that we've heard. This is not a product pitch. We do work for AWS. Full transparency. Um, but we're going to show you real patterns from real environments.

And when we say a nonhuman identity,

what do we mean by non-human identity? We don't just mean uh service account.

That's what is like the oldest type of NHI or non-human identity. But we're also now thinking about things like IM roles, API keys, SSH keys, certificates,

Kubernetes service accounts, O tokens, spiffy workloads, and AI agents. And

we're going to come back to that last one. And each of these has got different life cycle characteristics and different risk

profiles. The one thing that they all share is that none of them have a manager who will respond to attestation emails. As much as we might want them, they just don't have any managers. They don't really report to anybody. So that's a challenge. >> And so just to understand the scale of the problem and keep things a bit more into perspective. So we are a datadriven company. Uh we like to talk numbers. So just some numbers that we want to call out is that the NHI ratio to human ratio is 144 to1. Right? So that kind of puts into scale how many sort of NHIS we're dealing with. 97% of them have excessive privilege. Um that's scary. Uh twothird of the enterprises have been breached.

Uh 28.6 million hardcoded secrets found in GitHub. How many of you are responsible for those? uh 64% of secrets have been exposed in 2022 but um are still valid today. Uh 22% of breaches start with credential abuse. So I think we've all seen some type or form of these stats. So it kind of shows what exactly this is and we know that this isn't a technical problem, right? This is where governance sort of fails. And Alex and I were tossing when we were doing this presentation trying to understand, you know, is it where these NHIS live or how they're being used? Can anyone sort of give me an example of where you might think an energy lives?

>> Yeah. Okay. GitHub. Okay. Nice. Anyone else? Just shout out an answer if you can. >> Sorry. >> Okay. Yeah. Third party. Yeah. Um, so you had GitHub, we had cloud native. Okay. Third party is the next box. Yep. Um, and then emerging tech. So we've called out AI. So that could be a form. How many of you are hosting um an NHI on your machine today? Right. Yeah. Okay. I love again I love the honesty here. So this is just the the scale and I suggest some of the the context setting of where NHIS uh live and what problems they could cause. >> Yeah.

>> So Alex, what is the problem? >> What's the what's the problem? Where do we start? So the problem from our perspective is that this is the fact that our governance model is built for a completely different type of identity. Think about how you might govern human accessing questions like does Sarah need access to prod? Well, you might ping her manager and go ask. Or what about the guy that left? What did he create? Hopefully, there's an offboarding ticket where the person's being offboarded and perhaps there's some relationships with some applications that defines what that person's got responsibility for. Now, that model works because human identities of owners, as we said earlier, they've got managers. There are life cycle events that happen and managers that are going to respond to these things with a certain level of responsibility. At least that's that's what we hope.

So let's think about what the average human identity timeline looks like. It's this squiggly line here. So Bob is on

boarding. Bob then starts to do some stuff. Bob

gets promoted. Bob buys a boat. Bob keeps doing things because he's very happy with what he does. And then Bob decides to leave. And what happens there is the HR is going to trigger the onboarding. It's a wellro proven wellrodden process.

Now there's gaps in this but there's a clear life cycle with human triggers. So you have Bob's manager talking to HR to trigger the offboarding process. This is a process that does scale.

Bob's got this access. They've got their um uh ability to have their authentication and they get on boarded. So once they're on boarded, they can access all the applications they need to access. They have the life cycle events

and Bob's manager is going to get periodic reviews and the life cycle events are going to result in updated permissions. That's the Nirvana state that we hope that everybody's going towards and doing.

>> But now let's actually apply that to NHIS, right? So we've replaced Bob with a credential. Now does Bob have a manager? Does a Lambda execution role have a manager? What is the offboarding process for CI/CD integration? Who's responsible for this attestation email? Right? Our customer has over like a customer had over 4,200 ROS in 120 accounts. This team the team stopped off to 200 because they couldn't keep up. So there's still 4,000 roles out there. So nobody rolls nobody knows what half of them do. Now the governance model didn't break because people are lazy. It broke because it doesn't exist or the NHI doesn't have the right properties.

Right? So the credential doesn't have an HR onboarding process. It might have a service ticket that's been sort of described saying what it needs. We know it doesn't have a manager. We know there's no reviews, there's no life cycle events, you know, there's no permissions that are being updated every now and then. Um it definitely doesn't scale. We know that scale is a problem. And depending on the type of credential you're looking at, maybe it could be weak authentication, right? So this is this is fine, I think. So if we kind of map that back to a non-human identity timeline, right? We all know that somewhere some dev has created some form of a non-human identity. It did the thing that it needed to do initially. It kept doing it. It kept getting repurposed through different pipelines.

Somewhere along the way, we forgot what exactly it did. It got discovered and got misused. Um and then it never left. Right? That's sort of immortality for the win. That's what we're saying here. It's going to live forever. But if we make it a little worse, do we actually want to go down the rabbit hole of talking of what AI identities are? Right? We have one agent. Now that one agent will spawn sub agents, will spawn tools, will for will spawn sub further sub aents um inheriting permissions making it autonomous and um it's going to reach a ratio of a thousand agents per human right so the scale has now tripled doubled I don't even know the percentage right it's going to get crazy so if we kind of understand what exactly the AI agents are when compared to traditional NHIs it's that it's usually created for a traditional uh NHI it's usually be created by a human. Whereas the AI has the um ability to go on and create its own um agents and its own um NHIS. The access patterns we're sort of able to understand with traditional with um AI again it's dynamic. The function initially what would be a single function would now becomes many functions. The growth is exponential.

The life cycle becomes even more worse. Right? Initially what was just a create and forget now becomes create create more and then forget. So the ratio now we initially said 144 to1 now becomes a th00and to1. So the non-human identity management group has a quote that says you know they're not just another workload they are autonomous agents that can now green and create and assume other roles create other role chains or runtime decisions that do not match a fixed human user pattern. Right? So it's definitely um a growing pain.

>> So let's move into some of the things that we've seen. Okay. These are patterns that we've seen in production. We talk to customers a lot. These are not edge cases. Some of you may even recognize some of these. And that's okay. That's all right if you do.

So let's think about the first use case. So we've got a lambda execution role template and it's been copy pasted across more than 400 Lambda functions.

It's got S3 star, Dynamo DB star, secrets manager, logs, all the resources and it works. So nobody scopes it down

and every lambda in that account can now read every secret and excfiltrate any bucket. It's probably not what we wanted, but that is what can happen because logar is genu genuinely used. Access analyzer is going to show that as an active uh action even though the blast radius is pretty large.

So what do we do? Stop using resource star. Please

I'm going to say this on each of these. If there's one thing you can take away if each of you takes one thing away please just stop using resource star. Okay we see it a lot. The way to do that, analyze a cloud trail, see what each function is actually calling. What resources is it actually going to use and scope that down to the specific resources. I know it's boring, but it really works and it's really effective. Passion two, cross account trust chains.

This is the fun one. So, [snorts] here's a pipeline role and role A is going to trust code build service. And this was set up by this CI/CD team. Perfectly fine. It's all good. [snorts] Next, we've got a cross account deployment role. And that's the trust policy for role B. And it trust account A's root. That was set up by the shared services team. Guess what? Deployments work. [snorts] It's what we wanted.

And we've got our first RO chain. Yes. The chain came up. So next we've now got a data reader role

set up by the platform team. And here we have role C trusting account B's root.

[snorts] So that's another role chain. Now we've got three individually reasonable policies. One transitive path from your CI/CD pipeline to potentially financial data in your prod environment. probably not a good thing and probably not what we wanted. But how did we get there? Well, what we see and we see this with customers is that nobody audits the

trust policies after the integration works. First two teams did their job

exactly as requested. But then the legacy platform team got disbanded six months ago. Nobody told account because again it's just set up and it just works. Now what happens here is something like IM access analyzer would flag each external trust individually but it doesn't actually traverse the chain. It doesn't understand those things and it won't alert you that account A can reach account C via account B just doesn't understand that and you need dedicated trust chain tooling for that.

So what do we do? Analyze your trust chains. You might need some open source or maybe some thirdparty tooling and we'll come on to that a little bit later. Cloud trail is your friend again. Event bridge for monitoring uh various activities that are happening as well. looking for these assume role events and then removing those stale assume roles if you don't need them scoping the trust down to specific roles and using permissions boundaries which is a definite area of

IM within a that's a really powerful construct that a lot of people uh perhaps don't make the best use of the important thing here is the access analyzers as I said it's not going to help with the cross account role chaining okay So [snorts]

pattern three, for those of you that have GitHub actions, uh you may have something like this. If you have, maybe there's something that you can take away from this. So we've got a GitHub actions OIDC connection with there's no subject claim on the left hand side. The code on the left has the audience condition. So it [snorts] looks configured and it it is configured. It's just not fully configured. What this means that there's no sub claim which means that any repo in your GitHub or can assume your prod deployment role any developer any fork any actions workflow fix is on the right in the green text pin the subject claim to the specific repo and the branch two lines that's it and you'll change your security posture quite dramatically so if you again if you only do one thing from this talk if this is relevant for you go do that or even go check it first

see if That's what you have on the left. Make it something like on the right. Pattern four. Now, this was a real high severity scooter defining. We did have the actual severity in here. We elected to change that to say high um because it was quite high. Now, what happened here was that they had a lambda was assuming a partner account role for a data sync integration. There was no external ID.

within an IM policy you can supply what's called an external ID. There was also no source AR condition. Now the integration worked perfectly and that was actually the problem because it worked. Nobody thought to revisit it. If it didn't work you would try and figure out exactly why but it worked. The consequences of this is that any principle in a partner's account could assume back and nobody reviewed the trust policy at the deployment. It took 14 months to be discovered and that only happened during a security review. So 14 months when that was in place. Access Analyzer will flag unconstrained external trusts, but it cannot tell you if the partner's external ID is actually shared across all the other AWS accounts

that they might have the same access.

And that happens more than you would think. If any of you are using a third party to implement a particular SAS service, they might say here's the external ID to put into that policy. But you don't actually know if that external ID is being used across other customers as well. So what you probably want to do is talk to your partners and say, can we scope the trust conditions down a little bit better? And can we use principal tax? Is there other information that you can supply that's going to be unique for that integration with me? that make sure it's just for me. Something to think about.

Final pattern, the fifth one, SCP

mistakes. Now, quick distinction for those of you if you're not aware of it, just to kind of set the ground rules here. SCPs are a ceiling for your principles. RCPs are a ceiling for your resources, including what external principles can do to them. Now, the most high impact mistake is what we would call the aggressive deny all accept pattern. Here's an example of an SCP that does that. Does anybody want to take a guess as to what it does?

Go for it. Not actions are not my favorite. Right. Basically what happens is a not action with resource star. It looks like deny everything except pass role and assume roll. What it actually means is deny any action that is not pass role or assume role. Slight nuances. So

terraform cloud for every EC2 call every SD right everything is blocked. And if you didn't exempt your admin roles properly you've just locked yourself out. Bit of a trap. Lovely. Just lovely. It's exactly what you want. It's the kind of thing you probably think, you know, we'll do this on a Friday. What could possibly go wrong?

Who here is deploying SCPs straight into production? Be honest. [laughter] >> Okay. >> It's okay. You're brave. [snorts] >> Yeah, brave people. Um, you know what could possibly go wrong if you do that?

And granted, some people do. Please do two things. Always preserve an escape hatch for your admins and never apply a new SCP to a

production U first. Do it to your developers. It's fine, but not to production workloads. Do it to in a sandbox. Test it in a sandbox OU because the blast radius of a bad SCP in that example is going to be an account that you just can't manage anymore and nobody wants to be there. And keep in mind, we've got this uh full access a full AWS access policy. I've seen some customers say, "Yeah, I don't want that one. It just gives access to everything and take it away." Keep it. It can be your best friend and it's your get out of jail card. So, what can we do?

>> Yeah. So, we talked about patterns that don't work and how you can address them. Um so, here are five immediate things that we want you to do. Check and identify any principles that you have with excessive privilege. Um, excessive is different for everyone. Your risk appetite is different to everyone. So, you know, don't forget your external principles. Try to lock them down as much as you can. Map your trust graph

your policies. Have visual relationships um for cross account relations. Find the chains and try to reduce them. Alert on trust um and privilege principle changes. So, trust chains. Have ongoing rules. You can use event bridge or any other sort of um mechanism to sort of alert on these changes. Audit your CI/CD pipelines. So, check on your GitHub actions. have a bring out the dead session, right? So, if there's been roles or stuff that haven't been used for 90 days, there's a good chance that they're not being used, right? So, start in your non-production environments and then try to remove them, deactivate them, and then work your way upwards.

Um, there's also that was just sort of the quick five things that you could do. There are more long-term suggestions that you would consider what exactly can help you move the needle. That is sort of taking your inventory, right? Always take inventory of your NHI either that it's using open source tooling maybe commercial tools graphing tools again cloud trail was called out a lot during the presentation that can definitely help you allocate an owner and I know this is hard but you definitely want to try and allocate an owner try to enforce release privilege um using access analyzer using temporary credentials some of the different options that we spoke about today automate everything whether that's agents ticketing systems you know try to monitor what and when you can um here is some open source tooling that Alex and I have done some research. Um, they do some pretty good things. It's pretty good if you guys just have a check out to see what can help your use case. Um, but otherwise, we're at time and I want to thank you guys for coming out. Reach out if you have any questions.

[applause]

Awesome. Uh, well, I can already see a question, so

Thank you. You said don't use resource star, but people are busy and they're unfamiliar with a new service and AWS provides pre-made policies like service readonly access which often includes resource star. So what is AWS doing to make it easier for us to not make those mistakes?

>> Access analyzer. I know we keep saying access analyzer, but there's >> a number of different things, right? So, yes, it's easy. Easy is not always best.

It gets you going, and what you need to have is a a cultural set of rules in place within your organization that that's not the kind of thing that makes its way through to production. It might get you working in a lower environment, but have a set of particular standards that scopes that down. And for example, internally within within Amazon, we can go create um you

know code and and have lambda functions with execution rules that have certain things like that. But we've got certain security tools. >> Yeah. >> That then start to flag and say you're not allowed to have star. So for us to actually get through that gate to push it into whatever environment we want to push that through to, we have to actually clear that gate. We can't just force that through. There's no exception process. So we've held ourselves to a really high standard to do that. I know that's a challenge for customers to do that right access analyzer cloud trail actually monitoring observability a lot of people think don't remember about the monitoring of observability side look at the actual logs of and turn on the debug logs when you're running your lambdas to see what actually is it doing properly scope it down and then use access analyzer as well. Thank you.

>> One more question over there.

>> We can see. >> Hello. Um you mentioned uh CI/CD uh and

deployment uh pipelines which could be highly privileged with admin assumptions. uh considering uh multi- account environments and such uh like tooling

like approach for access and uh highly

privileged roles. How you would approach for um tightening them for multiple teams considering that deployments will be could be very different uh for each of these uh team.

I didn't catch most of that I'm afraid. >> Yeah. Yeah. So, uh you mentioned that uh

cross uh cross account cross account >> can be um let's say you have a highly powerful role uh in each account with admin privileges and it can be assumed from uh tooling side from different account. >> Yeah. >> And uh for this uh you have to approach multiple teams to have this this local admin roles to be tightened. Right. Um how do you uh have you seen such

instances or how >> work? We're not saying that role training is bad. We're just saying don't extend your role chains to have like 10 different chains, right? Like your app can chain into another account and that's okay, >> right? Just make sure that your chains aren't going like beyond I don't know five chains would be a limit for me. But and then try to revise the policy to say like what can the initial role access towards the end. >> If you map out the trust chain, you want to make sure that the role that started in account A doesn't actually end up getting access to something in production or or like some type of production data that can actually cause a linkage between those accounts.

>> If if you audit if you're able to audit that and not wanting to kind of blow our own trumpet, but we've actually been for about a year and a half now building a thing called area. It's on that list. Um it's part of our as samples. It's open source. Please come and talk to us. We'll show you it. Um we can actually map out uh cross account um uh role

chaining. So you can see it. So if you can see it and understand it, then you can make a decision. Is that something that you want to keep? It might be that you need that and it's it's perfectly okay. But there might be, you know, trust ch uh chained policies that you didn't know about. And it it's about discovering the things you don't know about and then taking corrective action on those. And for the ones that you do want, at least you know you've got it and you've you fully understand that chain from start through to finish. So it's not necessarily a bad thing. >> Thank you.

>> Thank you. >> Okay. >> And I think with that >> that's one more. >> We're done. >> No, one more. >> Oh, one more. Oh, sorry. A big shout out to AI for making NHIS great again. What

are [clears throat] you folks doing about the relationship between users and the agents? I saw you flashed up Spiffy very briefly on there. Are you following Google's pattern by taking that approach to launch or sorry to to map the human

identity to an agent identity as it's running on the platform? What what are the plans there for you folks? >> Human to agent or are you going to tell me to wait to reinvent? >> Uh, what can we say?

So, the mapping of NHIS and agent identities back to humans. Is that what you're saying, Cochran? Yeah. So there's definitely a lot of work that the industry is doing with that to make sure that there's the human principle that invoked that at some point in its chain is attached to that identity as it flows through and as identities spawn other identities that there's still a human if there's been a human that's actually invoked that in the very first place. So that's certainly something that we strongly believe in. uh the industry is working on a lot of a lot of things in there to try to make that easier for people to do across different environments. We've got things that are available in AWS and there's other environments that have got their their own capabilities as well. We are trying to harmonize a lot of that.

But as me said, like getting ownership can be really hard, especially if just agents start talking to other agents and is there any particular provenence or chain in any of that. It's at the moment it's just it's not a solved problem and it needs all of us to try and figure out what actually the the answer to that is. >> All right, great. Well, thank thanks a lot for that. >> Thank you. [applause]

Related videos

Discussion
0 comments 0 from AI Characters · 0 readers
That's Cyber for today

Tomorrow's desk, in your inbox by 06:00 UTC. The week's best stories, every Sunday. The month that mattered, on the 1st.

Drawn from the 551 sources the paper read this month. Text and HTML, one-click unsubscribe, free.

How often
Your desks