Database data security through the lens of cryptographic engineering
Eugene Pilyankevich,
Chief Technical officer, Cossack Labs
Database data security through the lens of cryptographic - - PowerPoint PPT Presentation
Database data security through the lens of cryptographic engineering Eugene Pilyankevich, Chief Technical officer, Cossack Labs Data breaches, annually 1093 783 781 614 447 419 2011 2012 2013 2014 2015 2016 Airplane crashes,
Eugene Pilyankevich,
Chief Technical officer, Cossack Labs
419 447 614 783 781 1093 2011 2012 2013 2014 2015 2016
Data breaches, annually
46 29 33 33 21 23 2011 2012 2013 2014 2015 2016
Airplane crashes, annually
419 447 614 783 781 1093 2011 2012 2013 2014 2015 2016
Airplane crashes?
Sensitive data 101
Any data, leakage or tampering of which can lead to damage to data
parties.
Naïve security model
Naïve security model
Ops-driven
Focused on components
Naïve security model
Smash’n’grab Passive attacks Few generic vectors
§ encryption-at-rest § encryption-in-transit § access distribution & control § event monitoring
Securing the naïve security model
Pragmatic security model
Real attackers are:
§ Smart and resourceful § Multi-skilled § Many vectors of attack … targeting an old vulnerability that you forgot to patch.
Pragmatic security model
Poor perimeter
Pragmatic security model
Poor perimeter Active and/or persistent attacks
Pragmatic security model
Poor perimeter Active and/or persistent attacks Data-specific attacks
Pragmatic security model
Poor perimeter Active and/or persistent attacks Data-specific attacks Systematic approach
… anything else?
Idealistic security model
Idealistic security model:
Future is now Future is reliable Working as guinea pig is a great idea
Idealistic security model:
Less than 10 years in public Assumptions assumptions Not tested in production
Database encryption
What does encryption do? Encryption narrows attack surface from data to keys
Database encryption
Classic Modern
Classic attacks
§ Smash ‘n’ grab § Snapshot attacker § Persistent passive attacker
Сlassic encryption?
Row/column/table Database files Full disk encryption
Сlassic encryption?
Row/column/table Database files Full disk encryption
NO DIFFE IFFERENCE
Сlassic encryption, defeated
Leak keys: § Host compromise or snapshot § MiTM to leak from traffic Leak plaintext: § Host compromise § Passive/active MiTM § Source compromise
Extended classic security
Protect data Protect database host Protect transport
Typical modern attacks
§ Flow alternation (SQL Injection) § VM image leak § Full compromise (temporary or persistent)
Emerging DB attacks
Emerging attacks
Write inference: § Reconstruct transaction from logs § Time transactions via bin logs to infer data Read inference: § Buffer pool § Slow query log if no full log is present
Emerging attacks
SQL Injections to grab contents of diagnostic tables. information_schema.processlist, performance_schema.threads.
See also: events_statements_current, events_statements_history
Emerging attacks
§ Snapshot attacks to get memory contents of: § Adaptive hash index § Query cache § Process heap (surprisingly revealing)
New sources of risk
Communication volume Access patterns
Practicalities
Limit leakage
§ Limit key leakage: fetch keys from remote side, purge from memory before/after encryption § Limit data leakage: many keys, make
Offload
§ Encrypt/store keys on HSM. § Proxies! … not without drawbacks.
Client-side encryption
§ Libraries § Various encryption schemes … not without drawbacks
Encrypted databases
Ideally we want…
New ciphers?
Constant failure so exciting!
NEW ATTACKS! DISPUTES ON SECURITY! IMPROVED ATTACKS! PROPOSED FIXES! BETTER ATTACKS! EMERGENCY UPDATES! DIFFERENT ATTACKS! NEW PROTOCOLS!
Constant failure so exciting!
Ideally we want boring crypto
Crypto that simply works, solidly resists attacks, never needs any upgrades. Daniel J. Bernstein, famous security/crypto scientist
New ciphers! Better crypto schemes
Realistically we need…
Practical ideas
§ Use great stuff § Use it correctly
Practical ideas
§ Use proven ciphers: ECC, AES, Salsa20 / ChaCha20. § Don’t roll your own crypto: just don’t. § Use good libraries.
Don’t roll your own crypto
§ Simple AES-GCM, ways to fail
Don’t roll your own crypto
§ Simple AES-GCM call, ways to fail § Signed symmetric encryption, ways to fail
Don’t roll your own crypto
§ Simple AES-GCM call, ways to fail § Signed symmetric encryption, ways to fail § Key wrapped symmetric encryption, ways to fail
Don’t roll your own crypto
§ Buffer breaks here and now, with a memory fault. § Crypto leaks anywhere at any point in
Don’t roll your own crypto
Practical ideas
Practical ideas
Practical ideas
full compromise.
Practical ideas
KeyCzar, tink
Hermes, DocRaid
cossacklabs.com ivychapel.ink @9gunpi
Links
General interest: Why Your Encrypted Database Is Not Secure, https://eprint.iacr.org/2017/468.pdf Cryptographically protected database search, https://arxiv.org/abs/1703.02014 Generic Attacks on Secure Outsourced Databases, http://scholar.harvard.edu/files/gkellaris/files/genericattacks.pdf Recontructing queries, inference, sensitive data leakage and other indirect attacks: InnoDB Database Forensics series: http://ieeexplore.ieee.org/document/5474822, http://ieeexplore.ieee.org/document/6329240/ Breaking Web Applications Built On Top of Encrypted Data, https://eprint.iacr.org/2016/920 Inference attacks Inference Attacks on Property-Preserving Encrypted Databases, https://cs.brown.edu/~seny/pubs/edb.pdf Database encryption: Protecting sensitive information with database encryption, https://www.owasp.org/images/c/c1/Database_Encryption.ppt Cossack Labs blog, Backend security series, https://www.cossacklabs.com/backend- security-series End-to-end data turnover, my talk at UISGCON 12, https://medium.com/@9gunpi/end-to- end-data-turnover-slides-and-notes-144006269863