Skip to content
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

CORS headers #796

Closed
jgillich opened this issue Nov 22, 2015 · 17 comments
Closed

CORS headers #796

jgillich opened this issue Nov 22, 2015 · 17 comments

Comments

@jgillich
Copy link

A way to set CORS headers like Access-Control-Allow-Origin would be great.

@jefferai jefferai added this to the future milestone Nov 22, 2015
@jefferai
Copy link
Member

Agreed. Not sure when it will happen, but it should be supported.

@certifiedloud
Copy link
Contributor

Until Vault supports this, you can get around the issue by using nginx (or something) as a reverse proxy that sets the headers for you.

Of course this doesn't work in every situation, but it has worked great for me.

@jgillich
Copy link
Author

That's exactly what I'm doing (I even, erm, "documented" it). IMO Vault should just allow everything in dev mode, having to deal with CORS is sooo annoying.

@jefferai
Copy link
Member

@certifiedloud @jgillich Unfortunately, that's not a solution that works for anyone sensitive to transitive trust issues, since it implies that the reverse proxy must decrypt and then re-encrypt the traffic.

@pearkes pearkes closed this as completed Apr 19, 2016
@jefferai jefferai reopened this Apr 19, 2016
@LeftyBC
Copy link

LeftyBC commented Apr 27, 2016

+1

Vault having a HTTP REST API but then not having CORS support is an issue for us as well.
I'm working on a frontend for replacing our team's password spreadsheet with something that is a lot more secure and role-based (as vault is exactly intended to do).

I'll install nginx, but that's a bit of a heavy dependency for just injecting a single header.

@naunga
Copy link
Contributor

naunga commented Oct 5, 2016

Having this feature would be great.

As I see it a moderately skilled Gopher could add this functionality in a PR, which leads me to wonder why it was not included from the start?

Does it cause anymore of an insecurity than having a proxy handle it?

Hell, I'd be happy to do it, but if there's something I'm not seeing...

Anyhow. I look forward to a response.

Cheers.

@jefferai
Copy link
Member

jefferai commented Oct 5, 2016

@naunga There are many, many things that it would be nice if Vault had from the start. If we took the time to implement all of those, there would never be a release of Vault, ever :-)

@naunga
Copy link
Contributor

naunga commented Oct 5, 2016

Yep I totally get that.

Which is why I mentioned that I'd happily submit a PR to implement it. That being said there is no sense in submitting a PR that'll be rejected for a reason like, "we discussed this for weeks and decided to never implement it, because of these reasons..."

My previous question was aimed at seeing if a PR to implement this feature would have a chance at being accepted.

@jefferai
Copy link
Member

jefferai commented Oct 5, 2016

Honestly, this hasn't been discussed as it's been very low priority -- the vast majority of Vault usage is not via direct browser calls, so CORS isn't paid attention to.

I think one item that would need to be figured out is whether such headers are configured in Vault's config file or at runtime. In general we try to keep security-sensitive items outside of Vault's configuration file but rather behind ACL'd APIs.

@naunga
Copy link
Contributor

naunga commented Oct 10, 2016

Ran into a blocker at work today where a proxy just won't work for us. It's a matter of we have close relationship with the engineers who run the vault installation, but they aren't interested in running a proxy for us. However they'd be fine with enabling CORS if Vault supported it.

So I've forked the repo and got it working. Not ready for a PR yet, because I want to put the CORS option inside the global configuration.

Certainly open to thoughts on things.

@benjic
Copy link
Contributor

benjic commented Oct 30, 2016

@jefferai Would the CORS settings fall into the core/ namespace? The LRU cache ignores this part of the namespace. Seeing as the CORS parameters would be needed per request it wold seem not feasible to do a full physical backend query without performance implications. The physical backend mechanism seems like it would be necessary to ensure HA would consistently support CORS parametrization as well.

Is there another example of a runtime parameter that is stored by vault outside of it's configuration?

@jefferai
Copy link
Member

They'd be stored there but it's reasonable to keep the current values in memory. No reason to hit the physical layer every request, cache or no, because it still requires description in that case.

@benjic
Copy link
Contributor

benjic commented Oct 30, 2016

I'm not sure how you would maintain a consistent CORS setting across all HA instances if the value is strictly kept in memory.

@jefferai
Copy link
Member

Only the active node responds to requests...

@PhillippOhlandt
Copy link

Any news on this?

@jefferai
Copy link
Member

It's being implemented in #2021 -- in fact, I should just close this in favor of it.

@PhillippOhlandt
Copy link

@jefferai cool. any ETA on the merge + release?

@pbernal pbernal removed this from the not-scheduled milestone May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants