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.
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.
4
7
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.
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.
6
10
7
11
The following is a list of Sourcegraph services and how and when each initiates outbound connections to external services:
8
12
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
13
+
-**executor**: Sourcegraph [Executor](../executors) batch change or precise indexing jobs may need to connect to
14
+
services hosted within an organization's private network
15
+
-**frontend**: The frontend service communicates externally when connecting to external [auth providers](../auth),
16
+
sending [telemetry data](../pings), testing code host connections, and connecting to [externally hosted](../external_services) Sourcegraph services
11
17
-**gitserver**: Executes git commands against externally hosted [code hosts](../external_service)
12
18
-**migrator**: Connects to Postgres instances (which may be [externally hosted](../external_services/postgres)) to process database migrations
13
19
-**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
20
+
-**worker**: Sourcegraph [Worker](../workers) run various background jobs that may require establishing connections to
21
+
services hosted within an organization's private network
15
22
16
23
## HTTP proxy configuration
17
24
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.
25
+
All Sourcegraph services respect the conventional `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` environment variables for
26
+
routing Sourcegraph client application HTTP traffic through a proxy server. The steps for configuring proxy environment
27
+
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>
44
+
<Callout type="warning">Failure to configure `NO_PROXY` correctly can cause the proxy configuration to interfere with
45
+
local networking between internal Sourcegraph services.</Callout>
36
46
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.
47
+
## Configuring TLS certificates for private networks
39
48
40
-
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`.
49
+
When deploying Sourcegraph in private networks, you'll often need to configure TLS certificates to establish trusted
50
+
connections with internal services like code hosts. The recommended approach is to configure root CA certificates
51
+
through Sourcegraph's site configuration using `tls.external` in the `experimentalFeatures` section.
41
52
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.
53
+
This method offers several advantages:
54
+
- Works consistently across both Cloud and self-hosted deployments
55
+
- Requires minimal configuration changes
56
+
- Can be managed entirely through the web UI
57
+
- Maintains certificates in a centralized location
58
+
- Aligns with enterprise PKI best practices
44
59
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>
152
+
### Validation of certificate configuration
153
+
These steps confirms that configuring the root CA certificate through `tls.external` is sufficient for all standard
154
+
Sourcegraph operations that require secure connections to internal services.
0 commit comments