You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: POST /api/settings/ops/reset writes no audit entry — ent#297's audit half stopped one route short #1966
ent#297 / PR #1893 added validation and an audit entry (ops_settings_change) to PUT /api/settings/ops/config. It did not add one to POST /api/settings/ops/reset, but both the PR body and the architecture.md prose it landed read as though it covered both:
Writes are audited. Neither this endpoint nor /ops/reset logged anything, while the generic PUT /{key} directly above them does…
…neither this route nor /ops/reset logged anything before…
reset_ops_settings (src/backend/routers/settings.py:2661) is admin-only, deletes rows for every key in OPS_SETTINGS_DEFAULTS, and writes no audit entry.
Scope of what's still unlogged
The retention claim in that prose does hold — reset correctly continues over RETENTION_OPS_KEYS (#1638), so it cannot shrink a retention window. What it can silently reset with no trace:
ssh_access_enabled — the security-relevant one; resetting it changes whether ephemeral SSH credentials can be minted at all
So the asymmetry ent#297 objected to still exists one route over: the generic PUT /{key} audits, /ops/config now audits, /ops/reset doesn't.
Fix
Mirror the /ops/config call — platform_audit_service.log(event_type=AuditEventType.CONFIGURATION, event_action="ops_settings_reset", …) with the reset and skipped key lists in details (keys and counts only; the values are being deleted, and none of these keys is a secret). request is already a parameter on the handler, so actor_ip / endpoint / request_id need no signature change.
Either that, or narrow the two prose claims to /ops/config — but auditing it is four lines and closes the class rather than documenting around it.
Acceptance
POST /api/settings/ops/reset writes a CONFIGURATION audit entry naming which keys were reset and which were skipped
A test asserts the entry is written (and that retention keys appear under skipped, never reset)
architecture.md's "neither this route nor /ops/reset logged anything before" is true after the change
Follow-up to trinity-enterprise#297 · surfaced in review of #1893.
Activity
dolho commentedon Aug 4, 2026
/claim — picking this up. Branch:
fix/1966-ops-reset-audit, offdev(independent of the scheduler stack).github-actions commentedon Aug 4, 2026
@dolho This issue is already assigned to dolho. Use
/unclaimfirst if you want to take over.dolho commentedon Aug 4, 2026
PR: #1977
fix(settings): audit POST /api/settings/ops/reset (#1966) (#1977)