Skip to content

Conversation

@sunib
Copy link
Contributor

@sunib sunib commented Nov 25, 2025

Add support for receiving Kubernetes audit events via a new webhook endpoint at /audit-webhook. This collects basic metrics on audit events split by Group Version Resource (GVR) and action, using a new Prometheus-compatible counter gitopsreverser_audit_events_received_total.

Changes include:

  • Registering the audit handler in main.go
  • Adding audit event parsing and metrics increment in internal/webhook/audit_handler.go
  • Defining the new metrics counter in internal/metrics/exporter.go
  • Updating go.mod to include k8s.io/apiserver as a direct dependency
  • Adding design documentation in docs/audit-webhook-experimental-design.md
  • Updating package comments in internal/webhook/event_handler.go

This is an experimental feature for experimenting, requiring cluster admin configuration for audit policy and webhook setup. No admission decisions are made; only metrics are collected.

Add support for receiving Kubernetes audit events via a new webhook endpoint at `/audit-webhook`. This collects basic metrics on audit events split by Group Version Resource (GVR) and action, using a new Prometheus-compatible counter `gitopsreverser_audit_events_received_total`.

Changes include:
- Registering the audit handler in main.go
- Adding audit event parsing and metrics increment in internal/webhook/audit_handler.go
- Defining the new metrics counter in internal/metrics/exporter.go
- Updating go.mod to include k8s.io/apiserver as a direct dependency
- Adding design documentation in docs/audit-webhook-experimental-design.md
- Updating package comments in internal/webhook/event_handler.go

This is an experimental feature for observability, requiring cluster admin configuration for audit policy and webhook setup. No admission decisions are made; only metrics are collected.
@sunib sunib merged commit 0a418a3 into main Dec 5, 2025
22 of 23 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