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

[TRI-1857] Improve email whitelisting for self-hosters #833

Open
matt-aitken opened this issue Jan 11, 2024 · 0 comments · May be fixed by #877
Open

[TRI-1857] Improve email whitelisting for self-hosters #833

matt-aitken opened this issue Jan 11, 2024 · 0 comments · May be fixed by #877

Comments

@matt-aitken
Copy link
Member

matt-aitken commented Jan 11, 2024

How to do it

You can restrict access to self-hosted instances of Trigger.dev by using the WHITELISTED_EMAILS environment variable.

Like this:

WHITELISTED_EMAILS="authorized@yahoo\.com|authorized@gmail\.com"

It's a regex pattern so you can allow specific addresses or patterns of addresses, like your company's email accounts.

Problem

The barrier only exists when a user tries to login using a magic link that they've been emailed. Security wise this should be fine, but it's not a great user experience.

  • If you want to allow GitHub login then you can't restrict access.
  • Magic link emails just shouldn't be sent in the first place to emails that don't pass the test.

Solution

Keep the existing check but also:

  • Check the whitelist before sending magic link emails.
  • Check the whitelist after a user has gone through the GitHub OAuth flow and reject them if their is a whitelist and they don't match.

TRI-1857

@matt-aitken matt-aitken changed the title Improve email whitelisting for self-hosters [TRI-1857] Improve email whitelisting for self-hosters Jan 11, 2024
@Kritik-J Kritik-J linked a pull request Jan 29, 2024 that will close this issue
3 tasks
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

Successfully merging a pull request may close this issue.

1 participant