-
Notifications
You must be signed in to change notification settings - Fork 10
ACME responses are blocked by auth plugins #38
Comments
Yeah that's good point, we can address that. cc @gszr In the meanwhile, there's a work around for this. Since Kong only maps a request to a single route, as long as your basic auth plugin is not applied globally, you can actually create a dummy route (similar to https://github.com/Kong/kong-plugin-acme#enable-the-plugin). So that the challenge request will map to the dummy route, not to |
Thanks @fffonion. I've verified the workaround functions but in our use case it poses a challenge: when created via the Kong ingress controller every route needs its own I did try creating a single one with a wildcard hostname, but it seems Kong's Nginx prioritizes matches with non-wildcard hostnames so that didn't work. |
@alexmbird In that case, and if i understand correctly, you can set |
I've given In case it helps here's the Kubernetes resource I'm using. Pointed to
|
plugins This ensures the ACME validation endpoints `/.well-known/acme-challenge/*` doesn't get blocked by auth plugins, causing validation failures. fixes #38
plugins This ensures the ACME validation endpoints `/.well-known/acme-challenge/*` doesn't get blocked by auth plugins, causing validation failures. fixes #38
I'm trying to use the ACME plugin to automatically provision TLS certs from LetsEncrypt and have run into a clash with the basic auth plugin. Presumably this will affect other kinds of auth too.
The setup is a simple one:
Ingress
resource (path/
) that is translated to a route by the Kong ingress controller. This is for the Kong admin service, which of course should not be exposed without auth. As the path is/
I think this satisfies the requirement that/.well-known/acme-challenge/...
fall inside a route served by Kong.KongPlugin
containing an instance of the basic auth plugin with a singleKongConsumer
setup. I've tested this and auth is being applied correctly.KongClusterPlugin
setting up the acme plugin. As it is a cluster-level plugin this will apply to all routes.As expected the acme plugin tries to get a cert from LetsEncrypt. But LE's calls to
http://my.domain/.well-known/acme-challenge/...
are met with a 401 response.To verify there isn't some other problem with the setup I've tried again with basic auth disabled; in that case the acme plugin is able to get a cert without any problem.
I believe what's wrong is that the ACME plugin runs with a lower priority (999) than basic-auth's (1001). Unfortunately at the present time Kong gives no way for the user to adjust plugin priorities. I cannot think of any reason why a user would want their ACME responses protected by auth, so please can the priority be adjusted so that the acme plugin runs first?
The text was updated successfully, but these errors were encountered: