The advice on FDE is misleading if not flat out wrong. It's NOT just to protect against media theft. It's also about "shit, the drive crashed. How do I destroy the data on it before throwing it in the trash?" Same with replacing a smaller drive with a bigger drive. Yes, DBAN it, but that won't take care of remapped sectors. It's easier to destroy an encryption key than it is to destroy the data.
Securing PostgreSQL [pdf]
31–40 of 72 posts
Re: Securing PostgreSQL [pdf]
#32One of the constraints I am working with is that a human is not necessarily in the loop all the time. What is the best way then bootstrap the encryption process?
You can get that fraction closer to 50% without a human in the loop by segregating your crypto code from the application in a virtual HSM, using something like a TLS client certificate to authenticate your application to the HSM, have humans in the loop for restarts/bringups of the HSM itself, and doing pretty aggressive monitoring on the request patterns between the app and the HSM.
The threat model here is that someone owns up your app server --- if that wasn't in your model, you wouldn't need application layer crypto. The idea is that owning up the app server will get an attacker enough access to make requests to the HSM, but not control of the HSM itself. If the HSM can detect abnormal volume of requests, you can use it as a circuit breaker to prevent bulk exfiltration of your secure data. You also get accountability, so that when your server is compromised you might know exactly what records were accessed.
Typically, the app server itself will handle all of the database operations, and the virtual HSM just provides a "seal" and "unseal" operation --- convert plaintext to ciphertext, convert ciphertext to plaintext.
† The 5% you're getting in the dumb online crypto scenario is that if you store the root crypto secrets in a file, an attacker can't necessarily recover it from an SQL injection attack --- but in reality the percentage is probably lower, since most of the time SQLI will equate to RCE.
Re: Securing PostgreSQL [pdf]
#33Earlier quoted context omitted.
The context of the long-winded conversation you linked to is user auth and session cookies. That's a VERY specific use case for AES. I'm talking about AES in general. But I still skimmed through it. TL;DR * AES CBC instead of ECB or (gasp) Triple DES * SHA-1 instead of MD5 * Use MACs * Be careful with padding
* ECB is not an alternative to 3DES * If you use 3DES or any other 8-byte block cipher you import several additional security concerns you have to code around * If you use CBC you also have to get the IV right, which tons of carefully designed crypto has failed to do * SHA-1 is also insecure * Neither MD5 nor SHA-1 is a MAC * Your choice of MACs brings with it new security pitfalls * How you apply the MAC also has pi…
* I would never use 3DES.
* I am aware of that, just TLDRing. SHA-256 is my cup of tea.
* Did I say they were a MAC? I would use CBC HMAC + SHA-256 for that.
* No idea, since I'm not an expert at AES.
I feel like you're offended that I didn't like the article. It's just an opinion, don't take it personally.
Re: Securing PostgreSQL [pdf]
#34Earlier quoted context omitted.
* ECB is not an alternative to 3DES * If you use 3DES or any other 8-byte block cipher you import several additional security concerns you have to code around * If you use CBC you also have to get the IV right, which tons of carefully designed crypto has failed to do * SHA-1 is also insecure * Neither MD5 nor SHA-1 is a MAC * Your choice of MACs brings with it new security pitfalls * How you apply the MAC also has pi…
* Never said AES ECB was an alternative to DES. * I would never use 3DES. * I am aware of that, just TLDRing. SHA-256 is my cup of tea. * Did I say they were a MAC? I would use CBC HMAC + SHA-256 for that. * No idea, since I'm not an expert at AES. I feel like you're offended that I didn't like the article. It's just an opinion, don't take it personally.
Re: Securing PostgreSQL [pdf]
#35Re: Securing PostgreSQL [pdf]
#36I think this talk misses one of the most important security patterns of PostgreSQL and SQL-databases in general. If you for example have a table with hashed passwords. Why would any user except admin need to be able to make a select on that table? Make a function to validate the user and only grant permission to run this function.
If you're worried about a SQL dump exposing password hashes, segregate password validation into its own microservice. This comes with other benefits: for instance, you can ratchet up the work factor on your password hash, because the service will very easily scale horizontally.
Re: Securing PostgreSQL [pdf]
#37Earlier quoted context omitted.
* Never said AES ECB was an alternative to DES. * I would never use 3DES. * I am aware of that, just TLDRing. SHA-256 is my cup of tea. * Did I say they were a MAC? I would use CBC HMAC + SHA-256 for that. * No idea, since I'm not an expert at AES. I feel like you're offended that I didn't like the article. It's just an opinion, don't take it personally.
I'm not offended that you didn't like the article. I'm saying you failed to summarize it. I'm pretty sure I know what the point of this particular article was. :)
Re: Securing PostgreSQL [pdf]
#38I think this talk misses one of the most important security patterns of PostgreSQL and SQL-databases in general. If you for example have a table with hashed passwords. Why would any user except admin need to be able to make a select on that table? Make a function to validate the user and only grant permission to run this function.
That's a bad idea, because it implies that your password hash has to be expressible inside of Postgres. If you're worried about a SQL dump exposing password hashes, segregate password validation into its own microservice. This comes with other benefits: for instance, you can ratchet up the work factor on your password hash, because the service will very easily scale horizontally.
Now if you make a good set of prepared statements as an interface for your database, this could be viewed as a "micro service" in it self.
Re: Securing PostgreSQL [pdf]
#39Earlier quoted context omitted.
That's a bad idea, because it implies that your password hash has to be expressible inside of Postgres. If you're worried about a SQL dump exposing password hashes, segregate password validation into its own microservice. This comes with other benefits: for instance, you can ratchet up the work factor on your password hash, because the service will very easily scale horizontally.
First of all, this pattern is not exclusive to password hashes. There are lots of situation when handling customer data where you simply don't need the ability for the client to query the whole data-set, and if that's the case, allowing it is just bad hygiene. Now if you make a good set of prepared statements as an interface for your database, this could be viewed as a "micro service" in it self.