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

Istio validatingWebhook doesn't catch Partial wildcards #42094

Closed
bvandewalle opened this issue Nov 21, 2022 · 3 comments · Fixed by #42119
Closed

Istio validatingWebhook doesn't catch Partial wildcards #42094

bvandewalle opened this issue Nov 21, 2022 · 3 comments · Fixed by #42119

Comments

@bvandewalle
Copy link

bvandewalle commented Nov 21, 2022

Bug Description

The following gateway object got added on one of our clusters:

- apiVersion: networking.istio.io/v1beta1
  kind: Gateway
  metadata:
    name: myservice
    namespace: istio-gateway
  spec:
    selector:
      istio: ingressgateway-internal
    servers:
    - hosts:
      - api.myservice.com
      - api2.myservice.com
      - '*-mr.api.myservice.com'
      port:
        name: myservice
        number: 443
        protocol: HTTPS
      tls:
        credentialName: myservice-cert
        minProtocolVersion: TLSV1_2
        mode: SIMPLE

As a result we saw the gateway pods going down with the following error:

2022-11-21T13:28:44.924187Z	warn	ads	ADS:LDS: ACK ERROR istio-ingressgateway-internal-5bccbf9cdf-mhsqx.istio-gateway-624 Internal:Error adding/updating listener(s) 0.0.0.0_443: error adding listener '0.0.0.0:443': partial wildcards are not supported in "server_names"
2022-11-21T18:28:17.981950Z	warn	Envoy proxy is NOT ready: config received from XDS server, but was rejected: cds updates: 102 successful, 0 rejected; lds updates: 0 successful, 102 rejected

This is because the hostname in the gateway object got added with a partial wildcard:

'*-mr.api.myservice.com'

Fix: This gateway object should have been denied by the validatingWebHook. Would be happy to push a fix for this if we agree that's the way to do it.

Relates to another similar report: #38343 (though that one was for a ServiceEntry).

Version

$ istioctl version
client version: 1.14.1
control plane version: 1.14.1
data plane version: 1.14.1 (324 proxies)


### Additional Information

_No response_
@bvandewalle
Copy link
Author

Actually some work started on this but went stale: #38432

@chaunceyjiang
Copy link
Member

I want to /assign, I am a newbie.I will try to find the cause of this problem. I'm not sure I can fix it

@zirain
Copy link
Member

zirain commented Nov 22, 2022

/assign chaunceyjiang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants