siemexport

package
v0.4.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package siemexport provides a background goroutine that continuously exports new audit log entries to an external SIEM or webhook endpoint.

Activation: set AUDIT_EXPORT_URL to an HTTP(S) endpoint. The exporter reads entries created after the last successfully-exported timestamp and POSTs them as newline-delimited JSON (one entry per line, content-type application/x-ndjson). An optional AUDIT_EXPORT_SECRET sets a Bearer token on the Authorization header.

The exporter starts from the most-recent audit entry at startup (no historical re-export on first run) and advances its bookmark atomically after each successful delivery.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter

type Exporter struct {
	// contains filtered or unexported fields
}

Exporter polls for new audit entries and ships them to an HTTP endpoint.

func New

func New(db *sqlx.DB) *Exporter

New creates an Exporter from environment variables. Returns nil and logs a message when AUDIT_EXPORT_URL is not set.

func (*Exporter) Start

func (e *Exporter) Start(ctx context.Context)

Start launches the background export loop. It returns immediately; call cancel on the context to stop it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL