forked from mtusi2026/mtusi2026lab7
fix: address openbao-secrets verify findings
bao_check now compares cert auth roles and policies in OpenBao with the repository and tries every foreign identity against every role and without a role name; API and migrations exit with code 2 on invalid settings; stop-at-start runs its attempts next to the stand's OpenBao again; openbao-outage checks the exit code, the record and the restart; run_docker restarts only services started before seed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -66,6 +66,25 @@ def write_record(event: str, *, level: str, **fields: object) -> None:
|
||||
os.write(1, (json.dumps(record) + "\n").encode())
|
||||
|
||||
|
||||
def write_settings_error(event: str, *, module: str, error: object) -> None:
|
||||
"""Запись о неверных настройках (`pydantic.ValidationError` — по
|
||||
утиной типизации, модуль только stdlib): `loc` и `msg` ошибок без
|
||||
значений полей — в них могут быть секреты (change `openbao-secrets`,
|
||||
правки verify W2: API и миграции, как worker)."""
|
||||
write_record(
|
||||
event,
|
||||
level="error",
|
||||
module=module,
|
||||
errors=[
|
||||
{
|
||||
"loc": ".".join(str(part) for part in item["loc"]),
|
||||
"msg": item["msg"],
|
||||
}
|
||||
for item in error.errors(include_input=False) # type: ignore[attr-defined]
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
def _stop(signum: int, _frame: FrameType | None) -> None:
|
||||
if not _armed:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user