The issue was not caused, directly or indirectly, by a cyber attack or malicious activity of any kind. Instead, it was triggered by a change to one of our database systems' permissions which caused the database to output multiple entries into a “feature file” used by our Bot Management system. That feature file, in turn, doubled in size. The larger-than-expected feature file was then propagated to all the machines that make up our network.

The software running on these machines to route traffic across our network reads this feature file to keep our Bot Management system up to date with ever changing threats. The software had a limit on the size of the feature file that was below its doubled size. That caused the software to fail.

all 48 comments

sorted by: hot top controversial new old
[–] 62 points 11 months ago (8 children)

When are people going to realise that routing a huge chunk of the internet through one private company is a bad idea? The entire point of the internet is that it's a decentralized network of networks.

  • source
  • hideshow 8 child comments
  • [–] 9 points 11 months ago (5 children)

    I hate it but there really isn't much in the way of an alternative. Which is why they're dominant, they're the only game in town

  • source
  • parent
  • hideshow 5 child comments
  • [–] 35 points 11 months ago (3 children)

    How come?

    You can route traffic without Cloudflare.

    You can use CDNs other than Cloudflare's.

    You can use tunneling from other providers.

    There are providers of DDOS protection and CAPTCHA other than Cloudflare.

    Sure, Cloudflare is probably closest to asingle, integrated solution for the full web delivery stack. It's also not prohibitively expensive, depending on who needs what.

    So the true explanation, as always, is lazyness.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 4 points 11 months ago (2 children)

    I'm lazy and use cloudflare, so that checks out. Due to recent events I'll switch to another CDN, the centralization of the internet is very concerning.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 11 months ago* (1 child)

    I'm a fan of BunnyCDN - somehow they're one of the fastest while also being one of the cheapest, and they're based in Europe (Slovenia).

    KeyCDN is good too, and they're also Europe-based (Switzerland), but they have a higher minimum monthly spend of $4 instead of $1 at Bunny.

    Fastly have a free tier with 100GB per month, but bandwidth pricing is noticeably higher than Bunny and KeyCDN once you exceed that.

    https://www.cdnperf.com/ is useful for comparing performance. They don't list every CDN though.

    Some CDN providers are focused only on large enterprise customers, and it shows in their pricing.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 10 points 11 months ago* (last edited 11 months ago)

    there really isn't much in the way of an alternative

    Bunny.net covers some of the use cases, like DNS and CDN. I think they just rolled out a WAF too.

    There's also the "traditional" providers like AWS, Akamai, etc. and CDN providers like KeyCDN and CDN77.

    I guess one of the appeals of Cloudflare is that it's one provider for everything, rather than having to use a few different providers?

  • source
  • parent
  • [–] 42 points 11 months ago* (2 children)

    Meaning, internal error, like the other two prior.

    Almost like one big provider with 99.9999% availability is worse than 10 with maybe 99.9%

  • source
  • hideshow 2 child comments
  • [–] 16 points 11 months ago

    Except, if you chose the wrong 1 of that 10 and your company is the only one down for a day, you get fire-bombed. If "TEH INTERNETS ARE DOWN" and your website is down for a day, no one even calls you.

  • source
  • parent
  • [–] 10 points 11 months ago

    Note that this outage by itself, based on their chart, was kicking out errors over the span of about 8 hours. This one outage would have almost entirely blown their downtown allowance under 99.9% availability criteria.

    If one big provider actually provided 99.9999%, that would be 30 seconds of all outages over a typical year. Not even long enough for people to generally be sure there was an 'outage' as a user. That wouldn't be bad at all.

  • source
  • parent
  • [–] 13 points 11 months ago

    This is just the beginning of the coming vibe code apocalypse.

  • source
  • [–] 61 points 11 months ago (14 children)

    So I work in the IT department of a pretty large company. One of the things that we do on a regular basis is staged updates, so we'll get a small number of computers and we'll update the software on them to the latest version or whatever. Then we leave it for about a week, and if the world doesn't end we update the software onto the next group and then the next and then the next until everything is upgraded. We don't just slap it onto production infrastructure and then go to the pub.

    But apparently our standards are slightly higher than that of an international organisation who's whole purpose is cyber security.

  • source
  • hideshow 14 child comments
  • [–] 40 points 11 months ago (9 children)

    Their motivation is that that file has to change rapidly to respond to threats. If a new botnet pops up and starts generating a lot of malicious traffic, they can't just let it run for a week

  • source
  • parent
  • hideshow 9 child comments
  • [–] 5 points 11 months ago* (6 children)

    How about an hour? 10 minutes? Would have prevented this. I very much doubt that their service is so unstable and flimsy that they need to respond to stuff on such short notice. It would be worthless to their customers if that were true.

    Restarting and running some automated tests on a server should not take more than 5 minutes.

  • source
  • parent
  • hideshow 6 child comments
  • [–] 12 points 11 months ago (5 children)

    5 minutes of uninterrupted DDoS traffic from a bot farm would be pretty bad.

  • source
  • parent
  • hideshow 5 child comments
  • [–] 11 points 11 months ago* (last edited 11 months ago) (2 children)

    5 hours of unintended downtime from an update is even worse.

    Edited for those who didn’t get the original point.

  • source
  • parent
  • hideshow 2 child comments
  • [–] -1 points 11 months ago (1 child)

    There are technical solutions to this. You update half your servers, and then if they die you just disconnect them from the network while you fix them and then have your own unaffected servers take up the load. Now yes, this doesn't get a fixout quickly, but if you update kills your entire system, you're not going to get the fix out quickly anyway.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 5 points 11 months ago*

    Congratulations, now your "good" servers are dead from the extra load and you also have a queue of shit to go through once you're back up, making the problem worse. Running a terabit-scale proxy network isn't exactly easy, the amount of moving parts interacting with each other is insane. I highly suggest reading some of their postmortems, they're usually really well written and very informative if you want to learn more about the failures they've encountered, the processes to handle them, and their immediate remediations

  • source
  • parent
  • [–] 13 points 11 months ago

    You would do well to go read up on the 1990 AT&T long distance network collapse. A single line of changed code, rolled out months earlier, ultimately triggered what you might call these days a DDoS attack that took down all 114 long distance telephone switches in their global network. Over 50 million long distance calls were blocked in the 9 hours it took them to identify the cause and roll out a fix.

    AT&T prided itself on the thoroughness of their testing & rollout strategy for any code changes. The bug that took them down was both timing-dependent and load-dependent, making it extremely difficult to test for, and required fairly specific real world conditions to trigger. That’s how it went unnoticed for months before it triggered.

  • source
  • parent
  • [–] 21 points 11 months ago (2 children)

    My assumption is that the pattern you describe is possible/doable on certain scales and in certain combinations of technologies. But doing this across a distributed system with as many nodes and as many different nodes as CloudFlare has, and still have a system that can be updated quickly (responding to DDOS attacks for example) is a lot harder.

    If you really feel like you have a better solution please contact them and consult for them, the internet would thank you for it.

  • source
  • parent
  • hideshow 2 child comments
  • [–] -4 points 11 months ago (1 child)

    They know this, it's not like any of this is a revelation. But the company has been lazy and would rather just test in production because that's cheaper and most of the time perfectly fine.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 64 points 11 months ago (3 children)
  • [–] 26 points 11 months ago

    We are going to see a lot more of this type of bullshit now that there are no standards anymore. Fuck everything else and make that money people!

  • source
  • [–] 15 points 11 months ago

    really reminds me of the self owned crowdstrike bullshit

  • source
  • [–] 8 points 11 months ago (1 child)

    Somewhere, that Dev who was told that having clustered databases in nonprod was two expensive and not needed is now updating the deploy scripts

  • source
  • hideshow 1 child comment
  • [–] 7 points 11 months ago (1 child)

    Before today, ClickHouse users would only see the tables in the default database when querying table metadata from ClickHouse system tables such as system.tables or system.columns.

    Since users already have implicit access to underlying tables in r0, we made a change at 11:05 to make this access explicit, so that users can see the metadata of these tables as well.

    I'm no expert, but this feels like something you'd need to ponder very carefully before deploying. You're basically changing the result of all queries to your db. I'm not working in there, but I'm sure in plenty places if the codebase there's a bunch of query this and pick column 5 from the result.

  • source
  • hideshow 1 child comment
  • [–] 5 points 11 months ago

    Mortem

    Wishful thinking :)

  • source
  • [+] -3 points 11 months ago (1 child)
  • [–] 2 points 11 months ago

    Zero for the triggering action. A human rolled out a permissions change in a database that led to an unexpected failure in a different system because that other system was missing some safety checks when loading the data (non-zero chance that code was authored in some way by AI).

  • source
  • parent
  • [+] -26 points 11 months ago* (last edited 11 months ago) (6 children)

    Classic example of how dangerous rust is.

    If they had just used Python and ran the whole thing in a try block with bare except this would have never been an issue.

    Edit: this was a joke, and not well done. I thought the foolishness would come through.

  • source
  • hideshow 6 child comments
  • [–] 10 points 11 months ago*

    This can happen regardless of language.

    The actual issue is that they should be canarying changes. Push them to a small percentage of servers, and ensure nothing bad happens before pushing them more broadly. At my workplace, config changes are automatically tested on one server, then an entire rack, then an entire cluster, before fully rolling out. The rollout process watches the core logs for things like elevated HTTP 5xx errors.

  • source
  • parent
  • [–] 9 points 11 months ago

    honestly this was a coding cock-up. there's a code snippet in the article that unwraps on a Result which you don't do unless you're fine with that part of the code crashing

    i think they are turning linters back to max and rooting through all their rust code as we speak

  • source
  • parent
  • [–] 5 points 11 months ago* (last edited 11 months ago) (3 children)

    I hope you're joking. If anything, Rust makes error handling easier by returning them as values using the Result monad. As someone else pointed out, they literally used unwrap in their code, which basically means "panic if this ever returns error". You don't do this unless it's impossible to handle the error inside the program, or if panicking is the behavior you want due to e.g. security reasons.

    Even as an absolute amateur, whenever I post any Rust to the public, the first thing I do is get rid of unwrap as much as possible, unless I intentionally want the application to crash. Even then, I use expect instead of unwrap to have some logging. This is definitely the work of some underpaid intern.

    Also, Python is sloooowwww.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 2 points 11 months ago (2 children)

    I was joking, but oof it did not go over well.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 3 points 11 months ago (1 child)

    Ah that makes sense. To be fair tho, there's a lot of unwarranted hate towards Rust so it can be hard to tell.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 2 points 11 months ago

    I should bite the bullet and learn it.

    I decided to learn zig recently, it feels like crafting artisanal software, which is what I liked C for. But it’s kinda janky in that each point version major features come and go (see io and async).

    There’s a place for engineering software which is what rust seems great at. Definitely seems like a tool I could/would use as rust is taking over many of my tool workflows.

  • source
  • parent
  • 7 comments in c/programming@programming.dev view that post
    [–] 8 points 11 months ago (5 children)

    They used .unwrap(...) in production, which can escape notice until there's an error, then it panics. It's better to always handle the potential error, or at least use ? to pass the error back to the caller.

  • source
  • hideshow 5 child comments
  • [–] 5 points 11 months ago

    Yep. This was the difference between a silent, recoverable error and a loud failure.

    It seems like they're planning to remove all potential panics based on the end of their article. This would be a good idea considering the scale of the service's usage.

    (Also, for anyone who's not reading the article, the unwrap caused the service to crash, but wasn't the source of the issues to begin with. It was just what toppled over first.)

  • source
  • parent
  • [–] 5 points 11 months ago* (last edited 11 months ago) (2 children)

    I've read a lot of people saying "oh what a horror, they used unwrap in production, they should NEVER do that". But I don't think that's true at all.

    1. The rust type system is not 100% flawless. For example you have a mathematically proven never-errors algorithm, but inside some steps have provisional Nones. At the end you just unwrap, since there's no point in changing the return type to an option to handle a non-existent error. You can't represent "this is None but I promise that it won't by the end" in rust's type system.
    2. Sometimes it's not worth handling the error. For example a simple CLI tool, just throw expects everywhere that shows why it failed, since most CLI tools just close anyway on failure, might as well panic.

    That being said, this was clearly a case where ? should have been used, since the function has a clear error case. And it also is a critical application that can't afford panicking as an error handling method.

    EDIT: Just to clarify, the way you would do this is by having a type Features that can error on creation/parsing which has a limit of 200 entries. And afterwards you can just use that type knowing that it will always have <= 200 entries. And you gracefully handle that one error case on creation/parsing.

    EDIT2: Another point for why I disagree with "production should never have unwrap":

    1. Unwrap is basically the same as assert(my_variable.is_some). I don't know a single person that would say "you should never have asserts in production code", the only reason I disable some assertions for release builds is for performance. Asserts are statements that should never do anything, by that logic they pose no harm by being there, so no need to remove them, their only effect should be wasting a few CPU cycles. Since asserts are only put when the programmer assures that a certain precondition will always be met. And if it is not, it's because the code changes and automatic tests should catch that.
  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 11 months ago

    Thank for elaborating my comment, but I never said never, only that it's usually better to avoid it.

    And yven if you think it's provably impossible to get an Error back now, someone or something may change an underlying function behaviour on you in the future and invalidate your proof. There are ways to limit that with version control and pinning and so on, but it's easy for an assumption to be overlooked when merging in new versions of things.

    So yes, I agree, better to use ? at least here, but like all guidelines, there may be times where you break it, accepting the risks.

  • source
  • parent
  • [–] 1 point 11 months ago

    Honestly it annoys me how much the well has been poisoned with rust that we're even talking about the language here. There is so much focus on rust that we're not even talking about how they literally couldn't tell the difference between their software crashing in production and a ddos attack.

    They had no visibility into their runtime environment, and from my understanding of the Blogpost, didn't even look into the possibility until the entire cluster went down from this bad config.

    Like, even assuming they did input validation, what should the clickhouse services do when they're fed an invalid config? I'd argue the only sensible thing would be to refuse to start. But it seems like crashing wasn't being detected at all.

  • source
  • parent
  • [–] 7 points 11 months ago

    I've come to the realization that I'm actually a nerd, because I enjoyed tthat read.

  • source
  • 1 comment in c/hackernews@lemmy.bestiver.se view that post
    [–] 3 points 11 months ago

    Love this article. Thanks for sharing. I hope more people realized this and made their websites actually secure instead of just hiding behind cloudflare and leaving us with the bag of solving inane captchas forever.

  • source