Skip to content

Commit 929906b

Browse files
committed
Updating Grafana security details
1 parent df78be9 commit 929906b

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

docs/admin/observability/metrics.mdx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,24 @@ sshuttle -r user@host 0/0
8282

8383
Grafana will be available at http://host:3370/-/debug/grafana.
8484

85-
### Grafana Security
85+
### Grafana security
8686

8787
<Callout type="warning">
8888
WARNING: By default, our Grafana container runs in anonymous mode with authentication disabled, relying on Sourcegraph's authentication and authorization when accessed through your Sourcegraph instance.
8989

90-
We recommend you use your network security controls to prevent access to Grafana's listening ports, or enable Grafana's builtin authentication.
90+
We recommend you use your network security controls to prevent access to Grafana's listening port, or enable Grafana's built-in authentication.
9191
</Callout>
9292

93-
To enable Grafana's builtin authentication, configure the `GF_AUTH_ANONYMOUS_ENABLED` environment variable to `false` in the Grafana container's environment variables in your deployment override file.
93+
To enable Grafana's built-in authentication, configure the `GF_AUTH_ANONYMOUS_ENABLED` environment variable to `false` in the Grafana container's environment variables in your deployment override file, then redeploy the Grafana container.
9494

95-
We also recommend that you customize the default admin username and password by configuring the `GF_SECURITY_ADMIN_USER` and `GF_SECURITY_ADMIN_PASSWORD` environment variables, using your secrets management tool in your deployment pipeline.
95+
We also recommend that you customize the default admin username and password.
96+
97+
For new deployments, configure the `GF_SECURITY_ADMIN_USER` and `GF_SECURITY_ADMIN_PASSWORD` environment variables on the Grafana container, using your deployment pipeline's secrets management tool, to initialize the default admin user. Changing these environment variables do not change the username or password after the user is initialized on first deployment.
98+
99+
For existing deployments, you can either:
100+
101+
1. Log in to the Grafana web UI with the default credentials, and it will prompt you to change the password.
102+
2. Or, configure the environment variables the same as a new instance, delete the Grafana container's storage volume, and restart the Grafana container. This will cause Grafana to re-initialize, including the default admin user. The contents of the Grafana container's storage volume are ephemeral, so metrics data will not be lost.
96103

97104
```yaml
98105
# Helm override
@@ -108,11 +115,12 @@ grafana:
108115
# Docker Compose override
109116
grafana:
110117
environment:
118+
- 'GF_AUTH_ANONYMOUS_ENABLED=false'
111119
- 'GF_SECURITY_ADMIN_USER=custom-admin-username'
112120
- 'GF_SECURITY_ADMIN_PASSWORD=custom-admin-password'
113-
- 'GF_AUTH_ANONYMOUS_ENABLED=false'
114121
```
115122
123+
116124
## Prometheus
117125
118126
Prometheus is a monitoring tool that collects application- and system-level metrics over time and makes these accessible through a robust query language.

0 commit comments

Comments
 (0)