Skip to content

Audit log for osctrl-admin#727

Merged
javuto merged 3 commits intomainfrom
audit-log-admin
Oct 9, 2025
Merged

Audit log for osctrl-admin#727
javuto merged 3 commits intomainfrom
audit-log-admin

Conversation

@javuto
Copy link
Collaborator

@javuto javuto commented Oct 9, 2025

Adding audit log capabilities and viewer in osctrl-admin.

@javuto javuto requested a review from Copilot October 9, 2025 14:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive audit logging capabilities to the osctrl-admin service, allowing administrators to track all user actions and system interactions within the admin interface.

  • Introduces a new audit log system with database persistence and configurable enable/disable functionality
  • Adds audit log viewing interface with real-time data display and filtering capabilities
  • Integrates audit logging throughout the admin handlers to capture user actions, visits, and configuration changes

Reviewed Changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/auditlog/audit.go Core audit log manager with database models and logging methods for different action types
pkg/auditlog/utils.go Utility functions for converting log types and severities to human-readable strings
pkg/auditlog/utils_test.go Unit tests for the utility conversion functions
pkg/config/flags.go Adds audit log configuration flag for enabling/disabling the feature
pkg/environments/util.go Adds safety check for zero environment ID in EnvironmentFinderID function
pkg/environments/environments.go Adds ExistsGet method to check environment existence and return the environment
cmd/admin/handlers/handlers.go Integrates audit log manager into the handlers structure with configuration option
cmd/admin/handlers/json-audit.go JSON API endpoint for serving audit log data to the frontend
cmd/admin/handlers/types-templates.go Template data structure for audit log page rendering
cmd/admin/templates/audit.html Frontend template for displaying audit logs with DataTables integration
cmd/admin/templates/components/page-aside-right.html Adds audit log navigation button to admin sidebar
cmd/admin/handlers/templates.go Adds audit log page handler and integrates visit logging across all template handlers
cmd/admin/handlers/post.go Integrates audit logging for all POST actions including login, logout, queries, carves, and configuration changes
cmd/admin/handlers/tokens.go Adds audit logging for token operations and page visits
cmd/admin/handlers/get.go Adds audit logging for file download operations
cmd/admin/main.go Initializes audit log manager and registers audit log routes
docker-compose-dev.yml Enables audit logging in development environment
go.mod Removes unused dependency

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

javuto and others added 2 commits October 9, 2025 16:56
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@javuto javuto merged commit 0978ffb into main Oct 9, 2025
55 checks passed
@javuto javuto deleted the audit-log-admin branch October 9, 2025 18:36
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