Skip to content

Commit

Permalink
[ENH] Explain how to create a secure password (#196)
Browse files Browse the repository at this point in the history
* [ENH] Explain how to create a secure password

* [FIX] broken links
  • Loading branch information
surchs authored May 9, 2024
1 parent 65f6037 commit c6e2d69
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 11 deletions.
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
2 changes: 1 addition & 1 deletion docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ and a local federation API
(everything in blue in the picture below)
that lets you search across the data in your node and in public Neurobagel nodes.

![Neurobagel node](../imgs/neurobagel_local_node.jpg)
![Neurobagel node](imgs/neurobagel_local_node.jpg)

To prepare your Neurobagel node for production use (i.e., for local or other users),
and to configure your deployment according to your specific needs,
Expand Down
2 changes: 1 addition & 1 deletion docs/query_tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Example:

If the values for all columns except for `DatasetID` and `SessionPath` in the participant-level results tsv are set to `protected`, this indicates the graph being queried has been configured (via its corresponding Neurobagel node API) to return only aggregate information about matches (due to data privacy reasons).
This configuration can be modified by setting the `NB_RETURN_AGG` environment variable to `false` (the value is by default `true`).
See related section of the documentation [here](https://neurobagel.org/infrastructure/#set-the-environment-variables).
See related section of the documentation [here](config.md#environment-variables).

Example:

Expand Down

0 comments on commit c6e2d69

Please sign in to comment.