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

Update default backend to add TLS >=1.2 support #9166

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

JJotah
Copy link

@JJotah JJotah commented Oct 15, 2022

What this PR does / why we need it:

Security issue with TLS < 1.2 https://github.com//issues/9155

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • CVE Report (Scanner found CVE and adding report)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation only

Which issue/s this PR fixes

#9155

How Has This Been Tested?

  • Deploy this helm chart
  • Point to the default backend
  • Execute nmap --script ssl-enum-ciphers -p PORT with the URL

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have added unit and/or e2e tests to cover my changes.
  • All new and existing tests passed.
  • Added Release Notes.

Does my pull request need a release note?

Any user-visible or operator-visible change qualifies for a release note. This could be a:

  • CLI change
  • API change
  • UI change
  • configuration schema change
  • behavioral change
  • change in non-functional attributes such as efficiency or availability, availability of a new platform
  • a warning about a deprecation
  • fix of a previous Known Issue
  • fix of a vulnerability (CVE)

No release notes are required for changes to the following:

  • Tests
  • Build infrastructure
  • Fixes for unreleased bugs

For more tips on writing good release notes, check out the Release Notes Handbook

### 4.4.0
- Update Default Backend due TLS < 1.2 Security Issue

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 15, 2022
@k8s-ci-robot k8s-ci-robot added the area/helm Issues or PRs related to helm charts label Oct 15, 2022
@k8s-ci-robot k8s-ci-robot requested a review from cpanato October 15, 2022 11:45
@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Oct 15, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @JJotah!

It looks like this is your first PR to kubernetes/ingress-nginx 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/ingress-nginx has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @JJotah. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 15, 2022
Copy link
Contributor

@Volatus Volatus left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. See comments for some suggestions.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 19, 2022
@bmv126
Copy link

bmv126 commented Oct 20, 2022

@JJotah
I have few queries on the package:

  1. Why /healthz path is being removed ? Will it not cause breaking change ?
    https://kubernetes.github.io/ingress-nginx/user-guide/default-backend/

  2. Also I do not see ssl being set in listen directive in the default.conf. How it will resolve the tls 1.2 >= issue ?
    https://github.com/kubernetes/ingress-nginx/pull/9166/files#diff-86820e49f1b0e9f1c20d6f68cef87b3692f7957e44874b5fc064c5a9c8683762R5

  3. What about custom-error via default backend ? Is it still supported ?
    https://github.com/kubernetes/ingress-nginx/tree/main/images/custom-error-pages

@JJotah
Copy link
Author

JJotah commented Oct 20, 2022

@JJotah I have few queries on the package:

1. Why /healthz path is being removed ? Will it not cause breaking change ?
   https://kubernetes.github.io/ingress-nginx/user-guide/default-backend/

2. Also I do not see ssl being set in listen directive in the default.conf. How it will resolve the tls 1.2 >= issue ?
   https://github.com/kubernetes/ingress-nginx/pull/9166/files#diff-86820e49f1b0e9f1c20d6f68cef87b3692f7957e44874b5fc064c5a9c8683762R5

3. What about custom-error via default backend ? Is it still supported ?
   https://github.com/kubernetes/ingress-nginx/tree/main/images/custom-error-pages

Hi @bmv126
1.- we don't need to pass healthz because the healtz is on the 80 port

2.- The issue is when you have a certificate in your load balancer (example AWS) and automatically defaultBackend enables de tls with the policy default created

3.- We can use custom error pages dockerfile for the moment in the values

@longwuyuan
Copy link
Contributor

longwuyuan commented Oct 20, 2022 via email

@JJotah
Copy link
Author

JJotah commented Oct 20, 2022

@JJotah, does this mean that this change is only relevant for TLS Termination in LB instead of TLS termination in controller ?

On Thu, Oct 20, 2022 at 10:03 PM Juan José Ruiz Romero < @.> wrote: @JJotah https://github.com/JJotah I have few queries on the package: 1. Why /healthz path is being removed ? Will it not cause breaking change ? https://kubernetes.github.io/ingress-nginx/user-guide/default-backend/ 2. Also I do not see ssl being set in listen directive in the default.conf. How it will resolve the tls 1.2 >= issue ? https://github.com/kubernetes/ingress-nginx/pull/9166/files#diff-86820e49f1b0e9f1c20d6f68cef87b3692f7957e44874b5fc064c5a9c8683762R5 3. What about custom-error via default backend ? Is it still supported ? https://github.com/kubernetes/ingress-nginx/tree/main/images/custom-error-pages Hi @bmv126 https://github.com/bmv126 1.- we don't need to pass healthz because the healtz is on the 80 port 2.- The issue is when you have a certificate in your load balancer (example AWS) and automatically defaultBackend enables de tls with the policy default created 3.- We can use custom error pages dockerfile for the moment in the values — Reply to this email directly, view it on GitHub <#9166 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGZVWXC2IOPZURBHZ637HDWEFX6TANCNFSM6AAAAAARF4CUXY . You are receiving this because you are subscribed to this thread.Message ID: @.>
-- ; Long Wu Yuan

Hi @longwuyuan
Yeah, 2 things here
The current docker image from k8s registry as ingress controller we shouldn't use that

Second sure, to create new ingress controller and you didn't specify de policy in lb automatically in 443 create de default one (I only tested in AWS) and use tls 1.0 tls 1.1 that is a security issue

| defaultBackend.image.runAsNonRoot | bool | `true` | |
| defaultBackend.image.runAsUser | int | `65534` | |
| defaultBackend.image.tag | string | `"1.5"` | |
| defaultBackend.image.tag | string | `"1.19.10-alpine"` | |
Copy link
Contributor

Choose a reason for hiding this comment

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

can we use the last nginx version?

registry: registry.k8s.io
image: defaultbackend-amd64
repository: nginx
tag: 1.19.10-alpine
Copy link
Contributor

Choose a reason for hiding this comment

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

same here, let's use latest nginx version (not :latest, but v1.22 etc)

Copy link
Member

Choose a reason for hiding this comment

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

Lets go ahead and use
cgr.dev/chainguard/nginx:1.23.1@sha256:310f9a01fc3e7a9410ae7ea1d9cac5add66d3f95d081efa6693a829e1b6aaa70

@rikatz
Copy link
Contributor

rikatz commented Oct 25, 2022

@strongjz what if we use https://github.com/chainguard-images/nginx ? I would love to use distroless here instead of some alpine image :)

@strongjz
Copy link
Member

strongjz commented Nov 4, 2022

/kind feature
/triage accepted
/priority backlog

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/backlog Higher priority than priority/awaiting-more-evidence. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority labels Nov 4, 2022
@JJotah
Copy link
Author

JJotah commented Nov 4, 2022

@strongjz what if we use https://github.com/chainguard-images/nginx ? I would love to use distroless here instead of some alpine image :)

Ok agree let me work on it

@rikatz
Copy link
Contributor

rikatz commented Nov 20, 2022

@JJotah let me know on this :)

@k8s-ci-robot
Copy link
Contributor

@JJotah: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 9, 2023
@strongjz
Copy link
Member

Please rebase and fix the merge conflicts.

@longwuyuan
Copy link
Contributor

@JJotah are you still available to make progress on this ?

@Gacko @strongjz @rikatz we need to get this done for the users who enable default-backend.

Copy link
Member

@Gacko Gacko left a comment

Choose a reason for hiding this comment

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

Do not merge. I'd rather have this stuff in the image than wrapped in the chart.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: JJotah
Once this PR has been reviewed and has the lgtm label, please assign ubergesundheit for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@longwuyuan
Copy link
Contributor

@Gacko Please elaborate "in the image". I only understand that its optional and when someone opts-in from the values file, only then the default-backend-deployment gets spec'd with the image that @rikatz and @strongjz discussed.

@Gacko
Copy link
Member

Gacko commented Sep 4, 2024

We can make the default backend image safe by default. I would not implement the whole TLS stuff in the chart. This is not useful and a lot of this stuff like the default 404 response belongs into the image IMHO.

@longwuyuan
Copy link
Contributor

ok. So are you going to use the $ROOT/images/custom-error-pages itself as the default-backend or are you going to create a new image ?

@Gacko
Copy link
Member

Gacko commented Sep 4, 2024

Actually I wasn't even aware the default backend is using TLS. I mean, it only serves a 404 and plain text. No user data should be transferred to it - so why should it serve TLS after all?

@longwuyuan
Copy link
Contributor

I am confused on that as well. Need to think through the workflow to answer your question. But one factor to note here is that this user is talking about a response from enabling default-backend, when the termination of TLS on a NLB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/helm Issues or PRs related to helm charts cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. priority/backlog Higher priority than priority/awaiting-more-evidence. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants