AWS GuardDuty – the Good, the Bad, and the Ugly
badshah.io
badshah.io
When comparing EC2 to servers, nobody adds the added premiums of the extras. Things like CloudTrail, Support, GuardDuty, CloudWatch. All of these things have a variable cost that grows with usage and very hard to predict ahead of time.
Just last week I discovered our GuardDuty bills went up from $15/month to $400/month. Inspecting closer, the issue was a small script that did AWS API call at a tight while loop in a couple of EC2 instances.
So if you choose to enable GD, make sure to have your monitoring in place, gradually enable GD across the infra and establish clear baselines and alerting in place for costs.
We used it at previous job and realised we were under constant attack and and it reduced our cou usage by 15% in reduced requests for the amount of traffic we were getting. No more random spikes.
Improved our overall security and ultimately reduced costs on the AWS bill.
But if you’re gonna switch it on and walk away then you’re not really using it.
The point is not the absolute sum but how easy is it to spike your bill by 30 times.
The way GD works, you are pretty much guaranteed to overpay for it sooner or later. If you can afford it.. great.
This is no different from programming. PHP has some awful code out in the wild, it doesn't mean PHP is shit just because people write bad code.
The issue with AWS is it's far too easy for people to just spin stuff up and it works and they don't look at what they are being billed for, don't analysis their infrastructure, don't optimize. They just throw servers, containers, etc up into the wild then when the bill comes:
"OH AWS BAD I got billed cos I just set it up and forgot about it, then when it worked they charged me for it, AWS is wrong, just go baremetal."
I don't think I said AWS is shit or that GD is worthless, after all, I use both by choice. Yet, I do not think that AWS are blameless when it comes to certain decisions of how to bill, how to present data and how to document some of their features.
For example, in order to discover something is wrong with your GD billing, you must have CloudTrail in place, and the appropriate infrastructure to query it. And even tho AWS can easily alert you about weird trend in your API calls (like suspiciously high Describe*), they won't do it. They do it with Trusted Advisor when you have under-utilised EC2 instances (which requires Business+ support plan per account).
Someone mentioned in the thread the need for SCP in order to disable regions. Why should you have go all the route to SCP? Why can't we disable regions by click of a button under root account like it's possible for some of the latest regions?
Is something inherently wrong in it and pure evil? No. But I think the defaults can be better. I think AWS can improve their customer's default posture when it comes to Audit and Security without the need to have to decide between 10 different services with different billing plans and gotchas.
[1] https://aws.amazon.com/aws-cost-management/aws-cost-anomaly-...
These products have their place, but they don't make sense until you reach a certain size.
Why not? Have people forgotten how to run servers in the past decade?
“Fire all your ops people do the cloud” has made it so that organizations have forgotten how to run servers.
Working in infra but not at supermassive scale does really feel like the new COBOL programmer.
Is there _any_ service on AWS where you feel like you're getting more value than the dollars you're paying with (other than IAM and Free tier services)? It's no secret that AWS is one of the most successful and profitable modern businesses, but perhaps there's a hidden offering that does something, does it well, and costs very little compared to the value it brings.
Some free services:
1. AWS Org (Disable services and enforce guardrails)
2. VPC (Create private networks)
3. IAM (User access and IAM policy analyzer to help with least priv)
4. IAM Access Analyzer (Alert on resources with cross account & public access)
5. SSM Inventory & Patch manager (Basic check if all VMs have security updates installed)
Reasonably priced IMO:
1. AWS WAF with free managed rules (when rightly configured you get lesser FP and high ROI)
A VPC isn't useful without EC2 instances in it. AWS Organizations allows you to create more accounts, with more instances, databases etc in them!
A single example was GuardDuty above. I know how expensive similar to GuardDuty services are per month when you have to have a well planned strategy, implementation, execution, operations for threats... no matter if one does it "in house" or with "consultants" - the cost is very high to implement anything similar to GuardDuty. No matter if it is duct taped open source or enterprise offerings.
And then you have to do that same iterative business process loop across infrastructure (servers/database), data centers, code deployment, DevOps, security, etc etc.
Someone else mentioned RDS and I agree with that too.
I can't complain about DynamoDB or Lambda pricing. Fargate is a little expensive for what we are running, but the infrastructure management tradeoff still makes it worthwhile.
Because of low usage? Lambda supports containers now (as of 2021 I think) so if you have a container to run (or something you could containerise) it's a relatively straightforward usage question which of Lambda/Fargate/EC2 makes sense on price. Lambda doesn't have to complicate comparison by being a completely different architecture/setup any more.
The usecases for Fargate vs Lambda are not the same. For instance, Fargate is mainly intended for servers/long-running applications, whereas Lambdas have a hard runtime cap of 15min.
Lambda makes sense when usage is a small fraction of the day; 'long-running applications' are not that.
There are a few different reasons we're using Fargate. Like the other commenter mentioned, there's the lambda max run time. Our Fargate tasks also have a few sidecar containers running alongside the main services. The ECS Exec integration is also nice for poking around when things aren't working correctly.
This is why I said it's a matter of usage - it's worth paying more per unit time if it's running less and more sporadically making it cheaper over all.
Fargate should allow users to specify their compute requirements beyond just vCPU count and GB memory.
Dev/staging environments are virtually free
Prod will cost more depending on usage, but you could optimize costs and add caching (like cloudflare - at cdn level)
- Some core databases.
- Compute in the form of EC2 or EKS with EBS.
- IAM roles.
- Secrets management.
- Load balancers.
- S3.
That’s basically it. Build the rest yourself, they tend to be cheaper.
S3 is incredibly powerful and cost effective for the price. It has insane throughout and a very simple API (compared to, say, setting up SMB or NFS to support public uploads where you need more pieces)
This is key advice anyway. When setting up new AWS infrastructure for a new company, set up an AWS organization, and only enable us-east-1 (required for some global services like CloudFront) and maybe one additional region (if you don't want to put all your eggs in the us-east-1 basket). Don't enable additional regions that you don't need. Because most AWS APIs are regional, it makes finding aberrant infrastructure much, much easier, even if you're just combing through the console manually.
Would be interesting to see a top-line comparison (GCP and Azure regions would also be neat)
I'm far from a AWS fan but this take can't even be deemed an apples-to-orange comparison.
"Classical" hosting at best matches EC2. The absolute high-end "classical" hosting offers at best also offer something resembling EC2's VPC. Forget about regions, let alone anything resembling availability zones.
Everything else that AWS offers ends up being nice-to-have conveniences. Stuff like object storage and pub-sub and message queues and managed nosql and classical RDBMS services and managed kubernetes and integrated infrastrucure-as-code systems are way outside what a "classical" hosting company offers
The past 10-15 years has seen enormous growth in eCommerce productivity as a portion of the overall economy (just google “gdp attributed to internet commerce” and similar phrases, there’s tons of data on this). The rise in the number of devops engineers and the amounts businesses spend on AWS hosting are often in service of business models that were simply impossible to even try before cloud computing.
Sure, everyone on HN seems to have a story about an organization going all “architecture astronaut”nuts with Kubernetes and then ending up with slower/more expensive infra, and it’s fun to tell those to each other, but there’s clearly a huge amount of economic activity being enabled here that wasn’t happening before.
Personally I care more about my enjoyment of my day to day job than saving the company a tiny bit of money that they'll never give me.
My first job had only incompetent seniors that I had to explain SQL query performance to etc. I left very quickly since I realized I wouldn't learn much there. I can see such places benefiting greatly from AWS services.
Or you can run them even better on AWS assuming you had the same level of competence except in cloud deployments. Granted they'd probably pick a more specialized cloud platform than AWS for the specific problems and scale of the team.
VPC flow logs are odd, too: you actually don’t need to enable them for Guard Duty - one of its selling points is that you can globally enable it without the possibility of one of your organization’s accounts having it disabled due to accident or malice – but again, if your security policy requires this there’s no shortcut for any tool: you can get figures quickly before you run through the free tier and use those for your budgets.
The DNS logging points are handled by separate products: if you want those features, check out the Route 53 resolver logging and firewall docs:
https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/re...
https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/re...
If money allows, I'd look at wiz.io instead