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

Initial auth key implementation #57

Merged
merged 63 commits into from
Oct 12, 2023
Merged

Initial auth key implementation #57

merged 63 commits into from
Oct 12, 2023

Conversation

hategan
Copy link
Collaborator

@hategan hategan commented Aug 25, 2023

This implements a workflow for requesting authentication keys through email.

The flow starts with an authentication token request page, which is a capthca-protected email entry. By default, free email services are rejected, but the user is given the opportunity to ask for an exception by justifying, in plain language, why an exception should be made. An admin email then receives the respective text and can approve or deny the request. If using an institutional email or if the exception request is approved, an email with a token is sent to the user. The user is given instructions on how to save and use the token.

Tokens are stored salted and hashed in the database, so a compromise to the database does not mean that the tokens are compromised.

@hategan hategan marked this pull request as draft August 25, 2023 16:58
@hategan
Copy link
Collaborator Author

hategan commented Aug 25, 2023

This is currently a draft because I want to make sure the deployment scripts properly install and configure relevant packages (e.g., postfix)

Copy link
Collaborator

@andre-merzky andre-merzky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the approach. It's quite some machinery though to get this up and running (postfix). But I don't see a better generic way either... :-/

@hategan
Copy link
Collaborator Author

hategan commented Aug 29, 2023

I like the approach. It's quite some machinery though to get this up and running (postfix). But I don't see a better generic way either... :-/

Yeah, I was worried about the same thing. But then I managed to set postfix up on my laptop fairly easily and it worked surprisingly well.

I'll deploy this on a test server so we can test it out. One thing that would be nice is a mailing list to send admin requests to.

@hategan hategan marked this pull request as ready for review September 1, 2023 03:37
@hategan
Copy link
Collaborator Author

hategan commented Sep 1, 2023

This should now be ready for review.
It goes together with ExaWorks/psij-python#408
There is a deployment on https://psij.testingeval.psij.io and https://sdk.testingeval.psij.io

You should use psij-ci-setup with PR #408 in psij-python and make sure you set server_url = https://psij.testingeval.psij.io in testing.conf before invoking psij-ci-setup, since the prompts are based on that setting. However, because #408 is not merged yet and the CI driver is always taken from main, you'll need to manually add the key in testing.conf by saying key = "<contents of ~/.psij/key>" (note that it's ~/.psij/key and not ~/.psij/.key -- the dotted one is the old style key and these are only accepted by the server if used previously, which won't be the case for the testing server).

For the SDK, most of this story won't matter and you'll have to request a key manually at https://sdk.testingeval.psij.io/auth.html. For now, you'll also have to send me your email address because the testing server is using a temporary mail gateway (AWS SES) that requires all destination emails to be verified before use.

A note: AWS automatically blocks egress on port 25, so I had to use a mail gateway. However, I got them to remove the block on the LLNL AWS instances and I'll try to configure postfix to send mails directly, but probably not tonight.

@hategan hategan merged commit 1e7ecfd into main Oct 12, 2023
1 check passed
@hategan hategan deleted the require_email_address branch October 12, 2023 16:20
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 this pull request may close these issues.

2 participants