Skip to content

Commit e960765

Browse files
Refine sample kubernetes manifest file for simplicity and ease of use (#155)
* Simplify & clarify sample kubernetes manifest * remove unnecessary inbound:wireguard map and show an allowlist & github config instead. * avoid including GITHUB_PAT in config.yaml and instead mount it in the secret volume * Remove inbound:github:token portion as it's not required * Address tom's feedback re: - GitHub base url placeholder - clarifying default behaviour of allowlist when unset. - tag version of manifest image * remove trailing whitespace from L34
1 parent f02a199 commit e960765

File tree

1 file changed

+31
-16
lines changed

1 file changed

+31
-16
lines changed

kubernetes.yaml

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,13 @@ metadata:
44
name: broker-config
55
data:
66
config.yaml: |
7-
# note: all of these values are bogus; the broker will start up but not actually work
7+
# Review https://semgrep.dev/docs/semgrep-ci/network-broker for more instructions.
8+
# This minimal example shows how to configure an optional allowlist and a GitHub Enterprise Server.
89
inbound:
9-
wireguard:
10-
localAddress: 192.168.0.2
11-
privateKey: 8DzUuki1Qn+Fdoc8IuRfhCfEL6/OMAIknx45QGtJFVs=
12-
peers:
13-
- publicKey: OgJxJJvNIFZb5UO15VACP9IlVnhkURq+v7PV80c0IB0=
14-
endpoint: example.com:51820
15-
allowedIps: 192.168.0.1/32
16-
heartbeat:
17-
url: http://192.168.0.1/ping
18-
allowlist:
19-
- url: http://example.com/*
20-
methods:
21-
- GET
10+
allowlist: [] # Optional. If unset, defaults to an empty array, permitting all outbound traffic from broker.
11+
github:
12+
baseURL: https://GHES_HOSTNAME/api/v3 # Update GHES_HOSTNAME to the domain of your GitHub server.
13+
2214
---
2315
apiVersion: apps/v1
2416
kind: Deployment
@@ -37,11 +29,16 @@ spec:
3729
app: semgrep-network-broker
3830
spec:
3931
containers:
40-
- name: gateway
41-
image: image-goes-here
32+
- name: broker
33+
# Optionally replace :latest with desired tag version from https://github.com/semgrep/semgrep-network-broker/tags
34+
image: ghcr.io/semgrep/semgrep-network-broker:latest
4235
args:
4336
- -c
4437
- /conf/config.yaml
38+
- -c
39+
- /secret/broker-secret.yaml
40+
- --deployment-id
41+
- "YOUR_ORGANIZATION_ID" # Update with your organization ID from https://semgrep.dev/orgs/-/settings/general/identifiers
4542
resources:
4643
limits:
4744
cpu: "1"
@@ -53,7 +50,25 @@ spec:
5350
- mountPath: /conf
5451
name: config-volume
5552
readOnly: true
53+
- mountPath: /secret
54+
name: broker-secret-volume
55+
readOnly: true
5656
volumes:
5757
- name: config-volume
5858
configMap:
5959
name: broker-config
60+
- name: broker-secret-volume
61+
secret:
62+
secretName: broker-secret
63+
64+
# ---
65+
# To create the kubernetes secret for the WireGuard private key, generate a file named broker-secret.yaml with the following contents:
66+
#
67+
# inbound:
68+
# wireguard:
69+
# privateKey: WIREGUARD-PRIVATE-KEY-HERE
70+
#
71+
# Then create the Kubernetes secret with:
72+
#
73+
# kubectl create secret generic broker-secret --from-file=broker-secret.yaml
74+
# ---

0 commit comments

Comments
 (0)