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

Multiple domains support, per organization #2690

Open
arkady-marchenko opened this issue Aug 15, 2022 · 8 comments · May be fixed by #3870
Open

Multiple domains support, per organization #2690

arkady-marchenko opened this issue Aug 15, 2022 · 8 comments · May be fixed by #3870
Labels
enhancement New feature or request help wanted Extra attention is needed low priority Won't fix anytime soon, but will accept PR if provided

Comments

@arkady-marchenko
Copy link

My use case is - i have single deployment of VW, but need support different domains (company1.com, company2.com etc) per organization

I configured VW when primary domain is used for organization 1, but organization 2 accounts are configured to use another 2nd level domain. Previously 1.21 or 1.22 it was working fine. After last upgrade 1.25 i cannot download attachments. According dev console in chrome it is restricted by CORS.

I understand security concern and why that's done. But i think use case has a valid point, so i would like to request support in config or admin panel - allow to specify different domains, either

  • just global list of allowed domains, e.g. comma separated: company1.com, company2.com
  • per organization in admin panel

I'm using docker-compose deployment.
VW version is latest at the moment 1.25.2 with web 2.28.1

@BlackDex
Copy link
Collaborator

What i think we should actually do here is have the attachments use the Host header sent by the client/reverse-proxy to be used to determine the actual domain. This would also help people accessing the vault internally with a different domain then externally for example. But i think that would solve your issue as well, since now it probably sends the link to go to the currently configured DOMAIN variable, instead of using the HOST header.

@BlackDex BlackDex added enhancement New feature or request low priority Won't fix anytime soon, but will accept PR if provided labels Aug 15, 2022
@BlackDex
Copy link
Collaborator

Hmm, it looks like there is some checking done already, but it always uses the configured domain by default.
Only if that domain isn't configured it will look for other ways to determine the host.

Not setting the DOMAIN variable would help for the attachments, but it will break all other items.
There is already a mentioning of this in the meta features requests: Make email and U2F use the same domain-guessing used by attachments. But looking at the code, that isn't quite right currently. Also, there could be some security implications regarding this, so having a list of allowed host's is probably something needed in this case.

Still need to work on this though, only looked at it.

@arkadym
Copy link

arkadym commented May 11, 2023

Just courious, any news. It is quite important for me support multiple domains.

@BlackDex
Copy link
Collaborator

There is no actual work done on this. At least not by me or any other main contributor as far as i can tell (No PR's or something).
Also to be clear, per organization is not something which i think we will support. If someone wants to have domains per organization, then i suggest to run multiple Vaultwarden instance with different domain settings. It's not that Vaultwarden takes up that much resources.

Also, it makes it more secure in the sense that you split the date between the domains/organizations.
I don't think we will ever support built-in multi-tenancy within one environment, as i also do not see the benefits of this.

@arkadym
Copy link

arkadym commented May 11, 2023

Sure, but previously it was working fine. I mean there was no issue with attachments. So is there hope to at least allow it work again ? Something simple will work, e.g. list of domains instead of single fqdn name ?

@BlackDex
Copy link
Collaborator

BlackDex commented May 11, 2023

Well, a well written PR on this is always welcome.

@BlackDex BlackDex added the help wanted Extra attention is needed label May 11, 2023
@arkadym
Copy link

arkadym commented May 11, 2023

Heh, one day may be i could do that, little bit issue here - never write line of code in Rust... :)

@Ramalama2
Copy link

There is no actual work done on this. At least not by me or any other main contributor as far as i can tell (No PR's or something). Also to be clear, per organization is not something which i think we will support. If someone wants to have domains per organization, then i suggest to run multiple Vaultwarden instance with different domain settings. It's not that Vaultwarden takes up that much resources.

Also, it makes it more secure in the sense that you split the date between the domains/organizations. I don't think we will ever support built-in multi-tenancy within one environment, as i also do not see the benefits of this.

Hey blackdex, first i wannt to thank the contributors for vaultwarden, you/dani/ and everyone else :-)

Second, you tell to use multiple vaultwarden instances, which is in my opinion not a big deal either, since vaultwarden doesn't consumes any ressources in my opinion.
But im asking because, did you wanted to point out, that we can share passwords with different people from different vw instances ?
If that's the case, then there is really no reason to not spin up vw multiple times.
If it's not the case, then that's what the op probably need/want/etc...

Cheers

@BlockListed BlockListed linked a pull request Sep 9, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed low priority Won't fix anytime soon, but will accept PR if provided
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants