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

TCP traffic tapping doesn't support any matching other than "any" #13803

Open
jphx opened this issue Oct 28, 2020 · 1 comment
Open

TCP traffic tapping doesn't support any matching other than "any" #13803

jphx opened this issue Oct 28, 2020 · 1 comment
Labels

Comments

@jphx
Copy link
Contributor

jphx commented Oct 28, 2020

I've been experimenting with TCP traffic tapping of an upstream cluster. E.g.,:

"transport_socket": {
    "name": "envoy.transport_sockets.tap",
    "typed_config": {
      "@type": "type.googleapis.com/envoy.extensions.transport_sockets.tap.v3.Tap",
      "common_config": {
        "admin_config": {
          "config_id": "mtu.hserver-multi-tenant-upstream.cerberus"
        }
      },
      "transport_socket": {
        "name": "envoy.transport_sockets.tls"
      }
    }
  },

This example uses the admin_config, but that's not important. My question concerns the static_config alternative as well. Continuing with the admin config example, however, if I post this document to the /tap endpoint, it captures traffic:

config_id: mtu.hserver-multi-tenant-upstream.cerberus
tap_config:
    match:
        any_match: true
    output_config:
        streaming: true
        sinks:
            - streaming_admin: {}

But if I post this document, with different match criteria, it never captures traffic, even when the header exists:

config_id: mtu.hserver-multi-tenant-upstream.cerberus
tap_config:
    match:
        http_request_headers_match:
            headers:
                - name: x-capture
                  present_match: true
    output_config:
        streaming: true
        sinks:
            - streaming_admin: {}

Possibly this is intentional. After all, I'm tapping at the TCP level, not the HTTP level. But the documentation doesn't say anything about matching (except for "any") not working when tapping at the TCP level. So I don't know if this is a bug or a documentation deficiency.

I tested with Envoy version

40de14954b29b4c1c87793482b90b27da3370f0f/1.17.0-dev/Clean/RELEASE/BoringSSL
@jphx jphx added the triage Issue requires triage label Oct 28, 2020
@mattklein123 mattklein123 added question Questions that are neither investigations, bugs, nor enhancements area/tap help wanted Needs help! and removed triage Issue requires triage question Questions that are neither investigations, bugs, nor enhancements labels Oct 28, 2020
@mattklein123
Copy link
Member

Transport level tapping doesn't support HTTP matching. I think we can do 2 things here:

  1. Better docs
  2. Possibly fail if a configuration that we can't actually match on is specified.

@mattklein123 mattklein123 self-assigned this Oct 28, 2020
@mattklein123 mattklein123 removed their assignment Mar 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants