Skip to content

feat(observer): expose OpenBao AppRole rotation metrics - #17

Merged
github-actions[bot] merged 5 commits into
mainfrom
feat/openbao-approle-observer-396
Nov 6, 2026
Merged

github-actions[bot] merged 5 commits into
mainfrom
feat/openbao-approle-observer-396

Conversation

@znerol2

@znerol2 znerol2 commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a metadata-only OpenBao AppRole lifecycle observer to dmf-promsd. It validates the configured CA, reads only the approved registry metadata, and exposes bounded lifecycle metrics for the monitoring stack.

Scope and readiness boundary

This is a source foundation for dmfdeploy/dmfdeploy#396 and dmfdeploy/dmfdeploy#11. It does not implement the credential rotation writer or scheduled CronJob, and it does not demonstrate a live scheduled heartbeat. The heartbeat metric reads the registry's last_scheduled_success_at; the writer must update that value only after a complete successful scheduled sweep.

The observer Kubernetes-auth role in dmf-infra#118 is provisioned only during fresh OpenBao initialization. Existing initialized environments require a separately reviewed privileged migration before the observer can authenticate. Do not treat this PR as rollout-ready for such environments; no auth-role management authority is added to the policy reconciler.

Verification

  • uv run --extra dev pytest tests/test_observer.py tests/test_settings.py tests/test_main.py -q: 32 passed.
  • Prometheus rules rendered and validated; the focused rotation alert rule tests passed.
  • No live cluster, OpenBao instance, credentials, or secrets were accessed.

Refs dmfdeploy/dmfdeploy#396 and dmfdeploy/dmfdeploy#11.

@znerol2 znerol2 added hold Disarm auto-merge: PR will not land on approval while this label is set and removed hold Disarm auto-merge: PR will not land on approval while this label is set labels Nov 6, 2026
@znerol2

znerol2 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Status, 2026-11-06: unblocked. The #396 scheduler question is settled (in-cluster CronJob; see dmfdeploy/dmfdeploy#396). This draft needs a rebase onto main before review.

Signed-off-by: znerol2 <6800371+znerol2@users.noreply.github.com>
Signed-off-by: znerol2 <6800371+znerol2@users.noreply.github.com>
Signed-off-by: znerol2 <6800371+znerol2@users.noreply.github.com>
Signed-off-by: znerol2 <6800371+znerol2@users.noreply.github.com>
@znerol2
znerol2 force-pushed the feat/openbao-approle-observer-396 branch from f8c645e to 1a8a65b Compare November 6, 2026 11:36
…hronology

Refs dmfdeploy/dmfdeploy#396

- Poll OpenBao outside the snapshot lock and publish a finished snapshot
  atomically, so a slow poll can't block /metrics or the other endpoints.
- Build the HTTP client with the configured CA only. A missing, empty or
  invalid CA leaves the targets unavailable with collection_error=1, the
  service still starts, and the next poll retries. The client never
  falls back to the system trust store.
- Reject records whose history contradicts the latest run: a timestamp
  newer than the latest run, a scheduled success newer than the last
  success, or a latest success missing from the success history.
- An explicit latest scheduled failure always raises the failure flag,
  even when its time ties the last scheduled success. The HELP text says
  the flag is conservative, because the registry keeps one shared failure
  time and a manual failure also raises it.

Signed-off-by: znerol2 <6800371+znerol2@users.noreply.github.com>
@znerol2
znerol2 marked this pull request as ready for review November 6, 2026 18:52
@znerol2
znerol2 requested a review from a team as a code owner November 6, 2026 18:52
@github-actions
github-actions Bot enabled auto-merge (rebase) November 6, 2026 18:52
@znerol2
znerol2 requested a review from lkirc November 6, 2026 19:00

@lkirc lkirc left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Static review of 7119318: no blocking findings.

The required checks, exact ntfy OK token, and approval gate all pass.

@github-actions
github-actions Bot merged commit 17f8117 into main Nov 6, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants