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

Recommend using Nextflow secrets for sensitive credentials in configs #5227

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions docs/amazons3.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,16 @@ The AWS access and secret keys can be specified by using the `aws` section in th

```groovy
aws {
accessKey = '<Your AWS access key>'
secretKey = '<Your AWS secret key>'
accessKey = secrets.MY_ACCESS_KEY
secretKey = secrets.MY_SECRET_KEY
region = '<AWS region identifier>'
}
```

:::{tip}
Use {ref}`secrets-page` to avoid hardcoding sensitive credentials in configuration files.
:::

If the access credentials are not found in the above file, Nextflow looks for AWS credentials in the following order:

1. The `nextflow.config` file in the pipeline execution directory
Expand All @@ -65,9 +69,9 @@ Learn more about [Using IAM Roles to Delegate Permissions to Applications that R
To use an AWS China region, make sure to specify the corresponding AWS API S3 endpoint in the Nextflow configuration file as shown below:

```groovy
aws {
aws {
client {
endpoint = "https://s3.cn-north-1.amazonaws.com.cn"
endpoint = "https://s3.cn-north-1.amazonaws.com.cn"
}
}
```
Expand All @@ -76,15 +80,15 @@ Read more about AWS API endpoints in the [AWS documentation](https://docs.aws.am

## S3-compatible storage

To use S3-compatible object storage such as [Ceph](https://ceph.io) or [Minio](https://min.io) specify the endpoint of
your storage provider and enable the [S3 path style access](https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html#path-style-access)
To use S3-compatible object storage such as [Ceph](https://ceph.io) or [Minio](https://min.io) specify the endpoint of
your storage provider and enable the [S3 path style access](https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html#path-style-access)
in your Nextflow configuration as shown below:


```groovy
aws {
accessKey = '<Your access key>'
secretKey = '<Your secret key>'
accessKey = secrets.MY_ACCESS_KEY
secretKey = secrets.MY_SECRET_KEY
client {
endpoint = '<Your storage endpoint URL>'
s3PathStyleAccess = true
Expand Down
4 changes: 4 additions & 0 deletions docs/aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ The AWS region is selected from the following sources, in order of descending pr
2. Environment variables - `AWS_REGION` or `AWS_DEFAULT_REGION`
3. EC2 instance metadata (if Nextflow is running in an EC2 instance)

:::{tip}
Use {ref}`secrets-page` when using Nextflow configuration files to avoid hardcoding sensitive credentials.
:::

SSO credentials and instance profile credentials are the most recommended because they don't require you to manage and distribute AWS keys explicitly. SSO credentials are ideal for launching pipelines from outside of AWS (e.g. your laptop), while instance profile credentials are ideal for launching pipelines within AWS (e.g. an EC2 instance).

## AWS IAM policies
Expand Down
36 changes: 22 additions & 14 deletions docs/azure.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ The Blob storage account name and key need to be provided in the Nextflow config
```groovy
azure {
storage {
accountName = "<YOUR BLOB ACCOUNT NAME>"
accountKey = "<YOUR BLOB ACCOUNT KEY>"
accountName = secrets.BLOB_ACCOUNT_NAME
accountKey = secrets.BLOB_ACCOUNT_KEY
}
}
```
Expand All @@ -32,6 +32,10 @@ When creating the Shared Access Token, make sure to allow the resource types `Co
The value of `sasToken` is the token stripped by the character `?` from the beginning of the token.
:::

:::{tip}
Use {ref}`secrets-page` to avoid hardcoding sensitive credentials in configuration files.
:::

Once the Blob Storage credentials are set, you can access the files in the blob container like local files by prepending the file path with `az://` followed by the container name. For example, a blob container named `my-data` with a file named `foo.txt` can be specified in your Nextflow script as `az://my-data/foo.txt`.

## Azure File Shares
Expand All @@ -47,8 +51,8 @@ For example:
```groovy
azure {
storage {
accountName = "<YOUR BLOB ACCOUNT NAME>"
accountKey = "<YOUR BLOB ACCOUNT KEY>"
accountName = secrets.BLOB_ACCOUNT_NAME
accountKey = secrets.BLOB_ACCOUNT_KEY
fileShares {
<YOUR SOURCE FILE SHARE NAME> {
mountPath = "<YOUR MOUNT DESTINATION>"
Expand Down Expand Up @@ -123,18 +127,22 @@ process {

azure {
storage {
accountName = "<YOUR STORAGE ACCOUNT NAME>"
accountKey = "<YOUR STORAGE ACCOUNT KEY>"
accountName = secrets.BLOB_ACCOUNT_NAME
accountKey = secrets.BLOB_ACCOUNT_KEY
}
batch {
location = '<YOUR LOCATION>'
accountName = '<YOUR BATCH ACCOUNT NAME>'
accountKey = '<YOUR BATCH ACCOUNT KEY>'
accountName = secrets.BATCH_ACCOUNT_NAME
accountKey = secrets.BATCH_ACCOUNT_KEY
autoPoolMode = true
}
}
```

:::{tip}
Use {ref}`secrets-page` to avoid hardcoding sensitive credentials in configuration files.
:::

In the above example, replace the location placeholder with the name of your Azure region and the account placeholders with the values corresponding to your configuration.

:::{tip}
Expand Down Expand Up @@ -454,11 +462,11 @@ azure {
}

storage {
accountName = '<YOUR STORAGE ACCOUNT NAME>'
accountName = secrets.STORAGE_ACCOUNT_NAME
}

batch {
accountName = '<YOUR BATCH ACCOUNT NAME>'
accountName = secrets.BATCH_ACCOUNT_NAME
location = '<YOUR BATCH ACCOUNT LOCATION>'
}
}
Expand All @@ -484,11 +492,11 @@ azure {
}

storage {
accountName = '<YOUR STORAGE ACCOUNT NAME>'
accountName = secrets.STORAGE_ACCOUNT_NAME
}

batch {
accountName = '<YOUR BATCH ACCOUNT NAME>'
accountName = secrets.BATCH_ACCOUNT_NAME
location = '<YOUR BATCH ACCOUNT LOCATION>'
}
}
Expand All @@ -514,11 +522,11 @@ azure {
}

storage {
accountName = '<YOUR STORAGE ACCOUNT NAME>'
accountName = secrets.STORAGE_ACCOUNT_NAME
}

batch {
accountName = '<YOUR BATCH ACCOUNT NAME>'
accountName = secrets.BATCH_ACCOUNT_NAME
location = '<YOUR BATCH ACCOUNT LOCATION>'
}
}
Expand Down
Loading