SlideShare a Scribd company logo
Copyright © 2018 HashiCorp
Secure and automated
workflows in
Azure with
Vault and Terraform
Copyright © 2018 HashiCorp
▪ Introduction
▪ Security and automation goals
▪ Vault Overview
– Secure Token Introduction
– Retrieving Secrets
– Seal/ Unseal
▪ Azure Use Cases
– Azure Auth Method
– Azure Secret Engine
– Azure Cloud Unseal
▪ ”Demo”
Agenda
2
Copyright © 2017 HashiCorp
Background
Stenio Ferreira
Sr. Solutions Engineer at Hashicorp
Prior experience:
• Software development,
• Startups,
• Consulting,
• Aspiring rock star
Hello!
Github, Twitter:
@stenio123
Copyright © 2018 HashiCorp
Security and Automation Goals
Automation:
• Repeatable and scalable deployments
• Version control history
• Easy to collaborate and share
Security:
• Reduce secret exposure
• Unique credentials per role
• Easy to revoke if compromised
Infrastructure as code!
(Terraform and Packer)
Platform authentication!
Dynamic secrets!
(Vault)
Copyright © 2018 HashiCorp
Vault Authentication and Authorization
Vault is an identity broker!
Copyright © 2018 HashiCorp
Secure Token Introduction
A Vault client needs a token proving its identity, and tied to Vault ACL policies
How to introduce this token without
• Hardcoding Vault credentials
• Hardcoding the token?
Trusted orchestrator!
• Define one orchestrator you trust:
- Azure
- AWS
- K8s
- Jenkins, etc
• This orchestrator will provide the IDENTITY of the client
• Configure Vault to check with orchestrator to validate the IDENTITY of a request
• Configure Vault to map ACL policies to these IDENTIES
• Client retrieves payload from orchestrator to prove IDENTITY (can use Vault Agent or custom logic)
• If valid, Vault returns the token with a TTL
Azure
Vault
Vault
Agent
Vault
token
VM
List of authentication methods: https://www.vaultproject.io/api/auth/index.html
Vault Agent docs: https://www.vaultproject.io/docs/agent/
Copyright © 2018 HashiCorp
Retrieving Secrets from Vault
▪ Vault CLI
– Vault binary can be used to issue commands, leveraging
env vars (VAULT_ADDR, VAULT_TOKEN, etc)
▪ cURL commands
– All Vault endpoints are reachable through API endpoints.
Pass token in request header
▪ Native Integration
– There are a variety of libraries that abstract the API calls
for developers (Java, GO, C#, Ruby, Python, etc)
▪ Consul Template/ Env
– Agent that externalizes Vault logic from the client
– Can manage token lifecycle and create a file or env var
with secrets
Assuming Token present, how can clients retrieve secrets from Vault?
Azure
Vault
VM
App
Consul
Template
File
w
Secrets
List of native integrations: https://www.vaultproject.io/api/libraries.html
Copyright © 2018 HashiCorp
Vault Seal/ Unseal
Vault is a centralized secrets management solution that offers “break glass procedure” – if it is compromised, an admin
can seal it, preventing all access.
This is also useful to ensure Vault is in a non-compromised situation before it is “unsealed”, the state where it can
accept client requests.
Because of this, when first deployed, Vault starts in the “sealed” state. If there are any changes with the background
process or the binary, it also becomes “sealed”.
Until recently, only Shamir Secret Sharing was available for unsealing Vault without an Enterprise license. As of Vault
1.0, Cloud auto-unseal is now available in open source, supporting AWS, Azure and GCP.
Shamir Secret Sharing Cloud Auto-unseal
Vault Vault
Copyright © 2018 HashiCorp
Vault – Azure Use Cases
1- Azure Auth Method
• Can only be used by VMs
deployed in Azure
• Once authenticated, they can
leverage any Vault services their
ACL policy allows:
- Static secrets (K/V)
- Encryption as Service
- AWS dynamic secrets
- and more!
2- Azure Secret Engine
• Can be used by clients deployed
anywhere
• Will create a service principal with
previously defined permissions
• Or will rotate password of a
previously created service principal
3- Azure Cloud Auto-unseal
• Leverages Azure Key Vault for auto-
unseal
Vault
Where 1, 2 and 3 can happen at the same time, but not a requirement.
Copyright © 2018 HashiCorp
▪ You have followed best practices and instead of hardcoding a secret in your app,
you store it in Vault.
▪ You update the logic of the app (or keep same logic and use Consul Template),
so it knows how to retrieve secret from Vault.
▪ But before it can do that, the app needs a client token from Vault.
▪ This is the chicken and egg problem of what comes first.
▪ Assuming you are deploying in Azure, you can leverage the Azure Auth Method
to save you!
The same pattern is also valid for AWS, GCP, K8s, etc.
More info here: https://www.vaultproject.io/docs/auth/index.html
Use Case 1 – Azure Auth Method (1/2)
Copyright © 2018 HashiCorp
Use Case 1 – Azure Auth Method (2/2)
Azure
Vault
AppVault
Agent
Consul
Template
File
w
Secrets
Vault
token
VM
Azure
resource
2. Configure Vault
• Enable Azure auth method
• Enter Azure configs
• Create roles mapping
service principals, groups
or subscriptions to Vault
policies
1. Create Service Principal for Vault
• Create app
• Create service principal with “Owner” role
• Add and grant app permissions (MicrosoftGraph)
3. Configure Authentication
within VM
• Install and configure Vault
Agent
• Alternatively, you can create
a startup script that retrieves
and sends metadata to
Vault
* If you are following an Infrastructure as Code workflow, you can have a CI/CD tool deploy the VM image with the Vault address as a dynamic value on step 3
4. Retrieve Secrets
• If secret retrieval is
managed by your app,
nothing else to do
• If you are leveraging Consul
Template, you can configure
it in this step
Copyright © 2018 HashiCorp
▪ Your user or app needs to access a resource from Azure (Blob storage, vm, etc).
▪ You are following best practices, and don’t want to create static credentials managed through out-of-
band processes (open ticket, create by hand, etc).
▪ Benefits of dynamic secret:
– Ephemeral
– Self service
– Unique
– Easy to revoke
– Leverages Vault to manage Azure permission assignments
Use Case 2 – Azure Secret Engine (1/2)
Copyright © 2018 HashiCorp
Use Case 2 – Azure Secret Engine (2/2)
Azure
Vault
AppVault
Agent
Consul
Template
File
w
Secrets
Vault
token
VM
Azure
resource
3. Configure Vault (1)
• Enable Azure secret engine
• Enter Azure configs
• Create roles mapping to
Azure roles or service
principals, and the scope
1. Create Service Principal for Vault
• Create app
• Create service principal with “Owner” role
• Add and grant app permissions (Azure AD)
5. Retrieve Azure Creds
• App or user located
anywhere authenticates with
Vault
• Leveraging client token,
retrieve Azure creds
• Use creds. They can be
renewed if enabled.
2. Create Custom Azure
Roles (optional)
• Create custom Azure
roles
4. Configure Vault (2)
• Create a Vault policy
allowing reading the secret
• Associate this policy with
auth identity or Control
Group
App
Non-Azure Location
(Workstation, AWS, etc)
Copyright © 2018 HashiCorp
▪ You want to leverage Azure Key Vault to unseal your Vault automatically.
▪ You can still seal/unseal it manually as part of the regular break glass procedure.
▪ If Vault process restarted, and it has access to Azure Key, it will start unsealed.
▪ Caveat:
– If connection to Azure Key is lost, Vault will work normally.
– However if process is killed or Vault is manually sealed, it won’t be able to start until connection to
Azure key is restored.
Use Case 3 – Azure Cloud Unseal (1/2)
Copyright © 2018 HashiCorp
Use Case 3 – Azure Cloud Unseal (2/2)
Azure
Vault
Azure
Key Vault
# Config.hcl
…
Seal {
Azure creds
Azure vault name
Azure key name
}
…
1. Create Service Principal for Vault
• Create app
• Create service principal with “Owner” role
• Add and grant app permissions (Azure Key Vault)
2. Create Azure Key Vault
• Create Key Vault
• Create Key
• Grant permissions to
service principal
3. Create Vault config
• Add Azure info
3. Start Vault
• Safely store recovery key
• Safely store or revoke root
password once finished
Recovery
key
4. Seal/ Unseal
• Manual “Seal” and “unseal”
follow expected behavior –
use Recovery Key
• If Vault process is killed, or
needs restart, it will unseal
automatically
5. Seal Migration
• If desired, the seal can be
migrated to different stanza
Copyright © 2018 HashiCorp
▪ Source:
https://github.com/stenio123/azure-vault-terraform
Demo
Thank you.
hello@hashicorp.comwww.hashicorp.co
m

More Related Content

What's hot

Secure and Convenient Workflows: Integrating HashiCorp Vault with Pivotal Clo...
Secure and Convenient Workflows: Integrating HashiCorp Vault with Pivotal Clo...Secure and Convenient Workflows: Integrating HashiCorp Vault with Pivotal Clo...
Secure and Convenient Workflows: Integrating HashiCorp Vault with Pivotal Clo...
Stenio Ferreira
 
Hashicorp Terraform Open Source vs Enterprise
Hashicorp Terraform Open Source vs EnterpriseHashicorp Terraform Open Source vs Enterprise
Hashicorp Terraform Open Source vs Enterprise
Stenio Ferreira
 
Adopting HashiCorp Vault
Adopting HashiCorp VaultAdopting HashiCorp Vault
Adopting HashiCorp Vault
Nicolas Corrarello
 
Level up your SQL and Azure, by using Rubrik
Level up your SQL and Azure, by using RubrikLevel up your SQL and Azure, by using Rubrik
Level up your SQL and Azure, by using Rubrik
Jaap Brasser
 
Multi-Cloud Roadmap: Architecting Hybrid Environments for Maximum Results
Multi-Cloud Roadmap: Architecting Hybrid Environments for Maximum ResultsMulti-Cloud Roadmap: Architecting Hybrid Environments for Maximum Results
Multi-Cloud Roadmap: Architecting Hybrid Environments for Maximum Results
RightScale
 
Easy and Flexible Application Deployment with HashiCorp Nomad
Easy and Flexible Application Deployment with HashiCorp NomadEasy and Flexible Application Deployment with HashiCorp Nomad
Easy and Flexible Application Deployment with HashiCorp Nomad
Amanda MacLeod
 
Moving to a Microservice World: Leveraging Consul on Azure
Moving to a Microservice World: Leveraging Consul on AzureMoving to a Microservice World: Leveraging Consul on Azure
Moving to a Microservice World: Leveraging Consul on Azure
Mitchell Pronschinske
 
Cloud security
Cloud securityCloud security
Cloud security
WSO2
 
Rapid Infrastructure in Hybrid Environments
Rapid Infrastructure in Hybrid EnvironmentsRapid Infrastructure in Hybrid Environments
Rapid Infrastructure in Hybrid Environments
Mitchell Pronschinske
 
Cloudera Director: Unlock the Full Potential of Hadoop in the Cloud
Cloudera Director: Unlock the Full Potential of Hadoop in the CloudCloudera Director: Unlock the Full Potential of Hadoop in the Cloud
Cloudera Director: Unlock the Full Potential of Hadoop in the Cloud
Cloudera, Inc.
 
Build a Cloud Day Paris
Build a Cloud Day ParisBuild a Cloud Day Paris
Build a Cloud Day Paris
Sebastien Goasguen
 
Multicloud
MulticloudMulticloud
Military Edge Computing with Vault and Consul
Military Edge Computing with Vault and ConsulMilitary Edge Computing with Vault and Consul
Military Edge Computing with Vault and Consul
Mitchell Pronschinske
 
Building Hybrid Cloud Architectures with GigaSpaces XAP
Building Hybrid Cloud Architectures with GigaSpaces XAPBuilding Hybrid Cloud Architectures with GigaSpaces XAP
Building Hybrid Cloud Architectures with GigaSpaces XAP
jimliddle
 
04 - VMUGIT - Lecce 2018 - Giampiero Petrosi, Rubrik
04 - VMUGIT - Lecce 2018 - Giampiero Petrosi, Rubrik04 - VMUGIT - Lecce 2018 - Giampiero Petrosi, Rubrik
04 - VMUGIT - Lecce 2018 - Giampiero Petrosi, Rubrik
VMUG IT
 
Superior Streaming and CDN Solutions: Cloud Storage Revolutionizes Digital Media
Superior Streaming and CDN Solutions: Cloud Storage Revolutionizes Digital MediaSuperior Streaming and CDN Solutions: Cloud Storage Revolutionizes Digital Media
Superior Streaming and CDN Solutions: Cloud Storage Revolutionizes Digital Media
Scality
 
Kubernetes with Docker Enterprise for multi and hybrid cloud strategy
Kubernetes with Docker Enterprise for multi and hybrid cloud strategyKubernetes with Docker Enterprise for multi and hybrid cloud strategy
Kubernetes with Docker Enterprise for multi and hybrid cloud strategy
Ashnikbiz
 
From Terraform OSS to Enterprise
From Terraform OSS to EnterpriseFrom Terraform OSS to Enterprise
From Terraform OSS to Enterprise
Mitchell Pronschinske
 
Google Cloud Storage | Google Cloud Platform Tutorial | Google Cloud Architec...
Google Cloud Storage | Google Cloud Platform Tutorial | Google Cloud Architec...Google Cloud Storage | Google Cloud Platform Tutorial | Google Cloud Architec...
Google Cloud Storage | Google Cloud Platform Tutorial | Google Cloud Architec...
Edureka!
 
Modern Scheduling for Modern Applications with Nomad
Modern Scheduling for Modern Applications with NomadModern Scheduling for Modern Applications with Nomad
Modern Scheduling for Modern Applications with Nomad
Mitchell Pronschinske
 

What's hot (20)

Secure and Convenient Workflows: Integrating HashiCorp Vault with Pivotal Clo...
Secure and Convenient Workflows: Integrating HashiCorp Vault with Pivotal Clo...Secure and Convenient Workflows: Integrating HashiCorp Vault with Pivotal Clo...
Secure and Convenient Workflows: Integrating HashiCorp Vault with Pivotal Clo...
 
Hashicorp Terraform Open Source vs Enterprise
Hashicorp Terraform Open Source vs EnterpriseHashicorp Terraform Open Source vs Enterprise
Hashicorp Terraform Open Source vs Enterprise
 
Adopting HashiCorp Vault
Adopting HashiCorp VaultAdopting HashiCorp Vault
Adopting HashiCorp Vault
 
Level up your SQL and Azure, by using Rubrik
Level up your SQL and Azure, by using RubrikLevel up your SQL and Azure, by using Rubrik
Level up your SQL and Azure, by using Rubrik
 
Multi-Cloud Roadmap: Architecting Hybrid Environments for Maximum Results
Multi-Cloud Roadmap: Architecting Hybrid Environments for Maximum ResultsMulti-Cloud Roadmap: Architecting Hybrid Environments for Maximum Results
Multi-Cloud Roadmap: Architecting Hybrid Environments for Maximum Results
 
Easy and Flexible Application Deployment with HashiCorp Nomad
Easy and Flexible Application Deployment with HashiCorp NomadEasy and Flexible Application Deployment with HashiCorp Nomad
Easy and Flexible Application Deployment with HashiCorp Nomad
 
Moving to a Microservice World: Leveraging Consul on Azure
Moving to a Microservice World: Leveraging Consul on AzureMoving to a Microservice World: Leveraging Consul on Azure
Moving to a Microservice World: Leveraging Consul on Azure
 
Cloud security
Cloud securityCloud security
Cloud security
 
Rapid Infrastructure in Hybrid Environments
Rapid Infrastructure in Hybrid EnvironmentsRapid Infrastructure in Hybrid Environments
Rapid Infrastructure in Hybrid Environments
 
Cloudera Director: Unlock the Full Potential of Hadoop in the Cloud
Cloudera Director: Unlock the Full Potential of Hadoop in the CloudCloudera Director: Unlock the Full Potential of Hadoop in the Cloud
Cloudera Director: Unlock the Full Potential of Hadoop in the Cloud
 
Build a Cloud Day Paris
Build a Cloud Day ParisBuild a Cloud Day Paris
Build a Cloud Day Paris
 
Multicloud
MulticloudMulticloud
Multicloud
 
Military Edge Computing with Vault and Consul
Military Edge Computing with Vault and ConsulMilitary Edge Computing with Vault and Consul
Military Edge Computing with Vault and Consul
 
Building Hybrid Cloud Architectures with GigaSpaces XAP
Building Hybrid Cloud Architectures with GigaSpaces XAPBuilding Hybrid Cloud Architectures with GigaSpaces XAP
Building Hybrid Cloud Architectures with GigaSpaces XAP
 
04 - VMUGIT - Lecce 2018 - Giampiero Petrosi, Rubrik
04 - VMUGIT - Lecce 2018 - Giampiero Petrosi, Rubrik04 - VMUGIT - Lecce 2018 - Giampiero Petrosi, Rubrik
04 - VMUGIT - Lecce 2018 - Giampiero Petrosi, Rubrik
 
Superior Streaming and CDN Solutions: Cloud Storage Revolutionizes Digital Media
Superior Streaming and CDN Solutions: Cloud Storage Revolutionizes Digital MediaSuperior Streaming and CDN Solutions: Cloud Storage Revolutionizes Digital Media
Superior Streaming and CDN Solutions: Cloud Storage Revolutionizes Digital Media
 
Kubernetes with Docker Enterprise for multi and hybrid cloud strategy
Kubernetes with Docker Enterprise for multi and hybrid cloud strategyKubernetes with Docker Enterprise for multi and hybrid cloud strategy
Kubernetes with Docker Enterprise for multi and hybrid cloud strategy
 
From Terraform OSS to Enterprise
From Terraform OSS to EnterpriseFrom Terraform OSS to Enterprise
From Terraform OSS to Enterprise
 
Google Cloud Storage | Google Cloud Platform Tutorial | Google Cloud Architec...
Google Cloud Storage | Google Cloud Platform Tutorial | Google Cloud Architec...Google Cloud Storage | Google Cloud Platform Tutorial | Google Cloud Architec...
Google Cloud Storage | Google Cloud Platform Tutorial | Google Cloud Architec...
 
Modern Scheduling for Modern Applications with Nomad
Modern Scheduling for Modern Applications with NomadModern Scheduling for Modern Applications with Nomad
Modern Scheduling for Modern Applications with Nomad
 

Similar to Hashicorp Chicago HUG - Secure and Automated Workflows in Azure with Vault and Terraform

Azure Low Lands 2019 - Building secure cloud applications with Azure Key Vault
Azure Low Lands 2019 - Building secure cloud applications with Azure Key VaultAzure Low Lands 2019 - Building secure cloud applications with Azure Key Vault
Azure Low Lands 2019 - Building secure cloud applications with Azure Key Vault
Tom Kerkhove
 
Intelligent Cloud Conference 2018 - Building secure cloud applications with A...
Intelligent Cloud Conference 2018 - Building secure cloud applications with A...Intelligent Cloud Conference 2018 - Building secure cloud applications with A...
Intelligent Cloud Conference 2018 - Building secure cloud applications with A...
Tom Kerkhove
 
Techdays Finland 2018 - Building secure cloud applications with Azure Key Vault
Techdays Finland 2018 - Building secure cloud applications with Azure Key VaultTechdays Finland 2018 - Building secure cloud applications with Azure Key Vault
Techdays Finland 2018 - Building secure cloud applications with Azure Key Vault
Tom Kerkhove
 
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
Taswar Bhatti
 
Eliminating Secret Sprawl in the Cloud with HashiCorp Vault - 07.11.2018
Eliminating Secret Sprawl in the Cloud with HashiCorp Vault - 07.11.2018Eliminating Secret Sprawl in the Cloud with HashiCorp Vault - 07.11.2018
Eliminating Secret Sprawl in the Cloud with HashiCorp Vault - 07.11.2018
HashiCorp
 
Secure your web app presentation
Secure your web app presentationSecure your web app presentation
Secure your web app presentation
Frans Lytzen
 
Secure your Azure Web App 2019
Secure your Azure Web App 2019Secure your Azure Web App 2019
Secure your Azure Web App 2019
Frans Lytzen
 
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
Yuechuan (Mike) Chen
 
Securing Sensitive Data with Azure Key Vault (Tom Kerkhove @ ITProceed)
Securing Sensitive Data with Azure Key Vault (Tom Kerkhove @ ITProceed)Securing Sensitive Data with Azure Key Vault (Tom Kerkhove @ ITProceed)
Securing Sensitive Data with Azure Key Vault (Tom Kerkhove @ ITProceed)
Codit
 
ITProceed 2015 - Securing Sensitive Data with Azure Key Vault
ITProceed 2015 - Securing Sensitive Data with Azure Key VaultITProceed 2015 - Securing Sensitive Data with Azure Key Vault
ITProceed 2015 - Securing Sensitive Data with Azure Key Vault
Tom Kerkhove
 
LASCON 2013 - AWS CLoud HSM
LASCON 2013 - AWS CLoud HSM LASCON 2013 - AWS CLoud HSM
LASCON 2013 - AWS CLoud HSM
Oleg Gryb
 
Secure Secret Management on a Budget: Reasoning about Scalable SM with Vault ...
Secure Secret Management on a Budget: Reasoning about Scalable SM with Vault ...Secure Secret Management on a Budget: Reasoning about Scalable SM with Vault ...
Secure Secret Management on a Budget: Reasoning about Scalable SM with Vault ...
Mary Racter
 
Vault 1.1: Secret Caching with Vault Agent and Other New Features
Vault 1.1: Secret Caching with Vault Agent and Other New FeaturesVault 1.1: Secret Caching with Vault Agent and Other New Features
Vault 1.1: Secret Caching with Vault Agent and Other New Features
Mitchell Pronschinske
 
Jenkins Terraform Vault
Jenkins Terraform VaultJenkins Terraform Vault
Jenkins Terraform Vault
Shrivatsa Upadhye
 
Paris FOD meetup - kafka security 101
Paris FOD meetup - kafka security 101Paris FOD meetup - kafka security 101
Paris FOD meetup - kafka security 101
Abdelkrim Hadjidj
 
Mike Allen's AWS + OWASP talk "AWS secret manager for protecting and rotating...
Mike Allen's AWS + OWASP talk "AWS secret manager for protecting and rotating...Mike Allen's AWS + OWASP talk "AWS secret manager for protecting and rotating...
Mike Allen's AWS + OWASP talk "AWS secret manager for protecting and rotating...
AWS Chicago
 
Azure Key Vault - Getting Started
Azure Key Vault - Getting StartedAzure Key Vault - Getting Started
Azure Key Vault - Getting Started
Taswar Bhatti
 
hashicorp-virtualdays-vaultkeeping-a-secret-200409143039.pptx
hashicorp-virtualdays-vaultkeeping-a-secret-200409143039.pptxhashicorp-virtualdays-vaultkeeping-a-secret-200409143039.pptx
hashicorp-virtualdays-vaultkeeping-a-secret-200409143039.pptx
hamzaaqqa7
 
Kafka Security 101 and Real-World Tips
Kafka Security 101 and Real-World Tips Kafka Security 101 and Real-World Tips
Kafka Security 101 and Real-World Tips
confluent
 
Masterless Puppet Using AWS S3 Buckets and IAM Roles
Masterless Puppet Using AWS S3 Buckets and IAM RolesMasterless Puppet Using AWS S3 Buckets and IAM Roles
Masterless Puppet Using AWS S3 Buckets and IAM Roles
Malcolm Duncanson, CISSP
 

Similar to Hashicorp Chicago HUG - Secure and Automated Workflows in Azure with Vault and Terraform (20)

Azure Low Lands 2019 - Building secure cloud applications with Azure Key Vault
Azure Low Lands 2019 - Building secure cloud applications with Azure Key VaultAzure Low Lands 2019 - Building secure cloud applications with Azure Key Vault
Azure Low Lands 2019 - Building secure cloud applications with Azure Key Vault
 
Intelligent Cloud Conference 2018 - Building secure cloud applications with A...
Intelligent Cloud Conference 2018 - Building secure cloud applications with A...Intelligent Cloud Conference 2018 - Building secure cloud applications with A...
Intelligent Cloud Conference 2018 - Building secure cloud applications with A...
 
Techdays Finland 2018 - Building secure cloud applications with Azure Key Vault
Techdays Finland 2018 - Building secure cloud applications with Azure Key VaultTechdays Finland 2018 - Building secure cloud applications with Azure Key Vault
Techdays Finland 2018 - Building secure cloud applications with Azure Key Vault
 
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
 
Eliminating Secret Sprawl in the Cloud with HashiCorp Vault - 07.11.2018
Eliminating Secret Sprawl in the Cloud with HashiCorp Vault - 07.11.2018Eliminating Secret Sprawl in the Cloud with HashiCorp Vault - 07.11.2018
Eliminating Secret Sprawl in the Cloud with HashiCorp Vault - 07.11.2018
 
Secure your web app presentation
Secure your web app presentationSecure your web app presentation
Secure your web app presentation
 
Secure your Azure Web App 2019
Secure your Azure Web App 2019Secure your Azure Web App 2019
Secure your Azure Web App 2019
 
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
 
Securing Sensitive Data with Azure Key Vault (Tom Kerkhove @ ITProceed)
Securing Sensitive Data with Azure Key Vault (Tom Kerkhove @ ITProceed)Securing Sensitive Data with Azure Key Vault (Tom Kerkhove @ ITProceed)
Securing Sensitive Data with Azure Key Vault (Tom Kerkhove @ ITProceed)
 
ITProceed 2015 - Securing Sensitive Data with Azure Key Vault
ITProceed 2015 - Securing Sensitive Data with Azure Key VaultITProceed 2015 - Securing Sensitive Data with Azure Key Vault
ITProceed 2015 - Securing Sensitive Data with Azure Key Vault
 
LASCON 2013 - AWS CLoud HSM
LASCON 2013 - AWS CLoud HSM LASCON 2013 - AWS CLoud HSM
LASCON 2013 - AWS CLoud HSM
 
Secure Secret Management on a Budget: Reasoning about Scalable SM with Vault ...
Secure Secret Management on a Budget: Reasoning about Scalable SM with Vault ...Secure Secret Management on a Budget: Reasoning about Scalable SM with Vault ...
Secure Secret Management on a Budget: Reasoning about Scalable SM with Vault ...
 
Vault 1.1: Secret Caching with Vault Agent and Other New Features
Vault 1.1: Secret Caching with Vault Agent and Other New FeaturesVault 1.1: Secret Caching with Vault Agent and Other New Features
Vault 1.1: Secret Caching with Vault Agent and Other New Features
 
Jenkins Terraform Vault
Jenkins Terraform VaultJenkins Terraform Vault
Jenkins Terraform Vault
 
Paris FOD meetup - kafka security 101
Paris FOD meetup - kafka security 101Paris FOD meetup - kafka security 101
Paris FOD meetup - kafka security 101
 
Mike Allen's AWS + OWASP talk "AWS secret manager for protecting and rotating...
Mike Allen's AWS + OWASP talk "AWS secret manager for protecting and rotating...Mike Allen's AWS + OWASP talk "AWS secret manager for protecting and rotating...
Mike Allen's AWS + OWASP talk "AWS secret manager for protecting and rotating...
 
Azure Key Vault - Getting Started
Azure Key Vault - Getting StartedAzure Key Vault - Getting Started
Azure Key Vault - Getting Started
 
hashicorp-virtualdays-vaultkeeping-a-secret-200409143039.pptx
hashicorp-virtualdays-vaultkeeping-a-secret-200409143039.pptxhashicorp-virtualdays-vaultkeeping-a-secret-200409143039.pptx
hashicorp-virtualdays-vaultkeeping-a-secret-200409143039.pptx
 
Kafka Security 101 and Real-World Tips
Kafka Security 101 and Real-World Tips Kafka Security 101 and Real-World Tips
Kafka Security 101 and Real-World Tips
 
Masterless Puppet Using AWS S3 Buckets and IAM Roles
Masterless Puppet Using AWS S3 Buckets and IAM RolesMasterless Puppet Using AWS S3 Buckets and IAM Roles
Masterless Puppet Using AWS S3 Buckets and IAM Roles
 

More from Stenio Ferreira

Lgpd webinar hashitalks brasil 2020
Lgpd webinar   hashitalks brasil 2020Lgpd webinar   hashitalks brasil 2020
Lgpd webinar hashitalks brasil 2020
Stenio Ferreira
 
HashiTalks 2020 Latin America Nomad
HashiTalks 2020 Latin America NomadHashiTalks 2020 Latin America Nomad
HashiTalks 2020 Latin America Nomad
Stenio Ferreira
 
Hashicorp Webinar - Vault Cloud Security - Spanish
Hashicorp Webinar - Vault Cloud Security - SpanishHashicorp Webinar - Vault Cloud Security - Spanish
Hashicorp Webinar - Vault Cloud Security - Spanish
Stenio Ferreira
 
Hashicorp Webinar - Vault Cloud Security - Portuguese
Hashicorp Webinar - Vault Cloud Security - PortugueseHashicorp Webinar - Vault Cloud Security - Portuguese
Hashicorp Webinar - Vault Cloud Security - Portuguese
Stenio Ferreira
 
Hashicorp corporate pitch deck Spanish
Hashicorp corporate pitch deck SpanishHashicorp corporate pitch deck Spanish
Hashicorp corporate pitch deck Spanish
Stenio Ferreira
 
Slalom: Introduction to Containers and AWS ECS
Slalom: Introduction to Containers and AWS ECSSlalom: Introduction to Containers and AWS ECS
Slalom: Introduction to Containers and AWS ECS
Stenio Ferreira
 
Networking 101 AWS - VPCs, Subnets, NAT Gateways, etc
Networking 101 AWS - VPCs, Subnets, NAT Gateways, etcNetworking 101 AWS - VPCs, Subnets, NAT Gateways, etc
Networking 101 AWS - VPCs, Subnets, NAT Gateways, etc
Stenio Ferreira
 
Secret Management Architectures
Secret Management Architectures Secret Management Architectures
Secret Management Architectures
Stenio Ferreira
 
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
Stenio Ferreira
 
Sales and Marketing in Small Company Environment
Sales and Marketing in Small Company EnvironmentSales and Marketing in Small Company Environment
Sales and Marketing in Small Company Environment
Stenio Ferreira
 

More from Stenio Ferreira (10)

Lgpd webinar hashitalks brasil 2020
Lgpd webinar   hashitalks brasil 2020Lgpd webinar   hashitalks brasil 2020
Lgpd webinar hashitalks brasil 2020
 
HashiTalks 2020 Latin America Nomad
HashiTalks 2020 Latin America NomadHashiTalks 2020 Latin America Nomad
HashiTalks 2020 Latin America Nomad
 
Hashicorp Webinar - Vault Cloud Security - Spanish
Hashicorp Webinar - Vault Cloud Security - SpanishHashicorp Webinar - Vault Cloud Security - Spanish
Hashicorp Webinar - Vault Cloud Security - Spanish
 
Hashicorp Webinar - Vault Cloud Security - Portuguese
Hashicorp Webinar - Vault Cloud Security - PortugueseHashicorp Webinar - Vault Cloud Security - Portuguese
Hashicorp Webinar - Vault Cloud Security - Portuguese
 
Hashicorp corporate pitch deck Spanish
Hashicorp corporate pitch deck SpanishHashicorp corporate pitch deck Spanish
Hashicorp corporate pitch deck Spanish
 
Slalom: Introduction to Containers and AWS ECS
Slalom: Introduction to Containers and AWS ECSSlalom: Introduction to Containers and AWS ECS
Slalom: Introduction to Containers and AWS ECS
 
Networking 101 AWS - VPCs, Subnets, NAT Gateways, etc
Networking 101 AWS - VPCs, Subnets, NAT Gateways, etcNetworking 101 AWS - VPCs, Subnets, NAT Gateways, etc
Networking 101 AWS - VPCs, Subnets, NAT Gateways, etc
 
Secret Management Architectures
Secret Management Architectures Secret Management Architectures
Secret Management Architectures
 
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
 
Sales and Marketing in Small Company Environment
Sales and Marketing in Small Company EnvironmentSales and Marketing in Small Company Environment
Sales and Marketing in Small Company Environment
 

Recently uploaded

Bengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal BrandingBengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal Branding
Tarandeep Singh
 
Securing BGP: Operational Strategies and Best Practices for Network Defenders...
Securing BGP: Operational Strategies and Best Practices for Network Defenders...Securing BGP: Operational Strategies and Best Practices for Network Defenders...
Securing BGP: Operational Strategies and Best Practices for Network Defenders...
APNIC
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
Paul Walk
 
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
rtunex8r
 
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
k4ncd0z
 
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
thezot
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
xjq03c34
 
HijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process HollowingHijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process Hollowing
Donato Onofri
 
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
3a0sd7z3
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
davidjhones387
 
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
3a0sd7z3
 
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
APNIC
 

Recently uploaded (12)

Bengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal BrandingBengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal Branding
 
Securing BGP: Operational Strategies and Best Practices for Network Defenders...
Securing BGP: Operational Strategies and Best Practices for Network Defenders...Securing BGP: Operational Strategies and Best Practices for Network Defenders...
Securing BGP: Operational Strategies and Best Practices for Network Defenders...
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
 
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
 
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
 
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
 
HijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process HollowingHijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process Hollowing
 
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
 
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
 
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
 

Hashicorp Chicago HUG - Secure and Automated Workflows in Azure with Vault and Terraform

  • 1. Copyright © 2018 HashiCorp Secure and automated workflows in Azure with Vault and Terraform
  • 2. Copyright © 2018 HashiCorp ▪ Introduction ▪ Security and automation goals ▪ Vault Overview – Secure Token Introduction – Retrieving Secrets – Seal/ Unseal ▪ Azure Use Cases – Azure Auth Method – Azure Secret Engine – Azure Cloud Unseal ▪ ”Demo” Agenda 2
  • 3. Copyright © 2017 HashiCorp Background Stenio Ferreira Sr. Solutions Engineer at Hashicorp Prior experience: • Software development, • Startups, • Consulting, • Aspiring rock star Hello! Github, Twitter: @stenio123
  • 4. Copyright © 2018 HashiCorp Security and Automation Goals Automation: • Repeatable and scalable deployments • Version control history • Easy to collaborate and share Security: • Reduce secret exposure • Unique credentials per role • Easy to revoke if compromised Infrastructure as code! (Terraform and Packer) Platform authentication! Dynamic secrets! (Vault)
  • 5. Copyright © 2018 HashiCorp Vault Authentication and Authorization Vault is an identity broker!
  • 6. Copyright © 2018 HashiCorp Secure Token Introduction A Vault client needs a token proving its identity, and tied to Vault ACL policies How to introduce this token without • Hardcoding Vault credentials • Hardcoding the token? Trusted orchestrator! • Define one orchestrator you trust: - Azure - AWS - K8s - Jenkins, etc • This orchestrator will provide the IDENTITY of the client • Configure Vault to check with orchestrator to validate the IDENTITY of a request • Configure Vault to map ACL policies to these IDENTIES • Client retrieves payload from orchestrator to prove IDENTITY (can use Vault Agent or custom logic) • If valid, Vault returns the token with a TTL Azure Vault Vault Agent Vault token VM List of authentication methods: https://www.vaultproject.io/api/auth/index.html Vault Agent docs: https://www.vaultproject.io/docs/agent/
  • 7. Copyright © 2018 HashiCorp Retrieving Secrets from Vault ▪ Vault CLI – Vault binary can be used to issue commands, leveraging env vars (VAULT_ADDR, VAULT_TOKEN, etc) ▪ cURL commands – All Vault endpoints are reachable through API endpoints. Pass token in request header ▪ Native Integration – There are a variety of libraries that abstract the API calls for developers (Java, GO, C#, Ruby, Python, etc) ▪ Consul Template/ Env – Agent that externalizes Vault logic from the client – Can manage token lifecycle and create a file or env var with secrets Assuming Token present, how can clients retrieve secrets from Vault? Azure Vault VM App Consul Template File w Secrets List of native integrations: https://www.vaultproject.io/api/libraries.html
  • 8. Copyright © 2018 HashiCorp Vault Seal/ Unseal Vault is a centralized secrets management solution that offers “break glass procedure” – if it is compromised, an admin can seal it, preventing all access. This is also useful to ensure Vault is in a non-compromised situation before it is “unsealed”, the state where it can accept client requests. Because of this, when first deployed, Vault starts in the “sealed” state. If there are any changes with the background process or the binary, it also becomes “sealed”. Until recently, only Shamir Secret Sharing was available for unsealing Vault without an Enterprise license. As of Vault 1.0, Cloud auto-unseal is now available in open source, supporting AWS, Azure and GCP. Shamir Secret Sharing Cloud Auto-unseal Vault Vault
  • 9. Copyright © 2018 HashiCorp Vault – Azure Use Cases 1- Azure Auth Method • Can only be used by VMs deployed in Azure • Once authenticated, they can leverage any Vault services their ACL policy allows: - Static secrets (K/V) - Encryption as Service - AWS dynamic secrets - and more! 2- Azure Secret Engine • Can be used by clients deployed anywhere • Will create a service principal with previously defined permissions • Or will rotate password of a previously created service principal 3- Azure Cloud Auto-unseal • Leverages Azure Key Vault for auto- unseal Vault Where 1, 2 and 3 can happen at the same time, but not a requirement.
  • 10. Copyright © 2018 HashiCorp ▪ You have followed best practices and instead of hardcoding a secret in your app, you store it in Vault. ▪ You update the logic of the app (or keep same logic and use Consul Template), so it knows how to retrieve secret from Vault. ▪ But before it can do that, the app needs a client token from Vault. ▪ This is the chicken and egg problem of what comes first. ▪ Assuming you are deploying in Azure, you can leverage the Azure Auth Method to save you! The same pattern is also valid for AWS, GCP, K8s, etc. More info here: https://www.vaultproject.io/docs/auth/index.html Use Case 1 – Azure Auth Method (1/2)
  • 11. Copyright © 2018 HashiCorp Use Case 1 – Azure Auth Method (2/2) Azure Vault AppVault Agent Consul Template File w Secrets Vault token VM Azure resource 2. Configure Vault • Enable Azure auth method • Enter Azure configs • Create roles mapping service principals, groups or subscriptions to Vault policies 1. Create Service Principal for Vault • Create app • Create service principal with “Owner” role • Add and grant app permissions (MicrosoftGraph) 3. Configure Authentication within VM • Install and configure Vault Agent • Alternatively, you can create a startup script that retrieves and sends metadata to Vault * If you are following an Infrastructure as Code workflow, you can have a CI/CD tool deploy the VM image with the Vault address as a dynamic value on step 3 4. Retrieve Secrets • If secret retrieval is managed by your app, nothing else to do • If you are leveraging Consul Template, you can configure it in this step
  • 12. Copyright © 2018 HashiCorp ▪ Your user or app needs to access a resource from Azure (Blob storage, vm, etc). ▪ You are following best practices, and don’t want to create static credentials managed through out-of- band processes (open ticket, create by hand, etc). ▪ Benefits of dynamic secret: – Ephemeral – Self service – Unique – Easy to revoke – Leverages Vault to manage Azure permission assignments Use Case 2 – Azure Secret Engine (1/2)
  • 13. Copyright © 2018 HashiCorp Use Case 2 – Azure Secret Engine (2/2) Azure Vault AppVault Agent Consul Template File w Secrets Vault token VM Azure resource 3. Configure Vault (1) • Enable Azure secret engine • Enter Azure configs • Create roles mapping to Azure roles or service principals, and the scope 1. Create Service Principal for Vault • Create app • Create service principal with “Owner” role • Add and grant app permissions (Azure AD) 5. Retrieve Azure Creds • App or user located anywhere authenticates with Vault • Leveraging client token, retrieve Azure creds • Use creds. They can be renewed if enabled. 2. Create Custom Azure Roles (optional) • Create custom Azure roles 4. Configure Vault (2) • Create a Vault policy allowing reading the secret • Associate this policy with auth identity or Control Group App Non-Azure Location (Workstation, AWS, etc)
  • 14. Copyright © 2018 HashiCorp ▪ You want to leverage Azure Key Vault to unseal your Vault automatically. ▪ You can still seal/unseal it manually as part of the regular break glass procedure. ▪ If Vault process restarted, and it has access to Azure Key, it will start unsealed. ▪ Caveat: – If connection to Azure Key is lost, Vault will work normally. – However if process is killed or Vault is manually sealed, it won’t be able to start until connection to Azure key is restored. Use Case 3 – Azure Cloud Unseal (1/2)
  • 15. Copyright © 2018 HashiCorp Use Case 3 – Azure Cloud Unseal (2/2) Azure Vault Azure Key Vault # Config.hcl … Seal { Azure creds Azure vault name Azure key name } … 1. Create Service Principal for Vault • Create app • Create service principal with “Owner” role • Add and grant app permissions (Azure Key Vault) 2. Create Azure Key Vault • Create Key Vault • Create Key • Grant permissions to service principal 3. Create Vault config • Add Azure info 3. Start Vault • Safely store recovery key • Safely store or revoke root password once finished Recovery key 4. Seal/ Unseal • Manual “Seal” and “unseal” follow expected behavior – use Recovery Key • If Vault process is killed, or needs restart, it will unseal automatically 5. Seal Migration • If desired, the seal can be migrated to different stanza
  • 16. Copyright © 2018 HashiCorp ▪ Source: https://github.com/stenio123/azure-vault-terraform Demo