Backport audit log config changes from enterprise

This commit is contained in:
Daniel Nephin 2021-05-06 17:09:18 -04:00
parent c9ae72e72f
commit 0707dc3d6b
4 changed files with 4 additions and 6 deletions

View File

@ -46,9 +46,8 @@ func validateEnterpriseConfigKeys(config *Config) []error {
add("acl.tokens.managed_service_provider")
config.ACL.Tokens.ManagedServiceProvider = nil
}
if config.Audit != nil {
if boolVal(config.Audit.Enabled) || len(config.Audit.Sinks) > 0 {
add("audit")
config.Audit = nil
}
return result

View File

@ -282,7 +282,7 @@ type Config struct {
VersionPrerelease *string `mapstructure:"version_prerelease"`
// Enterprise Only
Audit *Audit `mapstructure:"audit"`
Audit Audit `mapstructure:"audit"`
// Enterprise Only
ReadReplica *bool `mapstructure:"read_replica" alias:"non_voting_server"`
// Enterprise Only
@ -761,7 +761,6 @@ type Audit struct {
// AuditSink can be provided multiple times to define pipelines for auditing
type AuditSink struct {
Name *string `mapstructure:"name"`
Type *string `mapstructure:"type"`
Format *string `mapstructure:"format"`
Path *string `mapstructure:"path"`

View File

@ -47,7 +47,7 @@ advertise_addr = "17.99.29.16"
advertise_addr_wan = "78.63.37.19"
advertise_reconnect_timeout = "0s"
audit = {
enabled = false
enabled = true
}
auto_config = {
enabled = false

View File

@ -48,7 +48,7 @@
"advertise_addr_wan": "78.63.37.19",
"advertise_reconnect_timeout": "0s",
"audit": {
"enabled": false
"enabled": true
},
"auto_config": {
"enabled": false,