add mount accessor to audit request and responses (#15342)

* add mount accessor to audit request and responses

* add changelog

* cleanup todo
This commit is contained in:
swayne275 2022-05-12 11:28:00 -06:00 committed by GitHub
parent 0af0543bbe
commit 6f15ac255a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 16 deletions

View File

@ -115,6 +115,7 @@ func (f *AuditFormatter) FormatRequest(ctx context.Context, w io.Writer, config
ClientTokenAccessor: req.ClientTokenAccessor,
Operation: req.Operation,
MountType: req.MountType,
MountAccessor: req.MountAccessor,
Namespace: &AuditNamespace{
ID: ns.ID,
Path: ns.Path,
@ -278,6 +279,7 @@ func (f *AuditFormatter) FormatResponse(ctx context.Context, w io.Writer, config
ClientTokenAccessor: req.ClientTokenAccessor,
Operation: req.Operation,
MountType: req.MountType,
MountAccessor: req.MountAccessor,
Namespace: &AuditNamespace{
ID: ns.ID,
Path: ns.Path,
@ -294,6 +296,7 @@ func (f *AuditFormatter) FormatResponse(ctx context.Context, w io.Writer, config
Response: &AuditResponse{
MountType: req.MountType,
MountAccessor: req.MountAccessor,
Auth: respAuth,
Secret: respSecret,
Data: resp.Data,
@ -343,6 +346,7 @@ type AuditRequest struct {
ReplicationCluster string `json:"replication_cluster,omitempty"`
Operation logical.Operation `json:"operation,omitempty"`
MountType string `json:"mount_type,omitempty"`
MountAccessor string `json:"mount_accessor,omitempty"`
ClientToken string `json:"client_token,omitempty"`
ClientTokenAccessor string `json:"client_token_accessor,omitempty"`
Namespace *AuditNamespace `json:"namespace,omitempty"`
@ -359,6 +363,7 @@ type AuditRequest struct {
type AuditResponse struct {
Auth *AuditAuth `json:"auth,omitempty"`
MountType string `json:"mount_type,omitempty"`
MountAccessor string `json:"mount_accessor,omitempty"`
Secret *AuditSecret `json:"secret,omitempty"`
Data map[string]interface{} `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`

3
changelog/15342.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:improvement
audit: Include mount_accessor in audit request and response logs
```