Cyberstudy
1.4 3.3 In progress

Database Encryption

11 flashcards

Summary

Databases hold structured, often sensitive data, and can be encrypted at several levels. Encrypting the storage protects against stolen disks, while encrypting records or columns protects specific data even from database administrators. Finer levels give more control but cost more performance.

In plain words

Databases can be encrypted at different levels: the whole database on disk (e.g. TDE), individual records, or specific columns such as card numbers. Finer levels can even keep secrets hidden from database administrators.

Detailed explanation

  • Transparent data encryption (TDE): Encrypts the database files and backups at rest; applications see plaintext, so it doesn't protect against someone querying with valid access.
  • Disk or volume encryption: Encrypts the storage under the database, protecting against theft of drives.
  • Record-level encryption: Encrypts whole rows, which lets different records use different keys, such as one per customer.
  • Column-level encryption: Encrypts selected columns or cells, such as card numbers, so only authorized applications can read them.
    • Always Encrypted: A SQL Server feature where keys are held by the client application, so the database server never sees the plaintext.
  • Granularity trade-off: The finer the encryption, the more control and the higher the performance and key management cost.
  • Compliance: Standards such as PCI DSS require cardholder data to be protected at rest.

Important terms

taken from the text above
Transparent data encryption (TDE)
Encrypts the database files and backups at rest; applications see plaintext, so it doesn't protect against someone querying with valid access.
Disk or volume encryption
Encrypts the storage under the database, protecting against theft of drives.
Record-level encryption
Encrypts whole rows, which lets different records use different keys, such as one per customer.
Column-level encryption
Encrypts selected columns or cells, such as card numbers, so only authorized applications can read them.
Always Encrypted
A SQL Server feature where keys are held by the client application, so the database server never sees the plaintext.

Examples & real-world scenarios

  • TDE protecting database files and backups if the disks are stolen.
  • Column encryption for a 'card_number' field only.
  • Record-level encryption where only the client app can decrypt.

Scenario

A health insurer must stop even its DBAs from reading patient diagnoses. Database-level TDE isn't enough, because the DBMS decrypts for anyone querying it. It uses record or column encryption with keys held outside the database.

Common mistakes

  • Assuming TDE hides data from people with database access. It protects the files at rest.
  • Encrypting every column 'just because', which hurts performance with little benefit.

Practical skills

  • Pick a database encryption level from who you need to protect data against.

What I should remember

  • TDE: Protects database files and backups at rest, not against authorized queries.
  • Column-level encryption: Protects specific sensitive fields.
  • Always Encrypted: Client-held keys keep plaintext away from the database server.
  • Granularity: Finer encryption gives more control but costs performance.