12 ms·
Someone attacked our company
- PradeetPatel 6y agoIt has been proposed that having a robust monitoring and alerting system would significantly reduce the impact of a DDoS. What would be an advisable approach for a start up with limited resource in a situation like this?
- redis_mlc 6y agoUsually, no. Monitoring and alerting will tell you of a problem, but that doesn't fix anything by itself. You either need to ask your ISP to "do something about it but don't blackhole my server(s)", or DIY.
- iampims 6y agoBeing DDoS’d is expensive. That’s one thing that most cloud providers make difficult to protect against: how to prevent a random attacker from depleting my bank account.
- zapstar 6y agoWhat would the motivation be for such an attack? Any thoughts on who could be behind it?
- tsjq 6y agoSome proxy engaged by the competition?
- dodobirdlord 6y agoSince they seem to be some sort of analytics service bundled into client webpages, it's possible they are getting incidentally slammed by someone trying to attack one of their clients.
- csmattryder 6y agoI've seen something similar actually for our client-embedded web plugin, a web crawler hits a client's site and I see 6x traffic hit AWS WAF periodically - fortunately the brunt is rate-limited. I'd be almost certain that AWS' staff looked at the logs to determine this, they would've sorted it in 20 minutes by seeing a load of requests coming from a specific host.
- dschuetz 6y agoAnd why? What is "Fathom", what do they do that could have triggered such an attack? Or was that an attack to deliberately force them to turn to Cloudflare for "help"?
- fargle 6y agoPerhaps AWS needs to sell AWS Shield Advanced? Ha ha, I'm probably too paranoid.
- JackWritesCode 6y agoYou and me both, fargle. When the attacks started, I thought someone was attacking us just so I would write a technical blog post.
- asar 6y agoI've seen a lot SEO motivated DDoS attacks in very high value money-keyword niches. An attack basically downs a site for an extended period of time. GoogleBot notices the slow speed and logs dozens of 500 errors, which can result in dropped rankings. I did a quick check for usefathom.com though, the only somewhat interesting keyword would be "google analytics alternative", but fathom ranks on page 2, which imo would not really justify an attack. Maybe there is some other long-tail keyword with a high enough value though where usefathom.com pushed small niche players out of the top positions. Also a DDoS is obviously bad for the user experience of paying customers, nobody wants their analytics service to be down or have missing data bc of downtime etc.
- whalesalad 6y agoInteresting that they won’t use Cloudflare due to competition in the analytics space. It makes me realize that there actually isn’t a legitimate competitor to Cloudflare and they are dominating right now.
- solarpunk 6y agoIsn't Netlify a major competitor to Cloudflare?
- JackWritesCode 6y agoVercel is good too. And I've heard great things about BunnyCDN. Cloudflare does a lot though.
- busterarm 6y agoAs a customer of both, everything about the way Netlify operates seems half-assed.
- parliament32 6y agoThere isn't any competition in the free-ish space, no. But there are some big-boy options: Incapsula/Imperva, DOSarrest, Akamai, SiteLock, Radware, and a few other smaller players. These are complex setups where you at minimum need to be running an AS and own your IP space and infrastructure -- you get all sorts of cool solutions like sending (router) flows to them to monitor your traffic, and when an attack is detected they'll automatically advertise your IP space for you, scrub traffic via witchcraft and GRE-tunnel your clean traffic back to you. But don't bother contacting them if you have less than four figures to spend monthly -- if you don't have at least a few cabinets of gear (if not your own DC) you're not the target market. Cloudflare is dominating the "consumer-grade" market, but not really past that.
- cannabis_detox 6y ago"Enslave yourself to our giant corporation or the hackers will get you."
- altdatathrow 6y agoWe're going to see a lot more of such attacks (Denial of Capital?) as engineers blindly throw more and more SaaS components together without any sort of rate limiting in place, especially so when those endpoints are publicly accessible and tied to your account (e.g. Firebase or Algolia requests that are billable to your conveniently included client-side API key). And in all honesty it's a lot easier to take a site offline through depletion of budget than trying to exhaust an infinitely-scaling service.
- eat_veggies 6y agoCloudflare at least will refund any extra costs incurred from their serverless product if you get DDOSed
- JackWritesCode 6y agoSame with AWS Shield Advanced :)
- Scramblejams 6y agoWhat is that, $3k/mo?
- JackWritesCode 6y agoYup with a minimum 1 year commitment.
- Aeolun 6y agoNeed to have some pretty solid expectation you are going to be hit again at that price point. That said, it’d be a no brainer at enterprise level.
- cperciva 6y agoAt present, we put all incoming page views into SQS Hmm, not the most economical of choices, but... We had decided that we were going to simply increase our lambda concurrency limit to 8,000,000 requests per second (800,000 concurrents) and handle the spam attacks ... wait, what? If you're using Lambda functions for something as trivial as logging page views, you evidently have more money than sense. The author is concerned about this story reading like an advert for AWS Shield, but to me it reads like a case study in when "Serverless" is a bad idea.
- JackWritesCode 6y agoLambda concurrency wasn't actually increased to 800,000 concurrents. It's a stupid idea that someone would think up after fighting attacks all day.
- cperciva 6y agoRegardless of what you set Lambda concurrency to: Are you seriously invoking Lambdas for every page view?
- JackWritesCode 6y agoWe are indeed. Neither of us enjoy DevOps so we pay a premium to not have to manage servers. It brings a huge mental health benefit (we are a two person company), we're profitable and our monthly Lambda cost isn't that significant. Honestly, the biggest inefficiency (in terms of cost) is our use of SQS/RDS, which we are ditching soon.
- deleted 6y ago[deleted]
- cperciva 6y agoWell, it's your money... I'd be happy to help make this more efficient though (at no charge of course). Offhand I'd say "web server which accumulates data and uploads it to S3 every N requests or M seconds" would probably get you what you need at a tiny fraction of the cost of "lambda which posts to SQS". Create an AMI and toss it at an autoscaling group and you really won't need to worry about scaling issues either.
- hartator 6y agoPHP Laravel on Amazon Lambda to count pageviews? Are you sure it's not just a regular customer and not a DDOS? > privacy-first analytics solution [...] The only downside of this is that we need to keep access logs (IP & User-Agent, no browsing history) for 24 hours Keeping IPs don't make you super privacy friendly.
- JackWritesCode 6y agoAwesome, I'd love some advice if you're willing. So here's our situation. * We're getting hit with a huge DDoS attack, repeatedly over 3 weeks, with no sign of stopping * With zero access logs, there was no way to find patterns in the attack, and we had no way to block it * Our service was going offline during these attacks * We introduced access logs that are auto-deleted after 24 hours. We redacted all information about the site/page/activity etc. but keep IP & User Agent for pattern matching * We were then able to identify a pattern and block the attack on Saturday * Without access logs (even redacted ones), this wasn't possible I was hoping a more senior engineer on Hacker News would comment and I can't wait to hear how you'd do it. I have no experience in DDoS protection at all, and this seems like the only possible way. Even rate limiting requires storing IP addresses. But if you know a more privacy-focused way to block these attacks, I'm sure I'll buy you a few beers when we hang out.
- ve55 6y agoI would probably start by looking for third-parties to help manage to problems, at least unless they all end up at the application layer. Throw it beyond Cloudflare and talk to them, and if they're not the right fit, try someone else.
- tpetry 6y agoThere is nothing wrong with this approach but exactly this mentality lead to the actual centralized internet where only a few peers handle most of the traffic.
- JackWritesCode 6y ago
- hartator 6y agoI don't fully get how you can DDOS this service as it seems you need to give your credit card to sign up. Can't they block the API keys with issues and be done with it?
- JackWritesCode 6y agoPublic access point. The server accepts pageviews, so they DDoS'd that.
- joana035 6y agoThe article mention the use of lambda/serverless. If he had a server many of these issues would not exist in the first place :)
- joana035 6y agoAnd I does not looks like a DDoS either, this amount of connections is quite normal for mid-sized apps, and connections can be kept open in case you app is slow, making your stats higher than it actually should be. Btw, two servers plus a bit of architecture simplification solves this and cut the costs down to ~$400 or less.
- breatheoften 6y agoI'd be checking for bugs in the js -- particularly as might be triggered from a bot environment that one or more of your customers might use to test their site or observe their sites latency response ... puppeteer with setRequestInterception configured to block responses in the right way maybe https://github.com/puppeteer/puppeteer/blob/v5.5.0/docs/api.md#pagesetrequestinterceptionvalue https://github.com/puppeteer/puppeteer/blob/v5.5.0/docs/api..... I can imagine nightmares along those lines that could persuade some normally functioning js client logic that works normally when in a normal network environment to continually reissue failed requests when browser requests/responses are blocked in just the wrong way -- that could cause the same client side ip to appear in logs over and over again. And then ip variability could be the customer spinning up browser bots in various regions around the world in order to measure their sites region specific latency response. Just offering up an alt theory -- as I'm with some of the others -- not sure the graphs shown immediately scream dos to me.
- JackWritesCode 6y agoThe data was full of spam & was targeted at high profile customers. It was also run every hour for one period then ramped up to 500,000 concurrents. It was a DDoS :(
- futhey 6y agoI fully believe this was a DDOS attack. But, this is good advice. If you think you're getting DDOS'd, check for the number of unique IPs against your own user pool. Probably a lot more people introduce bugs into their codebase that DDOS's their own app than get repeatedly targeted by a well-funded attacker as above.
- softinio 6y agoI am just curious to know if any effort has been made to find out who was behind the attacks? at least more information about it?
- JackWritesCode 6y agoCan’t talk about this publicly, sorry :(
- futhey 6y agoLoved this post, thanks for the detailed write-up. As a solo-SaaS-founder I have a persistent, but very mild anxiety of something like this happening. The attacks we've received have been comparably mild and easy to mitigate. Boggles my mind who the heck thinks Fathom is valuable enough to target with such a persistent series of attacks.
- 7demons 6y agoAdvantage comes with those who attack, not defend. Attackers will always find new ways to attack and eventually break-in. Be ready for this. As history shows, crackers (DDoS'ers) always win if the price for your head is high enough (money or fame).
- kubanczyk 6y agoCould you elaborate on those historical experiences with DDoS?
- amzans 6y agoHey as a (way smaller) competitor of yours, I honestly feel you. I understand you may not want my advice. But anyways, here it goes :) I have dealt with similar issues too at my full-time job. We ingest data in the billions range too, and our costs are a lot lower than what you describe. * On the public endpoint, can you move the first point of contact closer to the edge? You want to block requests before they even reach your ingestion pipeline. If not, add a few geographical Load Balancers with the sole job of accepting requests before forwarding them to your Lambda. Divert traffic at the DNS level using a geo routing policy on Route53. * Are you also hitting DynamoDB for every request as part of your spam system? I found it quite expensive on-demand, unless you provision capacity. We used to pay tens of thousands per month for DynamoDB in the past, when a single Redis instance would have done it. Specially if it's temporary, non-critical data such as spam detection. * Do you batch the incoming events before triggering SQS? * How are your networking costs going? They tend to creep up in the AWS bills too. It just sounds to me you clearly need something in-between the public endpoint and those Lambdas. But maybe I'm missing some info. Otherwise you're going to keep paying for capacity that a "traditional" server could handle, without costing you more for each request. If you can't fight back, and don't want real requests to be lost, put a server at the battle-front, and buffer all raw HTTP requests into a queue made for this (like Kinesis). You can then process events and recover the data at your own pace. I did this in the past, and could handle 60k+ req/s with 2 instances on AWS. I used a simple Go tool to capture the traffic https://github.com/buger/goreplay https://github.com/buger/goreplay Also, at my full-time job we use Kinesis to buffer all analytics events, it's cheaper than SQS and handles billions of data points per month. This also keeps the ingest rate constant, but you seem to already do that with your workers. Full disclosure: I'm Anthony from http://panelbear.com/ http://panelbear.com/ , and I just want to offer honest help.
- amzans 6y agoAdditionally, be sure to check how your script behaves with SPAs and the browser history API. You seem to be binding to the browser history as-is, and might be firing lots of non-page view events. It's not just a theoretical case, I saw this for many customers with Panelbear. Many JS frameworks use the history API in ways you may not be considering. That's why I would recommend de-duplicating events on the client-side before sending them to your ingestion pipeline. But that is DDoS matters aside.
- FreshFries 6y agoGreat you guys suffered, learned and survived this attack. You have done what only few small shops would or could and this knowledge will be a valuable asset. You can expect a lot of requests for help / information based on your write up. Prepare some canned answers and a cool presentation you can whip out when needed.
- _wldu 6y agoOne simple way to stop a lot of shenanigans such as this is to block Tor exit nodes from connecting to your services. https://blog.torproject.org/changes-tor-exit-list-service https://blog.torproject.org/changes-tor-exit-list-service While some attackers have access to compromised home routers and IoT devices, most script kiddies do not, so they use Tor (because they don't want to get caught).
- gustavorg 6y agoI was thinking in some momment the culprit was identified and received a visit from fat Clemenza "Hello Carlo". Are there any way to identify who's doing this?
- plasma 6y agoThanks for the write up. A few thoughts: 1. Build a “live status” dashboard for your processing system so you can see the profile on the IPs or customers being affected, so you have more visibility into the issue when it happens 2. Can you just put the system behind cloudfront and process CF log files instead of having to invoke lambdas? 3. Identify the affected customer and put their lambda results in a separate queue, to help limit blast radius if it happens again from other customers 4. Double check there wasn’t throttling because downstream services were throttling lambda (you mentioned SQS?) 5. Make your lambda even faster (if it’s 100ms make it 10ms or less); can you move your logic out of lambda? Can you instead of inserting into SQS log to cloudwatch and then read its data? Or ensure no cross region lambda <> SQS invocations, etc 6. Consider replacing lambda (that cannot batch process invocations) with app servers that can absorb and then batch send many requests to SQS (let them absorb and coalesce a large amount of requests into aggregate SQS messages at the edge); going a step further eg even uploading aggregated data files to S3 for later processing then put a single message on the SQS queue pointing to that file
- joana035 6y agoIt's incredible that C10K was achieved in 1999. http://www.kegel.com/c10k.html http://www.kegel.com/c10k.html
- alisonkisk 6y agoSince the article doesn't define C10K (10K concurrent connections) https://en.m.wikipedia.org/wiki/C10k_problem https://en.m.wikipedia.org/wiki/C10k_problem
- jgrahamc 6y agoI get why they don't want to use Cloudflare but reading that gave me faith in why we offer the free DDoS service we do. The expense and hassle of dealing with a DDoS and then the expense and hassle of dealing with AWS looks awful.
- amzans 6y agoAs a one-man SaaS, Cloudflare has been invaluable for me. I'm currently still on your free tier, but would be happy to pay when I need to. Just wanted to say, thank you!
- JackWritesCode 6y agoDealing with AWS hasn’t been hassle but is expensive. However, the value proposition is well worth it for us.
- ksec 6y agoThere are many other Analytic companies around, Plausible, Simple Analytics, GoatCounter.. etc I think they need to take notes.
- toyg 6y ago> We will not let a lonely nerd attack our business How do they even know it was "a lonely nerd"? In fact, it's much more likely that it was carried out by a well-socialized team of shady professionals, on a commission from competitors. It's 2020, people, can we drop it with the "Hack3rs" stereotypes...?
- ASalazarMX 6y agoWhile more likely (why would a random nerd would have such a beef with them?), stating that without actual evidence is borderline conspiracy theory. I wouldn't have mentioned the hypothetical lone nerd at all, but I figure he was so angry he had to picture someone to be angry at.
- toyg 6y agoI’d have been happy with some generic “shady characters”. It just feels lazy (and bigoted) in 2020 to use this sort of negative stereotype, particularly when coming from someone in the business. One cannot deal with a threat effectively if one mis-identifies the actual profile and capabilities of such threat.
- harpiaharpyja 6y agoIf it's more likely then why can't it be used as the starting point? What's the conspiracy theory?
- ASalazarMX 6y agoEvil competitor hired shady cybercriminals to put him out of business. It's the most likely explanation, but it looks weird if stated without actual evidence.
- exolymph 6y ago> It's 2020, people, can we drop it with the "Hack3rs" stereotypes...? Well, stereotype accuracy is one of the most robust and replicable findings from psychology research...
- clon 6y agoI feel you, it is horrendous seeing your work being torn up like that. Having anything public-facing on the internet feels like running a liqueur store in a bad neighbourhood. I am the co-founder of a SaaS in the higher-ed-tech sector (universities, 300+ of them). Going to make sure we implement support for Fathom (in addition to GA, GTM, Matomo) and reach out to our customers. Hope it helps a bit. Our users would also benefit from stuffing less data to G.
- JackWritesCode 6y agoThat sounds incredible. We’re used in a lot of universities right now and it would be great to see more
- 1337shadow 6y ago> I don’t know anybody who has signed up for this $3,000/month service from AWS… it’s called AWS Shield Advanced. The big value of this service to us is that we have access to some of the world’s best DDoS mitigation experts. In the event of an attack, we can page them, and they’ll help us mitigate the attack, creating firewall rules, identifying bad actors, and offering advice. So instead of just two of us responding to DDoS attacks, we have genius engineers we can speak with, and that feels good. Just amazed at the amount of money and time that people are willing to give AWS so that they don't manage dedicated servers themselves, I mean, paying $36k/year just to have someone manage firewall rules that's plain laughable... not to mention this is happening on "hacker news". > They're competitors of ours and it's just not a good fit. I sincerely hope that AWS doesn't start an analytics product and become a "competitor" because that sounds like you're going to have to rewrite all your software outside of AWS, and it sure seems extremely locked in ...
- illumin8 6y agoYou're trivializing the value they provide. If mitigating large scale DDoS attacks was as simple as adding a few iptables rules they would have solved this weeks before paying AWS $3,000 a month for what is effectively an insurance policy. The reality is that AWS has terabits of bandwidth and can mitigate these attacks upstream from your servers, which have bandwidth measured in gbps, not tbps. So, unless you have a global network the size and scale of Amazon or Cloudfront, no, you can't just mitigate these attacks with a few firewall rules.
- free652 6y agoIf someone is going to throw 10gbit ddos at your home ip - how few firewall rules are going to help? I am not very well versed in ddos, but that's just traffic generated from thousands of bots. Its still takes bandwidth and will literally overload your link. I assume AWS has multiple upstream links where the traffic is coming via multiple links and its easier for them to handle than for someone with one or few upstream links.
- guanplee 6y ago2 questions. 1) Who stands to gain from doing DDOS attacks? Either the business competitors who wants to put you out of business or the "protectors" themselves (so they can sell their DDOS protection service"?? 2) Can you use AWS services to launch DDOS attacks?