start	end	text
4220	10300	So, hello everybody. We are very excited to be here. And welcome to the session
10300	15300	Breaching AWS Accounts Through Shadow Resources. And in this session we will
15300	19960	demonstrate several vulnerabilities that we found on AWS. The most severe of
19960	23480	these vulnerabilities could allow an attacker to add an admin role to another
23480	30600	account. So let's start. Let's start by discussing the most debatable topic on
30600	38100	AWS which is AWS account ID. So, each AWS account has a unique identifier
38100	45180	associated with it. This identifier consists of 12 digits and the most
45180	51440	important thing about this is that some treat it as a secret and some don't. And
51440	56280	along the history of AWS we have many different opinion whether it is a secret
56280	63940	or not. Although AWS in their documentation states that this account ID should be
63940	68980	shared carefully, they do not consider this a secret. But we as security
68980	72740	practitioners, security researchers, know that attacker could achieve
72740	78960	problematic things only by knowing this account ID. So, what is the right answer?
79120	84940	Are AWS account IDs secret or not? We hope that by the end of this session we will
84940	91920	have more solid opinion about this. So, let us introduce ourselves. My name is
91920	98500	Yakir Kotkoda and here with me are Michael Kaczynski and Ofik Itach. We are all
98500	103200	security researchers from Aqua Security and we are focusing in our daily on cloud
103200	107820	vulnerabilities, open source vulnerabilities and more. Let me go over the
107820	112080	agenda. We will introduce something that's called shadow resources and what they
112080	119100	are, then several vulnerabilities that we found on AWS and an open source tool that we
119100	124360	developed during our research that helped us to find more vulnerabilities. After
124360	129140	this we will introduce a new technique called bucket monopoly that help us emphasize
129140	134360	the risk of our findings and we will end our session by suggesting some
134360	141860	mitigations and recommendation. So, let's first talk how our journey began. While we
141860	148800	worked with the AWS management console, which is the GUI of AWS, we noticed that when a
148800	155580	user use the cloud formation service and upload a template file, AWS behind the
155580	162300	scenes creates an S3 bucket for the user. Although the user did not explicitly ask AWS to
162300	167900	do so, this is how the service operates. We have decided to name this kind of resources
167900	173520	that spawned automatically without the user intervention a shadow resource. So, let's
173520	179380	explain this term. When we refer to shadow resources, we are mainly first to resources that
179380	187200	generated automatically or semi-automatically by AWS. Most of the time they spawn without
187200	194080	user intervention and they might go unnoticed by the account owner. And the great example
194080	199380	for this is just the S3 bucket that we saw that the cloud formation service creates for the
199380	207360	user. Now, let's align some first, some common knowledge about S3 bucket, which is one of the
207360	215240	first services by AWS. This service has some special uniqueness. First of all, S3 bucket
215240	222140	name must be globally unique across all AWS. For example, if you create an S3 bucket called
222660	229020	coolbucket1, no one else on AWS could claim this name. It will be available only under your
229020	236080	account. So, let's set up a view and talk about our first vulnerability on cloud formation. So,
236080	241640	first of all, what is cloud formation? Cloud formation is an infrastructure as code service by
241640	248380	AWS similar to the telephone project. A user will define a template file that contain AWS
248380	255880	resources. Then the user store this template file locally or in S3 bucket. And then the user
255880	262840	will create a stack based on this template file and when the user will deploy this stack, the
262840	269180	cloud formation service deploys the resources that exist under this template file. Now, I
269180	273180	want us to understand what's happened behind the scenes when the user upload the template file
273180	281740	to this service. So, first, the user clicks on the upload template file under the GUI. And we
281740	289400	need to remember that every operation on AWS is eventually an API request. So, the create upload
289400	295440	bucket API request will be invoked. The cloud formation service will try to create an S3
295440	303160	bucket. Then it will return the bucket name. And then the put object API request will upload
303180	310600	the template file to the cloud formation service. Then we will have a lot of API requests. But in
310600	315960	the end, the user will submit the stack which will cause the cloud formation service to deploy
315960	323060	all the AWS resources that exist under this template file. Now, I want us to focus on the
323060	329960	bucket naming pattern of this S3 bucket. So, it will consist of three different parts. The first
329960	337060	one is a prefix, which is a constant string and it will remain the same. In this case, it is CF
337060	345400	template. Then we have the hash, which is a unique identifier per account. And then a region, which
345400	351000	will be related to where the user initiate the cloud formation service. So, now let's visualize
351000	359200	this. So, basically, when a user uses the cloud formation service via the AWS GUI, AWS behind the
359200	365120	scenes creates an S3 bucket with this pattern. And when the user will try to create another cloud
365120	370440	formation service in a new region for the first time, the cloud formation service creates an S3
370440	378420	bucket with the same prefix, with the same hash, but with a different region. So, we have here a
378420	387400	semi-predictable bucket name. So, what if an attacker open or claim this bucket before the user?
388100	395020	So, if a user, if an attacker does so, this technique is called bucket name squatting or bucket
395020	401560	sniping. You can read a great blog by Oren McKay about this technique. Now, let's explain this. So,
401560	407160	we have here the user with the cloud formation service on a specific region. And then the, an
407160	413640	attacker on a new region. And what the attacker did here is that he creates a bucket under his
413640	419280	account with the hash of the user. We will talk about this later. The prefix and the region. So,
419280	425560	whenever the user will try to use the cloud formation service in this region for the first time,
425560	431580	the cloud formation service will try to interact with the attacker claim bucket. But, it will
431580	438860	receive an error. So, basically, we have here a way to prevent the other user from using the cloud
438860	448080	formation service on a specific region which can be considered as a DOS scenario. And a DOS scenario
448080	455660	is fine, but it isn't enough for a DEF concession. So, let's escalate it. What if an attacker
455660	463080	opened a bucket for public access? So, the reason why the cloud formation service got an error
463080	469400	before is because the attacker needs still to define some settings on their S3 bucket. First of
469400	476240	all, the attacker needs to allow public access because it's blocked by default. And then, in
476240	484560	order to allow cross-account access, the attacker needs to define a resource-based policy. In this
484560	491200	case, we have a very permissive bucket policy that allows any principal on AWS to perform any
491200	496600	action on the S3 bucket of the attacker. Of course, this is just a POC and this is very, very
496600	503480	dangerous. So, after the attacker does so, now an interesting thing will happen. The cloud
503480	509680	formation service of the victim will succeed interact with the attacker claim bucket. So, whenever
509680	516240	the user upload a template file, it will be dropped to the attacker S3 bucket. So, we have here a
516240	522120	way to enumerate different secrets and resources that the user wrote in their template file. So,
522120	531040	this is an information disclosure scenario. But, if an attacker already has access to this
531040	538060	template file, what if an attacker modified it? So, if an attacker does so, this is called
538060	543440	resource injection in cloud formation templates and it's a great technique that's published
543440	550580	already by Rhinolab and also credited to Matthew Filler about this. And all the idea behind this
550580	556440	technique is some time of check, time of issue behavior that the cloud formation service has by
556900	562920	default that allow an attacker a windows of opportunity to modify templates file before the
562920	568320	cloud formation service try to deploy them. So, it's possible for attacker to modify this
568320	573860	template file and actually do it manually or with Lambda that will backdoor this template
573860	581880	automatically. So, now let's visualize this. Here we have the user and the attacker account. The
581880	587320	attacker is in external account and the attacker create an S3 bucket that the cloud formation
587320	592340	service of the victim will try to use. And a Lambda that will backdoor any file that dropped to
592340	600800	this S3 bucket. So, whenever the user creates a stack, the cloud formation service uploads the
600800	607320	victim template to the attacker S3 bucket. Then the Lambda will be triggered and gets the
608260	613680	template file from the attacker claim bucket. Then the Lambda will perform a resource
613680	621660	injection and here we have a new resource. It's an admin role that can be assumed by the attacker.
622340	630560	Then the Lambda will inject this backdoor template file to the S3 bucket. And as I said before, we
630560	636720	have here some time of check, time of use issue. So, the user needs to deploy the template file.
636720	641480	So, the user click on the submit stack. And then the previously vulnerable cloud formation
641480	648320	service will attempt to get the backdoor template file from the attacker S3 bucket and deploy this
648320	654260	malicious role under the victim account. So, we have here an admin role from external accounts
654260	664250	that the attacker can claim. So, actually it's, which, which means an account takeover. Okay.
666390	673490	But there are some important point to mention. In order to add or inject an admin role to another
673490	679910	account, the initiator of the cloud formation service, which is an AWS user or a service role,
679910	686010	needs to have some, needs to have some high privilege. And we can assume that user that use the
686010	691370	cloud formation service via the GUI have such privilege. And even if they do not have high
691370	698450	privilege, it's still possible to modify what exists in the template file. And of course, the
698450	703570	attacker needs to wait for the victim to use the cloud formation service in a new region for the
703570	710310	first time. So, now let's see a really quick POC of this. Here we have the victim account that
710310	715710	try to use the cloud formation service via the GUI and upload the template file. Behind the
715710	720310	scenes, the cloud, the template file already dropped to the attacker claim bucket and the user
720310	724990	still needs to define stack name, privilege and more. And this is what caused the time of check
724990	730810	time of use issue. As we can see here, we have the attacker S3 bucket with the template file of
730810	736390	the user and the attacker can modify it. Meanwhile, the attacker deploys the stack and we can
736390	742770	see that we have under this deployment an attacker user which is a really privileged role, an
742770	748490	admin role. And we can see also that this all can be assumed from external account. In this
749190	754690	case, the attacker account. So, all attacker needs to do is to assume this role, find the
754690	761030	related account ID of the user on the CloudWatch logs and then the attacker has an admin role on
761030	765250	the victim account. Which is one of the most severe thing that we can receive in the cloud,
765250	779400	right? Thank you Akir for showing us such a cool technique. But before we continue, let's not
779400	790460	ignore the elephant in the room. Akir showed us previously a way to, sorry, a way to
791100	797360	previously Akir showed us a way to, he showed us that the bucket name needs to be
797360	803400	predictable. But when we look at the bucket name, it's definitely not predictable, right? It's
803400	809320	due to the hash in the middle. So, we knew we had to address this problem. The first attempt
809320	818720	that we did was actually trying to enumerate and calculate every possible hash. But we
818720	825240	quickly realized it's just not doable to the amount of option that we had. Then we thought
825240	830340	maybe we can reverse the hash or something like that. Akir said that the hash is unique
830340	836220	per account. So, maybe it's based on the account ID or other unique identifier in the
836220	846300	account. But after many unsuccessful attempts, we left that technique. Then we decided to turn
846300	854660	to open source. In open source, we saw this code. And in this code we saw that there is some
854660	860560	cases, there is a code that shows that the bucket is actually randomized. The hash is
860560	873320	actually randomized. And what that actually means is it's, we can't predict the hash. So, our
873320	885640	technique is not going to work in the real world. But as good researchers, we were sad about
885640	890600	this because we know that our technique is not going to work and we had to rethink about
890600	896880	everything that we came so far. We have a really nice technique. We managed to remote account
896880	906420	takeover. But we don't have how to use it in the real world. But as good researchers, we thought
906420	914560	about a solution. We used the greatest tool known to us, which is the search tool. We used
914560	922680	GitHub search and we used source graph search and we managed to find over a thousand buckets.
922680	927940	Some of them with the hash that we mentioned. All of them with the hash that we mentioned. And
927940	936820	it gave us the ability to hack, like, a couple of big organizations. But we didn't stop there.
937180	944280	Doing our searches, we actually find that there is cases where the account, where the bucket
944280	952660	name of some services is actually created by just using account ID. So, we thought about
953650	962920	maybe instead of trying to find a mysterious hash or trying to understand this randomized string,
962920	971300	maybe we can just use the account ID instead and find new vulnerability that the bucket name
971300	981540	actually contains the account ID. So, we decided to shift our whole research and turn to find more
981540	988960	bucket patterns. We used the open source and look for more bucket patterns. We used AWS
988960	995500	documentation and SDK. We even started calling and trying to press nearly every possible button
995500	1004540	in AWS GUI. And we even created a tool, an open source tool that you can all play with it after
1004540	1014480	this talk. It lets you debug AWS like you're debugging network buckets. And it shows the inner
1014480	1023860	API calls made by AWS which is kind of nice. So, let's see how it works. In one screen, we initiate
1023860	1033520	an API call. This API call in this scenario is the upload template that Kir talked about before. In
1033520	1041420	the other screen, we use Wireshark with our plug-in. We wrote a plug-in for Wireshark. And we
1041420	1050220	just starting to capture API calls that we made. And what is interesting about what we seen using
1050220	1058380	this tool is actually when we initiate the API call in the GUI, it's actually one API call. But this
1058380	1065900	API call is undocumented. And the equivalent to that API call is actually five different API calls
1065900	1072680	made by the inner services of AWS. One of them is the create bucket that Kir told you before and it
1072680	1077880	also calculates the hash. So, we have here an undocumented API call used by AWS to create
1077880	1087200	buckets. So, all of the techniques that I mentioned before gave us around hundreds of buckets and we
1087200	1094920	understand that we have tons of work to do. Because as a reminder, some of the buckets came from
1094920	1100500	open source projects. So, we need to understand which bucket is related to what service. And we
1100500	1109200	also need to understand if any of the services is exploitable. So, you are probably wondering what is
1109200	1115440	the answer for those questions. And the answer was, we managed to find five different
1115440	1125200	vulnerabilities within AWS. Some of them by just using the account ID. So, let's talk about the
1125200	1132460	common steps that we need to take that is common to all the vulnerabilities that we found. As
1132460	1137420	Kir said before, we need to create a bucket name before the user. We also need to open the bucket
1137420	1144060	to the world and we need to put lambda or something to monitor the bucket. And when a file is
1144060	1150920	dropped to the bucket, we can change it. It's the same technique. So, let's explore our second
1150920	1157960	vulnerability for today. In AWS glue. This one is really strong. Because you only need the account
1157960	1171500	ID to exploit a remote account. And just a reminder, account ID is not a secret by AWS, right? So, what
1171500	1178680	is AWS glue? AWS glue is a service for data engineers. This is basically used for data
1178680	1185380	manipulation. To trigger the vulnerability, the user needs to create a job in glue. When you do
1185380	1191980	so, a bucket is automatically configured with a predictable name. There, files of glue will be
1191980	1200780	stored. So, if a bucket is predictable, we can take it before the user. And that's exactly what we
1200780	1208200	did. Our user creates a job. When he creates a job, a script is dropped to our bucket. We have our
1208200	1216600	lambda that changes the file. And when the user runs the job, he gets the modified script. And
1216600	1226710	voila. We have a remote code execution on the remote account. So, you are probably wondering,
1226710	1236810	what are the privileges of the AWS glue service? So, it's actually configured by the user that triggers
1236810	1246490	the job. Most of the time, it will be a default service role that you get when you use AWS glue for
1246490	1253390	the first time. And that role is pretty interesting. Because it has a lot of enumeration
1253390	1261990	potential on the account and also it has some write potential in the account. So, you could
1261990	1268910	probably escalate from here. But it's not the topic for our talk. Another cool anecdote about this
1268910	1277610	vulnerability is actually invisible. And I will explain. When the user tries to get the script and
1277610	1284790	look at the script, he actually gets the original script. Even though it's already modified. And
1284790	1291250	when he runs it, he actually runs the modified script. This is just due to a bug in the AWS
1291250	1299370	glue. But it's still cool. So, let's see the full POC. We recorded that on February. Here you
1299370	1309390	can see a user creating a glue job. When you press the save button, the files are dropped to the
1309390	1316470	attacker bucket. And that's what also gives us the time to modify the script. Because if we are
1316470	1323130	automating this, the Lambda takes just a couple of milliseconds to modify the to inject the code
1323130	1334110	there. In this POC, we just put a print for POC purposes. And as you can see, when the user tries
1334110	1341510	to get the script, he gets the original script. And when he runs the script, if we look at the
1341510	1356980	logs, you can see that the script is actually modified and we got remote code execution. So, now
1356980	1367480	let's explore the third vulnerability for today in EMR, which is another service of AWS. This one
1367480	1375420	is also kind of cool because it, again, it's only the account ID. That's what we were looking for. And
1375420	1385540	it has a cool post exploitation technique. So, EMR, it's a service for data consumption used by
1385540	1392720	data scientists. Another data service. To trigger the vulnerability, the user needs to create a
1392720	1398500	studio. And when you do so, a bucket is automatically configured. And that's where we come to
1398500	1405520	the picture. Again, we open the bucket before the user. When the user creates a studio, he actually
1405520	1412860	stores Jupyter notebooks to our bucket. And in our bucket, we have our Lambda that changes the code.
1412860	1421540	And in Jupyter notebook, you can inject JavaScript. So, we decided to inject JavaScript here and it
1421540	1431560	acts like stored XSS. When the user tried to open his EMR, his service, he gets the modified Jupyter
1431560	1438740	notebook and every time he will go to the notebook, he will be redirected to a fake login page
1438740	1447900	created by us. A quick disclaimer about this vulnerability. It's not a zero shot. It means that
1447900	1455480	the vulnerability, when the user configures the page, he actually needs to do some changes because
1455480	1462740	he gets an error. But the error is really vague. And when I see an error like this as a user, I do
1462740	1471760	one of two things. Either I change the role or I use the policy that is recommended by AWS. In
1471760	1480260	both cases, the vulnerability is going to work. This is due to inconsistent in AWS. The policy
1480260	1487000	that they recommend is actually lacking a string condition that's supposed to protect you from
1487000	1493840	such an attack. But they forgot it. Now Michael will show you a couple of more vulnerabilities
1494410	1499800	and will show you how our technique applies on open source projects. Thank you.
1505870	1512910	All right. So, thank you Ofek. So nowadays everyone loves AI and machine learning. And we could not
1512910	1517590	miss a chance to talk about this on our lecture. Let's discuss the rest of the vulnerabilities and
1517590	1524530	start from AWS SageMaker. So SageMaker is a tool in AWS that is designed to build, train and
1524530	1532850	deploy machine learning models. Canvas is part of the AWS SageMaker ecosystem and it's a very cool
1532850	1539410	no code drag and drop interface. We discovered that when a user creates a Canvas instance for the
1539410	1546470	first time on a specific region, then a bucket with the name SageMaker dash region dash account ID
1546470	1553550	is created and the S3 bucket will store files that are utilized by the service. So let's go over
1553550	1559630	the full attack scenario. So the attacker has claimed the bucket before the user and then the
1559630	1566110	user opens Canvas and it will create a data set and uploads the files. On the background the
1566110	1571070	files will be uploaded to the attacker controller S3 bucket and then the attacker could get the
1571070	1576370	data set and we will have data leakage. But if that's not enough, the attacker could
1576370	1582270	also manipulate the data set and then SageMaker will use the manipulated data set and we have
1582270	1588430	data manipulation. So it may lead to inaccurate models and all of this can happen without the
1588430	1595010	user even knowing that something has changed. And to our next vulnerability on AWS is on
1595010	1601270	CodeStar. So CodeStar is a tool that provides a unified user interface to easily manage
1601270	1606350	software development activities. So the service was deprecated just I think two weeks
1606350	1611790	ago and in this scenario the attacker has claimed the bucket again before the user and when
1611890	1618670	a user tries to create a CodeStar project on a region, then CodeStar on the background will
1618670	1625010	try to create a bucket and it will fail and it will return the user an error. So this is
1625010	1630010	essentially a denial of service attack since the attacker prevents the user from using CodeStar
1630010	1636750	on a specific region. And there's one more vulnerability on service catalog. We won't
1636750	1641230	elaborate about it right now but we're going to publish a blog in the next few hours so you
1641230	1650910	could see it there. So after we talked about the vulnerabilities in AWS, on our research we
1650910	1655510	also identified that this attack vector affects many open source projects as well apparently.
1656030	1662190	And many open source projects create S3 buckets as part of functionality and the consequences
1662190	1668730	change depending on the project but some projects are vulnerable and could allow an attacker
1668730	1675470	to gain full access to all of the files in the bucket. So here you can see an example of a
1675470	1682270	project that checks if the bucket exists. And this check is wrong since an attacker could claim
1682270	1687090	the bucket and the project will print to the screen that the bucket already exists but it will
1687090	1693650	continue running without any problems. And there's another example of a project that tries to
1693650	1699690	verify that the bucket exists and it tries to list the bucket. But this check is also wrong
1699690	1706510	since an attacker could claim the bucket, open it for public access, set permissive policy and
1706510	1714430	by doing so it will allow the victim to list using the AWS S3LS command to list the bucket and
1714430	1722550	again the script will continue running without any failure. And also as part of our investigation
1722550	1727910	we found services that could be vulnerable in the past. These services created predictable
1727910	1733950	bucket names. For instance Athena once created a bucket with the name AWS Athena query
1733950	1741790	results dash account ID dash region. This bucket is not created anymore and when we
1741790	1747230	encountered it Athena did not seem to be vulnerable and now this bucket is created by the user
1747230	1753470	specification. All right. So we discussed vulnerabilities in AWS services and open source
1753470	1758330	projects as well. Now let's explore how we can elevate what we've learned so far to the next
1758330	1764690	level. So we wanted to increase the chances of a victim to be compromised. It would be
1764690	1769330	important to us to show that this attack vector is not just theoretical but it's also practical
1769810	1775370	and effective on real world scenarios. And we are proud to produce uh, to introduce a new
1775370	1780270	technique we named bucket monopoly. So in previous vulnerabilities we targeted specific
1780270	1785630	regions of other accounts. We could check if a bucket already, already exists and if not we
1785630	1791150	could claim it before the victim. However as you all know AWS has multiple regions. So
1791150	1795650	instead of focusing on a single region we could claim all possible regions that the user has
1795650	1801890	not claimed yet. This strategy increases the likelihood of an unsuspecting victim interacting
1801890	1808630	with an attacker on S3 bucket. But since we have several vulnerable services let's create all
1808630	1814450	of the buckets in all of the possible services. This is practically a land mine. The victim
1814450	1820350	is surrounded by malicious buckets belonging to different services. Whenever the victim will
1820350	1826310	use a new service from uh, the six services we presented on any new region it will be
1826310	1835090	immediately compromised. Let's explain step by step how to perform this kind of attack. First
1835090	1840230	of all we must identify predictable bucket name. After finding these buckets we need to
1840230	1843970	verify that the associated services that create these kinds of buckets are indeed
1843970	1849670	vulnerable. Secondly we must recognize what is the unique identifier. And the last step
1849670	1855710	which is the easy one we need to claim all the bucket names across all regions. So we showed
1855710	1860270	you several ways how to find these kinds of buckets. We start reconnaissance by looking for
1860270	1866650	bucket names that contains a prefix or a postfix alongside with an identifier like account ID
1866650	1872470	or a hash. And it could be achieved by using the GitHub regex search. We could read AWS
1872470	1877590	documentation as well. And we could use, we could crawl AWS services with tools like
1877590	1882950	TrailShark that Ofig just showed you before. Next the second step is to understand what is
1882950	1888890	the unique identifier inside the bucket name. It might be a random hash and it will require
1888890	1893930	further instigation. It could also be account ID or some kind of other public metadata
1893930	1900250	information. If it's a hash we could search on GitHub and on source graph to find leaked
1900250	1904450	hashes and then target them. And if it's an account ID there are multiple ways to find
1904450	1910110	them. So the first method is to use GitHub. We could search the GitHub regex search for
1910110	1915450	specific patterns. We could also leverage the gray head warfare platform which is a
1915450	1919330	platform that collects publicly accessible S3 buckets and then we could extract the account
1919330	1926190	ID out of the bucket. So Jerome Brown did it and he extracted nearly 197 thousand unique
1926190	1931630	account IDs. We could also extract the account ID out of the AWS access key ID. Nice
1931630	1937150	article by Tal Berry who showed how to do it. And lastly there are valuable lists out there
1937150	1942110	of known AWS accounts which includes account IDs of numerous large organizations and
1942110	1947750	vendors. And the last step is to monopolize. So attacker utilize the understanding of
1947750	1952830	naming conventions and account IDs to strategically create S3 buckets with predictable
1952830	1958550	names across all AWS regions where these buckets do not exist yet. Then the attacker
1958550	1963890	will open the bucket for public access, set permissive policy and by doing so they
1963890	1970590	position themselves to intercept the victim future interactions with these buckets. Now
1970590	1974770	let's talk a little bit about disclosure and timeline. So we reported these vulnerabilities
1974770	1979830	at the middle of February and AWS immediately started fixing them. We got a final
1979830	1985410	confirmation that the vulnerabilities were fixed at the end of June and the general
1985410	1991850	approach here was consistent. So AWS will either add some kind of a random sequence or a
1991850	1997670	number to the bucket and then create it or they will prompt the user to choose a new bucket
1997670	2002830	name thereby they will ignore the already claimed bucket. AWS also indicated that they
2002830	2006850	confirmed the results of each team investigation and they will contact customers
2006850	2013170	directly in the event that they were affected. So to conclude what we've seen up until now.
2013170	2018150	We have identified six vulnerabilities in AWS that might enable an attacker to exploit
2018150	2022810	organization. We explained how these vulnerabilities occur and we presented a new
2022810	2027690	attack vector called shadow resources as well as the technique we named bucket monopoly.
2027690	2032830	While the vulnerabilities we mentioned were already mitigated by AWS this attack vector
2032830	2038210	can still be applicable to other AWS services and many, many open source projects as you
2038210	2043610	just saw. So to prevent an entity that assumes a role accessing a bucket you do not trust
2044110	2049610	you can define a scoped policy that contains the AWS resource account condition. So this
2049610	2055730	approach will prevent the user in your account to access and write data to buckets that
2055730	2062090	are located on accounts you do not trust. We also recommend verifying that the owner of
2062090	2068150	the S3 bucket using the expected bucket owner header to ensure that the buckets that are
2068150	2073570	used by your services are indeed under your account. It's very simple. You can just take
2073570	2078890	each one of your buckets, the cloud formation, the glue, the EMR and the rest of them and
2078890	2083670	for each region check that no one has claimed your bucket. It's a simple solution and it's
2083670	2092030	great to check if you haven't been exploited. Sorry, this command. And the expected bucket
2092030	2096130	owner header is also valuable for open source projects as well to verify that no one has
2096130	2107070	claimed the bucket. And lastly, name your S3 bucket with some kind of a random number or a
2107070	2116950	string making the bucket name less predictable. So, after everything we've demonstrated, do
2116950	2121810	you still believe account ID is not a secret? Thank you. We have short time for questions and
2121810	2148280	you're welcome to follow us on Twitter. All right. Questions anyone? All right. We can.
2154300	2165140	So, do I policy to prevent a lot of these attacks? So, you can use them. As I showed you
2165140	2176460	before, the, sorry, the, thank you. So, you should, we showed you several ways. I think the
2176460	2182340	resource account condition should be fine to prevent all your roles and users that are
2182340	2187060	assuming this role from accessing buckets you do not trust. I mean, for specific roles that need
2187060	2194300	to access some kinds of buckets, you just, I mean, by default, I recommend adding these like
2194300	2201300	section to making sure that the buckets you try to access or your services, et cetera, will not
2202340	2208240	access buckets that you do not own or maybe someone else owns. Right. Because you might also
2208240	2215860	delete the bucket and then someone can create it. So, it's like a dangling resource as well. All
2215860	2219740	right. Yeah, I think I'm going to have to go back through and double check my... Thank you. My
2219740	2226380	deny policies. Right. All right. Thank you very much for attending.
