Documentation Index
Fetch the complete documentation index at: https://docs.semgrep.dev/llms.txt
Use this file to discover all available pages before exploring further.

- Pull request comments
- Code access for Semgrep Managed Scans if enabled
- Webhooks
Feature Availability
TIER AVAILABILITYThe Semgrep Network Broker is available to Enterprise tier users.
Deployment
The Network Broker can be run as a bare Docker container, in a Kubernetes cluster, or simply as a standalone binary on a machine. Only one instance of the WireGuard-based Network Broker can be run at any time. Multiple brokers with the same configuration can cause disconnects, instability, and package loss.System Requirements
- CPU: 1
- RAM: 512 MB
Network Requirements
- Between Semgrep and Broker:
- Allow traffic from
wireguard.semgrep.devon UDP port 51820. If you are on a dedicated Semgrep tenant, allow traffic fromwireguard.<tenant-name>.semgrep.devinstead. - If using the
--deployment-idCLI flag, allow outbound tosemgrep.devon TCP port 443 for HTTPS.
- Allow traffic from
- Between Broker and each private network resource, enable outbound on TCP ports 80 and 443 for HTTP/HTTPS communication.
DETERMINING IP ADDRESSESTo determine the IP addresses for a domain, use dig. The addresses are listed under the ANSWER section. Example:
dig wireguard.semgrep.devArtifacts
You can choose between deploying pre-made artifacts or building your own.Pre-built by Semgrep
- Docker images are available from ghcr.io/semgrep/semgrep-network-broker.
- A sample Kubernetes Manifest is present within the repository. This should be extended for production.
Build Yourself
See the Network Broker repository’s README for instructions on how to build it yourself.Configure Semgrep Network Broker
Ensure that you are logged in to the server where you want to run Semgrep Network Broker. Complete the following steps while logged in to that server.Create the config file
- v0.25.0 and later
- v0.24.0 and earlier
Create a
config.yaml file similar to the following snippet, or copy a starting config from the Semgrep AppSec Platform at Settings > Broker. The steps required to generate values for the placeholders SEMGREP_LOCAL_ADDRESS, YOUR_PRIVATE_KEY, and YOUR_BASE_URL, as well as the scopes required for the access tokens, are provided in subsequent steps of this guide.Multiple configuration files
You can overlay multiple configuration files on top of each other by passing multiple-c arguments:
Generate a keypair
The broker requires a WireGuard keypair to establish a secure connection. To generate your private key to replaceYOUR_PRIVATE_KEY in the config template:
Determine the Network Broker version you want to use. The format should be similar to
v0.22.0. Most users should use the latest version, especially when setting up the broker for the first time.Run the following command in the CLI to generate your private key, replacing the placeholder with the Network Broker version number:
Update the config with the keypair
Update the config with your SCM information
Update theconfig.yaml by replacing the SCM information containing YOUR_BASE_URL with your SCM and its base URL for Azure DevOps, GitHub, GitLab, or Bitbucket Data Center.
- Azure DevOps
- Bitbucket
- GitHub
- GitLab
Add your local address to the config
Convert your organization ID to hexadecimal. The organization ID is found in Semgrep AppSec Platform under Settings > General > Identifiers in Semgrep AppSec Platform. This is sometimes also called a deployment ID. You can use a tool such as Decimal to Hexadecimal converter to perform the conversion if needed.
Embed the resulting hexadecimal value in the string
fdf0:59dc:33cf:9be8:0:ORGANIZATION_ID:0:1, replacing ORGANIZATION_ID with the value.Start the broker
Run the following command to start Semgrep Network Broker with your completed configuration file:Check Semgrep Network Broker logs
You can check the logs for Semgrep Network Broker by running:Adjusting log verbosity
The Semgrep Network Broker can log details of the proxied requests and responses for troubleshooting. To log additional details, add this snippet to your broker configuration:proxy.request and proxy.response.
These values can also be set on a per-allowlist basis:
Enable verbose WireGuard logging
To troubleshoot connection issues potentially related to the WireGuard configuration, you can enable verbose logging by adding the following snippet to the broker configuration:Use Semgrep Network Broker with Managed Scans
Semgrep Managed Scans uses Semgrep Network Broker to connect to your internal source code management instance. To enable Managed Scans when using Network Broker, ensure that you’ve updated your SCM information to allow code access:- Azure DevOps
- Bitbucket
- GitHub
- GitLab
ACCESS TOKENSSemgrep recommends providing the access token when you connect the source code manager instead of in the Network Broker configuration. However, if you must provide the token in the Network Broker configuration, see Prerequisites and permissions for access token requirements.
allowCodeAccess is true, beginning with Network Broker v0.32.0. For other source code managers, or earlier Network Broker versions the URL allowlist must include the base URL of your instance in order to clone repositories for scanning from any organization or group. For example, if your source code manager is at https://git.example.com/, the following allowlist will permit cloning repositories:
v0.30.0 or earlier of the Network Broker: to ensure checks can be both created and updated, add the PATCH method to the preceding allowlist example, or add a separate entry to allowlist check updates:
v0.31.0 and later, this URL is part of the default allowlist.
Run multiple instances of the Semgrep Network Broker
Do not attempt to run multiple instances of the Semgrep Network Broker to increase availability. Running multiple instances can result in contention and is less reliable than running a single instance.Allowlist multiple source code managers with one configuration file
It is possible to allow access to multiple source code managers (SCM) within a single configuration file. One entry for a given SCM uses the SCM-specific key provided in the configuration file, as shown in the following example for a GitHub connection:allowlist and add specific information needed for the HTTP requests. The following is a sample allowlist for additional GitHub entries: