Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/actions/install-trivy/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Install pinned Trivy
description: Install the checksum-verified Linux amd64 scanner from its GitHub release.
runs:
using: composite
steps:
- name: Download and verify Trivy
shell: bash
run: |
set -euo pipefail
if [[ "$(uname -s)" != Linux || "$(uname -m)" != x86_64 ]]; then
echo "This installer requires a Linux amd64 runner" >&2
exit 1
fi
version=0.74.0
sha256=2ae6fe3ee734b7fdf11335663e18c75ea12dccc76062f09f164a3b0f8be4371a
archive="trivy_${version}_Linux-64bit.tar.gz"
download_dir=$(mktemp -d "${RUNNER_TEMP:?}/trivy-download.XXXXXX")
trap 'rm -rf -- "$download_dir"' EXIT
# Bound DNS, connection and HTTP retries. Verify before extraction or execution.
curl --fail --show-error --location --retry 3 --retry-all-errors \
--retry-delay 2 --retry-max-time 180 --connect-timeout 15 --max-time 90 \
--output "$download_dir/$archive" \
"https://github.com/aquasecurity/trivy/releases/download/v${version}/${archive}"
printf '%s %s\n' "$sha256" "$download_dir/$archive" | sha256sum --check --status
tar -xzf "$download_dir/$archive" -C "$download_dir" trivy
sudo install -m 0755 "$download_dir/trivy" /usr/local/bin/trivy
trivy --version
17 changes: 11 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -624,9 +624,7 @@ jobs:
path: ~/.cache/trivy
key: trivy-db-${{ steps.week.outputs.week }}
- name: install trivy
uses: aquasecurity/setup-trivy@81e514348e19b6112ce2a7e3ecbafe19c1e1f567 # v0.3.1
with:
version: v0.74.0
uses: ./.github/actions/install-trivy
- name: prove the gate rejects a vulnerable image
run: ./hack/check-image-scan_test.sh
- name: scan every e2e image
Expand Down Expand Up @@ -1259,6 +1257,8 @@ jobs:
run: python3 charts/tests/check_gateway.py
- name: standalone panel isolation and persistence chart renders
run: python3 charts/tests/check_standalone.py
- name: strict network profile and sentinel policy selectors
run: python3 charts/tests/check_network_isolation.py
- name: auxiliary resources and management placement chart renders
run: python3 charts/tests/check_workloads.py
- name: operator Secret namespace permissions and cache configuration
Expand Down Expand Up @@ -1824,9 +1824,13 @@ jobs:
# (operator does zero logins and is wait-dominated, so it runs
# wide; the api buckets stay within the login limiter's budget).
# The arm64 job below uses the same steps and per-bucket settings.
bucket: [operator, api-auth, api-roles, api-rbac, api-agent, api-mods, telemetry, optional-components, management-placement]
bucket: [operator, api-auth, api-roles, api-rbac, api-agent, api-mods, telemetry, optional-components, network-isolation, management-placement]
arch: [amd64]
include:
- bucket: network-isolation
parallel: 1
test_timeout: 15m
job_timeout: 60
- bucket: operator
parallel: 8
test_timeout: 20m
Expand Down Expand Up @@ -1892,6 +1896,7 @@ jobs:
- name: bring up cluster + helm install
if: env.RUN_REGEX != '' || env.TAIL_REGEX != ''
env:
GAMEPLANE_E2E_CNI: ${{ matrix.bucket == 'network-isolation' && 'cilium' || 'kindnet' }}
GAMEPLANE_E2E_PROFILE: ${{ matrix.bucket == 'management-placement' && 'management' || 'default' }}
run: ./deploy/kind/e2e.sh up "$CLUSTER" e2e "$GAMEPLANE_E2E_PROFILE"
- name: run go e2e (${{ matrix.bucket }})
Expand Down Expand Up @@ -2706,7 +2711,7 @@ jobs:
'go-e2e-unit': (n) => n === 'go (test/e2e)',
'api-postgres': (n) => n === 'api (postgres)',
'e2e-buckets': (n) => n === 'e2e bucket coverage',
'e2e-go': (n) => /^e2e (operator|api-auth|api-roles|api-rbac|api-agent|api-mods|telemetry|optional-components|management-placement) \//.test(n) && n.includes('/ amd64 '),
'e2e-go': (n) => /^e2e (operator|api-auth|api-roles|api-rbac|api-agent|api-mods|telemetry|optional-components|network-isolation|management-placement) \//.test(n) && n.includes('/ amd64 '),
'e2e-go-arm64': (n) => /^e2e (operator|api-auth|api-roles|api-rbac|api-agent|api-mods|telemetry|optional-components) \//.test(n) && n.includes('/ arm64 '),
'e2e-multicluster': (n) => n.startsWith('e2e multicluster /') && n.includes('/ amd64 '),
'e2e-multicluster-arm64': (n) => n.startsWith('e2e multicluster /') && n.includes('/ arm64 '),
Expand Down Expand Up @@ -2859,7 +2864,7 @@ jobs:
const bucketSet = new Set();
for (const j of apiJobs) {
const n = j.name || '';
const m = n.match(/^e2e (operator|api-auth|api-roles|api-rbac|api-agent|api-mods|telemetry|optional-components|management-placement) \//);
const m = n.match(/^e2e (operator|api-auth|api-roles|api-rbac|api-agent|api-mods|telemetry|optional-components|network-isolation|management-placement) \//);
if (m) bucketSet.add(m[1]);
if (/^e2e multicluster \//.test(n)) bucketSet.add('multicluster');
if (/^e2e upgrade \//.test(n)) bucketSet.add('upgrade');
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/publish-edge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ on:
- "**/Dockerfile"
- "**/Dockerfile.*"
- ".github/workflows/publish-edge.yaml"
- ".github/actions/install-trivy/**"
- "hack/ci_scope.py"
- ".dockerignore"
- "signing/cosign.pub"
Expand Down Expand Up @@ -149,9 +150,7 @@ jobs:
# Spec 013 G2: never sign an image that has a fixed HIGH/CRITICAL
# vulnerability. Same flags as the `vuln (images)` CI gate.
- name: install trivy
uses: aquasecurity/setup-trivy@81e514348e19b6112ce2a7e3ecbafe19c1e1f567 # v0.3.1
with:
version: v0.74.0
uses: ./.github/actions/install-trivy
- name: scan pushed image
env:
IMAGE: ${{ steps.image.outputs.name }}
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ jobs:
# Spec 013 G2: never sign an image that has a fixed HIGH/CRITICAL
# vulnerability. Same flags as the `vuln (images)` CI gate.
- name: install trivy
uses: aquasecurity/setup-trivy@81e514348e19b6112ce2a7e3ecbafe19c1e1f567 # v0.3.1
with:
version: v0.74.0
uses: ./.github/actions/install-trivy
- name: scan pushed image
env:
IMAGE: ${{ steps.image.outputs.name }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: afbe99d46e972c35a07f42486a1f8f6ec895c183017a9d2eef67b7ea07824f6b
gameplane.local/crd-bundle-sha256: c74f1d52f8257b6d1a091e0d84d4aa139aec6b83ef487004d31f59ef137f6170
controller-gen.kubebuilder.io/version: v0.22.0
name: backups.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: afbe99d46e972c35a07f42486a1f8f6ec895c183017a9d2eef67b7ea07824f6b
gameplane.local/crd-bundle-sha256: c74f1d52f8257b6d1a091e0d84d4aa139aec6b83ef487004d31f59ef137f6170
controller-gen.kubebuilder.io/version: v0.22.0
name: backupschedules.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: afbe99d46e972c35a07f42486a1f8f6ec895c183017a9d2eef67b7ea07824f6b
gameplane.local/crd-bundle-sha256: c74f1d52f8257b6d1a091e0d84d4aa139aec6b83ef487004d31f59ef137f6170
controller-gen.kubebuilder.io/version: v0.22.0
name: clusters.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: afbe99d46e972c35a07f42486a1f8f6ec895c183017a9d2eef67b7ea07824f6b
gameplane.local/crd-bundle-sha256: c74f1d52f8257b6d1a091e0d84d4aa139aec6b83ef487004d31f59ef137f6170
controller-gen.kubebuilder.io/version: v0.22.0
name: gameservers.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: afbe99d46e972c35a07f42486a1f8f6ec895c183017a9d2eef67b7ea07824f6b
gameplane.local/crd-bundle-sha256: c74f1d52f8257b6d1a091e0d84d4aa139aec6b83ef487004d31f59ef137f6170
controller-gen.kubebuilder.io/version: v0.22.0
name: gametemplates.gameplane.local
spec:
Expand Down Expand Up @@ -2114,6 +2114,12 @@ spec:
minimum: 0
type: integer
type: object
sentinelIsolation:
description: |-
SentinelIsolation restricts a wake sentinel to its own server's advertised
ports. Templates opt in after module connectivity validation; absent or
false retains the legacy namespace-wide sentinel allowances.
type: boolean
storage:
description: Storage describes the default persistent storage layout.
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: afbe99d46e972c35a07f42486a1f8f6ec895c183017a9d2eef67b7ea07824f6b
gameplane.local/crd-bundle-sha256: c74f1d52f8257b6d1a091e0d84d4aa139aec6b83ef487004d31f59ef137f6170
controller-gen.kubebuilder.io/version: v0.22.0
name: modules.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: afbe99d46e972c35a07f42486a1f8f6ec895c183017a9d2eef67b7ea07824f6b
gameplane.local/crd-bundle-sha256: c74f1d52f8257b6d1a091e0d84d4aa139aec6b83ef487004d31f59ef137f6170
controller-gen.kubebuilder.io/version: v0.22.0
name: modulesources.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: afbe99d46e972c35a07f42486a1f8f6ec895c183017a9d2eef67b7ea07824f6b
gameplane.local/crd-bundle-sha256: c74f1d52f8257b6d1a091e0d84d4aa139aec6b83ef487004d31f59ef137f6170
controller-gen.kubebuilder.io/version: v0.22.0
name: networkcaptures.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: afbe99d46e972c35a07f42486a1f8f6ec895c183017a9d2eef67b7ea07824f6b
gameplane.local/crd-bundle-sha256: c74f1d52f8257b6d1a091e0d84d4aa139aec6b83ef487004d31f59ef137f6170
controller-gen.kubebuilder.io/version: v0.22.0
name: restores.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: afbe99d46e972c35a07f42486a1f8f6ec895c183017a9d2eef67b7ea07824f6b
gameplane.local/crd-bundle-sha256: c74f1d52f8257b6d1a091e0d84d4aa139aec6b83ef487004d31f59ef137f6170
controller-gen.kubebuilder.io/version: v0.22.0
name: backups.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: afbe99d46e972c35a07f42486a1f8f6ec895c183017a9d2eef67b7ea07824f6b
gameplane.local/crd-bundle-sha256: c74f1d52f8257b6d1a091e0d84d4aa139aec6b83ef487004d31f59ef137f6170
controller-gen.kubebuilder.io/version: v0.22.0
name: backupschedules.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: afbe99d46e972c35a07f42486a1f8f6ec895c183017a9d2eef67b7ea07824f6b
gameplane.local/crd-bundle-sha256: c74f1d52f8257b6d1a091e0d84d4aa139aec6b83ef487004d31f59ef137f6170
controller-gen.kubebuilder.io/version: v0.22.0
name: clusters.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: afbe99d46e972c35a07f42486a1f8f6ec895c183017a9d2eef67b7ea07824f6b
gameplane.local/crd-bundle-sha256: c74f1d52f8257b6d1a091e0d84d4aa139aec6b83ef487004d31f59ef137f6170
controller-gen.kubebuilder.io/version: v0.22.0
name: gameservers.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: afbe99d46e972c35a07f42486a1f8f6ec895c183017a9d2eef67b7ea07824f6b
gameplane.local/crd-bundle-sha256: c74f1d52f8257b6d1a091e0d84d4aa139aec6b83ef487004d31f59ef137f6170
controller-gen.kubebuilder.io/version: v0.22.0
name: gametemplates.gameplane.local
spec:
Expand Down Expand Up @@ -2114,6 +2114,12 @@ spec:
minimum: 0
type: integer
type: object
sentinelIsolation:
description: |-
SentinelIsolation restricts a wake sentinel to its own server's advertised
ports. Templates opt in after module connectivity validation; absent or
false retains the legacy namespace-wide sentinel allowances.
type: boolean
storage:
description: Storage describes the default persistent storage layout.
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: afbe99d46e972c35a07f42486a1f8f6ec895c183017a9d2eef67b7ea07824f6b
gameplane.local/crd-bundle-sha256: c74f1d52f8257b6d1a091e0d84d4aa139aec6b83ef487004d31f59ef137f6170
controller-gen.kubebuilder.io/version: v0.22.0
name: modules.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: afbe99d46e972c35a07f42486a1f8f6ec895c183017a9d2eef67b7ea07824f6b
gameplane.local/crd-bundle-sha256: c74f1d52f8257b6d1a091e0d84d4aa139aec6b83ef487004d31f59ef137f6170
controller-gen.kubebuilder.io/version: v0.22.0
name: modulesources.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: afbe99d46e972c35a07f42486a1f8f6ec895c183017a9d2eef67b7ea07824f6b
gameplane.local/crd-bundle-sha256: c74f1d52f8257b6d1a091e0d84d4aa139aec6b83ef487004d31f59ef137f6170
controller-gen.kubebuilder.io/version: v0.22.0
name: networkcaptures.gameplane.local
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
gameplane.local/crd-bundle-sha256: afbe99d46e972c35a07f42486a1f8f6ec895c183017a9d2eef67b7ea07824f6b
gameplane.local/crd-bundle-sha256: c74f1d52f8257b6d1a091e0d84d4aa139aec6b83ef487004d31f59ef137f6170
controller-gen.kubebuilder.io/version: v0.22.0
name: restores.gameplane.local
spec:
Expand Down
20 changes: 13 additions & 7 deletions charts/gameplane/templates/networkpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,9 @@ spec:
- { protocol: TCP, port: 443 }
- { protocol: TCP, port: 6443 }
---
# Allow the sentinel to egress to game pods on advertised ports for the proxy path.
# This is the INGRESS half only, on the game pod's own selector.
# Legacy sentinel proxy allowance, ingress half. This grants ALL ports between
# non-isolated sentinels and games. NetworkPolicies are additive; per-server
# player ingress does not narrow it. Opted-in templates use operator policies.
# NetworkPolicy requires both sides to agree: the destination (this policy)
# admits the sentinel, but default-deny-egress's podSelector: {} still
# governs the sentinel as a SOURCE and only opens DNS. allow-sentinel-to-game-egress
Expand All @@ -349,14 +350,17 @@ spec:
podSelector:
matchLabels:
app.kubernetes.io/name: gameplane-game
matchExpressions:
- { key: gameplane.local/sentinel-isolation, operator: NotIn, values: ["true"] }
policyTypes: [Ingress]
ingress:
- from:
- podSelector:
matchLabels:
app.kubernetes.io/name: gameplane-waker
# All ports; the per-server ingress policy covers which ports are
# actually advertised for each server.
matchExpressions:
- { key: gameplane.local/sentinel-isolation, operator: NotIn, values: ["true"] }
# Intentionally unrestricted for templates that have not opted in.
---
# The Egress half of allow-sentinel-to-game (see its comment above): admits
# the sentinel, as a traffic SOURCE, to reach game pods. Selects the
Expand All @@ -374,15 +378,17 @@ spec:
podSelector:
matchLabels:
app.kubernetes.io/name: gameplane-waker
matchExpressions:
- { key: gameplane.local/sentinel-isolation, operator: NotIn, values: ["true"] }
policyTypes: [Egress]
egress:
- to:
- podSelector:
matchLabels:
app.kubernetes.io/name: gameplane-game
# All ports; allow-sentinel-to-game above (the matching ingress half)
# and the per-server ingress policy cover which ports are actually
# advertised for each server.
matchExpressions:
- { key: gameplane.local/sentinel-isolation, operator: NotIn, values: ["true"] }
# Intentionally unrestricted for templates that have not opted in.
{{- end }}

{{- end }}
28 changes: 28 additions & 0 deletions charts/gameplane/templates/validate.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
{{- $network := .Values.networkPolicies | default dict }}
{{- if $network.strict }}
{{- if not $network.enabled }}
{{- fail "networkPolicies.strict requires networkPolicies.enabled=true" }}
{{- end }}
{{- range $key := list "kubeletCIDRs" "apiServerCIDRs" "probePorts" }}
{{- $entries := index $network $key }}
{{- if or (not (kindIs "slice" $entries)) (eq (len $entries) 0) }}
{{- fail (printf "networkPolicies.strict requires a non-empty networkPolicies.%s list" $key) }}
{{- end }}
{{- end }}
{{- $octet := "(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])" }}
{{- $ipv4 := printf "^%s(\\.%s){3}/([0-9]|[12][0-9]|3[0-2])$" $octet $octet }}
{{- $h := "[0-9A-Fa-f]{1,4}" }}
{{- $ipv6 := printf "^((%s:){7}%s|(%s:){1,7}:|(%s:){1,6}:%s|(%s:){1,5}(:%s){1,2}|(%s:){1,4}(:%s){1,3}|(%s:){1,3}(:%s){1,4}|(%s:){1,2}(:%s){1,5}|%s:((:%s){1,6})|:((:%s){1,7}|:))/([0-9]|[1-9][0-9]|1[01][0-9]|12[0-8])$" $h $h $h $h $h $h $h $h $h $h $h $h $h $h $h $h }}
{{- range $key := list "kubeletCIDRs" "apiServerCIDRs" }}
{{- range (index $network $key) }}
{{- if or (not (kindIs "string" .)) (not (or (regexMatch $ipv4 (toString .)) (regexMatch $ipv6 (toString .)))) }}
{{- fail (printf "networkPolicies.%s entries must be explicit IPv4/IPv6 CIDRs" $key) }}
{{- end }}
{{- end }}
{{- end }}
{{- range $network.probePorts }}
{{- if or (not (has (.protocol | default "") (list "TCP" "UDP" "SCTP"))) (not (regexMatch "^[0-9]+$" (toString .port))) (lt (int .port) 1) (gt (int .port) 65535) }}
{{- fail "networkPolicies.probePorts requires protocol TCP/UDP/SCTP and an integer port from 1 to 65535" }}
{{- end }}
{{- end }}
{{- end }}
{{- if and (eq (include "gameplane.apiEnabled" .) "true") (ne (toString .Values.api.replicas) "1") }}
{{- fail "api requires api.replicas=1; multiple API processes are not supported" }}
{{- end }}
Expand Down
Loading
Loading