10 ms·
Encryption wouldn't have mattered here. To a pretty good first approximation, none of the "encryption" done at scale at any Fortune 500 company in the US is mor
by tptacek 9y ago
Encryption wouldn't have mattered here. To a pretty good first approximation, none of the "encryption" done at scale at any Fortune 500 company in the US is more than a speed bump for attackers. Unless you're using moon math --- nobody is --- enterprise backend encryption is hamstrung by the fact that you're keeping the data because automated business processes need to use it, which means automated systems need to decrypt it.
- sova 9y agoYou mean because the data is used in a readable form at some point or another, a compromise would have resulted either way? Can't say I'm sold, my friend.
- tptacek 9y agoYes: because the point of encryption is to protect you from a compromise in your server (that's what happened at Equifax), but for the server to be able to use the data, it has to have have some means of getting plaintext access to it. Once you've lost your server to an attacker, you've lost control of that mechanism as well. This is a problem even with HSM designs; in real-world systems, HSMs usually just present an oracle interface to data. The hope is that with sufficient monitoring, you can use the oracle to buy time for defenders to detect a compromise before all your data is exfiltrated. I think most penetration testers have the experience of owning up a server and going on the brief treasure hunt for the static key stored somewhere on the filesystem.
- dredmorbius 9y agoWhat is "HSM" in this context? Among probable hits, "hierarchical storage management" and "hardware security module".
- tptacek 9y agoHardware security module.
- thristian 9y agoHardware Security Module, a device that stores a private key in a way that cannot be easily extracted. When your application needs to decrypt something, it sends a request over the network to the HSM, which decrypts it and returns the plaintext.
- nitwit005 9y agoThe point of encryption is often just to prevent people from walking off with hard disks and getting at the data. Remember that companies often have backups managed by 3rd parties.
- sova 9y agoMost people use encryption in the following way for passwords: user provides input, input is hashed, hash is stored, future attempts to log in are hashed and compared. This is very secure. Server compromised? No problem, all they get is a bunch of hashed stuff. Hashing is the main business of a bureau of any sort of public data. That is the business in 2017. If personal data were kept as fuzzy hashes that required partial knowledge to decrypt, systems would be more robust and information would be better protected. It is not a new idea, just an oft overlooked one.
- itissid 9y agoOnce you have remote code execution with privilege escalation on box Z, no amount of encryption can save at least box Z
- Johnny555 9y agoEncryption wouldn't have mattered here I think you mean "encryption wouldn't have mattered for the known attack", but there are lots of cases where encryption would help... even in cases that don't involve hacking, like hard-drive disposal.
- kakarot 9y agoIsn't that what he means by specifying "here"?
- wonderous 9y agoWhat is moon math?
- saulrh 9y agoPresumably whiz-bang space-age cryptostuff, homomorphic encryption and differential privacy et. al.. Things that'd be spectacular if you found them in a startup two years from now, much less in an enterprise that hasn't done any core tech upgrades since 2005.
- tptacek 9y agoAnything where the underlying math hasn't been proven at Amazon/Apple/Google scale, and/or isn't available in production-ready form in open-source software, and/or is heavily patented.
- kmill 9y agoIs "moon math" a term of art? Just a couple days ago, I heard a mathematician call a certain complicated knot invariant "space math" because of how out there the approach was, but that was idiosyncratic.
- reza_n 9y agoWe have an encryption scheme where all user data has its own unique user based key. So compromising 1 user key only lets you have access to that user data and that key has access to nothing else. Your statement is correct when you said that automated systems which need access to all data will inevitably lead to mass decryption and compromise. In the system described above, there is no way for an automated system (or anything) to have access to all keys and therefor no system or person can access all data.
- kabdib 9y agoHow does this help if you've got an API that decrypts for you? It's possible that you've protected the data at rest, but if some 'get' operation is just going to serve it up, what is the effective difference?
- reza_n 9y agoThe get operation provides parts of the key used to decrypt the data you are after. No key, no data. Edit: the key comes from the user, its not stored anywhere on a server. The key can optionally never leave the user's device.
- rhizome 9y agoIf someone drains your db, do they get the keys along with it?
- vehementi 9y agoNo, of course you would not store those keys in that database.
- kabdib 9y agoI guess you can have a key-per-row, or key-per-partition, and throttle and monitor access to that key. This isn't going to make operations like database indexing or joins very happy, so you're probably limited to payload-level data; hard to judge if that's okay since I don't know the requirements for the schema. This presupposes you know what you're doing, security-wise, on your network, and with your backups, and with temporary data on servers. All of your interior traffic is encrypted, right? Right. It doesn't sound like Equifax was even on the map.
- skosch 9y agoThank you for bringing sense into the discussion. I don't know how many times I've been asked "but will our data be encrypted on your server, in case someone hacks it?" and I need to explain this basic concept to otherwise intelligent people. It's like demanding that the driver's side door in a car must have a child lock installed.
- technion 9y agoI'm interested in a genuine discussion about how to answer that. For all the commonsense explanations you could give like that ones in this thread, all a client tends to hear is "anyone can hack it". For all the horrible stuff ups Equifax management has had, it sounds like congress would be substantively happier with them if they said "yes our SAN has an FDE feature". The media would certainly be kinder to them. I'm in two minds about rolling something objectively pointless just so I can address these sorts of concerns.
- schoen 9y agoThis is an excellent point, but you can also envision attack scenarios in which only parts of a distributed system are compromised. In that case, the inability of some systems to read the data that they store could be a benefit because the systems that are compromised are not absolutely guaranteed to be the same systems that possess the keys. One nice example of this which I once saw in a real system is that a system that collects credit card numbers from the public might not need to be able to read those numbers after they're recorded, if the charges are going to be made by a later batch process. So the credit card number receiving system can use a public key to encrypt the incoming data in such a way that the batch processor will later be able to decrypt it. In this case, there is certainly a machine that has the capacity to read the data, but it's not the same machine that stores the data or that is exposed to connections from the general public. (But that paradigm is a lot easier for the case of offline batch processing, which is mostly different from the applications that you were describing... but wherever a system has a component like this, it may be possible to reduce the window of exposure with this pattern.) Another example is that a database server might be compromised via a different vector from its clients. If some database fields were encrypted, the impact of a database-only compromise would be reduced. Edit: elsewhere in this thread someone points out that your argument may be meant to be more specific to this breach, and I think it's most likely right with respect to this particular incident.
- deleted 9y ago[deleted]
- da_chicken 9y agoWell, that depends. If the attackers gain complete control of the automated application, they can potentially decrypt the entire system (or, at least, the parts that application has access to). If they only gain access to just the datastore, they may or may not be able to decrypt the data -- the encryption keys might not be in the datastore at all. It depends on the manner and scope of the access that's gained.
- tptacek 9y agoAs a general rule, if you get the database, you can assume remote code execution. If you're a defender, I would go further and say you must assume it.
- deleted 9y ago[deleted]
- emidln 9y agoI'm trying to imagine a scenario where data is stored encrypted in the db and then decrypted in the app server (I've seen this in a bunch of random PHP apps over the years). A SQLi might be able to dump encrypted data or escalate to execution on the database (from which you could pivot back to the app server), but just the SQLi doesn't necessarily expose the encrypted data. See the example vulnerable web service here: https://gist.github.com/emidln/a43b9fee4fc55273106c4b850f6b40f4 https://gist.github.com/emidln/a43b9fee4fc55273106c4b850f6b4... Is the assumption that control over the db can pivot back to the server or that if there are basic issues with db access that there must be other exploitable issues (probably a fair assumption)?
- tptacek 9y agoSQLI -> RCE -> Recover key or access to oracle function -> data.
- zBard 9y agoI am not sure if thats necessarily true - a lot of folks are using cloud databases/datastores (Azure, S3 etc). Getting access to that is a different problem than remote code execution. Unless I am misunderstanding something, or you are specifically talking about on-site databases.
- lawnchair_larry 9y agoIt wouldn't have mattered, but they should absolutely still be doing it to mitigate exposure through loss of physical disks, and this question should be an easy yes. The other reason to do it, frankly, is because when you end up in the news, this is the first thing everyone asks. It's easier to say yes than to "no, but..." and explain why this is a dumb question to ask (as you are trying to do here, with a far more technical audience).
- tptacek 9y agoI mostly agree, but my concern is that this is not the perspective most people, including practitioners, are bringing to the discussion when they talk about "encryption". They mean, "if you had encrypted, this data never would have been exfiltrated in a breach". Which, of course, is false.
- mannykannot 9y agoFair enough, but I think we should be careful not to encourage the replacement of this perspective with one that says Equifax (and other collectors of sensitive data) could not be expected to do / have done better. I was quite surprised (though I probably should not have been) by the number of IT people advocating that position.
- Blazespinnaker 9y agoIt's called defense in depth. Google the term, it's a useful mechanism for real security.
- tptacek 9y agoIf that's true, why encrypt just once? Why not three times, and then add a rot14 just to be safe? Every millimeter of depth counts!
- philipwhiuk 9y agoBecause encrypting once adds noticeable depth against straightforward attacks. Encrypting multiple times adds practically nothing.
- tptacek 9y agoThe problem is that encrypting once in a conventional database design does not add noticeable depth. The server needs to be able to decrypt automatically in order to function. Whatever the server does to decrypt, the attacker will do too. It helps here to understand two things: 1. When we talk about protecting servers with encryption, we're stipulating attackers with RCE. That was the case with the Equifax attacker and is routinely the case in real-world applications. 2. SQLI, the app-layer non-RCE attack that gives you direct access to raw database rows (ie: the one non-RCE case in which you'd get access to the data we're encrypting) almost always equates to RCE anyways. There are real designs that involve cryptography that mitigate these problems. They fall into two buckets: 1. HSM/Crypto "oracle" schemes that are backed by intensive staffing and monitoring. Yes: nobody disagrees that Equifax should have had a serious security team doing serious monitoring. But: if it had that, it wouldn't have had this breach, which involved a published critical framework vulnerability. In other words: in bucket 1, "encryption" isn't helping you, "better security team" is. 2. Moon math schemes. I'm all for moon math, but when people say "phwat!? Equifax worn't even encrypticated?", they do not as a rule have a particular moon math scheme in mind (or, likely, an appreciation for what it means to be the first at-scale deployment of a new moon math scheme). I am not mounting an argument that people shouldn't encrypt things. Hard drives do get lost. I'm just saying that as an operational security mitigation, encryption isn't doing what 99.99% of developers think it's doing in this scenario. (by the way, I can't take credit for the term "moon math" but it is super useful)
- lmkg 9y agoMy understanding is that many businesses choose to encrypt their data because many laws requiring disclosure of data breaches have an exception for encrypted data (few of these laws have a good definition of 'encrypted'). Businesses are encrypting in a way that legally mitigates the PR risk, and not particularly paying attention to the actual security risks.
- walshemj 9y agoSimples use HSM's and use proper physical security
- girvo 9y agoWe’re using spooky moon math (semi-homomorphic encryption in a rather restricted case, mind you) for exactly this reason for the 4 biggest companies in a huge industry here in Australia. These companies are starting to understand why it might be needed, which is super exciting. And hell, even if the prototype gets killed, it’s been fun as hell to work on.
- deleted 9y ago[deleted]
- tinco 9y agoWhat kind of operations are you able to do on the data?
- girvo 9y agoSolely addition on integers, currently. I’m having a lot of fun exploring pattern matching with semi-homomorphic encryption for the larger project, though I have my reservations, but it’s hopefully possible. One of the more interesting bits of the project is that soft-real-time is not a requirement, so some simpler, slower and older algorithms become feasible (interactive ZKPs, even fully-HE systems perhaps). A very specific use case has allowed for the possibility. But it’s amazing to work on :)
- adrr 9y agoEncryption would have reduced the damage if encryption was done right. There's no reason for a front-end system to have access to SSN and with modern secure storage like Vault you can grant encryption(Write) and decryption(Read) rights specific to each app on your platform.
- tptacek 9y agoVault is designed for application configuration secrets, not for at-scale storage of raw business data.
- slackpad 9y agoThe transit backend can be used to encrypt more general business data - https://www.hashicorp.com/blog/transparent-data-encryption-in-the-modern-datacenter https://www.hashicorp.com/blog/transparent-data-encryption-i....
- bskap 9y agoHaving separate read and write permissions is entirely orthogonal to having encryption. That certainly would help (assuming the compromised system didn't need to have read permissions), but you don't need encryption to implement that and adding encryption doesn't imply that you've done it.
- justicezyx 9y agoWhy encryption wont help? Is it because the keys are easily comprimisable, or stolen?
- AnimalMuppet 9y agoBecause the attacker is in a position to query the database. That (probably) means that they have compromised one of the machines that can legitimately query the database. But if that machine can query the database, and the data in the database is encrypted, then that machine must be able to decrypt it, or else it can't use it. So the keys must be on the machine - and the attacker has compromised that machine. Or else, that machine has authorization to send requests to some other machine that is the decrypting authority - and the attackers, by having compromised that machine, have gained the ability to send requests for decryption. TL;DR: If a machine can actually use the data in the database, it has to be able to get the data in a decrypted form. If an attacker compromises that machine, the attacker can also get the data in decrypted form.
- mseebach 9y agoAll the best locks in the world doesn't help one iota if your attack is to get the janitor to open the gate for you. The compromised component at Equifax was the running application which is built to retrieve data from the database - it knows how to log in to the database and do whatever decryption is required to retrieve data. You don't particularly need to compromise passwords or encryption keys or whatever, because the application will just use them for you. Encryption protects against compromising the server itself either physically or at the OS level, which is not nothing, but also doesn't help if you have an underpaid janitor with a gambling problem with all the keys in his pocket guarding the loading bays out back.
- patio11 9y agoFor some color here, the Fermi estimate for number of unique consequential writes Equifax will make in a day is about ~1 billion and the number of "pull that entire file, please" is in the tens of millions. All the data is hot data. That's what Equifax exists at all. There are multiple internal services which can cause "pull that entire file." If you lose any of them, your data store doesn't matter; there goes the ball game. Someone's about to say "But rate limiting!" and not understand that Bank of America can ask for 10 million files at a time. (One cron job talking to a another cron job, etc etc, will fetch an update to a substantial fraction of all of their customers to update their internal records for underwriting. A larger recurring use case is "Refresh the soft pull on everyone in our marketing funnel whose pull is stale." Note that that is a sizable portion of the adult population.)
- tialaramex 9y agoOne good thing you get out of encryption at rest is that when some fool loses the backup tapes, or sells old servers to a "certified" recycling business that turns out to just put them on eBay without wiping anything, you may still be fine. So long as the keys weren't on the same tapes/ old servers. It's small, but it is something.
- sanmon3186 9y ago>none of the "encryption" done at scale at any Fortune 500 company in the US is more than a speed bump for attackers. So why Fortune 500 companies only? I am just trying to understand what this has to do with the scale of a company.