Skip to content

feat: allow disabling HTTPS redirect#86

Merged
thesuperzapper merged 1 commit into
deployKF:mainfrom
thesuperzapper:feat-allow-disable-https-redirect
Jan 27, 2024
Merged

feat: allow disabling HTTPS redirect#86
thesuperzapper merged 1 commit into
deployKF:mainfrom
thesuperzapper:feat-allow-disable-https-redirect

Conversation

@thesuperzapper

@thesuperzapper thesuperzapper commented Jan 27, 2024

Copy link
Copy Markdown
Member

This PR makes it possible to disable the HTTP->HTTPS redirect on the gateway with a new deploykf_core.deploykf_istio_gateway.gateway.tls.redirect value (default: true), and thus allows clients to talk over HTTP to the gateway.

We also introduced the deploykf_core.deploykf_istio_gateway.gateway.tls.clientsUseHttps value (default: true) which is how deployKF decides what protocol of links and cookies presented to client browsers.

WARNING: There is only ONE case where clients should talk to the gateway over HTTP. When the "client" is a proxy/load-balancer that is providing the actual "end users" its own TLS termination, but is unable to communicate with the backend over HTTPS.


Advanced Stuff:

We implement authentication using EnvoyFilters, we insert a bunch of HTTP_FILTER to the listener chain. These filters are set to do nothing by default, and are enabled per-route by selecting from VirtualServices which select our deploykf-gateway Gateway.

The problem is that we are unable to select routes by Gateway for HTTP listeners (istio/istio#46459), which means that authentication would not be enabled properly over HTTP.

We resolved this issue by simply making the HTTP listener an internal proxy to our HTTPS routes, which means that all HTTP requests end up on the HTTPS routes (which have authentication correctly set up), at the expense of one additional proxy hop.

For this reason, we no longer allow users to set deploykf_core.deploykf_istio_gateway.gateway.tls.enabled to false. However, we have left the value in the templates, so that if in the future, it becomes possible to avoid this work-around, we can more easily return to allowing users to disable the HTTPS listener on the gateway.

@thesuperzapper
thesuperzapper merged commit 9e84e77 into deployKF:main Jan 27, 2024
@thesuperzapper
thesuperzapper deleted the feat-allow-disable-https-redirect branch January 27, 2024 23:56
@thesuperzapper thesuperzapper added this to the v0.1.4 milestone Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant