At Rest Encryption with MySQL & Vault Tate McDaniel Charles - - PowerPoint PPT Presentation

at rest encryption with mysql vault
SMART_READER_LITE
LIVE PREVIEW

At Rest Encryption with MySQL & Vault Tate McDaniel Charles - - PowerPoint PPT Presentation

At Rest Encryption with MySQL & Vault Tate McDaniel Charles Thompson Percona Empowered Welcome and Introductions Charles Thompson Empowered Senior MySQL DBA with over seven years of experience in the industry. Proficient in server


slide-1
SLIDE 1

At Rest Encryption with MySQL & Vault

Charles Thompson Empowered Tate McDaniel Percona

slide-2
SLIDE 2

Welcome and Introductions

slide-3
SLIDE 3

Charles Thompson

Empowered

Senior MySQL DBA with over seven years of experience in the industry. Proficient in server tuning, query/schema optimization, and troubleshooting. I’ve worked with small & large (400+ instance) scale organizations. I really enjoy scripting solutions to my problems!

slide-4
SLIDE 4

Tate McDaniel

Percona

Senior MySQL DBA with 15 years in the industry, 2 years at Percona. Expert at query tuning, schema design, and optimization. In my spare time I do a lot of traveling. A lot. I actually live on a boat and sail around, so I guess you could say I’m always travelling. How is that for freedom? Want to work from “anywhere”, for real? Come talk to me about working for Percona!

slide-5
SLIDE 5

Working From Home…

slide-6
SLIDE 6

Agenda

slide-7
SLIDE 7

What Is This Talk About?

  • 1. Reasons for encryption using MySQL and other databases
  • 2. What types of encryption are available to use?
  • 3. When to use the different types of encryption (pros and

cons)

  • 4. An overview of a health care use case
  • 5. Percona Server working with Hashicorp’s Vault to achieve

data at rest encryption

  • 6. Questions?
slide-8
SLIDE 8

Reasons for Encryption

Modern demands for data security

slide-9
SLIDE 9

9

Common Compliance Issues

  • GDPR
  • PCI DSS
  • HIPAA
  • Specialized industry (eg. DOD)
slide-10
SLIDE 10

1

GDPR Requirements

“What level of encryption is required for GDPR? 32(1) of the General Data Protection Regulation to implement appropriate technical and organisational measures to secure personal data. The GDPR deliberately does not define which specific technical and organisational measures are considered suitable in each case, in order to accommodate individual factors.“

Source: https://gdpr-info.eu/issues/encryption/

slide-11
SLIDE 11

1 1

PCI DSS (eg: Monetary Transactions)

“PCI encryption requirements

Requirement 3 of the Payment Card Industry's Data Security Standard (PCI DSS) is to “protect stored cardholder data.” The public assumes merchants and financial institutions will protect data on payment cards to thwart theft and prevent unauthorized use. … Encryption of cardholder data with strong cryptography is an acceptable method of rendering the data unreadable in order to meet PCI DSS Requirement 3.4”

Source: https://www.pcisecuritystandards.org/pdfs/pci_fs_data_storage.pdf

slide-12
SLIDE 12

1 2

HIPAA Requirements (US healthcare)

“Furthermore, the HIPAA encryption requirements for transmission security state that covered entities should “implement a mechanism to encrypt PHI whenever deemed appropriate”. This instruction is considerably vague and open to interpretation”

Source: https://www.hipaajournal.com/hipaa-encryption-requirements/

slide-13
SLIDE 13

1 3

Take Away…

Policy makers have “kicked the can” down the road and put the

  • nus on the industry to protect data.
slide-14
SLIDE 14

1 4

Other Reasons

  • Data breach can ruin a business
  • Ethical or moral responsibility to protect

people

  • Protecting business secrets from competition
slide-15
SLIDE 15

Types of Encryption

Available in the MySQL Ecosystem

slide-16
SLIDE 16

1 6

Types of Encryption

  • Encryption at rest
  • Encryption in transit
  • Encryption in use
slide-17
SLIDE 17

1 7

Encryption in Use

Applications can encrypt data before storing it and decrypt it once

  • retrieved. The application takes responsibility for the data security.
slide-18
SLIDE 18

1 8

Encryption in Use

slide-19
SLIDE 19

1 9

Encryption in Transit

slide-20
SLIDE 20

2

Encryption in Transit

Followed by use of a UNIX SOCKET connection instead of the TCP/IP mysql connection.

slide-21
SLIDE 21

2 1

Encryption at Rest

Full Disk Encryption

slide-22
SLIDE 22

2 2

Encryption at Rest

Encrypted Database Files (Database Encryption)

slide-23
SLIDE 23

2 3

Encryption at Rest

Application encryption still counts!

slide-24
SLIDE 24

Choosing the Right Encryption

Pros and cons of the different types of encryption

slide-25
SLIDE 25

2 5

One Thing We Can All Agree On

No matter who you are or what you do in the IT world, it is probably best to encrypt data in transit. For MySQL this means TLS + enforcing SSL on user accounts as well as replication users. GRANT … REQUIRE SSL; GRANT … REQUIRE X509;

slide-26
SLIDE 26

2 6

The Exception Proves the Rule

slide-27
SLIDE 27

2 7

Another Thing We Can All Agree On

MySQL hasn’t got to a point of maturity where “in use” data is encrypted. Use

  • f debuggers like strace can give

access to the unencrypted data in memory, etc.

slide-28
SLIDE 28

2 8

The Exception Proves the Rule

Application encryption can ensure data in memory is encrypted.

slide-29
SLIDE 29

2 9

Encryption at Rest - Costs

slide-30
SLIDE 30

3

Encryption at the Volume/OS/Block Level

We just encrypt the volume or disk using one of the many tools available MySQL isn’t aware of any change Application isn’t aware of a change Cheap to do Doesn’t protect us from insider threats Centralized key storage and compliance is problematic sometimes PROs: CONs:

slide-31
SLIDE 31

3 1

Modern Considerations

slide-32
SLIDE 32

Encryption at the Database Level

Protects from “inside” threats Can encrypt across volumes you don’t control Backup/restores are automatically encrypted Lower overhead 3-5% performance hit DBA controlled (no sys admin needed) Centralized key storage and compliance ready. PROs:

slide-33
SLIDE 33

Encryption at the Database Level

Still vulnerable to in memory attacks More setup/complication Loss of keys can be catastrophic CONs:

slide-34
SLIDE 34

Encryption at the Application Level

Database servers are protected at all levels automatically since data cannot be used without decryption Most flexible Very little overhead on databases (which are usually the choke point) PROs:

slide-35
SLIDE 35

Encryption at the Application Level

Many applications are not built with this in mind and are hard to change Full text and partial text search can be a nightmare Application shoulders the responsibility for key security CONs:

slide-36
SLIDE 36
slide-37
SLIDE 37

What is Hashicorp’s Vault?

  • Software for securely managing secrets
  • A secret is anything that you want to tightly control access to, such as:

○ API Keys ○ Passwords ○ Certificates

  • Vault can be controlled via Web UI or command-line
  • Strong API using curl with lots of ways to authenticate

curl -k -X GET -H X-Vault-Token:$TOKEN "$VAULT_ADDR/v1/secret/mysql" | python -m json.tool

  • Updated regularly
slide-38
SLIDE 38

Pros of Vault Versus Keyring File

Pros of Using Vault Pros of Using Keyring File

One centralized location for all keys that is easily managed Do not have a single point of failure if Vault goes down No backups of keyring file No additional setup/overhead of Vault Better security! Key is nowhere on the MySQL server itself Powerful auditing capabilities

slide-39
SLIDE 39

Vault Web UI

slide-40
SLIDE 40

Why did we choose Vault?

  • SOC 2 Compliance
  • Fastest/easiest solution to put into production
  • We already wanted a secrets management tool in-house
slide-41
SLIDE 41

Setting Up Percona Server with Vault

  • Must be running Percona Server 5.7.20+
  • Configuration setup documentation can be found here:

○ https://www.percona.com/blog/2018/09/17/using-the-keyring_vault-plugin-with-percona-server

  • for-mysql-5-7/
  • Backup/restore tutorial:

○ https://www.percona.com/blog/2018/09/24/backing-up-percona-server-for-mysql-with-keyring_ vault-plugin-enabled/

  • Things that can be encrypted:

○ Binary Log ○ General Tablespaces ○ Tables ○ Temporary Files ○ Undo Tablespace ○ Redo Log

slide-42
SLIDE 42

Encrypting Tables

ALTER INSTANCE ROTATE INNODB MASTER KEY; Check Vault Web UI to ensure the key has been created. If you don’t see an entry for it, do not start encrypting tables! If you see an entry, you’re good to start encrypting tables! ALTER TABLE `db`.`table` ENCRYPTION = ‘Y’; Be careful - Converting a table locks the table completely for duration of execution

slide-43
SLIDE 43

Lessons Learned and Items to Note

  • PS doesn’t support KV Version 2
  • MySQL only uses Vault when it’s started
  • Error messages are extremely vague
  • No additional memory overhead
  • Performance decrease is about 3-5% due read/write to disk and

buffer pool operations

  • Vault encryption key names are Base64 encoded
  • Logical backups (mysqldump/mydumper) are not affected by

encryption

slide-44
SLIDE 44

Questions and Discussion

Ask away!

slide-45
SLIDE 45

Thank You to Our Sponsors

slide-46
SLIDE 46

46

Rate Our Session