configure admin endpoint as a listener/http-filter (e.g. to secure via RBAC)#11367
configure admin endpoint as a listener/http-filter (e.g. to secure via RBAC)#11367cstrahan wants to merge 2 commits intoenvoyproxy:masterfrom
Conversation
There are various singletons that must be initialized before the admin listener can be added.
| repeated core.v3.SocketOption socket_options = 4; | ||
|
|
||
| // Static :ref:`Listener <envoy_api_msg_config.listener.v3.Listener>`. | ||
| listener.v3.Listener listener = 5; |
There was a problem hiding this comment.
One question I have on this API is whether we should have a Listener embedded in admin or somehow provide an admin filter that can be hooked into an arbitrary listener? I suspect what you have is the right thing given how admin works today, since it probably wants to be running on the main thread for thread safety with some of the data structures it serves. CC @envoyproxy/api-shepherds
However, by placing a listener here, it's providing a bigger "hole" than is needed. Listeners can be configured to do lots of things, e.g. act as a Thrift proxy, and only a narrow slice of this configuration will apply. Can you document how Listener is intended to be used when configured inside the Admin message?
There was a problem hiding this comment.
My gut reaction is this config is right, but we should document the restrictions of the listener config which can be checked in code. I had discussed this offline with @cstrahan. So yeah +1 for documentation on the restrictions of the listener object and all of the check we should do in code on the config.
There was a problem hiding this comment.
I think I'd rather see it as a normal http filter attached to a normal listener. For things that must happen on the main thread, have the filter send a message back and forth for that work.
I'm worried that running arbitrary code on the main thread will expose issues because nobody intended all the non-admin filters or listener code to run on the main thread.
There was a problem hiding this comment.
For things that must happen on the main thread, have the filter send a message back and forth for that work.
I think this will likely end up being a really huge effort, though it's technically possible for sure.
There was a problem hiding this comment.
Another way of accomplishing the same thing is to post the entire request from the worker to the main thread, and post the response back to the worker. So leave everything done by the current admin endpoint on the main thread, and leave all the normal listener and filter-chain stuff on the worker thread.
|
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
This pull request has been automatically closed because it has not had activity in the last 14 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
Can we re-open this? Also, in which direction should this move: a regular http filter on a regular listener (as per @ggreenway's suggestion), or remain a special listener configured within the existing Admin config (as discussed with @mattklein123 earlier, and as the PR currently stands)? |
My feeling is that it would be simpler if this were a special listener. I think dong this is a normal listener with all of the posting back and forth is likely to be more complicated than we would like, though it's certainly possible. @ggreenway? |
My feeling is the opposite: we'll run into more corner cases by running all the regular listener/filter code on the main thread. I think it can be limited to a single post in each direction, roughly what is done currently for Also, after thinking about this more, I think it would make the most sense for this to be a Route I don't feel super strongly about this; Matt, if you do feel strongly, let's do it on the main thread. |
I don't feel that strongly either. I do have some concerns about whether a listener gets delivered over LDS and gets removed over post, multiple listeners that have the admin filter, etc., but maybe it doesn't matter if we are posting everything and are careful about using weak pointers and locking, etc. @cstrahan do you want to give it a shot and see how it goes? |
|
@cstrahan bump |
|
/wait |
Yes, I'll give that a go and report back -- thanks for the feedback, @ggreenway & @mattklein123. |
|
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
@cstrahan status please? |
|
Just a heads up that I'm working through the suggested changes. I'll report back soon with any new developments, or new open questions. |
|
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
This pull request has been automatically closed because it has not had activity in the last 14 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
Is it still in progress? |
|
@cstrahan is still working on it, he can report on any progress |
|
This is slow going, but this is still in the works. |
|
@cstrahan do you recall what happened to this? |
Commit Message: configure admin endpoint as a listener/http-filter (e.g. to secure via RBAC)
Additional Description: This adds the ability to configure the admin endpoint listener directly, allowing for RBAC policies to be declared (among other things).
Risk Level: Medium
Testing: in progress
Docs Changes: The admin listener may now be configured by a Listener message.
Release Notes:
Fixes #2763
This is still a work in progress, but I'd like to get feedback on the general approach, and a little assistance with some problems I've run into.
Some things I know need to change:
AdminFilterConfig::createFilterFactoryFromProtoTyped, I shouldn't be downcastingcontext.admin()toAdminImpl&, but I don't yet know how I should approach this.class AdminImpl, which currently still implementsNetwork::FilterChainManager,Network::FilterChainFactory, etc (no longer needed, since I'm now using the server'slistener_manager_).That's with this config: