From 5c83c9724ff51f787e1f1de4f572a5b5086854c3 Mon Sep 17 00:00:00 2001 From: Anis Eleuch Date: Fri, 28 Apr 2023 06:18:24 +0100 Subject: [PATCH] audit: Add request path and host to audit event (#17099) --- go.mod | 2 +- go.sum | 4 ++-- internal/logger/message/audit/entry.go | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2e169dfa4..c0179880f 100644 --- a/go.mod +++ b/go.mod @@ -50,7 +50,7 @@ require ( github.com/minio/madmin-go/v2 v2.1.0 github.com/minio/minio-go/v7 v7.0.52 github.com/minio/mux v1.9.0 - github.com/minio/pkg v1.7.0 + github.com/minio/pkg v1.7.1 github.com/minio/selfupdate v0.6.0 github.com/minio/sha256-simd v1.0.0 github.com/minio/simdjson-go v0.4.5 diff --git a/go.sum b/go.sum index fcbbc3b80..b1f729ae1 100644 --- a/go.sum +++ b/go.sum @@ -791,8 +791,8 @@ github.com/minio/minio-go/v7 v7.0.52/go.mod h1:IbbodHyjUAguneyucUaahv+VMNs/EOTV9 github.com/minio/mux v1.9.0 h1:dWafQFyEfGhJvK6AwLOt83bIG5bxKxKJnKMCi0XAaoA= github.com/minio/mux v1.9.0/go.mod h1:1pAare17ZRL5GpmNL+9YmqHoWnLmMZF9C/ioUCfy0BQ= github.com/minio/pkg v1.5.4/go.mod h1:2MOaRFdmFKULD+uOLc3qHLGTQTuxCNPKNPfLBTxC8CA= -github.com/minio/pkg v1.7.0 h1:tHPwt8eA4xd8mOUEGAripuHyePh8N3VavvZ5Lg4YMqk= -github.com/minio/pkg v1.7.0/go.mod h1:0iX1IuJGSCnMvIvrEJauk1GgQSX9JdU6Kh0P3EQRGkI= +github.com/minio/pkg v1.7.1 h1:Nu5EJ64PHmJtbq1zOxQv2lNM6drjbhO8QOCdntHSjVE= +github.com/minio/pkg v1.7.1/go.mod h1:0iX1IuJGSCnMvIvrEJauk1GgQSX9JdU6Kh0P3EQRGkI= github.com/minio/selfupdate v0.6.0 h1:i76PgT0K5xO9+hjzKcacQtO7+MjJ4JKA8Ak8XQ9DDwU= github.com/minio/selfupdate v0.6.0/go.mod h1:bO02GTIPCMQFTEvE5h4DjYB58bCoZ35XLeBf0buTDdM= github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= diff --git a/internal/logger/message/audit/entry.go b/internal/logger/message/audit/entry.go index 7e55f5317..4a2f63277 100644 --- a/internal/logger/message/audit/entry.go +++ b/internal/logger/message/audit/entry.go @@ -47,6 +47,8 @@ func ToEntry(w http.ResponseWriter, r *http.Request, reqClaims map[string]interf entry.RemoteHost = handlers.GetSourceIP(r) entry.UserAgent = r.UserAgent() entry.ReqClaims = reqClaims + entry.ReqHost = r.Host + entry.ReqPath = r.URL.Path q := r.URL.Query() reqQuery := make(map[string]string, len(q))