From ccade36aa5c3dfb0e882d616e1d34e07a217e1f9 Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Thu, 3 Dec 2020 15:29:15 -0800 Subject: [PATCH 1/2] Fix audit webhook endpoint for log search api server --- pkg/controller/cluster/log-search.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/controller/cluster/log-search.go b/pkg/controller/cluster/log-search.go index 09fcb693a17..02ebbce858e 100644 --- a/pkg/controller/cluster/log-search.go +++ b/pkg/controller/cluster/log-search.go @@ -34,8 +34,8 @@ func newAuditWebhookConfig(tenant *miniov1.Tenant, secret *corev1.Secret) auditW auditToken := string(secret.Data[miniov1.LogAuditTokenKey]) whTarget := fmt.Sprintf("audit_webhook:%s", tenant.LogSearchAPIDeploymentName()) - // audit_webhook enable=off endpoint= auth_token= - whArgs := fmt.Sprintf("%s auth_token=\"%s\" endpoint=\"%s\"", whTarget, auditToken, services.GetLogSearchAPIAddr(tenant)) + logIngestEndpoint := fmt.Sprintf("%s/%s?token=%s", services.GetLogSearchAPIAddr(tenant), "api/ingest", auditToken) + whArgs := fmt.Sprintf("%s auth_token=\"\" endpoint=\"%s\"", whTarget, logIngestEndpoint) return auditWebhookConfig{ target: whTarget, args: whArgs, From bd5e5282531bf8c720fe50907e85d022c5396029 Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Fri, 4 Dec 2020 10:27:04 -0800 Subject: [PATCH 2/2] Update pkg/controller/cluster/log-search.go Co-authored-by: Aditya Manthramurthy --- pkg/controller/cluster/log-search.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controller/cluster/log-search.go b/pkg/controller/cluster/log-search.go index 02ebbce858e..49a4a0b8eec 100644 --- a/pkg/controller/cluster/log-search.go +++ b/pkg/controller/cluster/log-search.go @@ -35,7 +35,7 @@ func newAuditWebhookConfig(tenant *miniov1.Tenant, secret *corev1.Secret) auditW whTarget := fmt.Sprintf("audit_webhook:%s", tenant.LogSearchAPIDeploymentName()) logIngestEndpoint := fmt.Sprintf("%s/%s?token=%s", services.GetLogSearchAPIAddr(tenant), "api/ingest", auditToken) - whArgs := fmt.Sprintf("%s auth_token=\"\" endpoint=\"%s\"", whTarget, logIngestEndpoint) + whArgs := fmt.Sprintf("%s endpoint=\"%s\"", whTarget, logIngestEndpoint) return auditWebhookConfig{ target: whTarget, args: whArgs,