mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 02:02:43 +00:00
Audit: eventlogger sink node reopen on SIGHUP (#23598)
* ensure nodes are asked to reload audit files on SIGHUP * added changelog
This commit is contained in:
@@ -391,6 +391,17 @@ func (b *Backend) open() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (b *Backend) Reload(_ context.Context) error {
|
func (b *Backend) Reload(_ context.Context) error {
|
||||||
|
// When there are nodes created in the map, use the eventlogger behavior.
|
||||||
|
if len(b.nodeMap) > 0 {
|
||||||
|
for _, n := range b.nodeMap {
|
||||||
|
if n.Type() == eventlogger.NodeTypeSink {
|
||||||
|
return n.Reopen()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
} else {
|
||||||
|
// old non-eventlogger behavior
|
||||||
switch b.path {
|
switch b.path {
|
||||||
case stdout, discard:
|
case stdout, discard:
|
||||||
return nil
|
return nil
|
||||||
@@ -413,6 +424,7 @@ func (b *Backend) Reload(_ context.Context) error {
|
|||||||
|
|
||||||
return b.open()
|
return b.open()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (b *Backend) Invalidate(_ context.Context) {
|
func (b *Backend) Invalidate(_ context.Context) {
|
||||||
b.saltMutex.Lock()
|
b.saltMutex.Lock()
|
||||||
|
|||||||
3
changelog/23598.txt
Normal file
3
changelog/23598.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
```release-note:bug
|
||||||
|
audit: Fix bug reopening 'file' audit devices on SIGHUP.
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user