From 8adf4be96e2559f0a1c55305b78a1ebc876ac850 Mon Sep 17 00:00:00 2001 From: Adrien PONSIN Date: Thu, 17 Apr 2025 14:07:19 +0200 Subject: [PATCH] return a 401 if the container is not authorized --- command/serve.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/command/serve.go b/command/serve.go index 7d882f0..d5db8ce 100644 --- a/command/serve.go +++ b/command/serve.go @@ -241,6 +241,14 @@ func (ph *ProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } } } + log.Error(). + Str("remote_addr", r.RemoteAddr). + Str("method", r.Method). + Str("path", r.URL.Path). + Str("decision", "denied"). + Msg("this container is not on the list of authorized ones") + http.Error(w, http.StatusText(http.StatusUnauthorized), http.StatusUnauthorized) + return /* log.Warn(). Str("remote_addr", r.RemoteAddr).