From 973852b106c859010b88d9b45ea8634bcba87e0a Mon Sep 17 00:00:00 2001 From: Nikolai Emil Damm Date: Fri, 13 Nov 2026 02:23:23 +0100 Subject: [PATCH 1/7] feat(business-site): reconcile the public staging app behind its hold Turn on the business-site Tenant's own application and WebApp at the already-verified v3.0.0 package. The platform-owned staging hold still denies gateway traffic, so the site is not reachable yet. - Admit exactly business-site.platform.devantler.tech for HTTPRoutes in the business-site namespace; the catch-all denied every route there. - Admit a tenant egress rule that is exactly {}: Cilium allows nothing through it, and the package uses it to select egress default deny. - Let the canonical source guard accept the source-only bootstrap shape or both switches on together, never a half-enabled Tenant. - Approve the moved Tenant ledger line and static-scan instance hash. Part of #5247. Co-Authored-By: Claude Opus 5.5 --- .../restrict-tenant-network-policies.yaml | 6 +- .../restrict-tenant-route-hostnames.yaml | 24 +++++-- .../hetzner/apps/business-site/tenant.yaml | 10 +-- scripts/canonical-tenant-source.lib.sh | 6 +- scripts/rgd-template-static-scan-baseline.tsv | 2 +- scripts/tests/test-business-staging-hold.sh | 9 +-- .../tests/test-canonical-source-bootstrap.sh | 21 +++++- .../tests/test-canonical-source-upgrade.sh | 6 +- .../test-restrict-tenant-network-policies.sh | 11 ++-- .../approved-surface.txt | 2 +- .../business_source_surface_test.go | 19 +++--- .../kyverno-test.yaml | 1 + .../resources.yaml | 21 ++++++ .../kyverno-test.yaml | 14 ++++ .../resources.yaml | 66 +++++++++++++++++++ .../values.yaml | 3 + 16 files changed, 185 insertions(+), 36 deletions(-) diff --git a/k8s/bases/infrastructure/cluster-policies/best-practices/restrict-tenant-network-policies.yaml b/k8s/bases/infrastructure/cluster-policies/best-practices/restrict-tenant-network-policies.yaml index 69e3d4c0a5..35401ffc8f 100644 --- a/k8s/bases/infrastructure/cluster-policies/best-practices/restrict-tenant-network-policies.yaml +++ b/k8s/bases/infrastructure/cluster-policies/best-practices/restrict-tenant-network-policies.yaml @@ -318,9 +318,13 @@ spec: variables.toEndpoints.all(selector, selector.?matchExpressions.orValue([]).all(item, !item.?key.orValue('').matches(variables.broadSelectorKey) || item.?operator.orValue('') in ['In', 'Exists'])) + # An egress rule that is exactly {} names no destination and no port, so + # Cilium allows nothing through it; it only switches the endpoint to egress + # default deny (#3501). A rule with only toPorts still allows every peer on + # those ports and stays refused below. - name: egressRulesNameDestinations expression: >- - variables.egress.all(rule, + variables.egress.all(rule, size(rule) == 0 || ['toEndpoints', 'toCIDR', 'toCIDRSet', 'toEntities', 'toNodes', 'toGroups', 'toServices', 'toFQDNs'] .exists(field, field in rule && rule[field] != null && size(rule[field]) > 0)) - name: egressOmitsNodesAndGroups diff --git a/k8s/bases/infrastructure/cluster-policies/best-practices/restrict-tenant-route-hostnames.yaml b/k8s/bases/infrastructure/cluster-policies/best-practices/restrict-tenant-route-hostnames.yaml index df91e17d85..c43aa9ff1b 100644 --- a/k8s/bases/infrastructure/cluster-policies/best-practices/restrict-tenant-route-hostnames.yaml +++ b/k8s/bases/infrastructure/cluster-policies/best-practices/restrict-tenant-route-hostnames.yaml @@ -12,13 +12,15 @@ # hostname on the listener. # # Coverage: every namespace bound to the tenant-edit ClusterRole gets a validation. -# Two namespaces reconcile tenant-controlled manifests as a tenant -# ServiceAccount today — wedding-app and ascoachingogvaner — and each has its own -# allow-list below, because tenant hostnames are not derivable from the namespace -# name (wedding-app serves wedding.*, ascoachingogvaner serves an apex customer +# Three namespaces reconcile tenant-controlled routes today — wedding-app, +# ascoachingogvaner and business-site — and each has its own allow-list below, +# because tenant hostnames are not derivable from the namespace name +# (wedding-app serves wedding.*, ascoachingogvaner serves an apex customer # domain). Each list is that tenant's own declared set from its # deploy/httproute.yaml, covering the production hostname and the *.platform.lan -# name used on local/dev clusters where the tenant declares one. +# name used on local/dev clusters where the tenant declares one. business-site +# declares its host in deploy/webapp.yaml and has one public staging name only; +# its production hostname stays on GitHub Pages until a separate cutover. # # Fail-closed for anything NOT listed: the final validation denies every HTTPRoute in a # ksail tenant namespace that has no allow-list above, so a newly onboarded @@ -112,11 +114,21 @@ spec: ascoachingogvaner.dk, www.ascoachingogvaner.dk or ascoachingogvaner.platform.lan. Omitting hostnames claims every hostname on the shared platform Gateway listener. + # The KRO controller renders this route from the tenant-owned WebApp, so + # the allow-list applies to it exactly as to a tenant-applied route. + - expression: >- + object.metadata.namespace != 'business-site' || + (size(variables.hostnames) > 0 && + variables.hostnames.all(h, h in ['business-site.platform.devantler.tech'])) + message: >- + business-site HTTPRoutes must set spec.hostnames and may only use + business-site.platform.devantler.tech. Omitting hostnames claims every + hostname on the shared platform Gateway listener. # Catch-all: any ksail tenant namespace without an allow-list above. This is # what makes onboarding fail loudly instead of silently unrestricted, the # exact gap that once left this policy covering only wedding-app while other # tenants shared the same wildcard Gateway. - - expression: "object.metadata.namespace in ['wedding-app', 'ascoachingogvaner']" + - expression: "object.metadata.namespace in ['wedding-app', 'ascoachingogvaner', 'business-site']" message: >- This tenant namespace has no approved hostnames. Add an allow-list validation for it to the restrict-tenant-route-hostnames ValidatingPolicy diff --git a/k8s/providers/hetzner/apps/business-site/tenant.yaml b/k8s/providers/hetzner/apps/business-site/tenant.yaml index a922a9bd68..035a31939e 100644 --- a/k8s/providers/hetzner/apps/business-site/tenant.yaml +++ b/k8s/providers/hetzner/apps/business-site/tenant.yaml @@ -1,5 +1,7 @@ -# Source-only staging: the signed manifest can be fetched and verified, but no -# tenant application, route or private identity configuration is reconciled. +# Public-only staging: the tenant reconciles its signed v3.0.0 package — the +# WebApp at business-site.platform.devantler.tech, its network policy, budget +# and disclosure input — while the platform-owned staging hold still denies +# gateway traffic. Portal identity, payments and devantler.tech stay off. apiVersion: kro.run/v1alpha1 kind: Tenant metadata: @@ -9,8 +11,8 @@ spec: name: business-site externalDns: false sops: false - webApp: false + webApp: true source: digest: sha256:7ec5b206635db783d8fd18789605a771cc772946f65339d3f0a2b4e08a14ebc6 publisherRevision: d8b5d0e9429cebf12907e0d4cb448433d3108e4b - reconcileApplication: false + reconcileApplication: true diff --git a/scripts/canonical-tenant-source.lib.sh b/scripts/canonical-tenant-source.lib.sh index 50d88cbbcc..a8f7a4e5d4 100644 --- a/scripts/canonical-tenant-source.lib.sh +++ b/scripts/canonical-tenant-source.lib.sh @@ -111,10 +111,12 @@ canonical_tenant_projection() ( select(.apiVersion==$record.tenantIdentity.apiVersion and .kind==$record.tenantIdentity.kind and .metadata.name==$record.tenantIdentity.name and .metadata.namespace==$record.tenantIdentity.namespace and (.spec|keys)==["externalDns","name","sops","source","webApp"] and .spec.name==$record.consumer and - .spec.webApp==false and .spec.externalDns==false and .spec.sops==false and + .spec.externalDns==false and .spec.sops==false and (.spec.source|keys)==["digest","publisherRevision","reconcileApplication"] and .spec.source.digest==$record.sourceIdentity.digest and .spec.source.publisherRevision==$pin and - .spec.source.reconcileApplication==false) | + # Source-only bootstrap, or the public staging application with its own + # WebApp. A half-enabled instance is neither reviewed shape. + (.spec.webApp|type)=="boolean" and .spec.webApp==.spec.source.reconcileApplication) | {apiVersion:"source.toolkit.fluxcd.io/v1",kind:"OCIRepository", metadata:{namespace:$record.sourceIdentity.namespace,name:$record.sourceIdentity.name}, spec:{url:$record.sourceIdentity.artifactURL,ref:{digest:$record.sourceIdentity.digest}, diff --git a/scripts/rgd-template-static-scan-baseline.tsv b/scripts/rgd-template-static-scan-baseline.tsv index 1c5ba57919..75964bca40 100644 --- a/scripts/rgd-template-static-scan-baseline.tsv +++ b/scripts/rgd-template-static-scan-baseline.tsv @@ -42,4 +42,4 @@ 1 k8s/bases/infrastructure/resource-graph-definitions/webapp/resource-graph-definition.yaml.resources/service.yaml KSV-0040 LOW CAUSE-SHA256:79c2597bf128e3ca530288250548c211e5e43a66a10d3c88748c6db4ac565920 1 k8s/providers/docker/apps/tenant-ascoachingogvaner.yaml INSTANCE-CONTENT SHA256 7e65481a62deb24c89dca2e5f83969e308e7604e770d97edb15e86ecc948f22c 1 k8s/providers/docker/apps/web-app-wedding-app.yaml INSTANCE-CONTENT SHA256 3d42027c7e549014cad1e717876a6eb72e0a6641f3bf181f7a0e1a70d94306d6 -1 k8s/providers/hetzner/apps/business-site/tenant.yaml INSTANCE-CONTENT SHA256 63fd7c3a83133a8debdb3d0c2cd0ade8c7cedf2ced5bb3646fd07608823545e1 +1 k8s/providers/hetzner/apps/business-site/tenant.yaml INSTANCE-CONTENT SHA256 f41cf288531722e872f273a55d0ed3d8827c642f49d37341f9e7f4a88fd75d45 diff --git a/scripts/tests/test-business-staging-hold.sh b/scripts/tests/test-business-staging-hold.sh index 39aa18bf8f..c118829f98 100755 --- a/scripts/tests/test-business-staging-hold.sh +++ b/scripts/tests/test-business-staging-hold.sh @@ -71,14 +71,15 @@ for change in \ exit 1 fi done -# Installing the hold is deliberately independent of enabling the application. +# The public staging application reconciles behind the hold; the hold, not the +# Tenant, decides whether gateway traffic reaches it. jq -e ' [.[] | select(.kind == "Tenant" and .metadata.name == "business-site")] | length == 1 and .[0].metadata.namespace == "flux-system" and - .[0].spec.webApp == false and .[0].spec.externalDns == false and - .[0].spec.source.reconcileApplication == false + .[0].spec.webApp == true and .[0].spec.externalDns == false and + .[0].spec.source.reconcileApplication == true ' "$scratch/production.json" >/dev/null kubectl kustomize "$root/k8s/providers/docker/apps" >"$scratch/local.yaml" yq -o=json -I=0 '.' "$scratch/local.yaml" | jq -es 'all(.[]; .metadata.name != "business-site-staging-hold" and .metadata.name != "business-site-customer-identity-hold")' >/dev/null -printf 'PASS: production-only staging and identity holds; 16 unsafe mutations refused; application remains disabled\n' +printf 'PASS: production-only staging and identity holds; 16 unsafe mutations refused; application reconciles behind the hold\n' diff --git a/scripts/tests/test-canonical-source-bootstrap.sh b/scripts/tests/test-canonical-source-bootstrap.sh index b1f8e0e893..4e86512ecb 100755 --- a/scripts/tests/test-canonical-source-bootstrap.sh +++ b/scripts/tests/test-canonical-source-bootstrap.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash -# Exercise the real raw discovery path with one fully qualified source-only binding. +# Exercise the real raw discovery path with one fully qualified binding: the +# source-only bootstrap shape and the enabled public staging shape. set -euo pipefail test_repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" work="$(mktemp -d)" @@ -99,6 +100,24 @@ for mutation in '.spec.source.reconcileApplication=true' '.spec.webApp=true' '.s test ! -s "$work/rows" controls=$((controls + 1)) done +# The enabled public staging shape turns both switches on together and projects +# the same reviewed source; each switch alone was refused above. +yq '.spec.webApp=true | .spec.source.reconcileApplication=true' "$work/good-tenant.yaml" >"$tree/$source_path" +if ! discover >"$work/rows" 2>"$work/error"; then + echo 'enabled staging Tenant was omitted or refused by actual discovery' >&2 + cat "$work/error" >&2 + exit 1 +fi +test "$(wc -l <"$work/rows" | tr -d ' ')" = 1 +for mutation in '.spec.webApp="true"' '.spec.externalDns=true' '.spec.sops=true'; do + yq ".spec.webApp=true | .spec.source.reconcileApplication=true | $mutation" "$work/good-tenant.yaml" >"$tree/$source_path" + if discover >"$work/rows" 2>"$work/error"; then + echo "changed enabled instance admitted: $mutation" >&2 + exit 1 + fi + test ! -s "$work/rows" + controls=$((controls + 1)) +done cp "$work/good-tenant.yaml" "$tree/$source_path" cp "$tree/$source_path" "$tree/$(dirname "$source_path")/clone.yaml" if discover >"$work/rows" 2>"$work/error"; then diff --git a/scripts/tests/test-canonical-source-upgrade.sh b/scripts/tests/test-canonical-source-upgrade.sh index 23b1f0853a..4df3cb9817 100755 --- a/scripts/tests/test-canonical-source-upgrade.sh +++ b/scripts/tests/test-canonical-source-upgrade.sh @@ -83,7 +83,7 @@ kubectl() { jq '.bindings[0].publication.workflowRunAttempt=2' "$binding_file" >"$upgrade_test_work/raced.json" mv "$upgrade_test_work/raced.json" "$binding_file" ;; - tenant) yq -i '.spec.webApp=true' "$tree/$tenant_path" ;; + tenant) yq -i '.spec.externalDns=true' "$tree/$tenant_path" ;; constructor) yq -i '.spec.schema.group="unapproved.example"' "$tree/k8s/bases/infrastructure/resource-graph-definitions/tenant/resource-graph-definition.yaml" ;; output) mkdir "$upgrade_test_work/candidate" @@ -144,7 +144,9 @@ jq -e --arg digest "$next_digest" --argjson old "$old_record" ' .previousBinding==$old and .previousObservation.generation==2 and (.previousObservation.uidSha256|test("^[0-9a-f]{64}$"))' "$candidate_record" >/dev/null test "$(yq '.spec.source.digest' "$upgrade_test_work/candidate/$tenant_path")" = "$next_digest" -test "$(yq '.spec.webApp or .spec.externalDns or .spec.sops or .spec.source.reconcileApplication' "$upgrade_test_work/candidate/$tenant_path")" = false +# A digest upgrade keeps every reviewed switch exactly as it was. +switches='[.spec.webApp, .spec.externalDns, .spec.sops, .spec.source.reconcileApplication]' +test "$(yq -o=json -I=0 "$switches" "$upgrade_test_work/candidate/$tenant_path")" = "$(yq -o=json -I=0 "$switches" "$upgrade_test_work/original-tenant.yaml")" if prepare >"$upgrade_test_work/result" 2>&1; then echo 'existing candidate directory overwritten' >&2 exit 1 diff --git a/scripts/tests/test-restrict-tenant-network-policies.sh b/scripts/tests/test-restrict-tenant-network-policies.sh index 423ae605d9..9ca3326cb9 100755 --- a/scripts/tests/test-restrict-tenant-network-policies.sh +++ b/scripts/tests/test-restrict-tenant-network-policies.sh @@ -41,7 +41,7 @@ expect_summary() { # used to be refused now admits. The unmanaged namespace control is an explicit # match-condition skip; a namespaceSelector previously omitted its result. apply "${tests}/resources.yaml" "${tests}/values.yaml" "${tests}/user-info.yaml" -expect_summary "pass: 18, fail: 80, warn: 0, error: 0, skip: 1" \ +expect_summary "pass: 19, fail: 80, warn: 0, error: 0, skip: 1" \ "tenant CiliumNetworkPolicy boundary" # 2. Carve-out: kyverno's background controller owns the generated floor. These @@ -57,10 +57,11 @@ expect_summary "pass: 0, fail: 0, warn: 0, error: 0, skip: 3" \ # Besides the reserved name, allow-dns reaches CoreDNS by naming kube-system # through the namespace label and allow-cnpg-operator names cnpg-system, the # cross-namespace selector a tenant is refused (#3399, #3655). default-deny's -# one empty rule per direction names no source or destination, which is refused -# because a sourceless rule WITH toPorts allows every peer on that port. Without -# toPorts, as here, Cilium allows nothing (#3501), so the refusal is conservative, -# not a hole. The generated floor is exempt only through its applying identity. +# empty ingress rule names no source, which is refused because a sourceless rule +# WITH toPorts allows every peer on that port. Without toPorts, as here, Cilium +# allows nothing (#3501), so the refusal is conservative, not a hole; its empty +# egress rule is admitted for the same reason. The generated floor is exempt +# only through its applying identity. apply "${tests}/kyverno-author/resources.yaml" \ "${tests}/kyverno-author/values.yaml" "${tests}/user-info.yaml" expect_summary "pass: 0, fail: 3, warn: 0, error: 0, skip: 0" \ diff --git a/scripts/validate-eks-ci-role-policy/approved-surface.txt b/scripts/validate-eks-ci-role-policy/approved-surface.txt index 083d13bbfe..4ce7e0938e 100644 --- a/scripts/validate-eks-ci-role-policy/approved-surface.txt +++ b/scripts/validate-eks-ci-role-policy/approved-surface.txt @@ -130,7 +130,7 @@ iam.aws.m.upbound.io/v1beta1|Role|aws|eks-ci c40205b3f48d193e8be1a39abda738865b9 kro.run/v1alpha1|ResourceGraphDefinition||tenant.kro.run 72f3f972cecdf3ca2e315deb4224bd28c1df1244fc7973a88eb7f4fc03ac1d05 -kro.run/v1alpha1|Tenant|flux-system|business-site 5854dbac8e7f4ff52f5d858ee7e673e82cd758f0c770c3203b9409c8dc15aba2 +kro.run/v1alpha1|Tenant|flux-system|business-site 47380ca8c8781c2de6b17226e44ac7cef030e13a89c8b41dae9ddf459304b3a4 kustomize.toolkit.fluxcd.io/v1|Kustomization|ascoachingogvaner|ascoachingogvaner ac00ca29c04de8d2c30a045d583570536a97fc305a1b06c4300da018ecdfb864 diff --git a/scripts/validate-eks-ci-role-policy/business_source_surface_test.go b/scripts/validate-eks-ci-role-policy/business_source_surface_test.go index 2382bd009d..9b0035d7bf 100644 --- a/scripts/validate-eks-ci-role-policy/business_source_surface_test.go +++ b/scripts/validate-eks-ci-role-policy/business_source_surface_test.go @@ -9,12 +9,13 @@ import ( "gopkg.in/yaml.v3" ) -// Approve only the exact source-only typed instance, never its future app or -// capabilities. The full ordinary validator must reject each widened intent. -func TestBusinessSourceOnlyAuthorization(t *testing.T) { +// Approve only the exact public staging instance: its own application and +// WebApp, with no DNS writer, SOPS or other source. The full ordinary +// validator must reject every other intent, including a return to source-only. +func TestBusinessStagingAuthorization(t *testing.T) { role, boundary, rendered := repositoryInputs(t) if err := validateAuthorization(role, boundary, rendered); err != nil { - t.Fatalf("reviewed source-only registration refused: %v", err) + t.Fatalf("reviewed staging registration refused: %v", err) } for _, tc := range []struct { name string @@ -22,8 +23,8 @@ func TestBusinessSourceOnlyAuthorization(t *testing.T) { mutate func(map[string]any) }{ {name: "source removed", remove: true}, - {name: "application reconciliation", mutate: func(spec map[string]any) { spec["source"].(map[string]any)["reconcileApplication"] = true }}, - {name: "webapp capability", mutate: func(spec map[string]any) { spec["webApp"] = true }}, + {name: "no application reconciliation", mutate: func(spec map[string]any) { spec["source"].(map[string]any)["reconcileApplication"] = false }}, + {name: "no webapp capability", mutate: func(spec map[string]any) { spec["webApp"] = false }}, {name: "external DNS", mutate: func(spec map[string]any) { spec["externalDns"] = true }}, {name: "SOPS", mutate: func(spec map[string]any) { spec["sops"] = true }}, {name: "different publisher", mutate: func(spec map[string]any) { @@ -58,15 +59,15 @@ func TestBusinessSourceOnlyAuthorization(t *testing.T) { t.Fatal(err) } if selected != 1 { - t.Fatalf("selected %d source-only registrations, want one", selected) + t.Fatalf("selected %d staging registrations, want one", selected) } var mismatch *surfaceMismatchError if err := validateAuthorization(role, boundary, changed.Bytes()); !errors.As(err, &mismatch) { - t.Fatalf("changed source-only authorization error = %v, want ledger mismatch", err) + t.Fatalf("changed staging authorization error = %v, want ledger mismatch", err) } for _, line := range mismatch.delta { if !strings.Contains(line, "kro.run/v1alpha1|Tenant|flux-system|business-site ") { - t.Fatalf("source-only mutation changed an unrelated authorization: %s", line) + t.Fatalf("staging mutation changed an unrelated authorization: %s", line) } } }) diff --git a/tests/restrict-tenant-network-policies/kyverno-test.yaml b/tests/restrict-tenant-network-policies/kyverno-test.yaml index 87a5f53d0c..35baa339ca 100644 --- a/tests/restrict-tenant-network-policies/kyverno-test.yaml +++ b/tests/restrict-tenant-network-policies/kyverno-test.yaml @@ -137,6 +137,7 @@ results: - tenant-ns/allow-web-egress-to-kube-apiserver-selector - tenant-ns/allow-web-ingress-from-documentation-cidr - tenant-ns/allow-web-ingress-from-gateway + - tenant-ns/allow-web-ingress-from-gateway-egress-default-deny - tenant-ns/allow-web-ingress-from-ingress-selector - policy: restrict-tenant-network-policies kind: CiliumNetworkPolicy diff --git a/tests/restrict-tenant-network-policies/resources.yaml b/tests/restrict-tenant-network-policies/resources.yaml index 025e4cac2a..06a00dfe33 100644 --- a/tests/restrict-tenant-network-policies/resources.yaml +++ b/tests/restrict-tenant-network-policies/resources.yaml @@ -1650,3 +1650,24 @@ spec: - k8sService: serviceName: db namespace: other-tenant +--- +# ALLOW case: the business-site package's own policy. Its one egress rule is +# exactly {}, which allows no destination; it only selects egress default deny. +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-web-ingress-from-gateway-egress-default-deny + namespace: tenant-ns +spec: + endpointSelector: + matchLabels: + app: web + ingress: + - fromEntities: + - ingress + toPorts: + - ports: + - port: "8080" + protocol: TCP + egress: + - {} diff --git a/tests/restrict-tenant-route-hostnames/kyverno-test.yaml b/tests/restrict-tenant-route-hostnames/kyverno-test.yaml index 0e51aa85fd..85348979fb 100644 --- a/tests/restrict-tenant-route-hostnames/kyverno-test.yaml +++ b/tests/restrict-tenant-route-hostnames/kyverno-test.yaml @@ -48,6 +48,20 @@ results: - ascoachingogvaner/approved-plus-wildcard kind: HTTPRoute result: fail + # --- business-site: one public staging hostname --- + - policy: restrict-tenant-route-hostnames + resources: + - business-site/approved-staging-hostname + kind: HTTPRoute + result: pass + - policy: restrict-tenant-route-hostnames + resources: + - business-site/production-hostname + - business-site/steals-wedding-hostname + - business-site/no-hostnames + - business-site/wildcard-covering-approved + kind: HTTPRoute + result: fail # --- fail-closed catch-all --- - policy: restrict-tenant-route-hostnames resources: diff --git a/tests/restrict-tenant-route-hostnames/resources.yaml b/tests/restrict-tenant-route-hostnames/resources.yaml index ed49910dce..6f0b492f11 100644 --- a/tests/restrict-tenant-route-hostnames/resources.yaml +++ b/tests/restrict-tenant-route-hostnames/resources.yaml @@ -252,3 +252,69 @@ spec: - backendRefs: - name: ascoachingogvaner port: 80 +--- +# business-site — the KRO-rendered route from its tenant-owned WebApp. Only the +# public staging hostname is approved. +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: approved-staging-hostname + namespace: business-site +spec: + hostnames: + - business-site.platform.devantler.tech + rules: + - backendRefs: + - name: business-site + port: 80 +--- +# The production hostname stays on GitHub Pages until a separate cutover. +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: production-hostname + namespace: business-site +spec: + hostnames: + - devantler.tech + rules: + - backendRefs: + - name: business-site + port: 80 +--- +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: steals-wedding-hostname + namespace: business-site +spec: + hostnames: + - wedding.platform.devantler.tech + rules: + - backendRefs: + - name: business-site + port: 80 +--- +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: no-hostnames + namespace: business-site +spec: + rules: + - backendRefs: + - name: business-site + port: 80 +--- +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: wildcard-covering-approved + namespace: business-site +spec: + hostnames: + - "*.platform.devantler.tech" + rules: + - backendRefs: + - name: business-site + port: 80 diff --git a/tests/restrict-tenant-route-hostnames/values.yaml b/tests/restrict-tenant-route-hostnames/values.yaml index 7768e66df3..fe6b8bad8a 100644 --- a/tests/restrict-tenant-route-hostnames/values.yaml +++ b/tests/restrict-tenant-route-hostnames/values.yaml @@ -17,3 +17,6 @@ namespaceSelector: app.kubernetes.io/managed-by: ksail - name: platform-ns labels: {} + - name: business-site + labels: + app.kubernetes.io/managed-by: kro From 6a7a6d039ff9c643f81e6e187809d2456d9f3bdd Mon Sep 17 00:00:00 2001 From: Nikolai Emil Damm Date: Fri, 13 Nov 2026 03:11:10 +0100 Subject: [PATCH 2/7] test(policies): count the new business-site admission fixtures The ownership-label replay pins each tenant family's exact Kyverno counts. The business-site route fixtures add one admitted and four refused routes, and the empty-egress fixture adds one admitted policy. Part of #5247. Co-Authored-By: Claude Opus 5.5 --- scripts/tests/test-tenant-controller-namespace-coverage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/tests/test-tenant-controller-namespace-coverage.sh b/scripts/tests/test-tenant-controller-namespace-coverage.sh index f8f5414340..b2e8a1c614 100755 --- a/scripts/tests/test-tenant-controller-namespace-coverage.sh +++ b/scripts/tests/test-tenant-controller-namespace-coverage.sh @@ -25,8 +25,8 @@ while IFS=$'\t' read -r family passed denied skipped; do done <<'CASES' restrict-tenant-secret-stores 5 7 0 restrict-tenant-issuer-refs 4 3 0 -restrict-tenant-route-hostnames 3 13 0 -restrict-tenant-network-policies 18 80 1 +restrict-tenant-route-hostnames 4 17 0 +restrict-tenant-network-policies 19 80 1 restrict-tenant-image-repositories 7 11 0 CASES [[ "$failures" == 0 ]] || exit 1 From 6a193eb72963f7128bed77aa4e22935962751013 Mon Sep 17 00:00:00 2001 From: Nikolai Emil Damm Date: Fri, 13 Nov 2026 08:41:31 +0100 Subject: [PATCH 3/7] feat(gateway): serve devantler.tech, www and portal for business-site The business-site package now routes its public pages on devantler.tech and www, and its portal on portal.devantler.tech. The shared Gateway had no listener or certificate for those names, and the route allow-list admitted only the staging name. - A platform-applied Certificate in the business-site namespace covers all three names through the shared Cloudflare ClusterIssuer, like world-at-ruin's zone-trial certificate. - A ReferenceGrant lets the Gateway read only that Secret. - Three HTTPS listeners, named for the sections the package's routes attach to, terminate TLS with it. - restrict-tenant-route-hostnames admits the three names beside the staging name; fixtures cover both new routes, an unlisted subdomain and a *.devantler.tech wildcard. The apex and www keep their GitHub Pages records until the cutover, since external-dns never overwrites a record it does not own. Part of #6177 Co-Authored-By: Claude Opus 5.5 --- .../restrict-tenant-route-hostnames.yaml | 13 +-- .../apps/business-site/certificate.yaml | 23 +++++ .../apps/business-site/kustomization.yaml | 2 + .../apps/business-site/reference-grant.yaml | 18 ++++ .../hetzner/infrastructure/kustomization.yaml | 8 ++ .../patches/add-devantler-tech-listeners.yaml | 83 +++++++++++++++++++ ...st-tenant-controller-namespace-coverage.sh | 2 +- .../kyverno-test.yaml | 7 +- .../resources.yaml | 51 +++++++++++- 9 files changed, 195 insertions(+), 12 deletions(-) create mode 100644 k8s/providers/hetzner/apps/business-site/certificate.yaml create mode 100644 k8s/providers/hetzner/apps/business-site/reference-grant.yaml create mode 100644 k8s/providers/hetzner/infrastructure/patches/add-devantler-tech-listeners.yaml diff --git a/k8s/bases/infrastructure/cluster-policies/best-practices/restrict-tenant-route-hostnames.yaml b/k8s/bases/infrastructure/cluster-policies/best-practices/restrict-tenant-route-hostnames.yaml index c43aa9ff1b..3257ae4fd8 100644 --- a/k8s/bases/infrastructure/cluster-policies/best-practices/restrict-tenant-route-hostnames.yaml +++ b/k8s/bases/infrastructure/cluster-policies/best-practices/restrict-tenant-route-hostnames.yaml @@ -19,8 +19,10 @@ # domain). Each list is that tenant's own declared set from its # deploy/httproute.yaml, covering the production hostname and the *.platform.lan # name used on local/dev clusters where the tenant declares one. business-site -# declares its host in deploy/webapp.yaml and has one public staging name only; -# its production hostname stays on GitHub Pages until a separate cutover. +# declares its staging host in deploy/webapp.yaml and its public and portal +# names in deploy/http-route-public.yaml and http-route-portal.yaml +# (platform#6177). The apex and www keep their GitHub Pages DNS records until a +# separate cutover, so admitting them here changes no live traffic before it. # # Fail-closed for anything NOT listed: the final validation denies every HTTPRoute in a # ksail tenant namespace that has no allow-list above, so a newly onboarded @@ -119,11 +121,12 @@ spec: - expression: >- object.metadata.namespace != 'business-site' || (size(variables.hostnames) > 0 && - variables.hostnames.all(h, h in ['business-site.platform.devantler.tech'])) + variables.hostnames.all(h, h in ['business-site.platform.devantler.tech', 'devantler.tech', 'www.devantler.tech', 'portal.devantler.tech'])) message: >- business-site HTTPRoutes must set spec.hostnames and may only use - business-site.platform.devantler.tech. Omitting hostnames claims every - hostname on the shared platform Gateway listener. + business-site.platform.devantler.tech, devantler.tech, + www.devantler.tech or portal.devantler.tech. Omitting hostnames claims + every hostname on the shared platform Gateway listener. # Catch-all: any ksail tenant namespace without an allow-list above. This is # what makes onboarding fail loudly instead of silently unrestricted, the # exact gap that once left this policy covering only wedding-app while other diff --git a/k8s/providers/hetzner/apps/business-site/certificate.yaml b/k8s/providers/hetzner/apps/business-site/certificate.yaml new file mode 100644 index 0000000000..f53a41e98e --- /dev/null +++ b/k8s/providers/hetzner/apps/business-site/certificate.yaml @@ -0,0 +1,23 @@ +# Platform-applied DNS-01 issuance for the names the business-site package +# routes: the public site (devantler.tech, www) and the portal. The shared +# Cloudflare ClusterIssuer already issues the zone's other names (see +# world-at-ruin/certificate.yaml); the Gateway listeners in +# infrastructure/patches/add-devantler-tech-listeners.yaml read this Secret +# through reference-grant.yaml. Issuance needs no listener and no DNS record, +# so it can complete before the apex and www leave GitHub Pages +# (devantler-tech/monorepo#3939). +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: devantler-tech + namespace: business-site +spec: + secretName: devantler-tech-tls + dnsNames: + - devantler.tech + - www.devantler.tech + - portal.devantler.tech + issuerRef: + group: cert-manager.io + kind: ClusterIssuer + name: letsencrypt-prod diff --git a/k8s/providers/hetzner/apps/business-site/kustomization.yaml b/k8s/providers/hetzner/apps/business-site/kustomization.yaml index 0b4cd23c79..f57d63fa8f 100644 --- a/k8s/providers/hetzner/apps/business-site/kustomization.yaml +++ b/k8s/providers/hetzner/apps/business-site/kustomization.yaml @@ -4,3 +4,5 @@ resources: - tenant.yaml - cilium-network-policy-staging-hold.yaml - cilium-network-policy-customer-identity-hold.yaml + - certificate.yaml + - reference-grant.yaml diff --git a/k8s/providers/hetzner/apps/business-site/reference-grant.yaml b/k8s/providers/hetzner/apps/business-site/reference-grant.yaml new file mode 100644 index 0000000000..2a6fcf5670 --- /dev/null +++ b/k8s/providers/hetzner/apps/business-site/reference-grant.yaml @@ -0,0 +1,18 @@ +# Lets the shared platform Gateway (kube-system) terminate TLS for the +# devantler.tech listeners with the platform-issued certificate.yaml Secret. +# Gateway API refuses a cross-namespace certificateRef without this grant +# (ResolvedRefs=False / RefNotPermitted). It names that one Secret only. +apiVersion: gateway.networking.k8s.io/v1beta1 +kind: ReferenceGrant +metadata: + name: platform-gateway-devantler-tech-tls + namespace: business-site +spec: + from: + - group: gateway.networking.k8s.io + kind: Gateway + namespace: kube-system + to: + - group: "" + kind: Secret + name: devantler-tech-tls diff --git a/k8s/providers/hetzner/infrastructure/kustomization.yaml b/k8s/providers/hetzner/infrastructure/kustomization.yaml index ac9829d3cb..9436680525 100644 --- a/k8s/providers/hetzner/infrastructure/kustomization.yaml +++ b/k8s/providers/hetzner/infrastructure/kustomization.yaml @@ -277,6 +277,14 @@ patches: kind: Gateway name: platform namespace: kube-system + # Adds HTTPS listeners for the business-site public and portal names; see the + # file header. + - path: patches/add-devantler-tech-listeners.yaml + target: + group: gateway.networking.k8s.io + kind: Gateway + name: platform + namespace: kube-system # Prod-only Coroot tuning: hcloud-backed persistent storage + Slack webhook # wiring. The CR it patches comes from ../../../bases/infrastructure/coroot/ # (the `infrastructure` layer); the strategic-merge patch matches on the diff --git a/k8s/providers/hetzner/infrastructure/patches/add-devantler-tech-listeners.yaml b/k8s/providers/hetzner/infrastructure/patches/add-devantler-tech-listeners.yaml new file mode 100644 index 0000000000..0982301794 --- /dev/null +++ b/k8s/providers/hetzner/infrastructure/patches/add-devantler-tech-listeners.yaml @@ -0,0 +1,83 @@ +# Serve the business-site package's public and portal names on the shared +# platform Gateway (platform#6177). SNI picks the most specific listener, so +# these terminate TLS with the names' own certificate while every other +# hostname keeps the hostname-less `https` listener and its ${domain} wildcard. +# JSON patch, not strategic merge: Gateway is a CRD, so a strategic-merge patch +# would replace the whole listeners list instead of appending. +# +# The section names are the ones the package's HTTPRoutes attach to +# (business-site deploy/http-route-public.yaml and http-route-portal.yaml). +# The certificateRefs point cross-namespace at the platform-issued +# business-site/devantler-tech-tls Secret (apps/business-site/certificate.yaml), +# which apps/business-site/reference-grant.yaml lets this Gateway read. Until the +# certificate issues, a listener stays ResolvedRefs=False while the Gateway +# stays Programmed, so it never gates reconciliation. +# +# external-dns creates portal.devantler.tech from its route. The apex and www +# keep their GitHub Pages records until the cutover hands them to external-dns +# (devantler-tech/monorepo#3939), because external-dns never overwrites a record +# it does not own. +# +# Each listener pins `allowedRoutes.kinds` to HTTPRoute, matching the base +# Gateway's listeners; see k8s/bases/infrastructure/gateway/gateway.yaml for why +# an unpinned HTTPS listener is a hostname-claiming gap. +- op: add + path: /spec/listeners/- + value: + name: https-devantler-tech + hostname: devantler.tech + port: 443 + protocol: HTTPS + tls: + mode: Terminate + certificateRefs: + - kind: Secret + group: "" + namespace: business-site + name: devantler-tech-tls + allowedRoutes: + namespaces: + from: All + kinds: + - group: gateway.networking.k8s.io + kind: HTTPRoute +- op: add + path: /spec/listeners/- + value: + name: https-www-devantler-tech + hostname: www.devantler.tech + port: 443 + protocol: HTTPS + tls: + mode: Terminate + certificateRefs: + - kind: Secret + group: "" + namespace: business-site + name: devantler-tech-tls + allowedRoutes: + namespaces: + from: All + kinds: + - group: gateway.networking.k8s.io + kind: HTTPRoute +- op: add + path: /spec/listeners/- + value: + name: https-portal-devantler-tech + hostname: portal.devantler.tech + port: 443 + protocol: HTTPS + tls: + mode: Terminate + certificateRefs: + - kind: Secret + group: "" + namespace: business-site + name: devantler-tech-tls + allowedRoutes: + namespaces: + from: All + kinds: + - group: gateway.networking.k8s.io + kind: HTTPRoute diff --git a/scripts/tests/test-tenant-controller-namespace-coverage.sh b/scripts/tests/test-tenant-controller-namespace-coverage.sh index b2e8a1c614..a1ca16a757 100755 --- a/scripts/tests/test-tenant-controller-namespace-coverage.sh +++ b/scripts/tests/test-tenant-controller-namespace-coverage.sh @@ -25,7 +25,7 @@ while IFS=$'\t' read -r family passed denied skipped; do done <<'CASES' restrict-tenant-secret-stores 5 7 0 restrict-tenant-issuer-refs 4 3 0 -restrict-tenant-route-hostnames 4 17 0 +restrict-tenant-route-hostnames 6 18 0 restrict-tenant-network-policies 19 80 1 restrict-tenant-image-repositories 7 11 0 CASES diff --git a/tests/restrict-tenant-route-hostnames/kyverno-test.yaml b/tests/restrict-tenant-route-hostnames/kyverno-test.yaml index 85348979fb..bf1e655299 100644 --- a/tests/restrict-tenant-route-hostnames/kyverno-test.yaml +++ b/tests/restrict-tenant-route-hostnames/kyverno-test.yaml @@ -48,15 +48,18 @@ results: - ascoachingogvaner/approved-plus-wildcard kind: HTTPRoute result: fail - # --- business-site: one public staging hostname --- + # --- business-site: the staging, public and portal hostnames --- - policy: restrict-tenant-route-hostnames resources: - business-site/approved-staging-hostname + - business-site/approved-public-hostnames + - business-site/approved-portal-hostname kind: HTTPRoute result: pass - policy: restrict-tenant-route-hostnames resources: - - business-site/production-hostname + - business-site/unlisted-devantler-subdomain + - business-site/devantler-wildcard - business-site/steals-wedding-hostname - business-site/no-hostnames - business-site/wildcard-covering-approved diff --git a/tests/restrict-tenant-route-hostnames/resources.yaml b/tests/restrict-tenant-route-hostnames/resources.yaml index 6f0b492f11..932bc0e619 100644 --- a/tests/restrict-tenant-route-hostnames/resources.yaml +++ b/tests/restrict-tenant-route-hostnames/resources.yaml @@ -253,8 +253,8 @@ spec: - name: ascoachingogvaner port: 80 --- -# business-site — the KRO-rendered route from its tenant-owned WebApp. Only the -# public staging hostname is approved. +# business-site — the KRO-rendered route from its tenant-owned WebApp, on the +# public staging hostname. apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: @@ -268,15 +268,58 @@ spec: - name: business-site port: 80 --- -# The production hostname stays on GitHub Pages until a separate cutover. +# The package-owned public route: the apex and www (platform#6177). apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: production-hostname + name: approved-public-hostnames namespace: business-site spec: hostnames: - devantler.tech + - www.devantler.tech + rules: + - backendRefs: + - name: business-site + port: 80 +--- +# The package-owned portal route (platform#6177). +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: approved-portal-hostname + namespace: business-site +spec: + hostnames: + - portal.devantler.tech + rules: + - backendRefs: + - name: business-site + port: 80 +--- +# Another devantler.tech name is not on the list. +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: unlisted-devantler-subdomain + namespace: business-site +spec: + hostnames: + - api.devantler.tech + rules: + - backendRefs: + - name: business-site + port: 80 +--- +# A wildcard covering the approved names is not itself an approved name. +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: devantler-wildcard + namespace: business-site +spec: + hostnames: + - "*.devantler.tech" rules: - backendRefs: - name: business-site From e9034d8f4f0ea57543749786858941ec75999acf Mon Sep 17 00:00:00 2001 From: "botantler-1[bot]" <185060876+botantler-1[bot]@users.noreply.github.com> Date: Fri, 13 Nov 2026 08:57:18 +0000 Subject: [PATCH 4/7] chore(security): regenerate the approved publish-workflow revisions --- scripts/canonical-tenant-source-bindings.json | 40 +------------------ ...workflow-approved-revisions.identities.tsv | 10 ++--- 2 files changed, 6 insertions(+), 44 deletions(-) diff --git a/scripts/canonical-tenant-source-bindings.json b/scripts/canonical-tenant-source-bindings.json index 83dd77d194..19b39111da 100644 --- a/scripts/canonical-tenant-source-bindings.json +++ b/scripts/canonical-tenant-source-bindings.json @@ -5,7 +5,7 @@ "consumer": "business-site", "consumerRepository": "devantler-tech/business-site", "workflow": "publish-app", - "kind": "published-upgrade", + "kind": "published-binding", "sourcePath": "k8s/providers/hetzner/apps/business-site/tenant.yaml", "constructorSpecSha256": "f48b056756b6d49c9b3f741fd597b70ae7c195cadf1ba523a3fec63c1c336d8d", "tenantIdentity": { @@ -31,44 +31,6 @@ "workflowRunId": 41631861843, "workflowRunAttempt": 1, "verifiedOn": "2026-11-03" - }, - "previousBinding": { - "consumer": "business-site", - "consumerRepository": "devantler-tech/business-site", - "workflow": "publish-app", - "kind": "published-binding", - "sourcePath": "k8s/providers/hetzner/apps/business-site/tenant.yaml", - "constructorSpecSha256": "f48b056756b6d49c9b3f741fd597b70ae7c195cadf1ba523a3fec63c1c336d8d", - "tenantIdentity": { - "apiVersion": "kro.run/v1alpha1", - "kind": "Tenant", - "namespace": "flux-system", - "name": "business-site" - }, - "sourceIdentity": { - "apiVersion": "source.toolkit.fluxcd.io/v1", - "kind": "OCIRepository", - "namespace": "business-site", - "name": "business-site", - "artifactURL": "oci://ghcr.io/devantler-tech/business-site/manifests", - "digest": "sha256:2f43bf60c87e373ab99f9fc08f187287d9526b3f1b3212b6234e2ae80b9c5e82" - }, - "publication": { - "gitTag": "v2.0.0", - "sourceSHA": "2eca5f823676adde374556848cf8bf86eb139804", - "publisherIdentity": "devantler-tech/.github/.github/workflows/publish-app.yaml@467f07582436a26b62cf4aa756423512f85ba0c0", - "callerWorkflow": ".github/workflows/publish-runtime.yaml", - "event": "release", - "workflowRunId": 40247127226, - "workflowRunAttempt": 1, - "verifiedOn": "2026-10-26" - } - }, - "previousObservation": { - "uidSha256": "38aff5c8aafbd89fc51dbbe131d27c9a3fb0e78108a20779d0e7a5680a6cc2d2", - "generation": 2, - "snapshotSha256": "1cea4a0991ae5e6093e4f057256fd5ce316599d214fa4b3196a272556879835b", - "observedOn": "2026-11-03" } } ] diff --git a/scripts/publish-workflow-approved-revisions.identities.tsv b/scripts/publish-workflow-approved-revisions.identities.tsv index 71bec2e7be..f28d84a79c 100644 --- a/scripts/publish-workflow-approved-revisions.identities.tsv +++ b/scripts/publish-workflow-approved-revisions.identities.tsv @@ -1,7 +1,7 @@ consumer workflow applied_tag applied_digest applied_publisher_identity main_publisher_identity observed_on -.github publish-manifests 19.0.8 sha256:63ee066e5b9b1309bb29753e9faca112617a5596266a4691a705174351d4fe8c devantler-tech/.github/.github/workflows/publish-manifests.yaml@bd24a3e1bbbf6aba2d7afd58a2fd8a3d67bebe6b devantler-tech/.github/.github/workflows/publish-manifests.yaml@bd24a3e1bbbf6aba2d7afd58a2fd8a3d67bebe6b 2026-11-02 -ascoachingogvaner publish-app 1.15.1 sha256:b7bd9728d0cd1657afd26b3a1c39ba4592ad72480a4078d635d8d48c9d0d618a devantler-tech/.github/.github/workflows/publish-app.yaml@467f07582436a26b62cf4aa756423512f85ba0c0 devantler-tech/.github/.github/workflows/publish-app.yaml@af042c540ce8db4d64add98c34b5c57691e0e812 2026-11-02 -aws publish-manifests 1.1.6 sha256:b612f9b855f016be804f35ee4df875b9a120e7a4a82604b55bf3e8b2d326bcaa devantler-tech/.github/.github/workflows/publish-manifests.yaml@bd24a3e1bbbf6aba2d7afd58a2fd8a3d67bebe6b devantler-tech/.github/.github/workflows/publish-manifests.yaml@bd24a3e1bbbf6aba2d7afd58a2fd8a3d67bebe6b 2026-10-31 -business-site publish-app 2.0.0 sha256:2f43bf60c87e373ab99f9fc08f187287d9526b3f1b3212b6234e2ae80b9c5e82 devantler-tech/.github/.github/workflows/publish-app.yaml@467f07582436a26b62cf4aa756423512f85ba0c0 devantler-tech/.github/.github/workflows/publish-app.yaml@467f07582436a26b62cf4aa756423512f85ba0c0 2026-10-26 +.github publish-manifests 21.3.2 sha256:3cbee859feaae9095b58193092076bad6f793f4e2636d6e6477732bae6c7aa27 devantler-tech/.github/.github/workflows/publish-manifests.yaml@2666baeaf1384d3c2d918e19692b8a6d9fb6fd78 devantler-tech/.github/.github/workflows/publish-manifests.yaml@2666baeaf1384d3c2d918e19692b8a6d9fb6fd78 2026-11-13 +ascoachingogvaner publish-app 1.15.2 sha256:a0565a504ba044cc5790eb376523fcbe8ff4faa3f03ece62f43853ef6840881d devantler-tech/.github/.github/workflows/publish-app.yaml@af042c540ce8db4d64add98c34b5c57691e0e812 devantler-tech/.github/.github/workflows/publish-app.yaml@af042c540ce8db4d64add98c34b5c57691e0e812 2026-11-13 +aws publish-manifests 1.1.7 sha256:8015bcb975eba394c8ad7d988ae8904846b5d9fdd94b2c971b054967cdacb83c devantler-tech/.github/.github/workflows/publish-manifests.yaml@2fa404276b0ce5c0527683b080e39045045c4e42 devantler-tech/.github/.github/workflows/publish-manifests.yaml@2fa404276b0ce5c0527683b080e39045045c4e42 2026-11-13 +business-site publish-app 3.0.0 sha256:7ec5b206635db783d8fd18789605a771cc772946f65339d3f0a2b4e08a14ebc6 devantler-tech/.github/.github/workflows/publish-app.yaml@d8b5d0e9429cebf12907e0d4cb448433d3108e4b devantler-tech/.github/.github/workflows/publish-app.yaml@d8b5d0e9429cebf12907e0d4cb448433d3108e4b 2026-11-13 data-product-controller publish-app 5.4.0 sha256:b9b5ff9e0cedf1305528e058708e9729eed9aa39a5dcdd967b7e74197264fe65 devantler-tech/actions/.github/workflows/publish-app.yaml@ea4df9004d4ab43b6c9af5b0c5f55712f7211328 devantler-tech/.github/.github/workflows/publish-app.yaml@467f07582436a26b62cf4aa756423512f85ba0c0 2026-10-24 -wedding-app publish-app 1.15.24 sha256:6b61d337fe934bd4c5305fbbc4c65f56659f4b22a865203e08cf37fd6f731899 devantler-tech/.github/.github/workflows/publish-app.yaml@467f07582436a26b62cf4aa756423512f85ba0c0 devantler-tech/.github/.github/workflows/publish-app.yaml@af042c540ce8db4d64add98c34b5c57691e0e812 2026-11-02 +wedding-app publish-app 1.15.27 sha256:df6c1e7aa89fc5d89d27f5e29e3b6c7528413265145b500974e19d4c463e3319 devantler-tech/.github/.github/workflows/publish-app.yaml@af042c540ce8db4d64add98c34b5c57691e0e812 devantler-tech/.github/.github/workflows/publish-app.yaml@af042c540ce8db4d64add98c34b5c57691e0e812 2026-11-13 From 0ccd870940241fb75354344a0fcf22642926d1b6 Mon Sep 17 00:00:00 2001 From: Nikolai Emil Damm Date: Fri, 13 Nov 2026 11:45:27 +0100 Subject: [PATCH 5/7] feat(business-site): move the tenant to its signed v3.2.1 release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v3.2.1 is the first business-site release with the two-host runtime and the package-owned public and portal routes. It is signed by the approved publish-app revision d8b5d0e9, as v3.0.0 was. - The binding and the Tenant digest are the unedited output of `bootstrap-tenant-source.sh --prepare-canonical-upgrade --tag v3.2.1`, run against the settled v3.0.0 binding from #6197 and a read-only production context. The preparation verified the release (cosign, tag v3.2.1, source 16cf60a0, run 43400872692) and the live v3.0.0 source (Ready, generation 3). - The Tenant keeps #6174's enabled flags; only its digest moves to sha256:eec71bcf…c66e4. - The rendered authorization surface and the static-scan baseline move only the business-site Tenant entry. Part of #6177 Co-Authored-By: Claude Opus 5.5 --- .../hetzner/apps/business-site/tenant.yaml | 7 +-- scripts/canonical-tenant-source-bindings.json | 50 ++++++++++++++++--- scripts/rgd-template-static-scan-baseline.tsv | 2 +- .../approved-surface.txt | 2 +- 4 files changed, 50 insertions(+), 11 deletions(-) diff --git a/k8s/providers/hetzner/apps/business-site/tenant.yaml b/k8s/providers/hetzner/apps/business-site/tenant.yaml index 035a31939e..cf9b44400a 100644 --- a/k8s/providers/hetzner/apps/business-site/tenant.yaml +++ b/k8s/providers/hetzner/apps/business-site/tenant.yaml @@ -1,7 +1,8 @@ -# Public-only staging: the tenant reconciles its signed v3.0.0 package — the +# Public-only staging: the tenant reconciles its signed v3.2.1 package — the # WebApp at business-site.platform.devantler.tech, its network policy, budget # and disclosure input — while the platform-owned staging hold still denies -# gateway traffic. Portal identity, payments and devantler.tech stay off. +# gateway traffic. Portal identity and payments stay off, and devantler.tech +# keeps pointing at GitHub Pages until the DNS cutover. apiVersion: kro.run/v1alpha1 kind: Tenant metadata: @@ -13,6 +14,6 @@ spec: sops: false webApp: true source: - digest: sha256:7ec5b206635db783d8fd18789605a771cc772946f65339d3f0a2b4e08a14ebc6 + digest: sha256:eec71bcfdf83665f3bcd941c1fb5c5c8e02cffa2b4ba38f76ef1b7cc967c66e4 publisherRevision: d8b5d0e9429cebf12907e0d4cb448433d3108e4b reconcileApplication: true diff --git a/scripts/canonical-tenant-source-bindings.json b/scripts/canonical-tenant-source-bindings.json index 19b39111da..9bf7d5c3e6 100644 --- a/scripts/canonical-tenant-source-bindings.json +++ b/scripts/canonical-tenant-source-bindings.json @@ -5,7 +5,7 @@ "consumer": "business-site", "consumerRepository": "devantler-tech/business-site", "workflow": "publish-app", - "kind": "published-binding", + "kind": "published-upgrade", "sourcePath": "k8s/providers/hetzner/apps/business-site/tenant.yaml", "constructorSpecSha256": "f48b056756b6d49c9b3f741fd597b70ae7c195cadf1ba523a3fec63c1c336d8d", "tenantIdentity": { @@ -20,17 +20,55 @@ "namespace": "business-site", "name": "business-site", "artifactURL": "oci://ghcr.io/devantler-tech/business-site/manifests", - "digest": "sha256:7ec5b206635db783d8fd18789605a771cc772946f65339d3f0a2b4e08a14ebc6" + "digest": "sha256:eec71bcfdf83665f3bcd941c1fb5c5c8e02cffa2b4ba38f76ef1b7cc967c66e4" }, "publication": { - "gitTag": "v3.0.0", - "sourceSHA": "84d4cc47b800597f7683e22dad1c23cfa320434f", + "gitTag": "v3.2.1", + "sourceSHA": "16cf60a01676452c6d139b8b131bed8fdbaa69c0", "publisherIdentity": "devantler-tech/.github/.github/workflows/publish-app.yaml@d8b5d0e9429cebf12907e0d4cb448433d3108e4b", "callerWorkflow": ".github/workflows/publish-runtime.yaml", "event": "release", - "workflowRunId": 41631861843, + "workflowRunId": 43400872692, "workflowRunAttempt": 1, - "verifiedOn": "2026-11-03" + "verifiedOn": "2026-11-13" + }, + "previousBinding": { + "consumer": "business-site", + "consumerRepository": "devantler-tech/business-site", + "workflow": "publish-app", + "kind": "published-binding", + "sourcePath": "k8s/providers/hetzner/apps/business-site/tenant.yaml", + "constructorSpecSha256": "f48b056756b6d49c9b3f741fd597b70ae7c195cadf1ba523a3fec63c1c336d8d", + "tenantIdentity": { + "apiVersion": "kro.run/v1alpha1", + "kind": "Tenant", + "namespace": "flux-system", + "name": "business-site" + }, + "sourceIdentity": { + "apiVersion": "source.toolkit.fluxcd.io/v1", + "kind": "OCIRepository", + "namespace": "business-site", + "name": "business-site", + "artifactURL": "oci://ghcr.io/devantler-tech/business-site/manifests", + "digest": "sha256:7ec5b206635db783d8fd18789605a771cc772946f65339d3f0a2b4e08a14ebc6" + }, + "publication": { + "gitTag": "v3.0.0", + "sourceSHA": "84d4cc47b800597f7683e22dad1c23cfa320434f", + "publisherIdentity": "devantler-tech/.github/.github/workflows/publish-app.yaml@d8b5d0e9429cebf12907e0d4cb448433d3108e4b", + "callerWorkflow": ".github/workflows/publish-runtime.yaml", + "event": "release", + "workflowRunId": 41631861843, + "workflowRunAttempt": 1, + "verifiedOn": "2026-11-03" + } + }, + "previousObservation": { + "uidSha256": "38aff5c8aafbd89fc51dbbe131d27c9a3fb0e78108a20779d0e7a5680a6cc2d2", + "generation": 3, + "snapshotSha256": "8b662b4f0b5ec50bd31eb3fbfc74eeb256288a2dbbae5f482d8f968eb6f2b33a", + "observedOn": "2026-11-13" } } ] diff --git a/scripts/rgd-template-static-scan-baseline.tsv b/scripts/rgd-template-static-scan-baseline.tsv index 75964bca40..ce36f447bf 100644 --- a/scripts/rgd-template-static-scan-baseline.tsv +++ b/scripts/rgd-template-static-scan-baseline.tsv @@ -42,4 +42,4 @@ 1 k8s/bases/infrastructure/resource-graph-definitions/webapp/resource-graph-definition.yaml.resources/service.yaml KSV-0040 LOW CAUSE-SHA256:79c2597bf128e3ca530288250548c211e5e43a66a10d3c88748c6db4ac565920 1 k8s/providers/docker/apps/tenant-ascoachingogvaner.yaml INSTANCE-CONTENT SHA256 7e65481a62deb24c89dca2e5f83969e308e7604e770d97edb15e86ecc948f22c 1 k8s/providers/docker/apps/web-app-wedding-app.yaml INSTANCE-CONTENT SHA256 3d42027c7e549014cad1e717876a6eb72e0a6641f3bf181f7a0e1a70d94306d6 -1 k8s/providers/hetzner/apps/business-site/tenant.yaml INSTANCE-CONTENT SHA256 f41cf288531722e872f273a55d0ed3d8827c642f49d37341f9e7f4a88fd75d45 +1 k8s/providers/hetzner/apps/business-site/tenant.yaml INSTANCE-CONTENT SHA256 c67f4edf55d452ea5d75f5fd3a73caf0979b6181ff2394fb56b5993922715c98 diff --git a/scripts/validate-eks-ci-role-policy/approved-surface.txt b/scripts/validate-eks-ci-role-policy/approved-surface.txt index 041bdf082d..cf02b5b92a 100644 --- a/scripts/validate-eks-ci-role-policy/approved-surface.txt +++ b/scripts/validate-eks-ci-role-policy/approved-surface.txt @@ -130,7 +130,7 @@ iam.aws.m.upbound.io/v1beta1|Role|aws|eks-ci c40205b3f48d193e8be1a39abda738865b9 kro.run/v1alpha1|ResourceGraphDefinition||tenant.kro.run 72f3f972cecdf3ca2e315deb4224bd28c1df1244fc7973a88eb7f4fc03ac1d05 -kro.run/v1alpha1|Tenant|flux-system|business-site 47380ca8c8781c2de6b17226e44ac7cef030e13a89c8b41dae9ddf459304b3a4 +kro.run/v1alpha1|Tenant|flux-system|business-site b982807b4f214b300a98e1d1d333e30934f01b95dfcfd2ddc7ceec26afdac18e kustomize.toolkit.fluxcd.io/v1|Kustomization|ascoachingogvaner|ascoachingogvaner ac00ca29c04de8d2c30a045d583570536a97fc305a1b06c4300da018ecdfb864 From bfdd67a74030b2917fd123e5867e5f4809b36760 Mon Sep 17 00:00:00 2001 From: Nikolai Emil Damm Date: Fri, 13 Nov 2026 15:04:48 +0100 Subject: [PATCH 6/7] fix(business-site): move the tenant to v3.2.2, signed by a publisher the image check trusts v3.0.0 and v3.2.1 were signed by publish-app v19.0.12, which the tenant source approved but production's image admission check does not, so the staging Deployment was denied. v3.2.2 is signed by v19.0.5, which the admission check, the node pull rule and the tenant source all trust. Business-site's approvals become v19.0.12 (the binding it moves from) and v19.0.5 (the one it moves to); v8.0.0 is no longer used by it. The upgrade record, Tenant digest and publisher, scan-baseline hash and ledger line come from the platform's own preparation and validators. Part of #6177 Co-Authored-By: Claude Opus 5.5 --- k8s/providers/hetzner/apps/business-site/tenant.yaml | 6 +++--- scripts/canonical-tenant-source-bindings.json | 10 +++++----- scripts/publish-workflow-canonical-approvals.tsv | 2 +- scripts/rgd-template-static-scan-baseline.tsv | 2 +- scripts/tests/test-bootstrap-tenant-source.sh | 6 +++--- .../validate-eks-ci-role-policy/approved-surface.txt | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/k8s/providers/hetzner/apps/business-site/tenant.yaml b/k8s/providers/hetzner/apps/business-site/tenant.yaml index cf9b44400a..7c57aac381 100644 --- a/k8s/providers/hetzner/apps/business-site/tenant.yaml +++ b/k8s/providers/hetzner/apps/business-site/tenant.yaml @@ -1,4 +1,4 @@ -# Public-only staging: the tenant reconciles its signed v3.2.1 package — the +# Public-only staging: the tenant reconciles its signed v3.2.2 package — the # WebApp at business-site.platform.devantler.tech, its network policy, budget # and disclosure input — while the platform-owned staging hold still denies # gateway traffic. Portal identity and payments stay off, and devantler.tech @@ -14,6 +14,6 @@ spec: sops: false webApp: true source: - digest: sha256:eec71bcfdf83665f3bcd941c1fb5c5c8e02cffa2b4ba38f76ef1b7cc967c66e4 - publisherRevision: d8b5d0e9429cebf12907e0d4cb448433d3108e4b + digest: sha256:78401ed9c68e66427e826bb610d42c6c307ec67135b99be4ce956f21073baaa8 + publisherRevision: af042c540ce8db4d64add98c34b5c57691e0e812 reconcileApplication: true diff --git a/scripts/canonical-tenant-source-bindings.json b/scripts/canonical-tenant-source-bindings.json index 9bf7d5c3e6..7265ac802b 100644 --- a/scripts/canonical-tenant-source-bindings.json +++ b/scripts/canonical-tenant-source-bindings.json @@ -20,15 +20,15 @@ "namespace": "business-site", "name": "business-site", "artifactURL": "oci://ghcr.io/devantler-tech/business-site/manifests", - "digest": "sha256:eec71bcfdf83665f3bcd941c1fb5c5c8e02cffa2b4ba38f76ef1b7cc967c66e4" + "digest": "sha256:78401ed9c68e66427e826bb610d42c6c307ec67135b99be4ce956f21073baaa8" }, "publication": { - "gitTag": "v3.2.1", - "sourceSHA": "16cf60a01676452c6d139b8b131bed8fdbaa69c0", - "publisherIdentity": "devantler-tech/.github/.github/workflows/publish-app.yaml@d8b5d0e9429cebf12907e0d4cb448433d3108e4b", + "gitTag": "v3.2.2", + "sourceSHA": "6fdbbf6db9357c8754e55be2c737308378690d20", + "publisherIdentity": "devantler-tech/.github/.github/workflows/publish-app.yaml@af042c540ce8db4d64add98c34b5c57691e0e812", "callerWorkflow": ".github/workflows/publish-runtime.yaml", "event": "release", - "workflowRunId": 43400872692, + "workflowRunId": 43435792740, "workflowRunAttempt": 1, "verifiedOn": "2026-11-13" }, diff --git a/scripts/publish-workflow-canonical-approvals.tsv b/scripts/publish-workflow-canonical-approvals.tsv index f471dac367..a52d84f97f 100644 --- a/scripts/publish-workflow-canonical-approvals.tsv +++ b/scripts/publish-workflow-canonical-approvals.tsv @@ -5,7 +5,7 @@ aws publish-manifests devantler-tech/.github bd24a3e1bbbf6aba2d7afd58a2fd8a3d67b .github publish-manifests devantler-tech/.github 2666baeaf1384d3c2d918e19692b8a6d9fb6fd78 ascoachingogvaner publish-app devantler-tech/.github 467f07582436a26b62cf4aa756423512f85ba0c0 ascoachingogvaner publish-app devantler-tech/.github af042c540ce8db4d64add98c34b5c57691e0e812 -business-site publish-app devantler-tech/.github 467f07582436a26b62cf4aa756423512f85ba0c0 +business-site publish-app devantler-tech/.github af042c540ce8db4d64add98c34b5c57691e0e812 business-site publish-app devantler-tech/.github d8b5d0e9429cebf12907e0d4cb448433d3108e4b data-product-controller publish-app devantler-tech/.github 467f07582436a26b62cf4aa756423512f85ba0c0 wedding-app publish-app devantler-tech/.github 467f07582436a26b62cf4aa756423512f85ba0c0 diff --git a/scripts/rgd-template-static-scan-baseline.tsv b/scripts/rgd-template-static-scan-baseline.tsv index ce36f447bf..9d49af176a 100644 --- a/scripts/rgd-template-static-scan-baseline.tsv +++ b/scripts/rgd-template-static-scan-baseline.tsv @@ -42,4 +42,4 @@ 1 k8s/bases/infrastructure/resource-graph-definitions/webapp/resource-graph-definition.yaml.resources/service.yaml KSV-0040 LOW CAUSE-SHA256:79c2597bf128e3ca530288250548c211e5e43a66a10d3c88748c6db4ac565920 1 k8s/providers/docker/apps/tenant-ascoachingogvaner.yaml INSTANCE-CONTENT SHA256 7e65481a62deb24c89dca2e5f83969e308e7604e770d97edb15e86ecc948f22c 1 k8s/providers/docker/apps/web-app-wedding-app.yaml INSTANCE-CONTENT SHA256 3d42027c7e549014cad1e717876a6eb72e0a6641f3bf181f7a0e1a70d94306d6 -1 k8s/providers/hetzner/apps/business-site/tenant.yaml INSTANCE-CONTENT SHA256 c67f4edf55d452ea5d75f5fd3a73caf0979b6181ff2394fb56b5993922715c98 +1 k8s/providers/hetzner/apps/business-site/tenant.yaml INSTANCE-CONTENT SHA256 b9c7d9964a40b82db85da1784fbd8b0baf6f5e36f7de2c41f0a3c323e2c2fb46 diff --git a/scripts/tests/test-bootstrap-tenant-source.sh b/scripts/tests/test-bootstrap-tenant-source.sh index 5b16ecb65f..db62c99ac2 100755 --- a/scripts/tests/test-bootstrap-tenant-source.sh +++ b/scripts/tests/test-bootstrap-tenant-source.sh @@ -206,7 +206,7 @@ echo 'bootstrap requires complete inventory and a verified immutable publication biz_work="$test_work/business" mkdir -p "$biz_work/bin" export BIZ_WORK="$biz_work" -export BIZ_SIGNER=467f07582436a26b62cf4aa756423512f85ba0c0 +export BIZ_SIGNER=af042c540ce8db4d64add98c34b5c57691e0e812 for approval in publish-workflow-approved-revisions.tsv publish-workflow-approved-revisions.identities.tsv \ publish-workflow-canonical-approvals.tsv publish-workflow-bootstrap-publications.json; do cp "$test_repo_root/scripts/$approval" "$biz_work/before-$approval" @@ -320,7 +320,7 @@ jq -e 'keys == ["callerWorkflow","consumer","deploymentAuthorized","digest","eve .deploymentAuthorized==false and .gitTag=="v1.0.2" and .sourceSHA=="e5eb256dcb5dbf3857257e9072937ab95f1ea6c3" and .digest=="sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" and - .publisherIdentity=="devantler-tech/.github/.github/workflows/publish-app.yaml@467f07582436a26b62cf4aa756423512f85ba0c0" and + .publisherIdentity=="devantler-tech/.github/.github/workflows/publish-app.yaml@af042c540ce8db4d64add98c34b5c57691e0e812" and .callerWorkflow==".github/workflows/publish-runtime.yaml" and .event=="release" and .workflowRunId==39869859801 and .workflowRunAttempt==1' "$biz_work/receipt.json" >/dev/null if read_bound_publications "$test_repo_root" "$biz_work/receipt.json" >/dev/null 2>&1; then @@ -365,7 +365,7 @@ for BIZ_SIGNER in f5d078cc4b04ecb15432ed4e34cba1142a6279d4 111111111111111111111 fi test ! -s "$biz_work/refusal" done -BIZ_SIGNER=467f07582436a26b62cf4aa756423512f85ba0c0 +BIZ_SIGNER=af042c540ce8db4d64add98c34b5c57691e0e812 for BIZ_CASE in wrong-event wrong-caller wrong-source wrong-tag wrong-product wrong-publisher duplicate-publisher \ malformed-list trailing-list incomplete-list run-read-failure tag-read-failure wrong-caller-pin multi-document-caller \ signature-failure malformed-signature trailing-signature wrong-digest wrong-reference changed-attempt moved-tag withdrawn-release \ diff --git a/scripts/validate-eks-ci-role-policy/approved-surface.txt b/scripts/validate-eks-ci-role-policy/approved-surface.txt index 59059dd9fb..4dae63aac3 100644 --- a/scripts/validate-eks-ci-role-policy/approved-surface.txt +++ b/scripts/validate-eks-ci-role-policy/approved-surface.txt @@ -132,7 +132,7 @@ iam.aws.m.upbound.io/v1beta1|Role|aws|ses-account-setup 7faa58457f4a17a3c14368d3 kro.run/v1alpha1|ResourceGraphDefinition||tenant.kro.run 72f3f972cecdf3ca2e315deb4224bd28c1df1244fc7973a88eb7f4fc03ac1d05 -kro.run/v1alpha1|Tenant|flux-system|business-site b982807b4f214b300a98e1d1d333e30934f01b95dfcfd2ddc7ceec26afdac18e +kro.run/v1alpha1|Tenant|flux-system|business-site e399acf3fa79ab13dfed2c6efe02840d963e97584bbdf29a85d247784348f6bb kustomize.toolkit.fluxcd.io/v1|Kustomization|ascoachingogvaner|ascoachingogvaner ac00ca29c04de8d2c30a045d583570536a97fc305a1b06c4300da018ecdfb864 From 2341366097a9d22ca1b657c0279d4369e6640c7c Mon Sep 17 00:00:00 2001 From: Nikolai Emil Damm Date: Fri, 13 Nov 2026 16:06:08 +0100 Subject: [PATCH 7/7] fix(business-site): list the approval being moved from first The approvals library drops a consumer's first row once its publisher move lands, so the revision being moved from (v19.0.12) goes first and the destination (v19.0.5) second. Part of #6177 Co-Authored-By: Claude Opus 5.5 --- scripts/publish-workflow-canonical-approvals.tsv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/publish-workflow-canonical-approvals.tsv b/scripts/publish-workflow-canonical-approvals.tsv index a52d84f97f..bdcd610e41 100644 --- a/scripts/publish-workflow-canonical-approvals.tsv +++ b/scripts/publish-workflow-canonical-approvals.tsv @@ -5,8 +5,8 @@ aws publish-manifests devantler-tech/.github bd24a3e1bbbf6aba2d7afd58a2fd8a3d67b .github publish-manifests devantler-tech/.github 2666baeaf1384d3c2d918e19692b8a6d9fb6fd78 ascoachingogvaner publish-app devantler-tech/.github 467f07582436a26b62cf4aa756423512f85ba0c0 ascoachingogvaner publish-app devantler-tech/.github af042c540ce8db4d64add98c34b5c57691e0e812 -business-site publish-app devantler-tech/.github af042c540ce8db4d64add98c34b5c57691e0e812 business-site publish-app devantler-tech/.github d8b5d0e9429cebf12907e0d4cb448433d3108e4b +business-site publish-app devantler-tech/.github af042c540ce8db4d64add98c34b5c57691e0e812 data-product-controller publish-app devantler-tech/.github 467f07582436a26b62cf4aa756423512f85ba0c0 wedding-app publish-app devantler-tech/.github 467f07582436a26b62cf4aa756423512f85ba0c0 wedding-app publish-app devantler-tech/.github af042c540ce8db4d64add98c34b5c57691e0e812