feature: Add signing (hmac-sha256) of audit entries (#1666)
This commit is contained in:
16 files changed
+344
-37
No files matched your search
@@ -1,6 +1,9 @@
|
||||
package base
|
||||
|
||||
import "github.com/hashicorp/boundary/internal/observability/event"
|
||||
import (
|
||||
"github.com/hashicorp/boundary/internal/observability/event"
|
||||
wrapping "github.com/hashicorp/go-kms-wrapping"
|
||||
)
|
||||
|
||||
// getOpts - iterate the inbound Options and return a struct.
|
||||
func getOpts(opt ...Option) Options {
|
||||
@@ -31,6 +34,7 @@ type Options struct {
|
||||
withDatabaseTemplate string
|
||||
withEventerConfig *event.EventerConfig
|
||||
withEventFlags *EventFlags
|
||||
withEventWrapper wrapping.Wrapper
|
||||
withAttributeFieldPrefix string
|
||||
withStatusCode int
|
||||
}
|
||||
@@ -136,6 +140,12 @@ func WithEventFlags(flags *EventFlags) Option {
|
||||
}
|
||||
}
|
||||
|
||||
func WithEventAuditWrapper(w wrapping.Wrapper) Option {
|
||||
return func(o *Options) {
|
||||
o.withEventWrapper = w
|
||||
}
|
||||
}
|
||||
|
||||
// WithAttributeFieldPrefix tells the command what prefix
|
||||
// to attach to attribute fields when they are returned as errors.
|
||||
func WithAttributeFieldPrefix(p string) Option {
|
||||
|
||||
@@ -192,7 +192,7 @@ func (b *Server) SetupEventing(logger hclog.Logger, serializationLock *sync.Mute
|
||||
}
|
||||
}
|
||||
|
||||
e, err := event.NewEventer(logger, serializationLock, serverName, *opts.withEventerConfig)
|
||||
e, err := event.NewEventer(logger, serializationLock, serverName, *opts.withEventerConfig, event.WithAuditWrapper(opts.withEventWrapper))
|
||||
if err != nil {
|
||||
return berrors.WrapDeprecated(err, op, berrors.WithMsg("unable to create eventer"))
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user