Skip to content

Commit

Permalink
Pipe MountPoint to audit logs (#20411)
Browse files Browse the repository at this point in the history
* MountPoint piped to audit logs
---------
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
  • Loading branch information
clemon committed Apr 28, 2023
1 parent 268655c commit 71ea66f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions audit/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ func (f *AuditFormatter) FormatRequest(ctx context.Context, w io.Writer, config
ClientToken: req.ClientToken,
ClientTokenAccessor: req.ClientTokenAccessor,
Operation: req.Operation,
MountPoint: req.MountPoint,
MountType: req.MountType,
MountAccessor: req.MountAccessor,
Namespace: &AuditNamespace{
Expand Down Expand Up @@ -313,6 +314,7 @@ func (f *AuditFormatter) FormatResponse(ctx context.Context, w io.Writer, config
ClientTokenAccessor: req.ClientTokenAccessor,
ClientID: req.ClientID,
Operation: req.Operation,
MountPoint: req.MountPoint,
MountType: req.MountType,
MountAccessor: req.MountAccessor,
Namespace: &AuditNamespace{
Expand All @@ -330,6 +332,7 @@ func (f *AuditFormatter) FormatResponse(ctx context.Context, w io.Writer, config
},

Response: &AuditResponse{
MountPoint: req.MountPoint,
MountType: req.MountType,
MountAccessor: req.MountAccessor,
Auth: respAuth,
Expand Down Expand Up @@ -394,6 +397,7 @@ type AuditRequest struct {
ClientID string `json:"client_id,omitempty"`
ReplicationCluster string `json:"replication_cluster,omitempty"`
Operation logical.Operation `json:"operation,omitempty"`
MountPoint string `json:"mount_point,omitempty"`
MountType string `json:"mount_type,omitempty"`
MountAccessor string `json:"mount_accessor,omitempty"`
ClientToken string `json:"client_token,omitempty"`
Expand All @@ -411,6 +415,7 @@ type AuditRequest struct {

type AuditResponse struct {
Auth *AuditAuth `json:"auth,omitempty"`
MountPoint string `json:"mount_point,omitempty"`
MountType string `json:"mount_type,omitempty"`
MountAccessor string `json:"mount_accessor,omitempty"`
Secret *AuditSecret `json:"secret,omitempty"`
Expand Down
3 changes: 3 additions & 0 deletions changelog/20411.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
audit: add a `mount_point` field to audit requests and response entries
```

0 comments on commit 71ea66f

Please sign in to comment.