Files
project-infra/docs/vault-vso.md
T

72 lines
2.6 KiB
Markdown

# Vault and Vault Secrets Operator
## Ownership
- Vault workload: `gitops/platform/vault`
- VSO Helm values: `gitops/platform/secret-delivery/base/helm/values.yaml`
- VaultConnection/VaultAuth: `gitops/platform/secret-delivery/base`
- lab secret declarations: `gitops/platform/secret-delivery/overlays/lab`
Vault KV-v2가 secret source of truth이며, workload는 VSO가 만든 Kubernetes
Secret만 소비합니다.
## Bootstrap order
```text
VSO controller/CRD install
Vault workload Running
Vault init + unseal
Kubernetes auth + policy/role
KV seed
VaultConnection/VaultAuth/pre-data VaultStaticSecret apply
pre-data destination Secret wait
PostgreSQL/MinIO/Keycloak apply
MinIO registry access key generate -> Vault
registry VaultStaticSecret/apply
consumer workloads apply
```
이 순서 때문에 `all/` aggregate를 직접 apply할 수 없습니다.
## Access split
| VaultAuth | Policy | Read paths |
| --- | --- | --- |
| `vault-auth-auth-platform` | `vso-auth-platform` | `identity-postgres/*`, `auth-server/*`, `keycloak/*`, `oauth2-proxy/*` |
| `vault-auth-storage` | `vso-storage` | `minio/*`, `docker-registry/*` |
현재 lab은 두 auth boundary가 같은 namespace와 ServiceAccount를 공유합니다.
실무 namespace 분리 시 workload/domain별 ServiceAccount, VaultAuth, policy,
bound namespace를 함께 분리해야 합니다.
## Secret catalog
| Domain | Kubernetes Secret |
| --- | --- |
| PostgreSQL | `identity-postgres-superuser`, `keycloak-db`, `auth-server-db` |
| Keycloak | `keycloak-db-operator`, `keycloak-bootstrap-admin-operator`, `keycloak-client-auth-server-ingress` |
| oauth2-proxy | `oauth2-proxy-secrets` |
| MinIO | `minio-tenant-env` |
| registry | `docker-registry-minio`, `docker-registry-basic-auth`, `docker-registry-pull-credentials` |
VSO destinations use `overwrite: true`. auth-server와 oauth2-proxy는 지원되는
Secret 변경에 rollout target을 선언합니다. DB/MinIO/registry credential은
backend 상태를 먼저 바꾸는 조정된 rotation이 필요합니다.
`docker-registry-minio`는 MinIO가 생성한 access key를 Vault에 기록한 뒤
`35-registry`에서 동기화합니다. 다른 정적 seed와 같은 시점에 미리 만들지
않습니다.
## Key material
`vault-init-keys.json`에는 root token과 unseal material이 들어가므로 Git에
들어가면 안 됩니다. 기본 lab 파일도 평문이며 단지 ignored/0600일 뿐입니다.
```bash
VAULT_KEYS_FILE=/secure/path/lab-vault-init.json \
bash scripts/bin/bootstrap.sh lab
```
과거 Git 이력에 포함된 값은 삭제만으로 복구되지 않습니다. live credential
회전과 원격 history 정리는 별도 incident response로 수행합니다.