導入 IaC ,做到頻繁且安全的 vault 更新,但同時又要有效率甚至全自動化
argocd + vault helm chart
server 與 injector 建議分開兩個 argocd applicatoin / helm release獨立deploy
tee admin-policy.hcl <<EOF
# Read system health check
path "sys/health"
{
capabilities = ["read", "sudo"]
}
# List existing policies
path "sys/policies/acl"
{
capabilities = ["list"]
}
EOF
vault policy write admin admin-policy.hcl
vault policy list
vault policy read admin
prerequisites: vault, terraform, terragrunt
git clone git@github.com:chechiachang/vault-playground.git
cd vault-playground/usage/03-terraform-lives/
terragrunt init
terragrunt plan
terraform test
on github actionterraform test
terraform test
resource "test_assertions" "main" {
component = "main"
equal "mount_path" {
description = "default mount_path is ${local.mount_path}"
got = local.mount_path
want = local.mount_path
}
equal "max_versions" {
description = "default max_versions is 10"
got = local.max_versions
want = 10
}
equal "delete_version_after" {
description = "default delete_version_after is 10"
got = local.delete_version_after
want = 12600
}