opsctrl_cli
opsctrl_cli copied to clipboard
`Admins can view organization-wide audit logs in the dashboard`
As an
Org administrator
I want to
view all user and system actions that have occurred within my organization
So that
I can monitor activity, investigate incidents, and ensure operational accountability
β Acceptance Criteria
π₯οΈ Web Dashboard Functionality
-
Access Control:
- Only users with the
adminrole can access the Audit Log tab/page. - Users without
adminsee no link to this section.
- Only users with the
-
Audit Log Table View:
-
Display the following columns:
- Timestamp (sortable)
-
User (resolved from
user_id) -
Event Type (
diagnosis.run,fix.applied, etc.) -
Source (
cli,slack,webhook) -
Status (
success,error) -
Summary (generated from context β e.g., βDiagnosed pod
api-123β)
-
-
Filtering & Search:
-
Filters:
- Date range
- Event type
- Source
- Status
-
Keyword search across
pod name,user name,command
-
-
Drill-Down View:
-
Click a row to open a modal or drawer with:
- Full
contextJSON (prettified) - Raw metadata for auditing or debugging
- (Optional) Links to related objects: pod, diagnosis
- Full
-
-
Pagination:
- 50 logs per page with pagination controls
-
Performance:
- Logs should load within 1s for typical orgs (indexes required)
π GitHub Tasks
Frontend
- [ ] [UI] Audit Log Page (Admin Only)
- [ ] [UI] Table Component for Log Events
- [ ] [UI] Filters & Search Input
- [ ] [UI] Expandable Row or Modal for JSON Drill-Down
- [ ] [UI] User RBAC Enforcement
Backend
- [ ] [API]
GET /audit/logsfor Admins - [ ] [Query] Indexing for Fast Filters (org_id, timestamp, event_type)
- [ ] [API] Result Pagination + Sorting
- [ ] [Security] Field Redaction Middleware (if needed)
π Additional Notes
- β No CLI access to logs β all audit visibility is centralized in the dashboard
- β This matches the future v2 goal of having org-wide observability and incident history
- π¦ You can build this atop Postgres and extend later to export logs via CSV