Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ssl_reject_handshake in Ingress and VS #1500

Merged
merged 1 commit into from
Apr 7, 2021

Conversation

pleshakov
Copy link
Contributor

Proposed changes

To handle missing or invalid TLS Secrets in Ingress and VirtualServer
resources, previously the Ingress Controller would generate the
following configuration:

ssl_certificate /etc/nginx/secrets/default;
ssl_certificate_key /etc/nginx/secrets/default;
ssl_ciphers NULL;

The configuration will break any attempts for clients to establish
TLS connections for the affected server in NGINX.

The configuration has the following limitations:

  • It requires a TLS cert and key (we used the default server Secret as
    it was always present on the file system)
  • It doesn't work if clients and NGINX use TLS v1.3: NGINX will terminate
    TLS connection.

This commit introduces the new ssl_reject_handshake directive, which
configures NGINX to break any attempt to establish a TLS connection:

ssl_reject_handshake on;

The directive addresses the mentioned limitations: it doesn't require
a TLS cert and key and works with TLS v1.3.

Changes for Changelog

  • Previously, to handle missing or invalid TLS Secrets in Ingress and VirtualServer resources, the Ingress Controller would configure NGINX to break any attempts for clients to establish TLS connections to the affected hosts using ssl_ciphers NULL; in the NGINX configuration. The method didn't work for TLS v1.3. Now the Ingress Controller uses ssl_reject_handshake on;, which works for TLS v1.3.

@pleshakov pleshakov added enhancement Pull requests for new features/feature enhancements change Pull requests that introduce a change labels Apr 2, 2021
@github-actions github-actions bot added the documentation Pull requests/issues for documentation label Apr 2, 2021
To handle missing or invalid TLS Secrets in Ingress and VirtualServer
resources, previously the Ingress Controller would generate the
following configuration:
ssl_certificate /etc/nginx/secrets/default;
ssl_certificate_key /etc/nginx/secrets/default;
ssl_ciphers NULL;

The configuration will break any attempts for clients to establish
TLS connections for the affected server in NGINX.

The configuration has the following limitations:
- It requires a TLS cert and key (we used the default server Secret as
it was always present on the file system)
- It doesn't work if clients and NGINX use TLS v1.3: NGINX will terminate
TLS connection.

This commit introduces the new ssl_reject_handshake directive, which
configures NGINX to break any attempt to establish a TLS connection:
ssl_reject_handshake on;

The directive addresses the mentioned limitations: it doesn't require
a TLS cert and key and works with TLS v1.3.
@@ -313,6 +313,7 @@ func addSSLConfig(server *version1.Server, owner runtime.Object, host string, in
}

var pemFile string
var rejectHandshake bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider assigning rejectHandshake as 'true' and handle the single case it's false? If I'm reading it right.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's 2 cases for false vs 3 cases for true

@pleshakov pleshakov merged commit 35dd67b into master Apr 7, 2021
@pleshakov pleshakov deleted the use-ssl-reject-handshake branch April 7, 2021 23:21
@ciarams87 ciarams87 removed the change Pull requests that introduce a change label Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Pull requests/issues for documentation enhancement Pull requests for new features/feature enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants