выполение на 5

This commit is contained in:
kaktuz20000
2026-11-04 19:22:35 +03:00
parent 20afc2c790
commit 5a6fcff3ef
90 changed files with 8848 additions and 130 deletions
+11 -4
View File
@@ -1,7 +1,14 @@
# OpenBao — реализовать конфигурацию и политики
# OpenBao service configuration and bootstrap
Добавьте non-dev конфигурацию listener/storage/TLS, API/worker policies, bootstrap и rotation scripts. Credentials и unseal material создаются локально; здесь нет готового root token или private key.
`config.hcl` configures a TLS listener and persistent file storage; Compose runs OpenBao outside dev mode. `bootstrap-openbao.py` provisions KV v2 secrets and per-process AppRoles after operator init/unseal.
Решение должно показать реальную сервисную аутентификацию и получение нужного secret по ограниченной policy; просто работающий контейнер OpenBao не засчитывается. На 3 статический KV secret допустим. На 4 покажите expiry/renewal/rotation и allow/deny. Путь KV v2 data/metadata и ACL должен соответствовать фактическому mount; не копируйте широкое `path "*"` для приложения.
The API, worker, publisher, migrator and reconciler use separate AppRole credentials and policies. Each policy can read only its own `secret/data/messenger/<service>` KV v2 path. Service tokens have a 15-minute TTL and a one-hour maximum TTL; AppRole SecretIDs expire after 24 hours. Application code never receives the operator root token.
Документируйте шаги оператора init/unseal и восстановление после restart. Скрипт не должен печатать tokens/shares или хранить их в Git. См. contracts/trust-matrix.md и REPORT.md.
Operator workflow:
1. Generate local keys and bootstrap secrets with the scripts documented in the root README.
2. Start the `openbao` service, run `bao operator init`, and unseal it using the operator-held shares. Keep the initial root token outside the repository.
3. Run `python3 scripts/bootstrap-openbao.py --root-token-file <operator-only-file>`. It writes non-root AppRole IDs/SecretIDs under ignored `secrets/openbao/`; values are not printed.
4. Start application services. On a normal restart, the file backend retains OpenBao state and the operator unseals it if required. If a service SecretID expires, provision a replacement and restart that service.
The script provisions distinct paths and identities; secret values originate from local bootstrap files and are not committed. Root token and unseal shares must never be mounted into application containers.
+3
View File
@@ -0,0 +1,3 @@
path "secret/data/messenger/api" {
capabilities = ["read"]
}
+15
View File
@@ -0,0 +1,15 @@
ui = false
api_addr = "https://openbao:8200"
cluster_addr = "https://openbao:8201"
storage "file" {
path = "/openbao/data"
}
listener "tcp" {
address = "0.0.0.0:8200"
cluster_address = "0.0.0.0:8201"
tls_cert_file = "/run/secrets/openbao_tls_cert"
tls_key_file = "/run/secrets/openbao_tls_key"
tls_min_version = "tls12"
}
+3
View File
@@ -0,0 +1,3 @@
path "secret/data/messenger/worker" {
capabilities = ["read"]
}