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

Internal Email/password based authentication #2837

Closed
AlexGilleran opened this issue May 18, 2020 · 3 comments · Fixed by #2847
Closed

Internal Email/password based authentication #2837

AlexGilleran opened this issue May 18, 2020 · 3 comments · Fixed by #2847
Assignees
Labels
refined Issues that have been refined, reviewed, estimated and are ready to work on

Comments

@AlexGilleran
Copy link
Contributor

AlexGilleran commented May 18, 2020

Description

Currently you have to plug Magda into some other auth provider in order to have user accounts / authentication.

This:

  • Makes it hard to setup for new users
    • In particular, it prevents us from having a working admin account from day 1
  • Forces a dependency on another service
  • Isn't really appropriate for users who can't integrate with an existing trusted SSO service, but also don't want to use something like Google or Facebook.

So it's time to provide our own username (or email) and password authentication.

Acceptance Criteria

  • An administrator with technical skills and access to the DB (i.e. one of us, or someone else who's set magda up) should be able to create a new user and set a password for them. This doesn't need to be via the UI (it can be a command-line tool that just connects direct to the DB for the first pass)
  • An administrator (as above) should be able to reset the password (once again, this could be via a CLI tool)
  • The password should be properly hashed #️⃣ and salted 🧂 - see OWASP, Troy Hunt guides on doing this properly.
  • This new login method should be available through the UI to the user
  • The login in the UI should have a "Forgot your password? Email mailto: link

Out of Scope

  • Changing passwords through the UI
  • Resetting passwords through the UI
  • "I forgot my password" button
  • Strong password requirements (initially it'll only be us using it, I trust you not to set the password to "password" unless it doesn't matter)

Technical Notes

  • Ideally this could just be another plugin for passport, along with the data.gov.au one, vanguard one etc etc etc
  • Hopefully someone's done something like this before in OSS land and we can just steal reuse it.
  • Keep everything in magda-core for now. Building it straight into the gateway is also fine if that's easier, we can pull it out later.
@AlexGilleran AlexGilleran added the unrefined Issues that are broad descriptions of something that needs doing, that need refinement before work label May 18, 2020
@AlexGilleran AlexGilleran changed the title Username/password based authentication Email/password based authentication May 20, 2020
@AlexGilleran AlexGilleran changed the title Email/password based authentication Spike: Email/password based authentication May 20, 2020
@AlexGilleran AlexGilleran changed the title Spike: Email/password based authentication Internal Email/password based authentication May 20, 2020
@AlexGilleran AlexGilleran added refined Issues that have been refined, reviewed, estimated and are ready to work on and removed spike unrefined Issues that are broad descriptions of something that needs doing, that need refinement before work labels May 20, 2020
@t83714 t83714 self-assigned this May 20, 2020
@t83714
Copy link
Contributor

t83714 commented May 21, 2020

Will use bcrypt password hasing function to generate hash.
It uses Blowfish (which is slow and defence GPU / FPGA brutal-force attack well) internally and modular crypt format (MCF) is used to encode the hashing string.
The salting round uses (default 10 increased to 12 as suggested by owasp) which should be slow enough.
Let me know if any thoughts on this @AlexGilleran

@AlexGilleran
Copy link
Contributor Author

AlexGilleran commented May 21, 2020

Seems fine to me - just make sure that it takes the same amount of time whether you get the email/password wrong or right :)

@t83714
Copy link
Contributor

t83714 commented May 21, 2020

bcrypt generally isn't susceptible to timing attacks especially our case attacker can't do offline cracking 😄
Many people discussed on the time attack topic on bcrypt see here and here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refined Issues that have been refined, reviewed, estimated and are ready to work on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants