Skip to content

Commit

Permalink
Audit: ensure 'prefix' is supplied to socket audit backends (#25004)
Browse files Browse the repository at this point in the history
* ensure 'prefix' is supplied to socket audit backends

* changelog
  • Loading branch information
peteski22 committed Jan 23, 2024
1 parent 8ea3e77 commit 5d265a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion builtin/audit/socket/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ func Factory(ctx context.Context, conf *audit.BackendConfig, useEventLogger bool
return nil, err
}

opts := []audit.Option{
audit.WithHeaderFormatter(headersConfig),
audit.WithPrefix(conf.Config["prefix"]),
}

b := &Backend{
saltConfig: conf.SaltConfig,
saltView: conf.SaltView,
Expand All @@ -96,7 +101,7 @@ func Factory(ctx context.Context, conf *audit.BackendConfig, useEventLogger bool
}

// Configure the formatter for either case.
f, err := audit.NewEntryFormatter(b.formatConfig, b, audit.WithHeaderFormatter(headersConfig))
f, err := audit.NewEntryFormatter(b.formatConfig, b, opts...)
if err != nil {
return nil, fmt.Errorf("error creating formatter: %w", err)
}
Expand Down
3 changes: 3 additions & 0 deletions changelog/25004.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
audit/socket: Provide socket based audit backends with 'prefix' configuration option when supplied.
```

0 comments on commit 5d265a3

Please sign in to comment.