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

[ENH] Explain how to create a secure password #196

Merged
merged 2 commits into from
May 9, 2024
Merged
Changes from 1 commit
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
36 changes: 27 additions & 9 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,6 @@ Below are all the possible Neurobagel environment variables that can be set in `

{{ read_table('./repos/recipes/docs/neurobagel_environment_variables.tsv') }}

At minimum, we recommend reviewing and changing the values of the following variables in `.env` for security purposes:

> `NB_GRAPH_ADMIN_PASSWORD`
> `NB_GRAPH_USERNAME`
> `NB_GRAPH_PASSWORD`
> `NB_GRAPH_DB`
> `NB_RETURN_AGG`
> `NB_API_QUERY_URL`

??? warning "Ensure that shell variables do not clash with `.env` file"

If the shell you run `docker compose` from already has any
Expand All @@ -92,6 +83,33 @@ At minimum, we recommend reviewing and changing the values of the following vari
!!! tip
Double check that any environment variables you have customized in `.env` are resolved with your expected values using the command `docker compose config`.

### Change security relevant variables

At minimum, we recommend reviewing and changing the values of the following variables in `.env` for security purposes:

> `NB_GRAPH_ADMIN_PASSWORD`
> `NB_GRAPH_USERNAME`
> `NB_GRAPH_PASSWORD`
> `NB_GRAPH_DB`
> `NB_RETURN_AGG`
> `NB_API_QUERY_URL`

Make sure to use a secure password for the `NB_GRAPH_ADMIN_PASSWORD` and `NB_GRAPH_PASSWORD` variables.
Here is how you can create a random password in the terminal:

```bash
openssl rand -hex 16
```

??? info "Passwords are handled as Docker secrets"

Although the `NB_GRAPH_ADMIN_PASSWORD` and `NB_GRAPH_PASSWORD` variables are set in the `.env` file,
they are passed to the containers as [Docker secrets](https://docs.docker.com/engine/swarm/secrets/).
This ensures that your passwords are not exposed in the container logs or in the `docker-compose.yml` file.

Make sure to not share your `.env` file with others,
especially if it contains sensitive information like passwords.

## `local_nb_nodes.json`

This file is only used by deployment profiles that include the federation API.
Expand Down
Loading