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

Consider supporting token-based authentication #29

Closed
bentsherman opened this issue Jun 27, 2023 · 7 comments
Closed

Consider supporting token-based authentication #29

bentsherman opened this issue Jun 27, 2023 · 7 comments
Labels
enhancement New feature or request

Comments

@bentsherman
Copy link
Contributor

Currently, you have to provide the username and password to your MM Cloud instance. This is okay for local testing, but I think most Nextflow users will be very hesitant to do this in production, i.e. with Tower, since it's easy for credentials to be leaked and MM Cloud has the ability to create infinite compute resources.

I assume the MemVerge team already has something like this on their roadmap, but I just wanted to put it here for posterity.

Tower uses a personal access token, so you can create a token in Tower with limited permissions and use it in your launch environment. That's one way you could do it in MM Cloud.

@bentsherman
Copy link
Contributor Author

Even better, allow the user to provide the access token as an environment variable so that no credentials are exposed in their pipeline code.

As a temporary workaround, we can do this for the username and password:

// use environment variables
float {
    username = "$MMCLOUD_USERNAME"
    password = "$MMCLOUD_PASSWORD"
}

@jealous
Copy link
Contributor

jealous commented Jul 6, 2023

You are right.
For the quick fix, we could use environment variables. We may need to find a way to hide those credentials in the logs.
The token fix would take some time.

@jealous jealous added the enhancement New feature or request label Jul 6, 2023
@bentsherman
Copy link
Contributor Author

I just realized yesterday that you could use secrets for this. First use the nextflow CLI to create the secrets:

nextflow secrets set MMCLOUD_USERNAME "..."
nextflow secrets set MMCLOUD_PASSWORD "..."

Then you can access them in the config file:

float {
    username = secrets.MMCLOUD_USERNAME
    password = secrets.MMCLOUD_PASSWORD
}

Nextflow should never expose secrets in the logs. This is something users can do today, I would simply point them to it in the README as a best practice.

@jealous
Copy link
Contributor

jealous commented Jul 7, 2023

Thanks! Let me try this and add them to the README.

jealous added a commit that referenced this issue Jul 11, 2023
Enable the plugin to read credentials from the environment variable:
* MMC_ADDRESS: address of the op center
* MMC_USERNAME: login username
* MMC_PASSWORD: login password

Hide the password in the log.

Add samples in the README to illustrate how to input the credentials
with NextFlow secrets.
@jealous
Copy link
Contributor

jealous commented Jul 11, 2023

I created a PR to hide the password in the log and read the credentials from the ENV.

jealous added a commit that referenced this issue Jul 12, 2023
Enable the plugin to read credentials from the environment variable:
* MMC_ADDRESS: address of the op center
* MMC_USERNAME: login username
* MMC_PASSWORD: login password

Hide the password in the log.

Add samples in the README to illustrate how to input the credentials
with NextFlow secrets.
jealous added a commit that referenced this issue Jul 13, 2023
Enable the plugin to read credentials from the environment variable:
* MMC_ADDRESS: address of the op center
* MMC_USERNAME: login username
* MMC_PASSWORD: login password

Hide the password in the log.

Add samples in the README to illustrate how to input the credentials
with NextFlow secrets.
@jealous
Copy link
Contributor

jealous commented Jul 13, 2023

The support for secrets and env variable is in. But the support for token still needs change in MMC.

@jealous
Copy link
Contributor

jealous commented Aug 21, 2024

MMC will support token in 3.0.1. Add support in the plugin in 0.4.4

@jealous jealous closed this as completed Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants