From ee3847d95452f1a4d1664dfb4e4791e032bb82cc Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Wed, 24 May 2023 09:44:57 +0100 Subject: [PATCH] Revert "Allow audit entries may contain forwarded to/from host info (#20689)" (#20732) This reverts commit 732dda34e726859fbb24ea51a87f3a1772bf9b7a. --- audit/format.go | 15 +++++---------- sdk/logical/request.go | 6 ------ 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/audit/format.go b/audit/format.go index cf9e57e2e0..506f39dbb5 100644 --- a/audit/format.go +++ b/audit/format.go @@ -92,9 +92,9 @@ func (f *AuditFormatter) FormatRequest(ctx context.Context, w io.Writer, config reqType = "request" } reqEntry := &AuditRequestEntry{ - Type: reqType, - Error: errString, - ForwardedFrom: req.ForwardedFrom, + Type: reqType, + Error: errString, + Auth: &AuditAuth{ ClientToken: auth.ClientToken, Accessor: auth.Accessor, @@ -297,9 +297,8 @@ func (f *AuditFormatter) FormatResponse(ctx context.Context, w io.Writer, config respType = "response" } respEntry := &AuditResponseEntry{ - Type: respType, - Error: errString, - ForwardedTo: req.ForwardedTo, + Type: respType, + Error: errString, Auth: &AuditAuth{ ClientToken: auth.ClientToken, Accessor: auth.Accessor, @@ -398,8 +397,6 @@ type AuditRequestEntry struct { Auth *AuditAuth `json:"auth,omitempty"` Request *AuditRequest `json:"request,omitempty"` Error string `json:"error,omitempty"` - // Populated in Enterprise when a request is forwarded - ForwardedFrom string `json:"forwarded_from,omitempty"` } // AuditResponseEntry is the structure of a response audit log entry in Audit. @@ -410,8 +407,6 @@ type AuditResponseEntry struct { Request *AuditRequest `json:"request,omitempty"` Response *AuditResponse `json:"response,omitempty"` Error string `json:"error,omitempty"` - // Populated in Enterprise when a request is forwarded - ForwardedTo string `json:"forwarded_to,omitempty"` } type AuditRequest struct { diff --git a/sdk/logical/request.go b/sdk/logical/request.go index fa5b869884..5dcd462f68 100644 --- a/sdk/logical/request.go +++ b/sdk/logical/request.go @@ -243,12 +243,6 @@ type Request struct { // InboundSSCToken is the token that arrives on an inbound request, supplied // by the vault user. InboundSSCToken string - - // When a request has been forwarded, contains information of the host the request was forwarded 'from' - ForwardedFrom string `json:"forwarded_from,omitempty"` - - // When a request has been forwarded, contains information of the host the request was forwarded 'to' - ForwardedTo string `json:"forwarded_to,omitempty"` } // Clone returns a deep copy of the request by using copystructure