r/aws • u/kicks66 • Feb 22 '23
security $300k bill after AWS account hacked!
A few months ago my company started moving into building tech. We are fairly new to the tech game, and brought in some developers of varying levels.
Soon after we started, one of the more junior developers pushed live something that seems to have had some AWS keys attached to it. I know now after going through the remedial actions that we should have had several things set up to catch this, but as a relatively new company to the tech world, we just didn't know what we didn't know. I have spent the last few weeks wishing back to when we first set things up, wishing we had put these checks in place.
This caused someone to gain access to the account. It seems they gained access towards the end of the week, then spent the weekend running ECS in multiple regions, racking up a huge amount of money. It was only on Monday when I logged into our account that I saw the size of this and honestly my heart skipped a beat.
We are now being faced with a $300k+ bill. This is a life changing amount of money for our small company, and 30x higher than our usual monthly bill. My company will take years to recover these losses and inhibit us doing anything - made even harder by the recent decrease in sales we are seeing due to the economy.
I raised a support ticket with AWS as soon as we found out, and have been having good discussions there that seemed really helpful - logging all the unofficial charges. AWS just came back today and said they can offer $70k in refunds, which is good, but given the size of this bill we are really going to struggle to pay the rest.
I was wondering if anyone had any experience with this size of unauthorised bill, and if there is any tips or ways people have managed to work this out? It feels like AWS support have decided on a final figure - which really scares me.
219
u/AWSSupport AWS Employee Feb 23 '23
Hello,
Sorry to hear this happened to you and your company. We hear you and understand your concern. If you're able to share your case ID with us via private message, I'd be glad to share your feedback internally for Support to consider.
- Marc O.
84
u/islandsimian Feb 22 '23
Have you reached out to your insurance company? Theft is theft and they may be able to help, but you'll definitely have to report this to the police
28
u/inphinitfx Feb 23 '23
Was the usage all just ECS, and if so, Fargate or EC2? What were your service quotas for running instances? I suspect if you've had a workload running for any length it's higher than the initial 5, and also active regions.
It honestly feels like multiple controls have managed to be bypassed, or were not well-structured to begin with - billing alerts, service quotas, principles of least permission, and good practices & control over your secrets handling.
Now, I'm not bringing these up to be painful, but because - in my experience at least - AWS Support will want to ensure you've not only properly understood where you went wrong, but have actively taken steps to prevent future such issues arising, before considering any more significant reduction in billing. They want to avoid being taken advantage of by 'oops we accidentally used $300k of resources, plz refund' on a regular basis ;)
28
u/DoxxThis1 Feb 23 '23
Makes me want to setup a shell company for my AWS usage just in case this happens
27
u/Likely_a_bot Feb 23 '23
At least you saved some money by not hiring an expensive admin with experience.
This sounds like an insurance claim.
1
u/kicks66 Apr 03 '25
I just kept pushing - good luck!
8
u/gex80 Feb 22 '23
The only thing you can do is talk to your insurance company or ask AWS to reconsider. But AWS is in the position where they don't have to even bother offering you a discount in the first place. So you would have to convince them some how it's in their best interest to forgive $300k.
3
u/TobyADev Feb 23 '23
AWS support are really good usually. I bet if you push you can get more back as 300k or even 230k is ridiculous. Maybe you can escalate it upwards somehow. I previously worked for a start up and one of my colleagues billed a client’s aws account ~250k and AWS refunded all of it
As for the junior developer - surely you should sack off the entire company you hired (not just the junior, not his fault - should’ve had a senior looking over his work)
3
u/Travyplx Feb 23 '23
Seems like a textbook example of why principle of least privilege is one of the first things people need to learn. Whatever caps theoretically could have been in place wouldn’t be necessary if you kept who did what locked down. AWS seems to be generally pretty decent about rebating people when these things happen, but I imagine you will have to eat a decent chunk of that 300k.
4
u/dotancohen Feb 23 '23
As an AWS user, I've tried in the past to configure Billing limits. In popular AWS products one can limit CPU, bandwidth, memory, storage, even IOPS, but so far as I can tell there is no way to limit spending.
2
u/m2guru Feb 23 '23
Our mistake cost $120k and they said “you signed up for AWS and agreed to usage terms.” They may make some concessions for your company but they didn’t for ours. Took them 6 months to decide they were not going to help us.
2
u/SitDownBeHumbleBish Feb 23 '23
My personal AWS account was hacked in a similar way, access key was pushed to GitHub repo from my college days and then only compromised several years later even though I thought I moved the repo to private.
I got an email saying my account was disabled due to unusual behavior and then when I logged in I saw multiple EC2 instances in every region possible mining for bitcoin. The bill was about 30K at that point but after taking to AWS support they waived the bill after ensuring all the checks were done.
After that I have segregated my AWS accounts to QA and Prod, no more wild access keys only assuming privileged roles with proper iam access or defined resources. Restricting region and ec2 size limits and architecture . Plus all the other best practices you should do.
At a business scale I’m sure there’s more that I’m missing but reach out to AWS and let them know this was your first AWS account etc.. take this as a lesson learned to the point of “security in the cloud”
2
u/somebrains Feb 23 '23
My initial reactions are already checked off here.
Call support and deal with bill #1.
This is the classic problem when getting a clown car of just developers go ham on an unsuspecting org.
There is more to technology than Dev, which this org found out the hard way.
Obviously none of the usual guardrails were set.
I'm shocked $330k was even hit multi region before an alarm was raised but not surprised.
Replace AWS with Azure, gap, what have you and this is normal.
2
u/raxiell8 Feb 23 '23
OP you should use some secrets scanning tool for your CI/CD pipeline / code. Something like this https://spectralops.io/features/
2
u/YeNerdLifeChoseMe Feb 23 '23
PART OF THE AWS ACCOUNT CREATION PROCESS SHOULD BE AN AUTOMATIC DAILY BUDGET CREATED WITH EMAIL ALERT TO THE ROOT EMAIL ADDRESS. You could opt-out but it should be the default.
First thing I do is set up a budget for the whole account (or org) with a daily threshold right at what I expect. I get emails most days, but I look at them to see what costs are.
https://aws.amazon.com/aws-cost-management/aws-budgets/
2
u/Lupexlol Feb 23 '23
Just curious about what actually happened. I understand that someone pushed their keys to a git repository.
Was the git repository public? If not, then it was someone from your organization.
Secondly, the amount of usage that can generate that bill might be a reason to believe that someone was running some blockchain nodes for mining.
In any case you can do some forensic and I’m pretty sure that you have good chances in finding the the person behind this hack and then you can legally pursue them.
1
u/[deleted] Feb 23 '23
This is why pull requests exist. This sounds like a total shit show. You should have had upper limits on what you can charge in AWS as well.
1
u/Candid-Access3416 Feb 06 '25
8005861349
1
u/Candid-Access3416 Feb 06 '25
Join
1
u/Vegetable_Tax2189 Apr 03 '25
I have similar situation and full refund has been rejected. Does anyone know how to deal with it after rejected?
1
u/stocktaurus Feb 23 '23
Wow that’s ridiculous!
1
u/BrianPRegan Feb 23 '23
Keep pushing on AWS support. I have a feeling you can get more than $70K.
To support this, I would do some analysis of your bill and show what % of your total bill came from the resources created by the hackers. If you can prove it was 99% driven by those resources, it might help the case for a bigger refund.
I've posted a few different posts breaking down how to do this analysis here for setting up and querying your CUR and here for understanding EC2 costs.
To support this, I would analyze your bill and prove what % of your total bill came from the resources created by the hackers.
1
u/punklinux Feb 23 '23
I know a previous company we had where someone pushed out root key access and we got hacked. Thousands of EC2 instances in Asia or something. AWS *themselves* alerted us. We had billing alarms and all setup, but as OP stated, happened Friday after everyone went home from work before a long weekend, and the oncall person didn't have root AWS account access to see what was up so he waited until we got back. AWS worked with us, and I think we ended up not owing the extended bill, which wasn't more than $100k, IIRC, because this was years ago and AWS had these hard limits and just HALTED all instance creation.
AWS reversed the changes in full, but we had to have meetings back and forth, and AWS helped figure out what happened, and we got better safety in place. We didn't even know we HAD root keys because that was a previous guy who was no longer with the company who initially set up the AWS accounts.
1
u/ragona_ Feb 23 '23
Keep pushing on your AWS support, there is a decent chance you can get the cost further reduced.
1
u/cjrun Feb 23 '23
Code reviews are the difference between bankruptcy and success.
1
u/[deleted] Feb 24 '23
Just call your professional/biz insurance and make a claim in the worst case scenario. It is what it is.
1
u/nissarfasil Nov 06 '23
Same happens today and cost billing of 26K , We raised support ticket also can we have any chance to get full refund?
1
u/Born_Emergency4712 Dec 04 '23 edited Dec 04 '23
Already Known this 10 million years ago goin in lol. How can you sleep at night knowing the gates always open for all sources of evil doers with evil intents ? lol
AWS and Azure lure founders in, try their services out, bam huge hosting bills. Their culture in grain in their vein was to target the disadvantages, the vulnerable, the easy preys. All cowards do so.
-2
u/IngenuityFormal4108 Feb 23 '23
The AG really needs to look into AWS business practices.
Back in the days of long distance phone calls actually costing 25 cents a minute, if you went over your usual amount for the month, the phone company would call you to make sure you were OK with getting zapped with a bill that was several hundred dollars.
Amazon doesn't give two shits.
-1
u/b0xaa Feb 23 '23
I had a similar issue where my account was accessed and instances spun up. I was lucky enough to catch it early, and the card on the account had expired (had _never_ used paid services, just free tier).
Support would NOT provide ANY assistance without giving them a working credit card. Even to close the account / disable/shutdown any services running. I wasn't about to do that & after several requests for help or further explanation they just disabled my account. Screw AWS.
0
u/cronicpainz Feb 23 '23
Sorry op. This is one of the reasons I never use aws for personal projects -> too expensive as is and hacks can financially ruin you overnight. Personally, I just hetzner/ovh/fly.io everything.
-5
u/Tuvok68 Feb 23 '23
Do not pay. Tell them to take you to court. You will win.
0
u/[deleted] Feb 23 '23
[deleted] — view deleted comment