-
Notifications
You must be signed in to change notification settings - Fork 977
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
Configurable webhook header filter #4290
Comments
I'm on Kratos v.1.3.0. I'm absolutely gutted that this header filtering was added without the possibility to add more headers to the allowlist in Kratos configuration. Recently updated Kratos to the latest version in our system and it broke some functionalities which relied on specific headers existing on the webhook requests as part of Kratos flows. Cannot downgrade as we need some latest Kratos features. What was the benefit of strict allowlist for webhook request headers? |
The workaround is a good option in my view. @robert-sisutech is that workaround not working for you? We have removed other headers due to security issues in our infra. At the moment there are no plans to change this |
Is there any reason why a config option wouldn't work? This seems like a very instance-specific thing. |
Not really (other than adding yet more config options), but it’s not a priority given that a workaround exists and we have no need for it! |
@aeneasr would this be a per-webhook or instance-wide config? Doing it instance-wide would probably be a slightly easier implementation but I could imagine a scenario where someone wants to be selective about what hooks get what headers. |
@aeneasr we have like around 5 headers we require to be on the request and that we would need to be able to read in Kratos' webhook request handler. Adding strict filtering of headers for everyone using Ory Kratos due to your infra's security concerns isn't a really thoughtful decision in my opinion. Many of us still need access to other headers thus why I and I imagine some more developers would want the headers allowlist to be configurable or at least it should be possible to disable the strict headers filtering. |
Did you see my last reply? Regarding your message pre-edit: We are listening to OSS community demands but as you know running such a large project isn’t free and our priorities are with people who pay us to maintain and advance this project (otherwise it would be long dead). It’s even more frustrating when other companies use our stuff, demand a lot, make a lot of money with their customers, but don’t give back except frustrated messages. So please don’t get frustrated but stay constructive. By the way, if you rely on that many headers, maybe transient payloads are a better option for you.
Global should be fine, otherwise the config gets really convoluted. The biggest challenge is probably figuring out where to put the config key. |
@aeneasr The aforementioned headers are something we don't have much control over. We could re-assign the headers but we cannot move them to transient payload while the request is in-flight. We don't add the headers ourself at the source of the request. The headers get added while the request is in flight in one part of our reverse-proxy/firewall/gateway of our infra. Transient payload is a good option if we can allow the data to be editable by end-user. In this case we don't want the end-user to have control of the data put in these headers so transient_payload unfortunately is not an option for us in this case. Transient payload however comes in very handy in some other flows we have. I regret the tone in my pre-edit message. Edited it for a reason. I appreciate something like Ory Kratos exists and is open-source and available for everybody to use. What would make the situation with strict headers allowlist better for some of us would be:
|
Apology accepted, no problem :) I feel making the headers configurable strikes a balance between security and customizability and would not need recompilation in case more headers are added to the allow list |
Preflight checklist
Ory Network Project
No response
Describe your problem
I talked about this a bit on slack, but the header filter implemented by #4048 is somewhat arbitrary and doesn't work for some configurations or use cases (for example, where you use
x-forwarded-for
instead oftrue-client-ip
to get client IP, or if you need to process injected telemetry from a header).Describe your ideal solution
Ideally there is a config value for allowed headers, possibly defaulting to the current list to avoid making significant changes.
Workarounds or alternatives
For getting the client IP, I've updated my proxy configuration to set
True-Client-IP
.Version
v1.3.1
Additional Context
No response
The text was updated successfully, but these errors were encountered: