dwyl / dwyl/auth

Restrict non-admin use of Auth to localhost?

Open
#117 0 comments 0 reactions 0 assignees View on GitHub
discuss question
Dominant language
Elixir
Stars
141
Forks
8
PR merge metrics
No merged PRs in 30d

Description

At present _anyone_ can authenticate on https://dwylauth.herokuapp.com and create an App + `AUTH_API_KEY`.
That's a _good_ thing because it allows people to run [`dwyl/app`](https://github.com/dwyl/app) on their localhost with a _single_ environment variable. Right now _nobody_ is using `auth` for any other Apps, just us. So I'm not _concerned_ that anyone will abuse it in the _short_ term.

However ... giving people free-access to an authentication system without any accountability/restrictions,
that _we_ (`@dwyl`) are ultimately responsible for when (_not `if`_) someone abuses it, is probably a bad idea.

![image](https://user-images.githubusercontent.com/194400/93195173-d4e58280-f740-11ea-8e8a-b354d82ef3ee.png)

Technically the risk of abuse is mitigated by the fact that `auth` does not return the GitHub `access_token` after the `person` record is created. So the _potential_ for abuse is limited to sending someone a spam email. There is no way to perform any _action_ on behalf of the person either on GitHub or Google because the "consuming" app (_the app using `auth_plug`_) never sees the OAuth `access_token`. This was a deliberate choice from a security perspective.

If some unscrupulous person was to use our `auth` system and then send people spam emails,
and the person _receiving_ those emails were to associate our `auth` with that spam, they could _report_ our app ...

![dwyl-auth-report-abuse](https://user-images.githubusercontent.com/194400/93200460-af0fac00-f747-11ea-9f87-cb79d65eb86a.png)

With this in mind, should we consider restricting creation of `app` and `AUTH_API_KEY` to people with a specific role?
i.e: restrict all new apps to `localhost` and create a means to request derestriction?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.