You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A **private network** refers to a secure network environment segregated from the public internet, designed to facilitate internal communications and operations within an organization. This network setup restricts external access, enhancing security and control over data flow by limiting exposure to external threats and unauthorized access.
4
-
5
-
When deploying self-hosted Sourcegraph instances in private networks with specific compliance and policy requirements, additional configuration may be required to ensure all networking features function correctly. The reasons for applying the following configuration options depend on the specific functionality of the Sourcegraph service and the unique network and infrastructure requirements of the organization.
6
-
7
-
The following is a list of Sourcegraph services and how and when each initiates outbound connections to external services:
8
-
9
-
-**executor**: Sourcegraph [Executor](../executors) batch change or precise indexing jobs may need to connect to services hosted within an organization's private network
10
-
-**frontend**: The frontend service communicates externally when connecting to external [auth providers](../auth), sending [telemetry data](../pings), testing code host connections, and connecting to [externally hosted](../external_services) Sourcegraph services
3
+
## Overview
4
+
A private network is your organization's secure, internal network space - separated from the public internet.
5
+
Think of it as your company's own protected environment where internal systems can communicate safely,
6
+
keeping your sensitive data and operations shielded from external access.
7
+
8
+
When deploying self-hosted Sourcegraph instances in private networks with specific compliance and policy requirements,
9
+
additional configuration may be required to ensure all networking features function correctly. The reasons for applying the following configuration options depend on the specific functionality of the Sourcegraph service and the unique network and infrastructure requirements of the organization.
10
+
11
+
The following is a list of Sourcegraph services that initiate outbound connections to external services. Sourcegraph services not included in this list can be assumed to only connect to services within the Sourcegraph deployment's network segment:
12
+
-**executor**: Sourcegraph [Executor](../executors) batch change or precise indexing jobs may need to connect to
13
+
services hosted within an organization's private network
14
+
-**frontend**: The frontend service communicates externally when connecting to:
15
+
* External [auth providers](../auth)
16
+
* Sending [telemetry data](../pings)
17
+
* Testing [code host connections](../code_hosts)
18
+
* Connecting to [externally hosted](../external_services) Sourcegraph services
19
+
* Connecting to external [LLM providers](../../cody/capabilities/supported-models) with Cody
11
20
-**gitserver**: Executes git commands against externally hosted [code hosts](../external_service)
12
21
-**migrator**: Connects to Postgres instances (which may be [externally hosted](../external_services/postgres)) to process database migrations
13
22
-**repo-updater**: Communicates with [code hosts](../external_service) APIs to coordinate repository synchronization
14
-
-**worker**: Sourcegraph [Worker](../workers) run various background jobs that may require establishing connections to services hosted within an organization's private network
23
+
-**worker**: Sourcegraph [Worker](../workers) run various background jobs that may require establishing connections to
24
+
services hosted within an organization's private network
15
25
16
26
## HTTP proxy configuration
17
27
18
-
All Sourcegraph services respect the conventional `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` environment variables for routing Sourcegraph client application HTTP traffic through a proxy server. The steps for configuring proxy environment variables will depend on your Sourcegraph deployment method.
28
+
All Sourcegraph services respect the conventional `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` environment variables for
29
+
routing Sourcegraph client application HTTP traffic through a proxy server. The steps for configuring proxy environment
30
+
variables will depend on your Sourcegraph deployment method.
<Callout type="warning">Failure to configure `NO_PROXY` correctly can cause the proxy configuration to interfere with local networking between internal Sourcegraph services.</Callout>
47
+
### Docker Compose
36
48
37
-
## Using private CA root certificates
38
-
Some organizations maintain a private Certificate Authority (CA) for issuing certificates within their private network. When Sourcegraph connects to TLS encrypted service using a self-signed certificate that it does not trust, you will observe an `x509: certificate signed by unknown authority` error message in logs.
49
+
Add the proxy environment variables your docker compose override file.
In order for Sourcegraph to respect an organization's self-signed certificates, the private CA root certificate(s) will need to be appended to Sourcegraph's trusted CA root certificate list in `/etc/ssl/certs/ca-certificates.crt`.
59
+
<Callout type="warning">Failure to configure `NO_PROXY` correctly can cause the proxy configuration to interfere with
60
+
local networking between internal Sourcegraph services.</Callout>
41
61
42
-
### Configuring sourcegraph-frontend to recognize private CA root certificates
43
-
The following details the process for setting up the sourcegraph-frontend to acknowledge and trust a private CA root certificate for Sourcegraph instances deployed using [Helm](../deploy/kubernetes/helm). For any other Sourcegraph service that needs to trust an organization's private CA root certificate (including gitserver, repo-updater, or migrator), similar steps will need to be followed.
62
+
## Docker networking configuration
63
+
If there is an IP conflict on between the host network and the Docker network, you may need to configure the docker CIDR
64
+
range in the docker-compose override file.
44
65
45
-
1. Copy out the existing `ca-certificates.crt` file from the sourcegraph-frontend container:
46
-
```sh
47
-
kubectl cp $(kubectl get pod -l app=sourcegraph-frontend -o jsonpath='{.items[0].metadata.name}'):/etc/ssl/certs/ca-certificates.crt sourcegraph-frontend-ca-certificates.crt
48
-
```
49
-
2. Concatenate the private CA root certificate to the `sourcegraph-frontend-ca-certificates.crt` file:
<Callout type="note">It is recommended to repeat these steps on a regular cadence to ensure that Sourcegraph's CA root certificate list stays up to date.</Callout>
185
+
### Validation of certificate configuration
186
+
These steps confirms that configuring the root CA certificate through `tls.external` is sufficient for all standard
187
+
Sourcegraph operations that require secure connections to internal services.
0 commit comments