-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
server: unauthenticated http requests running as root by default? #45018
Comments
Nvm, same on secure. But |
thanks for finding this out. Will look into it. |
Found it: the alias Let's close this issue and discuss further there. |
discussed with andrei: non-auth requests should not report they are runnign as root |
We've clarified the mechanics that motivate the current behavior in this tech note: #96427. The code should still be changed/improved, but at least this way we know where we are starting from. |
96451: server: only forward the SQL identity in gRPC metadata r=andreimatei a=knz Requested by `@andreimatei` . Informs #96427. Informs #45018. Prior to this patch, we were forwarding any and all gRPC metdata during a RPC fanout. This was creating doubt and confusion, about how much data is really important/useful to forward. Analysis suggests we only care about the SQL user identity resulting from HTTP authentication. So this patch limits the forwarding to just that information. This specialization makes the forwarding logic easier to understand. This patch additionally renames functions as follows: | Old name | New name | |---------------------------------|---------------------------------------| | `userFromContext` | `userFromIncomingRPCContext` | | `getSQLUsername` | `userFromHTTPAuthInfoContext` | | `apiToOutgoingGatewayCtx` | `forwardHTTPAuthInfoToRPCCalls` | | `forwardAuthenticationMetadata` | `translateHTTPAuthInfoToGRPCMetadata` | | `propagateGatewayMetadata` | `forwardSQLIdentityThroughRPCCalls` | Release note: None Epic: None Co-authored-by: Raphael 'kena' Poss <[email protected]>
I was looking into the
/health
endpoint requiring authentication since recently, and wondering how come I still seem able to access it from my browser.It turns out it's because of this code that says that if there's an "incoming context" with metadata but no user, then the user is
root
by default because it must be " a gRPC / internal SQL connection which has root on the cluster" - which is not true; I'm doing an https request from outside the cluster.This happens to save us for the
/health
request, which doesn't actually want authentication, but is it good for all other endpoints?I've tested this on an
--insecure
cluster. Perhaps that plays a role?Jira issue: CRDB-5180
The text was updated successfully, but these errors were encountered: