SlideShare a Scribd company logo
1 of 20
S P R I N G C L O U D
C O N F I G &
V A U LT
C H R I S TO P H L U D W I G
H A U F E G R O U P, F R E I B U R G
J AVA U S E R G R O U P F R E I B U R G , 2 4 . 1 0 . 2 0 1 7
AGENDA
• What’s the noise about app configuration?
• Spring Cloud Config
• HashiCorp Vault
– Generic Secrets
– PKI: Vault as Certification Authority
– Client Authentication
• Usage Scenarios
• Extensions in Haufe Projects
– Vault-based Config Server Discovery (or: Where do I get the config server credentials
from???)
– Keystores for client & server configurations in Vault
E X T E R N A L I Z E D
S P R I N G A P P L I C A T I O N
C O N F I G U R A T I O N
SPRING APPLICATION CONFIGURATION
– Environment Variables
– Command Line Arguments
– Property Files
1 APPLICATION – MANY DEPLOYMENTS
Git
Developer
PC
CI
Environmen
t
Performance
, Load, and
Stress Test
Enviroment
Production
Enviroment
Branch A
Integration
Environmen
t
Branch B
Integration
Environmen
t
Demo
Environmen
t
TWELVE FACTOR APPS
I. Codebase
One codebase tracked in revision control,
many deploys
II. Dependencies
Explicitly declare and isolate dependencies
III. Config
Store config in the environment
IV. Backing services
Treat backing services as attached resources
V. Build, release, run
Strictly separate build and run stages
VI. Processes
Execute the app as one or more
stateless processes
VII. Port binding
Export services via port binding
VIII. Concurrency
Scale out via the process model
IX. Disposability
Maximize robustness with fast startup and
graceful shutdown
X. Dev/prod parity
Keep development, staging, and production
as similar as possible
XI. Logs
Treat logs as event streams
XII. Admin processes
Run admin/management tasks as
one-off processes
Source: https://12factor.net/
S P R I N G
C L O U D C O N F I G
CONFIG SERVER CONCEPT
• Manageable # Environment Variables:
– Profile Names (Env ID, Feature Selectors)
– Config Server URL
– Config Server Credentials
• Configuration under revision control
• App fetches config details while
bootstrapping
• Config server scalable since state in repo
Git
App
Imag
e
Config
Server
App
Instanc
e 1
App
Instanc
e 2
App
Instanc
e …
Build
Deploy
Pull
Fetch
SPRING CLOUD CONFIG
Server:
• “Normal” Spring Boot Service
• URL path parameters:
– App name
– List of profile names
– Git label (revision / branch)
• Git-based:
– Uses (file:///…) or clones (git://…, ssh://…)
lokal Git repo
– Git access via JGit library
– On every client access, branch is checked
out and pulled from remote
• Alternative "native" profile:
– Config in simple file folder
– Ideal for local development
Client:
• Configuration in
– bootstrap.yml
– bootstrap-profile.yml usw.
– By discovery (e.g., Consul, Eureka)
• Adds PropertySources to the Environment
==> combined with other property
sources
• Periodic health check re-fetches config
H A S H I C O R P
V A U LT
SECRETS
• Don’t put plain passwords (for, say DB access) into config files!
• Don’t put passwords into your Git repo!
• Many developers perceive TLS key handling as complex
• Secrets in environment variables / command lines easy to read from a shell account
• When did you last change your DB passwords??
• All network transport of secrets must be protected by, say, TLS
• …
HASHICORP VAULT
• Tool for secure access to secrets:
– Encryption of data at rest
– Elaborate access control concept
– Audit log of every access
• Support for dynamic secrets:
– E.g., on-the-fly setup of DB users with their respective roles and credentials
– Issuing of freshly created X.509 certificates
• One-time tokens, cubbyhole backend
• Many storage backends (filesystem, cloud storage, databases, Etcd, …)
• Revocation of individual leases as well as complete immediate system lock-down.
• Most parts open source (Mozilla Public License 2.0)
• One shared app image serves both as daemon and as command line interface
• Server exposes REST API
VAULT AUTHENTICATION
How to authenticate a vault client?
• AppRole:
– Static Role Id / ephemeral Secret Id
– Secret typically created by deployment
pipeline
– Optional: Secret expires after use
– Alternative: No secret, but CIDR
• AWS:
– EC2 or IAM credentials
– Trusts AWS signatures
• LDAP:
– User credentials stored in LDAP / AD
– Optional MFA
• GitHub:
– GitHub personal access token
• Radius
• Client certificates
• Username / Password
Underlying Token Authentication:
• Explicit or under the hood by other mechanisms
• Tokens bound to policies (access control)
• Tokens expire if not renewed
• Tokens can be revoked by admin
• Most REST requests require token in HTTP header
DEPLOYMENT CONSIDERATIONS
One-time tokens are great, but…
• App operation in container clusters becomes more and more popular
• Containers often replicated (scale out, disruption free deployments, …)
• Cluster may migrate / restart containers at any time
• So far no cluster hooks for automated re-creation of tokens (abuse potential!)
==> Multi-use secrets for container vault authentication
In the Deployment Pipeline:
vault write -f –format=json auth/approle/role/myapprole/secret-id |
jq -r '.secret_id' |
docker secret create myapprole_secretid -
docker service create --name=“myapp" 
--secret="myapprole_secretid" myapp:alpine
S P R I N G
C L O U D V A U LT
SPRING CLOUD VAULT
Secret Bootstrapping:
• Adds PropertySource to Spring Environment (similar to Cloud Config client)
• Runs in bootstrapping phase
• App name + profiles translate in Vault paths:
{backendName}/{appName}/{appName-profile}
RestTemplates for Vault Access:
• Ease Vault use from custom code
• Examples:
– Storage of secrets at runtime
– Interactions with PKI backend
– Transit backend: Encryption as a service
CONFIG SERVER + VAULT
Git
App
Imag
e
Config
Server
App
Instanc
e 1
App
Instanc
e 2
App
Instanc
e …
Build
Deploy
Pull
Fetch
Vault
S P R I N G
C L O U D V A U LT
E X T E N S I O N S
@ H A U F E
VAULT-BASED
CONFIG SERVER DISCOVERY
Issue:
• Even with secrets in Vault, configuration details give clues to potential attackers
==> Config Server access should require authorization
• Config Server passwords are secrets, belong into Vault
• Out of the box, config client won’t see properties fetched by vault client
(config client configuration too early in bootstrap process)
Solution:
• Leverage Cloud Config Discovery mechanism
• VaultPropertySourceLocator injected as @Resource into VaultBasedDiscoveryClient
PKI KEY- & TRUSTSTORE INTEGRATION
Issue:
• Keystore management (JCEKS, PKCS#12) cumbersome, frequent source of operation
errors
• Keystores in the file system should be password-protected
Solution:
• For (app) internal connections (= no “official” cert required):
– Leverage Vault’s PKI backend, issue certificates on-the-fly.
– Build on sample by Mark Paluch, extended with retrieval of trusted certificates
• For customer / partner facing clients & services:
– Represent key- and trust stores as JSON objects in Vault’s generic secret backend
– Auto-configuration for Web container & HTTP clients
• Fallback to keystores in the file system (for, e.g., local development, tests)
• Fallback to the trusted certificates of the runtime’s default X509TrustManager

More Related Content

What's hot

AWS Lambda와 API Gateway를 통한 Serverless Architecture 특집 (윤석찬)
AWS Lambda와 API Gateway를 통한 Serverless Architecture 특집 (윤석찬)AWS Lambda와 API Gateway를 통한 Serverless Architecture 특집 (윤석찬)
AWS Lambda와 API Gateway를 통한 Serverless Architecture 특집 (윤석찬)Amazon Web Services Korea
 
Kubernetes #1 intro
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 introTerry Cho
 
Docker & Kubernetes 기초 - 최용호
Docker & Kubernetes 기초 - 최용호Docker & Kubernetes 기초 - 최용호
Docker & Kubernetes 기초 - 최용호용호 최
 
What is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | EdurekaWhat is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | EdurekaEdureka!
 
Ngrok을 이용한 Nginx Https 적용하기.pptx
Ngrok을 이용한 Nginx Https 적용하기.pptxNgrok을 이용한 Nginx Https 적용하기.pptx
Ngrok을 이용한 Nginx Https 적용하기.pptxwonyong hwang
 
[오픈소스컨설팅] Ansible을 활용한 운영 자동화 교육
[오픈소스컨설팅] Ansible을 활용한 운영 자동화 교육[오픈소스컨설팅] Ansible을 활용한 운영 자동화 교육
[오픈소스컨설팅] Ansible을 활용한 운영 자동화 교육Ji-Woong Choi
 
Microservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring CloudMicroservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring CloudEberhard Wolff
 
가상 데이터 센터 만들기 VPC 기본 및 연결 옵션- AWS Summit Seoul 2017
가상 데이터 센터 만들기 VPC 기본 및 연결 옵션- AWS Summit Seoul 2017가상 데이터 센터 만들기 VPC 기본 및 연결 옵션- AWS Summit Seoul 2017
가상 데이터 센터 만들기 VPC 기본 및 연결 옵션- AWS Summit Seoul 2017Amazon Web Services Korea
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins PipelinesSteffen Gebert
 
AWS 네트워크 보안을 위한 계층별 보안 구성 모범 사례 – 조이정, AWS 솔루션즈 아키텍트:: AWS 온라인 이벤트 – 클라우드 보안 특집
AWS 네트워크 보안을 위한 계층별 보안 구성 모범 사례 – 조이정, AWS 솔루션즈 아키텍트:: AWS 온라인 이벤트 – 클라우드 보안 특집AWS 네트워크 보안을 위한 계층별 보안 구성 모범 사례 – 조이정, AWS 솔루션즈 아키텍트:: AWS 온라인 이벤트 – 클라우드 보안 특집
AWS 네트워크 보안을 위한 계층별 보안 구성 모범 사례 – 조이정, AWS 솔루션즈 아키텍트:: AWS 온라인 이벤트 – 클라우드 보안 특집Amazon Web Services Korea
 
Docker introduction
Docker introductionDocker introduction
Docker introductiondotCloud
 
Docker Swarm for Beginner
Docker Swarm for BeginnerDocker Swarm for Beginner
Docker Swarm for BeginnerShahzad Masud
 
AWS Kubernetes 서비스 자세히 살펴보기 (정영준 & 이창수, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
AWS Kubernetes 서비스 자세히 살펴보기 (정영준 & 이창수, AWS 솔루션즈 아키텍트) :: AWS DevDay2018AWS Kubernetes 서비스 자세히 살펴보기 (정영준 & 이창수, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
AWS Kubernetes 서비스 자세히 살펴보기 (정영준 & 이창수, AWS 솔루션즈 아키텍트) :: AWS DevDay2018Amazon Web Services Korea
 
Spring Cloud Function: Where We Were, Where We Are, and Where We’re Going
Spring Cloud Function: Where We Were, Where We Are, and Where We’re GoingSpring Cloud Function: Where We Were, Where We Are, and Where We’re Going
Spring Cloud Function: Where We Were, Where We Are, and Where We’re GoingVMware Tanzu
 
(DVO202) DevOps at Amazon: A Look At Our Tools & Processes
(DVO202) DevOps at Amazon: A Look At Our Tools & Processes(DVO202) DevOps at Amazon: A Look At Our Tools & Processes
(DVO202) DevOps at Amazon: A Look At Our Tools & ProcessesAmazon Web Services
 
Terraform in deployment pipeline
Terraform in deployment pipelineTerraform in deployment pipeline
Terraform in deployment pipelineAnton Babenko
 

What's hot (20)

Jenkins CI
Jenkins CIJenkins CI
Jenkins CI
 
Jenkins-CI
Jenkins-CIJenkins-CI
Jenkins-CI
 
AWS Lambda와 API Gateway를 통한 Serverless Architecture 특집 (윤석찬)
AWS Lambda와 API Gateway를 통한 Serverless Architecture 특집 (윤석찬)AWS Lambda와 API Gateway를 통한 Serverless Architecture 특집 (윤석찬)
AWS Lambda와 API Gateway를 통한 Serverless Architecture 특집 (윤석찬)
 
Kubernetes #1 intro
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 intro
 
Docker & Kubernetes 기초 - 최용호
Docker & Kubernetes 기초 - 최용호Docker & Kubernetes 기초 - 최용호
Docker & Kubernetes 기초 - 최용호
 
What is Docker
What is DockerWhat is Docker
What is Docker
 
What is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | EdurekaWhat is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | Edureka
 
Ngrok을 이용한 Nginx Https 적용하기.pptx
Ngrok을 이용한 Nginx Https 적용하기.pptxNgrok을 이용한 Nginx Https 적용하기.pptx
Ngrok을 이용한 Nginx Https 적용하기.pptx
 
[오픈소스컨설팅] Ansible을 활용한 운영 자동화 교육
[오픈소스컨설팅] Ansible을 활용한 운영 자동화 교육[오픈소스컨설팅] Ansible을 활용한 운영 자동화 교육
[오픈소스컨설팅] Ansible을 활용한 운영 자동화 교육
 
Microservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring CloudMicroservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring Cloud
 
가상 데이터 센터 만들기 VPC 기본 및 연결 옵션- AWS Summit Seoul 2017
가상 데이터 센터 만들기 VPC 기본 및 연결 옵션- AWS Summit Seoul 2017가상 데이터 센터 만들기 VPC 기본 및 연결 옵션- AWS Summit Seoul 2017
가상 데이터 센터 만들기 VPC 기본 및 연결 옵션- AWS Summit Seoul 2017
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
 
AWS 네트워크 보안을 위한 계층별 보안 구성 모범 사례 – 조이정, AWS 솔루션즈 아키텍트:: AWS 온라인 이벤트 – 클라우드 보안 특집
AWS 네트워크 보안을 위한 계층별 보안 구성 모범 사례 – 조이정, AWS 솔루션즈 아키텍트:: AWS 온라인 이벤트 – 클라우드 보안 특집AWS 네트워크 보안을 위한 계층별 보안 구성 모범 사례 – 조이정, AWS 솔루션즈 아키텍트:: AWS 온라인 이벤트 – 클라우드 보안 특집
AWS 네트워크 보안을 위한 계층별 보안 구성 모범 사례 – 조이정, AWS 솔루션즈 아키텍트:: AWS 온라인 이벤트 – 클라우드 보안 특집
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Docker Swarm for Beginner
Docker Swarm for BeginnerDocker Swarm for Beginner
Docker Swarm for Beginner
 
AWS Kubernetes 서비스 자세히 살펴보기 (정영준 & 이창수, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
AWS Kubernetes 서비스 자세히 살펴보기 (정영준 & 이창수, AWS 솔루션즈 아키텍트) :: AWS DevDay2018AWS Kubernetes 서비스 자세히 살펴보기 (정영준 & 이창수, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
AWS Kubernetes 서비스 자세히 살펴보기 (정영준 & 이창수, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
 
Spring Cloud Function: Where We Were, Where We Are, and Where We’re Going
Spring Cloud Function: Where We Were, Where We Are, and Where We’re GoingSpring Cloud Function: Where We Were, Where We Are, and Where We’re Going
Spring Cloud Function: Where We Were, Where We Are, and Where We’re Going
 
(DVO202) DevOps at Amazon: A Look At Our Tools & Processes
(DVO202) DevOps at Amazon: A Look At Our Tools & Processes(DVO202) DevOps at Amazon: A Look At Our Tools & Processes
(DVO202) DevOps at Amazon: A Look At Our Tools & Processes
 
Springboot Microservices
Springboot MicroservicesSpringboot Microservices
Springboot Microservices
 
Terraform in deployment pipeline
Terraform in deployment pipelineTerraform in deployment pipeline
Terraform in deployment pipeline
 

Similar to Externalized Spring Boot App Configuration

DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
DEF CON 24 - workshop - Craig Young - brainwashing embedded systemsDEF CON 24 - workshop - Craig Young - brainwashing embedded systems
DEF CON 24 - workshop - Craig Young - brainwashing embedded systemsFelipe Prado
 
AWS CodeDeploy: Manage Deployment Complexity
AWS CodeDeploy: Manage Deployment ComplexityAWS CodeDeploy: Manage Deployment Complexity
AWS CodeDeploy: Manage Deployment ComplexityAmazon Web Services
 
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...wesley chun
 
Adding identity management and access control to your app
Adding identity management and access control to your appAdding identity management and access control to your app
Adding identity management and access control to your appÁlvaro Alonso González
 
Adding Identity Management and Access Control to your App
Adding Identity Management and Access Control to your AppAdding Identity Management and Access Control to your App
Adding Identity Management and Access Control to your AppFIWARE
 
Extending kubernetes
Extending kubernetesExtending kubernetes
Extending kubernetesGigi Sayfan
 
SpringOne Tour: An Introduction to Azure Spring Apps Enterprise
SpringOne Tour: An Introduction to Azure Spring Apps EnterpriseSpringOne Tour: An Introduction to Azure Spring Apps Enterprise
SpringOne Tour: An Introduction to Azure Spring Apps EnterpriseVMware Tanzu
 
"Wie passen Serverless & Autonomous zusammen?"
"Wie passen Serverless & Autonomous zusammen?""Wie passen Serverless & Autonomous zusammen?"
"Wie passen Serverless & Autonomous zusammen?"Volker Linz
 
Transforming Software Development
Transforming Software DevelopmentTransforming Software Development
Transforming Software DevelopmentAmazon Web Services
 
Introduction to Kong API Gateway
Introduction to Kong API GatewayIntroduction to Kong API Gateway
Introduction to Kong API GatewayYohann Ciurlik
 
Globus Command Line Interface (APS Workshop)
Globus Command Line Interface (APS Workshop)Globus Command Line Interface (APS Workshop)
Globus Command Line Interface (APS Workshop)Globus
 
F5 Meetup presentation automation 2017
F5 Meetup presentation automation 2017F5 Meetup presentation automation 2017
F5 Meetup presentation automation 2017Guy Brown
 
Thick Application Penetration Testing - A Crash Course
Thick Application Penetration Testing - A Crash CourseThick Application Penetration Testing - A Crash Course
Thick Application Penetration Testing - A Crash CourseNetSPI
 
muCon 2017 - 12 Factor Serverless Applications
muCon 2017 - 12 Factor Serverless ApplicationsmuCon 2017 - 12 Factor Serverless Applications
muCon 2017 - 12 Factor Serverless ApplicationsChris Munns
 
Day 3 - DevOps Culture - Continuous Integration & Continuous Deployment on th...
Day 3 - DevOps Culture - Continuous Integration & Continuous Deployment on th...Day 3 - DevOps Culture - Continuous Integration & Continuous Deployment on th...
Day 3 - DevOps Culture - Continuous Integration & Continuous Deployment on th...Amazon Web Services
 
Cloud Native Identity with SPIFFE
Cloud Native Identity with SPIFFECloud Native Identity with SPIFFE
Cloud Native Identity with SPIFFEPrabath Siriwardena
 
Thick Application Penetration Testing: Crash Course
Thick Application Penetration Testing: Crash CourseThick Application Penetration Testing: Crash Course
Thick Application Penetration Testing: Crash CourseScott Sutherland
 
Introduction to the Globus Platform (APS Workshop)
Introduction to the Globus Platform (APS Workshop)Introduction to the Globus Platform (APS Workshop)
Introduction to the Globus Platform (APS Workshop)Globus
 
Kube con china_2019_7 missing factors for your production-quality 12-factor apps
Kube con china_2019_7 missing factors for your production-quality 12-factor appsKube con china_2019_7 missing factors for your production-quality 12-factor apps
Kube con china_2019_7 missing factors for your production-quality 12-factor appsShikha Srivastava
 
Introduction to the Globus Platform (GlobusWorld Tour - UMich)
Introduction to the Globus Platform (GlobusWorld Tour - UMich)Introduction to the Globus Platform (GlobusWorld Tour - UMich)
Introduction to the Globus Platform (GlobusWorld Tour - UMich)Globus
 

Similar to Externalized Spring Boot App Configuration (20)

DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
DEF CON 24 - workshop - Craig Young - brainwashing embedded systemsDEF CON 24 - workshop - Craig Young - brainwashing embedded systems
DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
 
AWS CodeDeploy: Manage Deployment Complexity
AWS CodeDeploy: Manage Deployment ComplexityAWS CodeDeploy: Manage Deployment Complexity
AWS CodeDeploy: Manage Deployment Complexity
 
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
 
Adding identity management and access control to your app
Adding identity management and access control to your appAdding identity management and access control to your app
Adding identity management and access control to your app
 
Adding Identity Management and Access Control to your App
Adding Identity Management and Access Control to your AppAdding Identity Management and Access Control to your App
Adding Identity Management and Access Control to your App
 
Extending kubernetes
Extending kubernetesExtending kubernetes
Extending kubernetes
 
SpringOne Tour: An Introduction to Azure Spring Apps Enterprise
SpringOne Tour: An Introduction to Azure Spring Apps EnterpriseSpringOne Tour: An Introduction to Azure Spring Apps Enterprise
SpringOne Tour: An Introduction to Azure Spring Apps Enterprise
 
"Wie passen Serverless & Autonomous zusammen?"
"Wie passen Serverless & Autonomous zusammen?""Wie passen Serverless & Autonomous zusammen?"
"Wie passen Serverless & Autonomous zusammen?"
 
Transforming Software Development
Transforming Software DevelopmentTransforming Software Development
Transforming Software Development
 
Introduction to Kong API Gateway
Introduction to Kong API GatewayIntroduction to Kong API Gateway
Introduction to Kong API Gateway
 
Globus Command Line Interface (APS Workshop)
Globus Command Line Interface (APS Workshop)Globus Command Line Interface (APS Workshop)
Globus Command Line Interface (APS Workshop)
 
F5 Meetup presentation automation 2017
F5 Meetup presentation automation 2017F5 Meetup presentation automation 2017
F5 Meetup presentation automation 2017
 
Thick Application Penetration Testing - A Crash Course
Thick Application Penetration Testing - A Crash CourseThick Application Penetration Testing - A Crash Course
Thick Application Penetration Testing - A Crash Course
 
muCon 2017 - 12 Factor Serverless Applications
muCon 2017 - 12 Factor Serverless ApplicationsmuCon 2017 - 12 Factor Serverless Applications
muCon 2017 - 12 Factor Serverless Applications
 
Day 3 - DevOps Culture - Continuous Integration & Continuous Deployment on th...
Day 3 - DevOps Culture - Continuous Integration & Continuous Deployment on th...Day 3 - DevOps Culture - Continuous Integration & Continuous Deployment on th...
Day 3 - DevOps Culture - Continuous Integration & Continuous Deployment on th...
 
Cloud Native Identity with SPIFFE
Cloud Native Identity with SPIFFECloud Native Identity with SPIFFE
Cloud Native Identity with SPIFFE
 
Thick Application Penetration Testing: Crash Course
Thick Application Penetration Testing: Crash CourseThick Application Penetration Testing: Crash Course
Thick Application Penetration Testing: Crash Course
 
Introduction to the Globus Platform (APS Workshop)
Introduction to the Globus Platform (APS Workshop)Introduction to the Globus Platform (APS Workshop)
Introduction to the Globus Platform (APS Workshop)
 
Kube con china_2019_7 missing factors for your production-quality 12-factor apps
Kube con china_2019_7 missing factors for your production-quality 12-factor appsKube con china_2019_7 missing factors for your production-quality 12-factor apps
Kube con china_2019_7 missing factors for your production-quality 12-factor apps
 
Introduction to the Globus Platform (GlobusWorld Tour - UMich)
Introduction to the Globus Platform (GlobusWorld Tour - UMich)Introduction to the Globus Platform (GlobusWorld Tour - UMich)
Introduction to the Globus Platform (GlobusWorld Tour - UMich)
 

More from Haufe-Lexware GmbH & Co KG

X-celerate 2019: Iterating fast with the MERN Stack
X-celerate 2019: Iterating fast with the MERN StackX-celerate 2019: Iterating fast with the MERN Stack
X-celerate 2019: Iterating fast with the MERN StackHaufe-Lexware GmbH & Co KG
 
Nils Rhode - Does it always have to be k8s - TeC Day 2019
Nils Rhode - Does it always have to be k8s - TeC Day 2019Nils Rhode - Does it always have to be k8s - TeC Day 2019
Nils Rhode - Does it always have to be k8s - TeC Day 2019Haufe-Lexware GmbH & Co KG
 
Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019
Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019
Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019Haufe-Lexware GmbH & Co KG
 
Cloud Journey: Lifting a Major Product to Kubernetes
Cloud Journey: Lifting a Major Product to KubernetesCloud Journey: Lifting a Major Product to Kubernetes
Cloud Journey: Lifting a Major Product to KubernetesHaufe-Lexware GmbH & Co KG
 
ONA ( organizational network analysis ) to enable individuals to impact their...
ONA ( organizational network analysis ) to enable individuals to impact their...ONA ( organizational network analysis ) to enable individuals to impact their...
ONA ( organizational network analysis ) to enable individuals to impact their...Haufe-Lexware GmbH & Co KG
 
ONA ( organizational network analysis ) enabling individuals to impact their ...
ONA ( organizational network analysis ) enabling individuals to impact their ...ONA ( organizational network analysis ) enabling individuals to impact their ...
ONA ( organizational network analysis ) enabling individuals to impact their ...Haufe-Lexware GmbH & Co KG
 
Using word vectors to enable better search in our legal products
Using word vectors to enable better search in our legal productsUsing word vectors to enable better search in our legal products
Using word vectors to enable better search in our legal productsHaufe-Lexware GmbH & Co KG
 
Identifying customer potentials through unsupervised learning
Identifying customer potentials through unsupervised learningIdentifying customer potentials through unsupervised learning
Identifying customer potentials through unsupervised learningHaufe-Lexware GmbH & Co KG
 
Managing short lived Kubernetes (Production) deployments
Managing short lived Kubernetes (Production) deploymentsManaging short lived Kubernetes (Production) deployments
Managing short lived Kubernetes (Production) deploymentsHaufe-Lexware GmbH & Co KG
 
DevOps Journey of Foundational Services at Haufe
DevOps Journey of Foundational Services at HaufeDevOps Journey of Foundational Services at Haufe
DevOps Journey of Foundational Services at HaufeHaufe-Lexware GmbH & Co KG
 
Microservice Transformation of the Haufe Publishing System
Microservice Transformation of the Haufe Publishing SystemMicroservice Transformation of the Haufe Publishing System
Microservice Transformation of the Haufe Publishing SystemHaufe-Lexware GmbH & Co KG
 

More from Haufe-Lexware GmbH & Co KG (20)

Tech stackhaufegroup
Tech stackhaufegroupTech stackhaufegroup
Tech stackhaufegroup
 
X-celerate 2019: Iterating fast with the MERN Stack
X-celerate 2019: Iterating fast with the MERN StackX-celerate 2019: Iterating fast with the MERN Stack
X-celerate 2019: Iterating fast with the MERN Stack
 
Nils Rhode - Does it always have to be k8s - TeC Day 2019
Nils Rhode - Does it always have to be k8s - TeC Day 2019Nils Rhode - Does it always have to be k8s - TeC Day 2019
Nils Rhode - Does it always have to be k8s - TeC Day 2019
 
Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019
Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019
Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019
 
Cloud Journey: Lifting a Major Product to Kubernetes
Cloud Journey: Lifting a Major Product to KubernetesCloud Journey: Lifting a Major Product to Kubernetes
Cloud Journey: Lifting a Major Product to Kubernetes
 
ONA ( organizational network analysis ) to enable individuals to impact their...
ONA ( organizational network analysis ) to enable individuals to impact their...ONA ( organizational network analysis ) to enable individuals to impact their...
ONA ( organizational network analysis ) to enable individuals to impact their...
 
ONA ( organizational network analysis ) enabling individuals to impact their ...
ONA ( organizational network analysis ) enabling individuals to impact their ...ONA ( organizational network analysis ) enabling individuals to impact their ...
ONA ( organizational network analysis ) enabling individuals to impact their ...
 
Using word vectors to enable better search in our legal products
Using word vectors to enable better search in our legal productsUsing word vectors to enable better search in our legal products
Using word vectors to enable better search in our legal products
 
Identifying customer potentials through unsupervised learning
Identifying customer potentials through unsupervised learningIdentifying customer potentials through unsupervised learning
Identifying customer potentials through unsupervised learning
 
Field report: Rapid application development
Field report: Rapid application developmentField report: Rapid application development
Field report: Rapid application development
 
Behavior-Driven Development with JGiven
Behavior-Driven Development with JGivenBehavior-Driven Development with JGiven
Behavior-Driven Development with JGiven
 
Managing short lived Kubernetes (Production) deployments
Managing short lived Kubernetes (Production) deploymentsManaging short lived Kubernetes (Production) deployments
Managing short lived Kubernetes (Production) deployments
 
Docker in Production at the Aurora Team
Docker in Production at the Aurora TeamDocker in Production at the Aurora Team
Docker in Production at the Aurora Team
 
DevOps Journey of Foundational Services at Haufe
DevOps Journey of Foundational Services at HaufeDevOps Journey of Foundational Services at Haufe
DevOps Journey of Foundational Services at Haufe
 
New Serverless World - Cloud Native Apps
New Serverless World - Cloud Native AppsNew Serverless World - Cloud Native Apps
New Serverless World - Cloud Native Apps
 
Microservice Transformation of the Haufe Publishing System
Microservice Transformation of the Haufe Publishing SystemMicroservice Transformation of the Haufe Publishing System
Microservice Transformation of the Haufe Publishing System
 
Haufe API Strategy
Haufe API StrategyHaufe API Strategy
Haufe API Strategy
 
Haufe's Tech Strategy In Practice
Haufe's Tech Strategy In PracticeHaufe's Tech Strategy In Practice
Haufe's Tech Strategy In Practice
 
Kubernetes Intro @HaufeDev
Kubernetes Intro @HaufeDev Kubernetes Intro @HaufeDev
Kubernetes Intro @HaufeDev
 
API Management with wicked.haufe.io
API Management with wicked.haufe.ioAPI Management with wicked.haufe.io
API Management with wicked.haufe.io
 

Recently uploaded

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 

Recently uploaded (20)

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 

Externalized Spring Boot App Configuration

  • 1. S P R I N G C L O U D C O N F I G & V A U LT C H R I S TO P H L U D W I G H A U F E G R O U P, F R E I B U R G J AVA U S E R G R O U P F R E I B U R G , 2 4 . 1 0 . 2 0 1 7
  • 2. AGENDA • What’s the noise about app configuration? • Spring Cloud Config • HashiCorp Vault – Generic Secrets – PKI: Vault as Certification Authority – Client Authentication • Usage Scenarios • Extensions in Haufe Projects – Vault-based Config Server Discovery (or: Where do I get the config server credentials from???) – Keystores for client & server configurations in Vault
  • 3. E X T E R N A L I Z E D S P R I N G A P P L I C A T I O N C O N F I G U R A T I O N
  • 4. SPRING APPLICATION CONFIGURATION – Environment Variables – Command Line Arguments – Property Files
  • 5. 1 APPLICATION – MANY DEPLOYMENTS Git Developer PC CI Environmen t Performance , Load, and Stress Test Enviroment Production Enviroment Branch A Integration Environmen t Branch B Integration Environmen t Demo Environmen t
  • 6. TWELVE FACTOR APPS I. Codebase One codebase tracked in revision control, many deploys II. Dependencies Explicitly declare and isolate dependencies III. Config Store config in the environment IV. Backing services Treat backing services as attached resources V. Build, release, run Strictly separate build and run stages VI. Processes Execute the app as one or more stateless processes VII. Port binding Export services via port binding VIII. Concurrency Scale out via the process model IX. Disposability Maximize robustness with fast startup and graceful shutdown X. Dev/prod parity Keep development, staging, and production as similar as possible XI. Logs Treat logs as event streams XII. Admin processes Run admin/management tasks as one-off processes Source: https://12factor.net/
  • 7. S P R I N G C L O U D C O N F I G
  • 8. CONFIG SERVER CONCEPT • Manageable # Environment Variables: – Profile Names (Env ID, Feature Selectors) – Config Server URL – Config Server Credentials • Configuration under revision control • App fetches config details while bootstrapping • Config server scalable since state in repo Git App Imag e Config Server App Instanc e 1 App Instanc e 2 App Instanc e … Build Deploy Pull Fetch
  • 9. SPRING CLOUD CONFIG Server: • “Normal” Spring Boot Service • URL path parameters: – App name – List of profile names – Git label (revision / branch) • Git-based: – Uses (file:///…) or clones (git://…, ssh://…) lokal Git repo – Git access via JGit library – On every client access, branch is checked out and pulled from remote • Alternative "native" profile: – Config in simple file folder – Ideal for local development Client: • Configuration in – bootstrap.yml – bootstrap-profile.yml usw. – By discovery (e.g., Consul, Eureka) • Adds PropertySources to the Environment ==> combined with other property sources • Periodic health check re-fetches config
  • 10. H A S H I C O R P V A U LT
  • 11. SECRETS • Don’t put plain passwords (for, say DB access) into config files! • Don’t put passwords into your Git repo! • Many developers perceive TLS key handling as complex • Secrets in environment variables / command lines easy to read from a shell account • When did you last change your DB passwords?? • All network transport of secrets must be protected by, say, TLS • …
  • 12. HASHICORP VAULT • Tool for secure access to secrets: – Encryption of data at rest – Elaborate access control concept – Audit log of every access • Support for dynamic secrets: – E.g., on-the-fly setup of DB users with their respective roles and credentials – Issuing of freshly created X.509 certificates • One-time tokens, cubbyhole backend • Many storage backends (filesystem, cloud storage, databases, Etcd, …) • Revocation of individual leases as well as complete immediate system lock-down. • Most parts open source (Mozilla Public License 2.0) • One shared app image serves both as daemon and as command line interface • Server exposes REST API
  • 13. VAULT AUTHENTICATION How to authenticate a vault client? • AppRole: – Static Role Id / ephemeral Secret Id – Secret typically created by deployment pipeline – Optional: Secret expires after use – Alternative: No secret, but CIDR • AWS: – EC2 or IAM credentials – Trusts AWS signatures • LDAP: – User credentials stored in LDAP / AD – Optional MFA • GitHub: – GitHub personal access token • Radius • Client certificates • Username / Password Underlying Token Authentication: • Explicit or under the hood by other mechanisms • Tokens bound to policies (access control) • Tokens expire if not renewed • Tokens can be revoked by admin • Most REST requests require token in HTTP header
  • 14. DEPLOYMENT CONSIDERATIONS One-time tokens are great, but… • App operation in container clusters becomes more and more popular • Containers often replicated (scale out, disruption free deployments, …) • Cluster may migrate / restart containers at any time • So far no cluster hooks for automated re-creation of tokens (abuse potential!) ==> Multi-use secrets for container vault authentication In the Deployment Pipeline: vault write -f –format=json auth/approle/role/myapprole/secret-id | jq -r '.secret_id' | docker secret create myapprole_secretid - docker service create --name=“myapp" --secret="myapprole_secretid" myapp:alpine
  • 15. S P R I N G C L O U D V A U LT
  • 16. SPRING CLOUD VAULT Secret Bootstrapping: • Adds PropertySource to Spring Environment (similar to Cloud Config client) • Runs in bootstrapping phase • App name + profiles translate in Vault paths: {backendName}/{appName}/{appName-profile} RestTemplates for Vault Access: • Ease Vault use from custom code • Examples: – Storage of secrets at runtime – Interactions with PKI backend – Transit backend: Encryption as a service
  • 17. CONFIG SERVER + VAULT Git App Imag e Config Server App Instanc e 1 App Instanc e 2 App Instanc e … Build Deploy Pull Fetch Vault
  • 18. S P R I N G C L O U D V A U LT E X T E N S I O N S @ H A U F E
  • 19. VAULT-BASED CONFIG SERVER DISCOVERY Issue: • Even with secrets in Vault, configuration details give clues to potential attackers ==> Config Server access should require authorization • Config Server passwords are secrets, belong into Vault • Out of the box, config client won’t see properties fetched by vault client (config client configuration too early in bootstrap process) Solution: • Leverage Cloud Config Discovery mechanism • VaultPropertySourceLocator injected as @Resource into VaultBasedDiscoveryClient
  • 20. PKI KEY- & TRUSTSTORE INTEGRATION Issue: • Keystore management (JCEKS, PKCS#12) cumbersome, frequent source of operation errors • Keystores in the file system should be password-protected Solution: • For (app) internal connections (= no “official” cert required): – Leverage Vault’s PKI backend, issue certificates on-the-fly. – Build on sample by Mark Paluch, extended with retrieval of trusted certificates • For customer / partner facing clients & services: – Represent key- and trust stores as JSON objects in Vault’s generic secret backend – Auto-configuration for Web container & HTTP clients • Fallback to keystores in the file system (for, e.g., local development, tests) • Fallback to the trusted certificates of the runtime’s default X509TrustManager

Editor's Notes

  1. When Spring resolves a property, it goes through the list of all registered property sources and takes the value from the first source that contains this property. Property values can refer to other properties (using the “${otherProperty}” syntax); the referenced property is then looked up in the list of property sources as well.
  2. Once a deployable artifact (Jar, Docker image, …) is created from the application sources, we want to run it without modification in many different environments. Of course, sizing, URLs of backend systems, certificates of client-facing endpoints etc. will be different in the various environments.
  3. However, if any parameter that might change becomes an environment variable, then the handling of these environment variables becomes unwieldy. Extra care is required for the handling of secrets.
  4. JGit supports ssh-rsa keys only and does not understand hashed known hosts entry. This can lead to errors that are hard to diagnose if there is already a hashed entry for the remote Git host.
  5. Encrypted secrets in the repo are still not ideal: At runtime, the code needs to decrpyt the secret – where you keep the decryption key? The code in the repo makes it obvious where the key comes from. Typically, a large group has access to the repo – often including _former_ project members or all developers in the company.
  6. The Open Source version has no Web UI, unfortunately. There are 3rd party projects, but they have other restrictions (i.e., AuthN options). As a consequence, I’d recommend to plan the structure of your secrets and access roles for different environments right from the beginning of a project and automate the vault setup.
  7. The AuthN methods on the right are primarily for the login of developers; the methods on the left are well suited for the login of applications.
  8. The example uses Docker Swarm mode. After changes to the secret store in recent releases of Kubernetes, a similar approach is possible if you are using a Kubernetes cluster.