Skip to content

Commit

Permalink
fix the other diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodingenthusiast committed Jun 7, 2023
1 parent d77784b commit f5a557d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 11 additions & 0 deletions agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -1621,7 +1621,18 @@ func (a *Agent) RPC(ctx context.Context, method string, args interface{}, reply
method = e + "." + p[1]
}
}

// audit log only on consul clients
_, ok := a.delegate.(*consul.Client)
if ok {
a.writeAuditRPCEvent(method, "OperationStart")
}

a.endpointsLock.RUnlock()

defer func() {
a.writeAuditRPCEvent(method, "OperationComplete")
}()
return a.delegate.RPC(ctx, method, args, reply)
}

Expand Down
5 changes: 3 additions & 2 deletions agent/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -807,8 +807,9 @@ type ConfigEntries struct {

// Audit allows us to enable and define destinations for auditing
type Audit struct {
Enabled *bool `mapstructure:"enabled"`
Sinks map[string]AuditSink `mapstructure:"sink"`
Enabled *bool `mapstructure:"enabled"`
Sinks map[string]AuditSink `mapstructure:"sink"`
RPCEnabled *bool `mapstructure:"rpc_enabled"`
}

// AuditSink can be provided multiple times to define pipelines for auditing
Expand Down

0 comments on commit f5a557d

Please sign in to comment.