projectcontour / contour

Contour is a Kubernetes ingress controller using Envoy proxy.
https://projectcontour.io
Apache License 2.0
3.69k stars 671 forks source link

IpAllowPolicy is not applied when using passthrough mode and tcpproxy #6076

Closed therealak12 closed 2 weeks ago

therealak12 commented 7 months ago

What steps did you take and what happened:

Create an httpproxy with passthrough: true and tcpproxy set. Then try to access the host (example.com here) from an IP not included in the ipAllowPolicy. It's still accessible.

An example of such httpproxy:

apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
  name: example.com
  namespace: playground
spec:
  tcpproxy:
    services:
    - name: sample-server
      port: 8000
      weight: 100
  virtualhost:
    fqdn: example.com
    ipAllowPolicy:
    - cidr: 10.20.16.0/22
      source: Peer
    tls:
      passthrough: true

What did you expect to happen: The host should only be accessible from the source IPs specified in the ipAllowPolicy list.

Anything else you would like to add: This might be the cause:

I was wondering what's the reasoning behind this continue statement. Omitting this continue statement might resolve the issue.

Environment:

therealak12 commented 7 months ago

In not applying a configuration, this might be related to #2702 in which the OP says

With that said, it seems like there might be another issue where the TLS configuration is not being applied properly in this scenario.

therealak12 commented 7 months ago

Related issue: #2855

Bilanda commented 5 months ago

Any news about this issue ?

It looks like even without passthrough, ipAllowPolicy is still not used with tcpproxy mode.

github-actions[bot] commented 3 months ago

The Contour project currently lacks enough contributors to adequately respond to all Issues.

This bot triages Issues according to the following rules:

You can:

Please send feedback to the #contour channel in the Kubernetes Slack

therealak12 commented 3 months ago

/remove-lifecycle stale

github-actions[bot] commented 1 month ago

The Contour project currently lacks enough contributors to adequately respond to all Issues.

This bot triages Issues according to the following rules:

You can:

Please send feedback to the #contour channel in the Kubernetes Slack

github-actions[bot] commented 2 weeks ago

The Contour project currently lacks enough contributors to adequately respond to all Issues.

This bot triages Issues according to the following rules:

You can:

Please send feedback to the #contour channel in the Kubernetes Slack