SlideShare ist ein Scribd-Unternehmen logo
1 von 70
Downloaden Sie, um offline zu lesen
VaultDECOUPLING SECRETS & APPLICATIONS
Armon Dadgar
@armon
HASHICORP
© 2016 Pythian5
Derek Downey
@derek_downey
© 2016 Pythian6
ABOUT PYTHIAN

11,400
Pythian currently manages
more than 11,400 systems.
400+Pythian currently employs more
than 400 people in 200 cities in
35 countries
1997Pythian was founded in 1997
Global Leader In IT Transformation And Operational Excellence

Unparalleled Expertise
• Top 5% in databases, applications, infrastructure, Big Data, Cloud, Data
Science, and DevOps

Unmatched Certifications
• 9 Oracle ACEs, 4 Oracle ACE Directors, 1 Oracle ACE Associate
• 6 Microsoft MVPs, 1 Microsoft Certified Master
• 5 Google Platform Qualified Developers
• 1 Cloudera Champion of Big Data
• 1 Mongo DB Certified DBA Associate Level
• 1 DataStax Certified Partner, 1 MVP
• 11 AWS Certified Solutions Architects, 1 AWS Certified Developer, 1 AWS
Certified SysOps Administrator

Broad Technical Experience
• Oracle, Microsoft, MySQL, Oracle EBS, Hadoop, Cassandra, MongoDB,
virtualization, configuration management, monitoring, trending, and more.
© 2016 Pythian7
SOME OF OUR CLIENTS
SECRET MANAGEMENT
WHAT IS "SECRET"?
SECRET VS. SENSITIVE
 SECRET  SENSITIVE
DB CREDENTIALS
CLOUD ACCESS KEYS
SSL CA/CERTIFICATES
ENCRYPTION KEYS
WIFI PASSWORDS
EMAIL ADDRESSES
PHONE NUMBERS
MOTHER'S MAIDEN NAME
DATACENTER LOCATIONS
CUSTOMER PII
SOURCE CODE EMAIL/CHAT
 SECRET  SENSITIVE
DB CREDENTIALS
CLOUD ACCESS KEYS
SSL CA/CERTIFICATES
ENCRYPTION KEYS
WIFI PASSWORDS
EMAIL ADDRESSES
PHONE NUMBERS
MOTHER'S MAIDEN NAME
DATACENTER LOCATIONS
CUSTOMER PII
SOURCE CODE EMAIL/CHAT

SECRET MANAGEMENT 1.0
HOW DO I DISTRIBUTE SECRETS?
How do applica3ons get secrets?
How do humans acquire secrets?
How are secrets updated?
How is a secret revoked?
{
"mysql_user": "root",
"mysql_pass": "s3(Ret"
}
secure master cat config.son
WHY NOT CONFIG MANAGEMENT?
Centrally stored
Eventually consistent
No access control
No audi3ng
No revoca3on
WHY NOT (ONLINE) DATABASES?
RDBMS, Consul, ZooKeeper, etc
Not designed for secrets
Limited access controls
Typically plaintext storage
No audi3ng or revoca3on abili3es
HOW TO HANDLE SECRET SPRAWL?
Secret material is distributed
Who has access?
When were secrets used?
What is the aMack surface?
What do we do in the event of a compromise?
STATE OF THE WORLD 1.0
Secret sprawl
Decentralized keys
Limited visibility
Poorly defined “break glass” procedures
SECRET MANAGEMENT 2.0
VaultMODERN SECRETS MANAGEMENT
VAULT GOALS
Single source for secrets
Programma3c applica3on access (Automated)
Operator access (Manual)
Prac3cal security
Modern data center friendly
VAULT FEATURES
Secure secret storage (in-memory, Consul, file, postgres, and more)
Audi3ng
Rich ACLs
Mul3ple client authen3ca3on methods
Leasing, renewal, and revoca3on
Dynamic secrets
SECURE SECRET STORAGE
Data is encrypted in transit and at rest
256bit AES in GCM mode
TLS 1.2 for clients
No HSM required
AUDITING
Pluggable Audit Backends
Request and Response Logging
Priori3zes Safety over Availability
Secrets Hashed in Audits
Searchable, but not reversible
RICH ACLS
Role Based Policies
Restrict access to “need to know”
Default Deny, must be explicitly allowed
FLEXIBLE AUTH
Pluggable Backends
Tokens, GitHub, AppID, User/Pass, TLS Certs
Machine-Oriented vs Operator-Oriented
LEASING, RENEWAL, AND REVOCATION
Every Secret has a Lease*
Secrets are revoked at the end of the lease unless renewed
Secrets may be revoked early by operators
“Break Glass” procedure
Dynamic Secrets make leases enforceable
Not possible for arbitrary secrets
DYNAMIC SECRETS
Never provide “root” creden3als to clients
Provide limited access creden3als based on role
Generated on demand when requested
Leases are enforceable via revoca3on
Audit trail can iden3fy point of compromise
DYNAMIC SECRETS
Pluggable Backends
AWS, Cassandra, Consul, MySQL, PostgreSQL, MSSQL, …
Grow support over 3me
INTEGRATING MYSQL
© 2016 Pythian
MySQL user management
32
● Clunky to manage many users
● Difficult to manage passwords
● Password expiration only recently
● Password validation only recently
© 2016 Pythian
MySQL user management
33
● Hardcoded in applications
● Plaintext secrets
● Difficult to rotate
© 2016 Pythian
How does Vault help?
34
● Creates users with high entropy secrets
● Secrets have aggressive expiration
● Secrets can easily be revoked
© 2016 Pythian35
$ vault write mysql/roles/readonly 
sql="CREATE USER '{{name}}'@'%' IDENTIFIED BY '{{password}}';GRANT SELECT ON
*.* TO '{{name}}'@'%';"
Create user pattern
© 2016 Pythian36
$ vault read mysql/creds/readonly
Key Value
lease_id mysql/creds/readonly/b9b1fbb4-5ef8-1977-1fd2-ed21912e6288
lease_duration 600
lease_renewable true
password 04f9d427-5ea4-8ce4-8e92-30c5cdcb5f7e
username root-6dd78551-dd
Read from Vault
© 2016 Pythian37
$ vault read mysql/creds/readonly
Key Value
lease_id mysql/creds/readonly/b9b1fbb4-5ef8-1977-1fd2-ed21912e6288
lease_duration 600
lease_renewable true
password 04f9d427-5ea4-8ce4-8e92-30c5cdcb5f7e
username github-6dd78551-dd
Read from Vault
© 2016 Pythian38
$ mysql -ugithub-6dd78551-dd -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 12
Server version: 5.7.11 MySQL Community Server (GPL)
mysql> SELECT USER();
+——————————————+
| User() |
+——————————————+
| github-6dd78551-dd@localhost |
+——————————————+
1 row in set (0.00 sec)
mysql> SHOW GRANTS;
+———————————————————————+
| Grants for github-6dd78551-dd@% |
+———————————————————————+
| GRANT SELECT ON *.* TO 'github-6dd78551-dd'@'%' |
+———————————————————————+
1 row in set (0.00 sec)
© 2016 Pythian
Doesn’t MySQL do this natively?
39
● Proxy users (5.5+)
● Secrets have expiration (in 5.6+)
● Strong password policies can be implemented (5.6+)
© 2016 Pythian
But…
40
● Must manually add/remove users
● Must manually update passwords
● MySQL-specific authentication plugins
© 2016 Pythian
Why Vault?
41
● Centralized secret management with rest of organization
● Users easier to manage
● Vault generates high-entropy secrets by default
● Limit attack surface if secrets compromised
● “Breakglass” policies to revoke secrets
© 2016 Pythian42
$ vault revoke mysql/creds/readonly/6f1a7e70-cdd7-6954-eb57-b46da0c88ad5docker
Key revoked with ID ‘mysql/creds/readonly//6f1a7e70-cdd7-6954-eb57-b46da0c88ad5'.
$ mysql -uroot -p -e "SELECT user, host FROM mysql.user"
Enter password:
+—————————+——+
| user | host |
+—————————+——+
| root | % |
+—————————+——+
Remove single secret
© 2016 Pythian43
$ mysql -uroot -p -e "SELECT user, host FROM mysql.user"
+————————+——+
| user | host |
+————————+——+
| root | % |
| root-6a1e1fbb-37 | % |
| root-7dc68b1f-dd | % |
| root-fcb6e200-87 | % |
+————————+——+
$ vault revoke --prefix mysql
Key revoked with ID 'mysql'.
$ mysql -uroot -p -e "SELECT user, host FROM mysql.user“
+———+———+
| user | host |
+———+———+
| root | % |
+———+———+
Remove all MySQL secrets
© 2016 Pythian
Vault for Direct Access
44
● Great for third-party access: consultants, auditors, etc
● Only create a single user to grant appropriate access
● Or create user per vendor or role
● Aggressive secrets expiration limits risk of password
exposure
● Authentication plugins
© 2016 Pythian
Vault Authentication
45
● Github
● LDAP
© 2016 Pythian46
$ vault policies github
path "mysql/*" {
policy = "write"
}
$ vault auth -method=github token=$GITHUB_TOKEN
Successfully authenticated!
token: 920b84f1-4ca9-33aa-4946-f046ef0b3f53
token_duration: 2591999
token_policies: [default, github]
$ vault read mysql/creds/readonly
Key Value
lease_id mysql/creds/readonly/6b4c559e-5008-f813-92af-19eaa41cbac4
lease_duration 600
lease_renewable true
password 8bb914dc-9619-3c87-ba4e-18f1ec602e98
username github-dte-7a311
© 2016 Pythian
Vault for MySQL Applications
47
● Dynamic config via consul-template
● Secrets not stored in plaintext
● consul-template automatically renews
© 2016 Pythian
Vault Auditing
48
● Log access
● Supports writing syslog and file
● Hashes access so secrets are not stored in plaintext
© 2016 Pythian
Audit log
49
{"time":"2016-04-07T19:20:46Z","type":"request","auth":{"display_name":"root","policies":
["root"],"metadata":null},"request":{"operation":"read","client_token":"hmac-
sha256:ab960b87941cb0ad31477bec09b31671457c1967b15a89bf8574bae528c11ffa","pa
th":"mysql/creds/readonly","data":null,"remote_address":"127.0.0.1"},"error":""}
© 2016 Pythian
Considerations
50
● Current implementation requires multiple mysql mount
per unique environment.
● Auditing only access requests to Vault, not whether used
on DB or what was done.
OPERATING VAULT
HIGH AVAILABILITY
Consul used for leader elec3on
Ac3ve/Standby
Automa3c failover
UNSEALING THE VAULT
Data in Vault encrypted
Vault requires encryp3on key
Must be provided online
WATCHING THE WATCHMEN
Master Key is the “key to the kingdom”
All data could be decrypted
Protect against insider aMack
Two-Man Rule
SHAMIR SECRET SHARING
Protect Encrypt Key with Master Key
Split Master Key into N shares
T shares to recompute Master
Quorum of key holders required to
unseal
Default N:5, T:3
SUMMARY
Solves the “Secret Sprawl Problem”
Protects against external threats (Cryptosystem)
Protects against internal threats (ACLs and Secret Sharing)
DEMONSTRATION
© 2016 Pythian58
● Setup vault, unseal (Docker containers), setup file audit
● Create github auth config
● Authenticate
● Create mysql user
● Request secret
● Use secret
● Revoke secret
● Verify Audit log
Demo Github Authentication
BUILDING ON VAULT
SECURITY FOUNDATION
Base of Trust
Core Infrastructure
Flexible Architecture
Founda3on for Security Infrastructure
PERSONALLY IDENTIFIABLE INFORMATION
PII informa3on is everywhere
SSN, CC#, OAuth Tokens, etc.
Email? Physical address?
Security of storage?
Scalability of storage?
Audibility of access?
PII WITH VAULT
“transit” backend in Vault
Encrypt/Decrypt data in transit
Avoid secret management in client applica3ons
Builds on Vault founda3on
TRANSIT BACKEND
Web server has no encryp3on keys
Requires two-factor compromise (Vault + Database)
Decouples storage from encryp3on and access control
EXTENSIBLE
PKI backend for Cer3ficate Authority + Signing
Mutual TLS for Applica3ons
SSH backend for SSH key management
“vault ssh” CLI command, dynamic keys or one-3me-passwords
VAULT IN PRACTICE
USING VAULT
API Driven
JSON/HTTPS
Rich CLI for humans and scripts
Rich client libraries
APPLICATION INTEGRATION
Vault-aware
Na3ve client libraries (go, ruby, rails, python, node, and more)
Secrets only in-memory
Safest but high-touch
CONSUL TEMPLATE INTEGRATION
Secrets templa3zed into applica3on configura3on
Vault is transparent
Lease management is automa3c
Non-secret configura3on s3ll via Consul
{{ with $secret := vault "mysql/creds/production" }}
---
production:
adapter: mysql
database: mysql.service.consul
username: {{$secret.Data.username}}
password: {{$secret.Data.password}}
pool: {{key "production/mysql/pool"}}
{{ end }}
secure master cat secrets.yml.ctmpl
hashicorp/vault
hOps://vaultproject.io
security@hashicorp.com
QUESTIONS?
THANK YOU!
hashicorp/vault
hOps://vaultproject.io
security@hashicorp.com



QUESTIONS?
THANK YOU!
hOps://pythian.comhOps://pythian.com

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Vault 101
Vault 101Vault 101
Vault 101
 
Adopting HashiCorp Vault
Adopting HashiCorp VaultAdopting HashiCorp Vault
Adopting HashiCorp Vault
 
Vault Open Source vs Enterprise v2
Vault Open Source vs Enterprise v2Vault Open Source vs Enterprise v2
Vault Open Source vs Enterprise v2
 
Vault
VaultVault
Vault
 
Neil Saunders (Beamly) - Securing your AWS Infrastructure with Hashicorp Vault
Neil Saunders (Beamly) - Securing your AWS Infrastructure with Hashicorp Vault Neil Saunders (Beamly) - Securing your AWS Infrastructure with Hashicorp Vault
Neil Saunders (Beamly) - Securing your AWS Infrastructure with Hashicorp Vault
 
Vault
VaultVault
Vault
 
Best practices for Terraform with Vault
Best practices for Terraform with VaultBest practices for Terraform with Vault
Best practices for Terraform with Vault
 
Hashicorp Vault: Open Source Secrets Management at #OPEN18
Hashicorp Vault: Open Source Secrets Management at #OPEN18Hashicorp Vault: Open Source Secrets Management at #OPEN18
Hashicorp Vault: Open Source Secrets Management at #OPEN18
 
Hashicorp Vault - OPEN Public Sector
Hashicorp Vault - OPEN Public SectorHashicorp Vault - OPEN Public Sector
Hashicorp Vault - OPEN Public Sector
 
Kubernetes Secrets Management on Production with Demo
Kubernetes Secrets Management on Production with DemoKubernetes Secrets Management on Production with Demo
Kubernetes Secrets Management on Production with Demo
 
HashiCorp Vault Workshop:幫 Credentials 找個窩
HashiCorp Vault Workshop:幫 Credentials 找個窩HashiCorp Vault Workshop:幫 Credentials 找個窩
HashiCorp Vault Workshop:幫 Credentials 找個窩
 
Overview of secret management solutions and architecture
Overview of secret management solutions and architectureOverview of secret management solutions and architecture
Overview of secret management solutions and architecture
 
HashiCorp Brand Guide
HashiCorp Brand GuideHashiCorp Brand Guide
HashiCorp Brand Guide
 
Managing secrets at scale
Managing secrets at scaleManaging secrets at scale
Managing secrets at scale
 
Chickens & Eggs: Managing secrets in AWS with Hashicorp Vault
Chickens & Eggs: Managing secrets in AWS with Hashicorp VaultChickens & Eggs: Managing secrets in AWS with Hashicorp Vault
Chickens & Eggs: Managing secrets in AWS with Hashicorp Vault
 
Terraform modules restructured
Terraform modules restructuredTerraform modules restructured
Terraform modules restructured
 
Hashicorp Vault Open Source vs Enterprise
Hashicorp Vault Open Source vs EnterpriseHashicorp Vault Open Source vs Enterprise
Hashicorp Vault Open Source vs Enterprise
 
Secure your app with keycloak
Secure your app with keycloakSecure your app with keycloak
Secure your app with keycloak
 
Prometheus 101
Prometheus 101Prometheus 101
Prometheus 101
 
Designing High Availability for HashiCorp Vault in AWS
Designing High Availability for HashiCorp Vault in AWSDesigning High Availability for HashiCorp Vault in AWS
Designing High Availability for HashiCorp Vault in AWS
 

Andere mochten auch

ProxySQL Tutorial - PLAM 2016
ProxySQL Tutorial - PLAM 2016ProxySQL Tutorial - PLAM 2016
ProxySQL Tutorial - PLAM 2016
Derek Downey
 

Andere mochten auch (17)

Dynamic Database Credentials: Security Contingency Planning
Dynamic Database Credentials: Security Contingency PlanningDynamic Database Credentials: Security Contingency Planning
Dynamic Database Credentials: Security Contingency Planning
 
Using ansible vault to protect your secrets
Using ansible vault to protect your secretsUsing ansible vault to protect your secrets
Using ansible vault to protect your secrets
 
ContainerDays Boston 2016: "Hiding in Plain Sight: Managing Secrets in a Cont...
ContainerDays Boston 2016: "Hiding in Plain Sight: Managing Secrets in a Cont...ContainerDays Boston 2016: "Hiding in Plain Sight: Managing Secrets in a Cont...
ContainerDays Boston 2016: "Hiding in Plain Sight: Managing Secrets in a Cont...
 
ContainerDays NYC 2016: "The Secure Introduction Problem: Getting Secrets Int...
ContainerDays NYC 2016: "The Secure Introduction Problem: Getting Secrets Int...ContainerDays NYC 2016: "The Secure Introduction Problem: Getting Secrets Int...
ContainerDays NYC 2016: "The Secure Introduction Problem: Getting Secrets Int...
 
ProxySQL Tutorial - PLAM 2016
ProxySQL Tutorial - PLAM 2016ProxySQL Tutorial - PLAM 2016
ProxySQL Tutorial - PLAM 2016
 
Hashicorp @ JUST EAT - Part 2
Hashicorp @ JUST EAT - Part 2Hashicorp @ JUST EAT - Part 2
Hashicorp @ JUST EAT - Part 2
 
Vault: Beyond secret storage - Using Vault to harden your infrastructure
Vault: Beyond secret storage - Using Vault to harden your infrastructureVault: Beyond secret storage - Using Vault to harden your infrastructure
Vault: Beyond secret storage - Using Vault to harden your infrastructure
 
dome and vault
dome and vaultdome and vault
dome and vault
 
Pythian operational visibility
Pythian operational visibilityPythian operational visibility
Pythian operational visibility
 
Proxysql ha plam_2016_2_keynote
Proxysql ha plam_2016_2_keynoteProxysql ha plam_2016_2_keynote
Proxysql ha plam_2016_2_keynote
 
Proxysql use case scenarios plam 2016
Proxysql use case scenarios    plam 2016Proxysql use case scenarios    plam 2016
Proxysql use case scenarios plam 2016
 
Ansible MySQL MHA
Ansible MySQL MHAAnsible MySQL MHA
Ansible MySQL MHA
 
Like Ruby on Rails for Node - the Sails js framework
Like Ruby on Rails for Node - the Sails js frameworkLike Ruby on Rails for Node - the Sails js framework
Like Ruby on Rails for Node - the Sails js framework
 
Microservices Manchester: Security, Microservces and Vault by Nicki Watt
Microservices Manchester:  Security, Microservces and Vault by Nicki WattMicroservices Manchester:  Security, Microservces and Vault by Nicki Watt
Microservices Manchester: Security, Microservces and Vault by Nicki Watt
 
Hashicorp: Delivering the Tao of DevOps
Hashicorp: Delivering the Tao of DevOpsHashicorp: Delivering the Tao of DevOps
Hashicorp: Delivering the Tao of DevOps
 
10 Green Companies to Work For
10 Green Companies to Work For10 Green Companies to Work For
10 Green Companies to Work For
 
Securing the Container Pipeline at Salesforce by Cem Gurkok
Securing the Container Pipeline at Salesforce by Cem Gurkok   Securing the Container Pipeline at Salesforce by Cem Gurkok
Securing the Container Pipeline at Salesforce by Cem Gurkok
 

Ähnlich wie Using Vault to decouple MySQL Secrets

Ähnlich wie Using Vault to decouple MySQL Secrets (20)

Guob - MySQL e LGPD
Guob - MySQL e LGPDGuob - MySQL e LGPD
Guob - MySQL e LGPD
 
Percona Live 2019 - MySQL Security
Percona Live 2019 - MySQL SecurityPercona Live 2019 - MySQL Security
Percona Live 2019 - MySQL Security
 
Enhancing MySQL Security
Enhancing MySQL SecurityEnhancing MySQL Security
Enhancing MySQL Security
 
MySQL Security and Standardization at PayPal - Percona Live 2019
MySQL Security and Standardization at PayPal - Percona Live 2019MySQL Security and Standardization at PayPal - Percona Live 2019
MySQL Security and Standardization at PayPal - Percona Live 2019
 
Enhancing MySQL Security
Enhancing MySQL SecurityEnhancing MySQL Security
Enhancing MySQL Security
 
Securing your MySQL / MariaDB Server data
Securing your MySQL / MariaDB Server dataSecuring your MySQL / MariaDB Server data
Securing your MySQL / MariaDB Server data
 
Securing Big Data at rest with encryption for Hadoop, Cassandra and MongoDB o...
Securing Big Data at rest with encryption for Hadoop, Cassandra and MongoDB o...Securing Big Data at rest with encryption for Hadoop, Cassandra and MongoDB o...
Securing Big Data at rest with encryption for Hadoop, Cassandra and MongoDB o...
 
Cloud Platform Symantec Meetup Nov 2014
Cloud Platform Symantec Meetup Nov 2014Cloud Platform Symantec Meetup Nov 2014
Cloud Platform Symantec Meetup Nov 2014
 
Managing your secrets in a cloud environment
Managing your secrets in a cloud environmentManaging your secrets in a cloud environment
Managing your secrets in a cloud environment
 
Oracle Database Security: Top 10 Things You Could & Should Be Doing Differently
Oracle Database Security: Top 10 Things You Could & Should Be Doing DifferentlyOracle Database Security: Top 10 Things You Could & Should Be Doing Differently
Oracle Database Security: Top 10 Things You Could & Should Be Doing Differently
 
제3회난공불락 오픈소스 인프라세미나 - MySQL
제3회난공불락 오픈소스 인프라세미나 - MySQL제3회난공불락 오픈소스 인프라세미나 - MySQL
제3회난공불락 오픈소스 인프라세미나 - MySQL
 
DBA Tasks in Oracle Autonomous Database
DBA Tasks in Oracle Autonomous DatabaseDBA Tasks in Oracle Autonomous Database
DBA Tasks in Oracle Autonomous Database
 
Mysql 8 vs Mariadb 10.4 Highload++ 2019
Mysql 8 vs Mariadb 10.4 Highload++ 2019Mysql 8 vs Mariadb 10.4 Highload++ 2019
Mysql 8 vs Mariadb 10.4 Highload++ 2019
 
Winning in the Dark: Defending Serverless Infrastructure
Winning in the Dark: Defending Serverless InfrastructureWinning in the Dark: Defending Serverless Infrastructure
Winning in the Dark: Defending Serverless Infrastructure
 
DataStax | Best Practices for Securing DataStax Enterprise (Matt Kennedy) | C...
DataStax | Best Practices for Securing DataStax Enterprise (Matt Kennedy) | C...DataStax | Best Practices for Securing DataStax Enterprise (Matt Kennedy) | C...
DataStax | Best Practices for Securing DataStax Enterprise (Matt Kennedy) | C...
 
PartnerSkillUp_Enable a Streaming CDC Solution
PartnerSkillUp_Enable a Streaming CDC SolutionPartnerSkillUp_Enable a Streaming CDC Solution
PartnerSkillUp_Enable a Streaming CDC Solution
 
Hadoop security implementationon 20171003
Hadoop security implementationon 20171003Hadoop security implementationon 20171003
Hadoop security implementationon 20171003
 
Security implementation on hadoop
Security implementation on hadoopSecurity implementation on hadoop
Security implementation on hadoop
 
Securing Hadoop @eBay
Securing Hadoop @eBaySecuring Hadoop @eBay
Securing Hadoop @eBay
 
How to upgrade like a boss to MySQL 8.0 - PLE19
How to upgrade like a boss to MySQL 8.0 -  PLE19How to upgrade like a boss to MySQL 8.0 -  PLE19
How to upgrade like a boss to MySQL 8.0 - PLE19
 

Kürzlich hochgeladen

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Kürzlich hochgeladen (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Using Vault to decouple MySQL Secrets

  • 3.
  • 5. © 2016 Pythian5 Derek Downey @derek_downey
  • 6. © 2016 Pythian6 ABOUT PYTHIAN
 11,400 Pythian currently manages more than 11,400 systems. 400+Pythian currently employs more than 400 people in 200 cities in 35 countries 1997Pythian was founded in 1997 Global Leader In IT Transformation And Operational Excellence
 Unparalleled Expertise • Top 5% in databases, applications, infrastructure, Big Data, Cloud, Data Science, and DevOps
 Unmatched Certifications • 9 Oracle ACEs, 4 Oracle ACE Directors, 1 Oracle ACE Associate • 6 Microsoft MVPs, 1 Microsoft Certified Master • 5 Google Platform Qualified Developers • 1 Cloudera Champion of Big Data • 1 Mongo DB Certified DBA Associate Level • 1 DataStax Certified Partner, 1 MVP • 11 AWS Certified Solutions Architects, 1 AWS Certified Developer, 1 AWS Certified SysOps Administrator
 Broad Technical Experience • Oracle, Microsoft, MySQL, Oracle EBS, Hadoop, Cassandra, MongoDB, virtualization, configuration management, monitoring, trending, and more.
  • 7. © 2016 Pythian7 SOME OF OUR CLIENTS
  • 11.  SECRET  SENSITIVE DB CREDENTIALS CLOUD ACCESS KEYS SSL CA/CERTIFICATES ENCRYPTION KEYS WIFI PASSWORDS EMAIL ADDRESSES PHONE NUMBERS MOTHER'S MAIDEN NAME DATACENTER LOCATIONS CUSTOMER PII SOURCE CODE EMAIL/CHAT
  • 12.  SECRET  SENSITIVE DB CREDENTIALS CLOUD ACCESS KEYS SSL CA/CERTIFICATES ENCRYPTION KEYS WIFI PASSWORDS EMAIL ADDRESSES PHONE NUMBERS MOTHER'S MAIDEN NAME DATACENTER LOCATIONS CUSTOMER PII SOURCE CODE EMAIL/CHAT 
  • 14. HOW DO I DISTRIBUTE SECRETS? How do applica3ons get secrets? How do humans acquire secrets? How are secrets updated? How is a secret revoked?
  • 16. WHY NOT CONFIG MANAGEMENT? Centrally stored Eventually consistent No access control No audi3ng No revoca3on
  • 17. WHY NOT (ONLINE) DATABASES? RDBMS, Consul, ZooKeeper, etc Not designed for secrets Limited access controls Typically plaintext storage No audi3ng or revoca3on abili3es
  • 18. HOW TO HANDLE SECRET SPRAWL? Secret material is distributed Who has access? When were secrets used? What is the aMack surface? What do we do in the event of a compromise?
  • 19. STATE OF THE WORLD 1.0 Secret sprawl Decentralized keys Limited visibility Poorly defined “break glass” procedures
  • 22. VAULT GOALS Single source for secrets Programma3c applica3on access (Automated) Operator access (Manual) Prac3cal security Modern data center friendly
  • 23. VAULT FEATURES Secure secret storage (in-memory, Consul, file, postgres, and more) Audi3ng Rich ACLs Mul3ple client authen3ca3on methods Leasing, renewal, and revoca3on Dynamic secrets
  • 24. SECURE SECRET STORAGE Data is encrypted in transit and at rest 256bit AES in GCM mode TLS 1.2 for clients No HSM required
  • 25. AUDITING Pluggable Audit Backends Request and Response Logging Priori3zes Safety over Availability Secrets Hashed in Audits Searchable, but not reversible
  • 26. RICH ACLS Role Based Policies Restrict access to “need to know” Default Deny, must be explicitly allowed
  • 27. FLEXIBLE AUTH Pluggable Backends Tokens, GitHub, AppID, User/Pass, TLS Certs Machine-Oriented vs Operator-Oriented
  • 28. LEASING, RENEWAL, AND REVOCATION Every Secret has a Lease* Secrets are revoked at the end of the lease unless renewed Secrets may be revoked early by operators “Break Glass” procedure Dynamic Secrets make leases enforceable Not possible for arbitrary secrets
  • 29. DYNAMIC SECRETS Never provide “root” creden3als to clients Provide limited access creden3als based on role Generated on demand when requested Leases are enforceable via revoca3on Audit trail can iden3fy point of compromise
  • 30. DYNAMIC SECRETS Pluggable Backends AWS, Cassandra, Consul, MySQL, PostgreSQL, MSSQL, … Grow support over 3me
  • 32. © 2016 Pythian MySQL user management 32 ● Clunky to manage many users ● Difficult to manage passwords ● Password expiration only recently ● Password validation only recently
  • 33. © 2016 Pythian MySQL user management 33 ● Hardcoded in applications ● Plaintext secrets ● Difficult to rotate
  • 34. © 2016 Pythian How does Vault help? 34 ● Creates users with high entropy secrets ● Secrets have aggressive expiration ● Secrets can easily be revoked
  • 35. © 2016 Pythian35 $ vault write mysql/roles/readonly sql="CREATE USER '{{name}}'@'%' IDENTIFIED BY '{{password}}';GRANT SELECT ON *.* TO '{{name}}'@'%';" Create user pattern
  • 36. © 2016 Pythian36 $ vault read mysql/creds/readonly Key Value lease_id mysql/creds/readonly/b9b1fbb4-5ef8-1977-1fd2-ed21912e6288 lease_duration 600 lease_renewable true password 04f9d427-5ea4-8ce4-8e92-30c5cdcb5f7e username root-6dd78551-dd Read from Vault
  • 37. © 2016 Pythian37 $ vault read mysql/creds/readonly Key Value lease_id mysql/creds/readonly/b9b1fbb4-5ef8-1977-1fd2-ed21912e6288 lease_duration 600 lease_renewable true password 04f9d427-5ea4-8ce4-8e92-30c5cdcb5f7e username github-6dd78551-dd Read from Vault
  • 38. © 2016 Pythian38 $ mysql -ugithub-6dd78551-dd -p Enter password: Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 12 Server version: 5.7.11 MySQL Community Server (GPL) mysql> SELECT USER(); +——————————————+ | User() | +——————————————+ | github-6dd78551-dd@localhost | +——————————————+ 1 row in set (0.00 sec) mysql> SHOW GRANTS; +———————————————————————+ | Grants for github-6dd78551-dd@% | +———————————————————————+ | GRANT SELECT ON *.* TO 'github-6dd78551-dd'@'%' | +———————————————————————+ 1 row in set (0.00 sec)
  • 39. © 2016 Pythian Doesn’t MySQL do this natively? 39 ● Proxy users (5.5+) ● Secrets have expiration (in 5.6+) ● Strong password policies can be implemented (5.6+)
  • 40. © 2016 Pythian But… 40 ● Must manually add/remove users ● Must manually update passwords ● MySQL-specific authentication plugins
  • 41. © 2016 Pythian Why Vault? 41 ● Centralized secret management with rest of organization ● Users easier to manage ● Vault generates high-entropy secrets by default ● Limit attack surface if secrets compromised ● “Breakglass” policies to revoke secrets
  • 42. © 2016 Pythian42 $ vault revoke mysql/creds/readonly/6f1a7e70-cdd7-6954-eb57-b46da0c88ad5docker Key revoked with ID ‘mysql/creds/readonly//6f1a7e70-cdd7-6954-eb57-b46da0c88ad5'. $ mysql -uroot -p -e "SELECT user, host FROM mysql.user" Enter password: +—————————+——+ | user | host | +—————————+——+ | root | % | +—————————+——+ Remove single secret
  • 43. © 2016 Pythian43 $ mysql -uroot -p -e "SELECT user, host FROM mysql.user" +————————+——+ | user | host | +————————+——+ | root | % | | root-6a1e1fbb-37 | % | | root-7dc68b1f-dd | % | | root-fcb6e200-87 | % | +————————+——+ $ vault revoke --prefix mysql Key revoked with ID 'mysql'. $ mysql -uroot -p -e "SELECT user, host FROM mysql.user“ +———+———+ | user | host | +———+———+ | root | % | +———+———+ Remove all MySQL secrets
  • 44. © 2016 Pythian Vault for Direct Access 44 ● Great for third-party access: consultants, auditors, etc ● Only create a single user to grant appropriate access ● Or create user per vendor or role ● Aggressive secrets expiration limits risk of password exposure ● Authentication plugins
  • 45. © 2016 Pythian Vault Authentication 45 ● Github ● LDAP
  • 46. © 2016 Pythian46 $ vault policies github path "mysql/*" { policy = "write" } $ vault auth -method=github token=$GITHUB_TOKEN Successfully authenticated! token: 920b84f1-4ca9-33aa-4946-f046ef0b3f53 token_duration: 2591999 token_policies: [default, github] $ vault read mysql/creds/readonly Key Value lease_id mysql/creds/readonly/6b4c559e-5008-f813-92af-19eaa41cbac4 lease_duration 600 lease_renewable true password 8bb914dc-9619-3c87-ba4e-18f1ec602e98 username github-dte-7a311
  • 47. © 2016 Pythian Vault for MySQL Applications 47 ● Dynamic config via consul-template ● Secrets not stored in plaintext ● consul-template automatically renews
  • 48. © 2016 Pythian Vault Auditing 48 ● Log access ● Supports writing syslog and file ● Hashes access so secrets are not stored in plaintext
  • 49. © 2016 Pythian Audit log 49 {"time":"2016-04-07T19:20:46Z","type":"request","auth":{"display_name":"root","policies": ["root"],"metadata":null},"request":{"operation":"read","client_token":"hmac- sha256:ab960b87941cb0ad31477bec09b31671457c1967b15a89bf8574bae528c11ffa","pa th":"mysql/creds/readonly","data":null,"remote_address":"127.0.0.1"},"error":""}
  • 50. © 2016 Pythian Considerations 50 ● Current implementation requires multiple mysql mount per unique environment. ● Auditing only access requests to Vault, not whether used on DB or what was done.
  • 52. HIGH AVAILABILITY Consul used for leader elec3on Ac3ve/Standby Automa3c failover
  • 53. UNSEALING THE VAULT Data in Vault encrypted Vault requires encryp3on key Must be provided online
  • 54. WATCHING THE WATCHMEN Master Key is the “key to the kingdom” All data could be decrypted Protect against insider aMack Two-Man Rule
  • 55. SHAMIR SECRET SHARING Protect Encrypt Key with Master Key Split Master Key into N shares T shares to recompute Master Quorum of key holders required to unseal Default N:5, T:3
  • 56. SUMMARY Solves the “Secret Sprawl Problem” Protects against external threats (Cryptosystem) Protects against internal threats (ACLs and Secret Sharing)
  • 58. © 2016 Pythian58 ● Setup vault, unseal (Docker containers), setup file audit ● Create github auth config ● Authenticate ● Create mysql user ● Request secret ● Use secret ● Revoke secret ● Verify Audit log Demo Github Authentication
  • 60. SECURITY FOUNDATION Base of Trust Core Infrastructure Flexible Architecture Founda3on for Security Infrastructure
  • 61. PERSONALLY IDENTIFIABLE INFORMATION PII informa3on is everywhere SSN, CC#, OAuth Tokens, etc. Email? Physical address? Security of storage? Scalability of storage? Audibility of access?
  • 62. PII WITH VAULT “transit” backend in Vault Encrypt/Decrypt data in transit Avoid secret management in client applica3ons Builds on Vault founda3on
  • 63. TRANSIT BACKEND Web server has no encryp3on keys Requires two-factor compromise (Vault + Database) Decouples storage from encryp3on and access control
  • 64. EXTENSIBLE PKI backend for Cer3ficate Authority + Signing Mutual TLS for Applica3ons SSH backend for SSH key management “vault ssh” CLI command, dynamic keys or one-3me-passwords
  • 66. USING VAULT API Driven JSON/HTTPS Rich CLI for humans and scripts Rich client libraries
  • 67. APPLICATION INTEGRATION Vault-aware Na3ve client libraries (go, ruby, rails, python, node, and more) Secrets only in-memory Safest but high-touch
  • 68. CONSUL TEMPLATE INTEGRATION Secrets templa3zed into applica3on configura3on Vault is transparent Lease management is automa3c Non-secret configura3on s3ll via Consul
  • 69. {{ with $secret := vault "mysql/creds/production" }} --- production: adapter: mysql database: mysql.service.consul username: {{$secret.Data.username}} password: {{$secret.Data.password}} pool: {{key "production/mysql/pool"}} {{ end }} secure master cat secrets.yml.ctmpl