-
Notifications
You must be signed in to change notification settings - Fork 107
Simplify Network Broker config generation instructions #2418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
✅ Don't forget to add
|
| Name | Link |
|---|---|
| 🔨 Latest commit | db96c29 |
| 🔍 Latest deploy log | https://app.netlify.com/projects/semgrep-docs-prod/deploys/692f602d4f6fc40008fb18ab |
| 😎 Deploy Preview | https://deploy-preview-2418--semgrep-docs-prod.netlify.app |
| 📱 Preview on mobile |
To edit notification comments on pull requests, go to your Netlify project configuration.
khorne3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some nits. Thank you!
| token: GITLAB_PAT | ||
| ``` | ||
| 1. Log in to the Semgrep AppSec platform and navigate to **Settings > Broker**. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 1. Log in to the Semgrep AppSec platform and navigate to **Settings > Broker**. | |
| 1. Sign in to Semgrep AppSec platform and navigate to **Settings > Broker**. |
| ``` | ||
| 1. Log in to the Semgrep AppSec platform and navigate to **Settings > Broker**. | ||
| 2. Copy the starting config into a `config.yaml` file. It should look similar to this: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 2. Copy the starting config into a `config.yaml` file. It should look similar to this: | |
| 2. Create a `config.yaml` file that contains the following starting configuration: |
| ``` | ||
|
|
||
| #### Add your local address to the config | ||
| 1. Convert your organization ID to hexadecimal. The organization ID is found in Semgrep AppSec Platform under [**Settings > General > Identifiers**](https://semgrep.dev/orgs/-/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](https://www.rapidtables.com/convert/number/decimal-to-hex.html) to perform the conversion if needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 1. Convert your organization ID to hexadecimal. The organization ID is found in Semgrep AppSec Platform under [**Settings > General > Identifiers**](https://semgrep.dev/orgs/-/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](https://www.rapidtables.com/convert/number/decimal-to-hex.html) to perform the conversion if needed. | |
| 1. Convert your organization ID to hexadecimal. The organization ID is found in Semgrep AppSec Platform under [**Settings > General > Identifiers**](https://semgrep.dev/orgs/-/settings/general/identifiers). This value is sometimes called a deployment ID. You can use a tool such as [Decimal to Hexadecimal converter](https://www.rapidtables.com/convert/number/decimal-to-hex.html) to perform the conversion if needed. |
| 1. Update the `config.yaml` file by replacing `YOUR_PRIVATE_KEY` with the value of your private key. | ||
| 1. Add your public key to the Semgrep AppSec Platform: | ||
| ### 2. Generate and store your private key | ||
| * Network Broker requires a WireGuard keypair to establish a secure connection. To generate your private key: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * Network Broker requires a WireGuard keypair to establish a secure connection. To generate your private key: | |
| The Network Broker requires a WireGuard keypair to establish a secure connection. To generate your private key: |
| 1. Determine the [Network Broker version](https://github.com/semgrep/semgrep-network-broker/pkgs/container/semgrep-network-broker) you want to use. The format should be similar to `v0.36.0`. Most users should use the latest version, especially when setting up the broker for the first time. | ||
| 2. Run the following command in your terminal to generate your private key, replacing the placeholder with the Network Broker version number: | ||
| <pre class="language-console"><code>docker run ghcr.io/semgrep/semgrep-network-broker:<span className="placeholder">VERSION_NUMBER</span> genkey</code></pre> | ||
| 3. Store your private key in the config file by adding a `privateKey` field under `wireguard` section with its value set to the key you just generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 3. Store your private key in the config file by adding a `privateKey` field under `wireguard` section with its value set to the key you just generated. | |
| 3. Store your private key in the config file by adding a `privateKey` field under `wireguard` section with its value set to the key you generated. |
|
|
||
| ### Update the config with your SCM information | ||
| ### 5. Update the config with your SCM information | ||
| 1. Update the `config.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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 1. Update the `config.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. | |
| Update the `config.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. |
|
|
||
| ### Start the broker | ||
| #### Multiple configuration files | ||
| You can overlay multiple configuration files on top of each other by passing multiple `-c` arguments: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| You can overlay multiple configuration files on top of each other by passing multiple `-c` arguments: | |
| You can overlay multiple configuration files by passing multiple `-c` arguments: |
|
|
||
| ### Add your local address to the config | ||
| ### 6. Start the Network Broker | ||
| i. Run the following command to start Semgrep Network Broker with your completed configuration file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| i. Run the following command to start Semgrep Network Broker with your completed configuration file: | |
| Run the following command to start Semgrep Network Broker with your completed configuration file: |
The docs were written before we provided a starter config and before Network Broker supported fetching information like public key from DNS records. This updates the instructions for >v0.25.0 to omit unnecessary fields and streamline the setup. Note that this does create a dependence from Broker on DNS which previously did not exist so we want to carefully assess this change in recommendations.
As a side effect, this buries the explanation of how to manually generate Broker local addresses under the legacy section which is hidden by default.