Remove trusted proxies (#2229)

This commit is contained in:
kermieisinthehouse
2022-02-02 15:16:22 -08:00
committed by GitHub
parent a3c20ce8da
commit def9ad88b0
12 changed files with 14 additions and 120 deletions

View File

@@ -57,15 +57,10 @@ func authenticateHandler() func(http.Handler) http.Handler {
if err := session.CheckAllowPublicWithoutAuth(c, r); err != nil {
var externalAccess session.ExternalAccessError
var untrustedProxy session.UntrustedProxyError
switch {
case errors.As(err, &externalAccess):
securityActivateTripwireAccessedFromInternetWithoutAuth(c, externalAccess, w)
return
case errors.As(err, &untrustedProxy):
logger.Warnf("Rejected request from untrusted proxy: %v", net.IP(untrustedProxy))
w.WriteHeader(http.StatusForbidden)
return
default:
logger.Errorf("Error checking external access security: %v", err)
w.WriteHeader(http.StatusInternalServerError)