Skip to content

Commit d08150f

Browse files
authored
Close Grafana port from outside access for Docker deployments (#1204)
<!-- description here --> Our Docker deployments have exposed the Grafana container's listening port (3370) for side-channel access by default, since we started bundling Grafana in our deployments. This hasn't been a security concern in the past because Grafana had only been used for system health and performance metrics, but Grafana will now also show PII for usage data for a select few customers adding the the Airgapped Analytics dashboard. Closing port 3370 on the Docker host still allows Site Admins to reach Grafana through the site admin web UI. Also, fixed a broken port number in sourcegraph-frontend-internal's config for the Grafana URL, which has been broken since f6f8d8d, so probably not used. ### Checklist <!-- Kubernetes and Docker Compose MUST be kept in sync. You should not merge a change here without a corresponding change in the other repository, unless it truly is specific to this repository. If unneeded, add link or explanation of why it is not needed here. --> * [ ] Sister [deploy-sourcegraph](https://github.com/sourcegraph/deploy-sourcegraph) change: * [ ] Sister [customer-replica](https://github.com/sourcegraph/deploy-sourcegraph-docker-customer-replica-1) change (if necessary, for any changes affecting pure-docker or configuration): * [ ] All images have a valid tag and SHA256 sum ### Test plan Tested on test instance, frontend still proxies the connection to Grafana as needed, without side channel access <!-- As part of SOC2/GN-104 and SOC2/GN-105 requirements, all pull requests are REQUIRED to provide a "test plan". A test plan is a loose explanation of what you have done or implemented to test this, as outlined in our Testing principles and guidelines: https://docs.sourcegraph.com/dev/background-information/testing_principles Write your test plan here after the "Test plan" header. -->
1 parent 5fb29bd commit d08150f

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

docker-compose/docker-compose.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ services:
192192
- 'SYMBOLS_URL=http://symbols-0:3184'
193193
- 'INDEXED_SEARCH_SERVERS=zoekt-webserver-0:6070'
194194
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
195-
- 'GRAFANA_SERVER_URL=http://grafana:3000'
195+
- 'GRAFANA_SERVER_URL=http://grafana:3370'
196196
- 'PROMETHEUS_URL=http://prometheus:9090'
197197
- 'PRECISE_CODE_INTEL_UPLOAD_BACKEND=blobstore'
198198
- 'PRECISE_CODE_INTEL_UPLOAD_AWS_ENDPOINT=http://blobstore:9000'
@@ -481,8 +481,6 @@ services:
481481
- 'grafana:/var/lib/grafana'
482482
- '../grafana/datasources:/sg_config_grafana/provisioning/datasources'
483483
- '../grafana/dashboards:/sg_grafana_additional_dashboards'
484-
ports:
485-
- '0.0.0.0:3370:3370'
486484
networks:
487485
- sourcegraph
488486
restart: always

pure-docker/deploy-grafana.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ docker run --detach \
1717
--restart=always \
1818
--cpus=1 \
1919
--memory=1g \
20-
-p 0.0.0.0:3370:3370 \
2120
-v $VOLUME:/var/lib/grafana \
2221
-v $(pwd)/../grafana/datasources:/sg_config_grafana/provisioning/datasources \
2322
-v $(pwd)/../grafana/dashboards:/sg_grafana_additional_dashboards \

0 commit comments

Comments
 (0)