-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[NP] Hide Authorization header on KibanaRequest #55670
Comments
Pinging @elastic/kibana-platform (Team:Platform) |
Isn't this going to be blocker for plugins that actually relies on accessing the @tsullivan Could you confirm/infirm that? |
It might require additional work from the platform team to provide an alternative solution, but restricting access to the |
I understand the need and concern regarding security. However, accessing them is a blocking requirement for (at least) reporting. We can't implement this before having a proper alternative to answer the plugins' need. @elastic/kibana-security Do you have any suggestion on how plugins such as reporting should be accessing the Authz headers after this change? One example in const jobDocPayload: JobDocPayloadPanelCsv = await createJobFn(
jobParams,
request.headers, // <---
request
); return async function createJob(
jobParams: JobParamsPanelCsv,
headers: any,
req: RequestFacade
): Promise<JobDocPayloadPanelCsv> {
const { savedObjectType, savedObjectId } = jobParams;
const serializedEncryptedHeaders = await crypto.encrypt(headers); // <--- |
That is correct, and thank you so much for catching this, @pgayvallet Reporting captures the request headers from the user that created the reporting job through the UI. The headers are encrypted, and stored in the reporting job document in Sources:
|
@pmuellr could it affect alerting plugin somehow? As I can see you use ApiKey, asking if I missed something
|
Yes, I think it will, as we "fake request" things with an API key - @mikecote is more familiar with these bits than I. Just in general, we're find clients of alerting wanting more and more access to things that they normally get off a request, but are needed when the alert function runs, in the background, without an active request available. The last request was for uiSettings (legacy), which is fairly easily accommodated by creating one by hand with our "fake" SO client (which we already provide). Seems like the right answer is to provide 1st class support for creating a "request" object that alerting can hand to the alert functions, outside of the context of an incoming http request. We already have the space and API key, not sure what else would be required to create one of these - let's call it "transactional request object". It would then need to be augmented with all the other context-y bits. Certainly, it's a separate issue :-) . Or do we already have a similar issue open somewhere? I wonder if Make It Slow impacts this stuff as well? Seems like that could have similar issues - wanting to run some user-specific Kibana code long after some "slow" transaction was started with an http request to Kibana. |
We create fake requests with authorization headers to access a scoped saved objects client and a scoped admin client (Elasticsearch). Once we pass the request to those, we no longer need to access the authorization headers. @pmuellr is right where we may later on need more features that are scoped to the user without a real request. Usage here: kibana/x-pack/legacy/plugins/alerting/server/plugin.ts Lines 133 to 137 in 9d4414d
Where |
The proxy project was suspended indefinitely. We should revert #39506 to prevent plugins from accessing the
Authorization
header.The text was updated successfully, but these errors were encountered: