View
7
Download
0
Category
Preview:
Citation preview
Copyright © 2019 HashiCorp
HashiCorp Vault & Kubernetes
© 2018 HashiCorp
NetworkingConnect infrastructure and applications
DevelopmentRun applications
SecuritySecure applications and infrastructure
OperationsProvision Infrastructure
The 4 essential elements of dynamic infrastructure
2THE HASHICORP STACK
一般的なシークレット管理
3
クライアント
● アプリ● CI● ユーザ● etc,
バックエンド
● GCP● DB● PKI● etc,
認証
トークン(権限)
シークレット要求シークレット発行
ttl=1 hour
シークレット破棄
クライアント
● アプリ● CI● ユーザ● etc,
バックエンド
● GCP● DB● PKI● etc,
認証
トークン(権限)
シークレット要求シークレット発行
ttl=1 hour
シークレット破棄
🤔
kubernetes.io/serviceaccount/tokenを使ってVaultの認証をしシークレットを取得する
ClusterRoleBinding ClusterRolesystem: auth-delegatorServiceAccount
ClusterRoleBinding ClusterRolesystem: auth-delegatorServiceAccount
● TokenReview APIをコールするための権限
ClusterRoleBinding ClusterRolesystem: auth-delegatorServiceAccount
● TokenReview APIをコールするための権限
● Service Account Tokenが有効かを判断● Vault K8s Authメソッドで利用される
Vault
K8s Auth
$ vault write auth/kubernetes/config \ token_reviewer_jwt="$SA_JWT_TOKEN" \ kubernetes_host="https://$K8S_HOST:443" \ kubernetes_ca_cert="$SA_CA_CRT"
ClusterRoleBinding ClusterRolesystem: auth-delegatorServiceAccount
Pod
--serviceaccount=postgres-vault
ServiceAccountToken
Vault
ClusterRoleBinding ClusterRolesystem: auth-delegatorServiceAccount
Pod
ServiceAccountToken K8s Auth
--serviceaccount=postgres-vault
verify
ClusterRoleBinding ClusterRolesystem: auth-delegatorServiceAccount
Pod
--serviceaccount=postgres-vault
VAULT_TOKEN
Vault
K8s Auth
Role
ServiceAccountToken
ClusterRoleBinding ClusterRolesystem: auth-delegatorServiceAccount
Pod
--serviceaccount=postgres-vault
Vault
K8s Auth
Role
path "database/creds/postgres-role" { capabilities = ["read"]}path "sys/leases/renew" { capabilities = ["create"]}path "sys/leases/revoke" { capabilities = ["update"]}
VAULT_TOKEN
ServiceAccountToken
Pod
ClusterRoleBinding ClusterRolesystem: auth-delegatorServiceAccount
--serviceaccount=postgres-vault
Vault
K8s Auth
Role
Postgres Secret Engine
VAULT_TOKEN
ServiceAccountToken
Pod
ClusterRoleBinding ClusterRolesystem: auth-delegatorServiceAccount
--serviceaccount=postgres-vault
Vault
K8s Auth
Role
Postgres Secret Engine
シークレット生成 /破棄/ローテーションシークレット提供
VAULT_TOKEN
ServiceAccountToken
Pod
App
Vault Sidecar
Local Filesystem
Vault
認証、シークレットライフサイクル
Pod
Pod
Pod
Pod
Pod
Vault
K8s Auth
Role
Postgres Secret Engine
secret-a
secret-b
secret-c
secret-d
secret-e
シークレット生成、破棄、リニューアル
Let’s Start Vault on GKE
$ git clone https://github.com/hashicorp/vault-helm.git
$ helm install --name=vault .
Connect K8s by Consul
Provision K8s by Terraform
Secure K8s by Vault
HashiStack 🤝Kubernetes
🤝
🤝
🤝
kabu@hashicorp.com
@hashicorpjp
Recommended