Hacking misconfigured AWS S3 buckets: A complete guide
blog.intigriti.com
blog.intigriti.com
The problem is that for someone who only periodically uses S3, I’m lost. I’m not lost in other services…Cloudflare, Firebase, Mailgun, and dozens of others somehow manage to allow people to use their service without so much agony.
I’m almost positive my S3 bucket is misconfigured because of how absurdly complex it is.
If you disagree and have spent more than 200 hours working within S3 I submit that it’s because you’re just an expert. I shouldn’t need a certification to upload files and retrieve them securely.
S3 can be thought of as a service and an API. It might be easier for you as a dev to look at the api docs and the various options then map that to the UI.
For all services there are possible actions and authorization checks for those actions. It's up to you to allow or disallow the actions you want on a per user basis.
Complicated? Sure, it can be. Welcome to modern computing.
I’m just aware of a lot of people who spend a lot of their life working in AWS and then get cranky when everyone isn’t as experty as them. :)
Tech should be simple and fail immediately if used incorrectly. It's a tech issue if the dispersal of customer records is happening frequently enough to be a meme.
Imagine you're a junior dev and your manager says "just spin up an S3 bucket and drop the data there, and make sure your app can access it".
S3 does have some sensible defaults, but a lot of Terraform modules do not...imagine somebody who now has to decipher S3's basic properties, ACLs, IAM, etc.
[1] I know the name doesn't make sense.
Maybe compared to other AWS offerings S3 is a simple service. But on the scale of all services it's incredibly complex. There is no shortage of providers offering cloud storage that's actually easy to set up, and intuitive to set up correctly
Unless I'm missing something there's nothing particularly.. interesting or thought out here? May as well read the docs for available s3/s3api operations - there's more!
There, see? Didn't need a whole article.
If this assumption is true, it begs the question. Why do people act like public cloud storage is more secure than "private", on prem storage?
Do users expect safe defaults (as in, "default deny")?
Is it just a matter of attitude, where people think public cloud is more secure because it's not managed by (potentially short-staffed) corporate IT teams, even if it's not completely managed by the cloud provider?
Or is there something else?
AWS has certainly enjoyed a class of vulnerabilities caused by the way they allocate resources and expose them over DNS, but S3 is just a simple namespace.
If you mean there were years where it was dangerously easy to accidentally open up a bucket, you'll get no disagreement from me. But I can't think of a time when they weren't default deny.
#1 risk people are concerned about is dataloss where cloud wins.
That's where cloud is more secure comes from. I've not lost any data in GCS or S3.
But same cannot be said for local copies of data.
321 strategy is best for most cases.
But if you are new and are pressed for time, you only look at maybe a fraction of those thousand things, and inevitably you miss some important things.
AWS used to not have sane defaults for S3 buckets.
I ran one of those for years in a place where the median user had a science Ph.D. This happened more than once.
People also made public FTP upload folders or had PHP accepting uploads to save time.
I’m skeptical that this is more common in S3 versus being a popularity contest, and reflecting the likelihood that some “temporary troubleshooting” mistake will be noticed in S3 is much greater than on a private server.
What would a ransomware attack look like if the same kind of employee who downloads bootleg versions of PDF editors was only given read access to the files they need and write access to only their own files? It'd look like a big nothing.
The fact that we see ransomware attacks that affect entire huge corporations and organizations gives an idea of how many "admins" (who don't deserve the title) give 777 permissions to everyone.
Most ransomware attacks start by phishing an end user who already has appropriately limited permissions for their job function.
The real damage comes from the attacker exploiting widely known vulnerabilities, almost always in Microsoft Windows, to escalate their own privileges irrespective of the permissions of the end user they phished.
Microsoft Windows is by far the most significant factor here, not dumbass end users with root access.
Trying to make it an either-or thing is not correct. It's multiple things, but the lack of real permissions is a non-trivial percentage of cases.
I wouldn't be so sure about that, it still happens a lot that this is the default reply in many help forums.
Everything is possible, I know, but the amount of hacks related to S3 misconfigurations (https://github.com/nagwww/s3-leaks), including major companies, still makes me wonder.
Because Microsoft, Google, Amazon told them that the "cloud is more secure".
It’s hard in the console to make buckets public, it’s obvious when they are, and Amazon sends emails about public buckets just in case you’re not using the console.
You still have the risk that someone somewhere is using some random copy/pasted terraform/cloud formation recipes or aws cli commads that grant public access on an account that is bound to an email address nobody ever reads without realizing the consequences.
I have like the worlds largest collection of license plate photos now. :)
[0] https://en.wikipedia.org/wiki/Line_length#Electronic_text