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

How to disable the WebSocket for specific ingress #10947

Closed
cbl315 opened this issue Jan 31, 2024 · 2 comments
Closed

How to disable the WebSocket for specific ingress #10947

cbl315 opened this issue Jan 31, 2024 · 2 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@cbl315
Copy link

cbl315 commented Jan 31, 2024

For now the ingress-nginx support websocket protocol by default, refer to here.
I want to know if there is a way to disable the websocket for a specific ingress?
In our scenario, one of the service, that expose endpoints via ingress, has some security issues with it's websocket endpoints. As a workaround, we want to disable the websocket protocol for this service.

@cbl315 cbl315 added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 31, 2024
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jan 31, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@cbl315
Copy link
Author

cbl315 commented Jan 31, 2024

One workaround is refused all the request with header Connection: Upgrade by annotation server-snippets:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/server-snippet: |
      if ($http_connection ~* "(upgrade)" ){
              return 400 ;
            }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
Archived in project
Development

No branches or pull requests

2 participants