Proxy forward auth always granting access -> 200 #450
Labels
No labels
bug
chore
documentation
enhancement
help
in-progress
question
ready-for-release
released
translation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
adam/gate#450
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the bug:
The forward auth endpoint always returns 200 even when hit using insomnia, a logged out incognito tab or using curl. In my traefik forward auth setup it also always grants access no matter what I do.
I've also tried to add a wildcard / domain with a group no user has been assigned to explicitly deny access but still 200.
To Reproduce:
Expected behavior:
Return 403 when not identified or no rule exists.
Database Driver:
Postgres
Please set the container environment variable
ENABLE_DEBUG=true, and attempt to verify that the VoidAuth forward-auth endpoint is being hit and returning a statusCode200. You would see VoidAuth container logs that look like:From a preliminary test using the latest version and Caddy, it appears that I correctly get a status
302that redirects to the login page.Yes I have tried that and it always returns 200 with the message "access_granted"
{"timestamp":1780036266227,"level":"debug","message":"API Response Sent","details":{"request":{"ip":"10.0.3.1","method":"GET","path":"/api/authz/forward-auth"},"proxyauth":{"action":"access_granted"},"response":{"statusCode":200}}}If you would be interested in (temporarily) using theMy initial suspicion is that the host header(s) being passed to VoidAuth is of itself (auto-granted) instead of the protected resource, which could be confirmed with the additional logs. Those logs are now available in the latest release, so if you update to the most recent version should see a bit more information when access is granted.:edgetag it should show additional details of the forward-auth when access is granted in the debug logs.The following log is from a request using insomnia with no headers added:
And the same when coming from traefik:
The logs shown indicate access granted because "reason":"request_to_self_url"; that means that the X-Forwarded-* Headers being sent from your reverse-proxy to VoidAuth indicate the URL that VoidAuth itself is hosted on, instead of the protected/original URL. That could be due to a misconfiguration of the reverse-proxy forwardAuth, make sure that the Traefik config matches what is shown in the ProxyAuth docs.
It should be configured exactly as described:
voidauth traefik config:
application traefik config:
the rest of the application labels is using the same structure as voidauth since im using coolify for deployment.
I am not familiar with coolify and might be reading your configs wrong but I think some of those labels should be on the main Traefik service (or perhaps in the Traefik service startup command) instead of the VoidAuth service, and some labels on the protected application should be on VoidAuth. I will update the ProxyAuth Traefik documentation to hopefully be more clear