Conversation
Signed-off-by: Kevin Leimkuhler <kleimkuhler@icloud.com>
Signed-off-by: Kevin Leimkuhler <kleimkuhler@icloud.com>
adleong
left a comment
There was a problem hiding this comment.
If the environment variable is not provided, this will return Unauthenticated on every request? Wouldn't it be better to simply error out at startup time if the variable is missing?
Or, rather, how does this interact with the setting to disable the tap server? I'd expect this behavior:
Tap disabled + No tap svc name => Don't listen on the tap port
Tap disabled + tap svc name => Don't listen on the tap port
Tap enabled + No tap svc name => config error on startup
Tap enabled + tap svc name => listen on tap port and require client name to match
If identity is disabled, then tap must be explicitly disabled. If ideneity is enabled, then tap can either be enabled or disabled. Signed-off-by: Kevin Leimkuhler <kleimkuhler@icloud.com>
|
@adleong @hawkw Tap has now been tied to identity in the proxy config. This prevents a user from accidentally setting up a proxy environment where there is an error in expecting tap to work if identity has been explicitly disabled. The behavior now ensures that if identity has been disabled, tap must also be explicitly disabled. If identity is enabled, then tap can either be enabled or disabled. Once the above configuration has been verified, if tap is disabled then the tap service name is set to |
Signed-off-by: Kevin Leimkuhler <kleimkuhler@icloud.com>
Signed-off-by: Kevin Leimkuhler <kleimkuhler@icloud.com>
Signed-off-by: Kevin Leimkuhler <kleimkuhler@icloud.com>
There was a problem hiding this comment.
What do you think about changing the type of Config.control_listener from Option<Listener> to Option<(Listener, identity::Name)> and getting rid of the config.tap_svc_name field? This structurally enforces that a tap server MUST have a name.
This lets us consolidate parse_control_listener and parse_tap_svc_name into one function and brings all the tap config error handling into one place.
It also simplifies serve_tap since we can be guaranteed that there will be tap_svc_name.
Signed-off-by: Kevin Leimkuhler <kleimkuhler@icloud.com>
|
@adleong |
Signed-off-by: Kevin Leimkuhler <kleimkuhler@icloud.com>
|
|
||
| admin_listener: Listen<identity::Local, ()>, | ||
| control_listener: Option<Listen<identity::Local, ()>>, | ||
| control_listener: Option<(Listen<identity::Local, ()>, identity::Name)>, |
There was a problem hiding this comment.
I kept this as a tuple because we destructure it right away here. I could be convinced to add a similar TapSettings type in tap.rs, but after trying that out it seemed like a lot of boilerplate for not much of an abstraction.
There was a problem hiding this comment.
@kleimkuhler FWIW, it looks like we also access a field of the tuple here, which is a little unclear out of context (though not a big deal).
There was a problem hiding this comment.
Yep I should have pointed that out too. For the clarity we gain in that access though, it still seemed a little unnecessary to add a new struct for it.
hawkw
left a comment
There was a problem hiding this comment.
I noticed some potential test improvements + some other nits that are not really blocking.
| /// Where to listen for connections initiated by the control plane. | ||
| pub control_listener: Option<Listener>, | ||
| /// Where to listen for connections initiated by the tap service. | ||
| pub control_listener: Option<TapSettings>, |
There was a problem hiding this comment.
Nit/TIOLI: If this is tap-specific, and contains more than just a listener configuration, what do you think of renaming the field to tap_settings or something?
There was a problem hiding this comment.
Yep sounds good!
There was a problem hiding this comment.
@hawkw A naming change like this touches a few places in main.rs that were not before. I may default to a separate PR to keep the diff down. I feel like we usually default to this so I'm going to as well in this case.
There was a problem hiding this comment.
Especially since @adleong has already approved. I don't want to introduce additional changes that were not there before
|
|
||
| admin_listener: Listen<identity::Local, ()>, | ||
| control_listener: Option<Listen<identity::Local, ()>>, | ||
| control_listener: Option<(Listen<identity::Local, ()>, identity::Name)>, |
There was a problem hiding this comment.
@kleimkuhler FWIW, it looks like we also access a field of the tuple here, which is a little unclear out of context (though not a big deal).
Signed-off-by: Kevin Leimkuhler <kleimkuhler@icloud.com>
|
I opened linkerd/linkerd2#3197 to track renaming |
* update-rust-version: Check usage (linkerd/linkerd2-proxy#298) * tap: fix tap response streams never ending (linkerd/linkerd2-proxy#299) * Require identity on tap requests (linkerd/linkerd2-proxy#295) * Authority label should reflect logical dst (linkerd/linkerd2-proxy#300) * Replace futures_watch with tokio::sync::watch (linkerd/linkerd2-proxy#301)
* Update h2 to v0.1.26 * Properly fall back in the dst_router (linkerd/linkerd2-proxy#291) * Tap server authorizes clients when identity is expected (linkerd/linkerd2-proxy#290) * update-rust-version: Check usage (linkerd/linkerd2-proxy#298) * tap: fix tap response streams never ending (linkerd/linkerd2-proxy#299) * Require identity on tap requests (linkerd/linkerd2-proxy#295) * Authority label should reflect logical dst (linkerd/linkerd2-proxy#300) * Replace futures_watch with tokio::sync::watch (linkerd/linkerd2-proxy#301) * metrics: add `request_handle_us` histogram (linkerd/linkerd2-proxy#294) * linkerd2-proxy: Adopt Rust 2018 (linkerd/linkerd2-proxy#302) * Remove futures-mpsc-lossy (linkerd/linkerd2-proxy#305) * Adopt std::convert::TryFrom (linkerd/linkerd2-proxy#304) * lib: Rename directories to match crate names (linkerd/linkerd2-proxy#303)
* update-rust-version: Check usage (linkerd/linkerd2-proxy#298) * tap: fix tap response streams never ending (linkerd/linkerd2-proxy#299) * Require identity on tap requests (linkerd/linkerd2-proxy#295) * Authority label should reflect logical dst (linkerd/linkerd2-proxy#300) * Replace futures_watch with tokio::sync::watch (linkerd/linkerd2-proxy#301) * metrics: add `request_handle_us` histogram (linkerd/linkerd2-proxy#294) * linkerd2-proxy: Adopt Rust 2018 (linkerd/linkerd2-proxy#302) * Remove futures-mpsc-lossy (linkerd/linkerd2-proxy#305) * Adopt std::convert::TryFrom (linkerd/linkerd2-proxy#304) * lib: Rename directories to match crate names (linkerd/linkerd2-proxy#303)
* update-rust-version: Check usage (linkerd/linkerd2-proxy#298) * tap: fix tap response streams never ending (linkerd/linkerd2-proxy#299) * Require identity on tap requests (linkerd/linkerd2-proxy#295) * Authority label should reflect logical dst (linkerd/linkerd2-proxy#300) * Replace futures_watch with tokio::sync::watch (linkerd/linkerd2-proxy#301) * metrics: add `request_handle_us` histogram (linkerd/linkerd2-proxy#294) * linkerd2-proxy: Adopt Rust 2018 (linkerd/linkerd2-proxy#302) * Remove futures-mpsc-lossy (linkerd/linkerd2-proxy#305) * Adopt std::convert::TryFrom (linkerd/linkerd2-proxy#304) * lib: Rename directories to match crate names (linkerd/linkerd2-proxy#303)
Motivation
With linkerd/linkerd2#3155 merging, proxy containers will now always have the
LINKERD2_PROXY_TAP_SVC_NAMEvariable in their environment. This variable can now be reliably used to check that the client names of incoming tap requests match this value.If the values do not match, we will always return the gRPC Unauthenticated status code. If the values do match, we will accept the connection.
If there is no client identity, we will similarly return the gRPC Unauthenticated status code.
Closes linkerd/linkerd2#3157
Closes linkerd/linkerd2#3163
Signed-off by: Kevin Leimkuhler kleimkuhler@icloud.com