From b42df44730d2ec07104a6dbd6d83423c213eb682 Mon Sep 17 00:00:00 2001 From: Nikolai Emil Damm Date: Fri, 13 Nov 2026 06:17:55 +0100 Subject: [PATCH 1/3] feat(crossplane): install the AWS SES provider for company mail Company Email's outbound mail moves to Amazon SES, so the platform needs the SES v2 member of the Upbound AWS provider family, pinned to the family's release and verified with the same Upbound signature check and name guard as the IAM provider. This prerequisite revision also activates the kinds the next revisions use: the SES domain identity and MAIL FROM domain, which the aws tenant may write, and the IAM user, policy attachment and access key of the SMTP sending identity, which stay platform-owned. The provider may reach only the SES v2 API in the account's region, and its singleton gets the same Coroot availability acceptance and Kubescape secret-reader exception as the other AWS providers. No AWS resource is created yet. Part of devantler-tech/platform#5481. Co-Authored-By: Claude Opus 5.5 --- .github/renovate.json | 5 +- .../secret-reader-rbac.yaml | 3 + k8s/providers/hetzner/apps/aws/role.yaml | 18 +++++ .../crossplane/cilium-network-policy.yaml | 5 ++ .../coroot/config-map-risk-acceptances.yaml | 6 ++ .../cron-job-risk-acceptance-reconciler.yaml | 8 +- .../deployment-runtime-config-aws-sesv2.yaml | 73 +++++++++++++++++++ .../crossplane/kustomization.yaml | 2 + ...anaged-resource-activation-policy-aws.yaml | 12 +++ .../crossplane/provider-aws-sesv2.yaml | 15 ++++ scripts/check-upbound-package-signatures.sh | 3 +- .../tests/crossplane-egress-policy-rules.yaml | 2 + .../test-check-upbound-package-signatures.sh | 27 +++++-- .../test-coroot-risk-acceptance-reconciler.sh | 9 ++- .../tests/test-crossplane-egress-policy.sh | 4 +- 15 files changed, 176 insertions(+), 16 deletions(-) create mode 100644 k8s/providers/hetzner/infrastructure/crossplane/deployment-runtime-config-aws-sesv2.yaml create mode 100644 k8s/providers/hetzner/infrastructure/crossplane/provider-aws-sesv2.yaml diff --git a/.github/renovate.json b/.github/renovate.json index ee543e57c7..25468770e0 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -331,11 +331,12 @@ "automerge": false }, { - "description": "provider-aws-iam depends on provider-family-aws, which ships the ProviderConfig CRD every family member uses, and the two must be pinned to the same release (see provider-aws-iam.yaml), so they move in one PR. Grouping does not force equal versions; scripts/tests/test-crossplane-aws-family-version-parity.sh fails a PR that pins them apart.", + "description": "provider-aws-iam and provider-aws-sesv2 depend on provider-family-aws, which ships the ProviderConfig CRD every family member uses, and all of them must be pinned to the same release (see provider-aws-iam.yaml), so they move in one PR. Grouping does not force equal versions; scripts/tests/test-crossplane-aws-family-version-parity.sh fails a PR that pins them apart.", "matchManagers": ["crossplane"], "matchPackageNames": [ "xpkg.upbound.io/upbound/provider-family-aws", - "xpkg.upbound.io/upbound/provider-aws-iam" + "xpkg.upbound.io/upbound/provider-aws-iam", + "xpkg.upbound.io/upbound/provider-aws-sesv2" ], "groupName": "crossplane aws providers" }, diff --git a/k8s/bases/infrastructure/cluster-security-exceptions/secret-reader-rbac.yaml b/k8s/bases/infrastructure/cluster-security-exceptions/secret-reader-rbac.yaml index 659502f6b4..a3c0f6abc1 100644 --- a/k8s/bases/infrastructure/cluster-security-exceptions/secret-reader-rbac.yaml +++ b/k8s/bases/infrastructure/cluster-security-exceptions/secret-reader-rbac.yaml @@ -139,6 +139,9 @@ spec: - apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: ^crossplane:provider:upbound-provider-family-aws-[0-9a-f]+:system$ + - apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: ^crossplane:provider:upbound-provider-aws-sesv2-[0-9a-f]+:system$ - apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: ^crossplane:provider:provider-upjet-github-[0-9a-f]+:system$ diff --git a/k8s/providers/hetzner/apps/aws/role.yaml b/k8s/providers/hetzner/apps/aws/role.yaml index 3d0daf8bd6..20b65a94ca 100644 --- a/k8s/providers/hetzner/apps/aws/role.yaml +++ b/k8s/providers/hetzner/apps/aws/role.yaml @@ -20,6 +20,11 @@ # (policy-eks-ci-smoke-boundary.yaml) and the role it constrains # (role-eks-ci.yaml) are platform-owned. The artifact keeps only the OIDC # provider, which is what it legitimately owns. +# +# Company Email's SES domain identity and its MAIL FROM domain (platform#5481) +# grant no AWS permission to anyone, so the tenant may own them. The IAM user, +# policy and access key of the SMTP sending identity stay platform-owned for the +# same reason as the boundary above, so no IAM user kind is granted here. apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: @@ -40,3 +45,16 @@ rules: - update - patch - delete + - apiGroups: + - sesv2.aws.m.upbound.io + resources: + - emailidentities + - emailidentitymailfromattributes + verbs: + - get + - list + - watch + - create + - update + - patch + - delete diff --git a/k8s/providers/hetzner/infrastructure/controllers/crossplane/cilium-network-policy.yaml b/k8s/providers/hetzner/infrastructure/controllers/crossplane/cilium-network-policy.yaml index 2cd17da8b0..93af50e930 100644 --- a/k8s/providers/hetzner/infrastructure/controllers/crossplane/cilium-network-policy.yaml +++ b/k8s/providers/hetzner/infrastructure/controllers/crossplane/cilium-network-policy.yaml @@ -39,6 +39,9 @@ spec: # AWS identity APIs used by provider-aws-iam. The provider calls STS # GetCallerIdentity before reconciling IAM resources, then uses the # global IAM endpoint for the managed OIDC provider and role. + # email.eu-central-1.amazonaws.com — the SES v2 API used by + # provider-aws-sesv2 for company Email's sending identity, in the + # account's existing region (platform#5481). # api.ui.com — the UniFi Cloud Connector endpoint used by # provider-upjet-unifi for every managed-resource request. - toFQDNs: @@ -49,6 +52,7 @@ spec: - matchName: "d3qrbvrml4iuq4.cloudfront.net" - matchName: "sts.eu-central-1.amazonaws.com" - matchName: "iam.amazonaws.com" + - matchName: "email.eu-central-1.amazonaws.com" - matchName: "api.ui.com" toPorts: - ports: @@ -77,5 +81,6 @@ spec: - matchName: "d3qrbvrml4iuq4.cloudfront.net" - matchName: "sts.eu-central-1.amazonaws.com" - matchName: "iam.amazonaws.com" + - matchName: "email.eu-central-1.amazonaws.com" - matchName: "api.ui.com" - matchPattern: "*.cluster.local" diff --git a/k8s/providers/hetzner/infrastructure/coroot/config-map-risk-acceptances.yaml b/k8s/providers/hetzner/infrastructure/coroot/config-map-risk-acceptances.yaml index 3a072d9a22..a2df495de3 100644 --- a/k8s/providers/hetzner/infrastructure/coroot/config-map-risk-acceptances.yaml +++ b/k8s/providers/hetzner/infrastructure/coroot/config-map-risk-acceptances.yaml @@ -229,6 +229,12 @@ data: "type": "single-instance-app", "reason": "platform#3812: provider revision names rotate; a singleton remains off the serving path and prevents duplicate AWS writes" }, + { + "application_pattern": "^crossplane-system:Deployment:upbound-provider-aws-sesv2-[0-9a-f]{12}\\z", + "category": "Availability", + "type": "single-instance-app", + "reason": "platform#3812: provider revision names rotate; a singleton remains off the serving path and prevents duplicate AWS writes" + }, { "application": "velero:Deployment:velero", "category": "Availability", diff --git a/k8s/providers/hetzner/infrastructure/coroot/cron-job-risk-acceptance-reconciler.yaml b/k8s/providers/hetzner/infrastructure/coroot/cron-job-risk-acceptance-reconciler.yaml index a3ff85b392..87069fd4b3 100644 --- a/k8s/providers/hetzner/infrastructure/coroot/cron-job-risk-acceptance-reconciler.yaml +++ b/k8s/providers/hetzner/infrastructure/coroot/cron-job-risk-acceptance-reconciler.yaml @@ -95,11 +95,13 @@ spec: UNIFI_PROVIDER_PATTERN='^crossplane-system:Deployment:provider-upjet-unifi-[0-9a-f]{12}\z' AWS_IAM_PROVIDER_PATTERN='^crossplane-system:Deployment:provider-aws-iam-[0-9a-f]{12}\z' AWS_FAMILY_PROVIDER_PATTERN='^crossplane-system:Deployment:upbound-provider-family-aws-[0-9a-f]{12}\z' + AWS_SESV2_PROVIDER_PATTERN='^crossplane-system:Deployment:upbound-provider-aws-sesv2-[0-9a-f]{12}\z' jq -e --arg instance_manager_pattern "$LONGHORN_INSTANCE_MANAGER_PATTERN" \ --arg github_provider_pattern "$GITHUB_PROVIDER_PATTERN" \ --arg unifi_provider_pattern "$UNIFI_PROVIDER_PATTERN" \ --arg aws_iam_provider_pattern "$AWS_IAM_PROVIDER_PATTERN" \ - --arg aws_family_provider_pattern "$AWS_FAMILY_PROVIDER_PATTERN" ' + --arg aws_family_provider_pattern "$AWS_FAMILY_PROVIDER_PATTERN" \ + --arg aws_sesv2_provider_pattern "$AWS_SESV2_PROVIDER_PATTERN" ' type == "array" and all(.[]; ((has("application") and (has("application_pattern") | not) and @@ -116,13 +118,15 @@ spec: (.application_pattern == $aws_iam_provider_pattern and (.reason | startswith("platform#3812: "))) or (.application_pattern == $aws_family_provider_pattern and + (.reason | startswith("platform#3812: "))) or + (.application_pattern == $aws_sesv2_provider_pattern and (.reason | startswith("platform#3812: ")))))) and .category == "Availability" and (.type as $type | ["single-instance-app", "single-node-app", "single-az-app", "spot-only-app", "unreplicated-database"] | index($type) != null) ) and - ([.[] | select(has("application_pattern"))] | length <= 5) and + ([.[] | select(has("application_pattern"))] | length <= 6) and ([.[] | [(.application // .application_pattern), .category, .type] | @tsv] | length) == ([.[] | [(.application // .application_pattern), .category, .type] | @tsv] | unique | length) ' "$ACCEPTANCES_FILE" >/dev/null || { diff --git a/k8s/providers/hetzner/infrastructure/crossplane/deployment-runtime-config-aws-sesv2.yaml b/k8s/providers/hetzner/infrastructure/crossplane/deployment-runtime-config-aws-sesv2.yaml new file mode 100644 index 0000000000..6d0f648331 --- /dev/null +++ b/k8s/providers/hetzner/infrastructure/crossplane/deployment-runtime-config-aws-sesv2.yaml @@ -0,0 +1,73 @@ +# Bounded resources for the AWS SES v2 provider runtime pod (the same bounds as +# the IAM provider; AWS_REGION is the region SES resources default to). +apiVersion: pkg.crossplane.io/v1beta1 +kind: DeploymentRuntimeConfig +metadata: + name: provider-aws-sesv2 +spec: + deploymentTemplate: + spec: + selector: {} + template: + spec: + # validate-pod-security's require-seccomp-profile asserts the POD-level + # path, and Crossplane's package manager creates this Deployment + # directly, so the container-level value below does not satisfy it and + # the create is denied by the fail-closed webhook. add-security-context + # cannot fill the gap either: its match/exclude carry pod selectors, so + # Kyverno generates no pod-controller rules for it and it never sees a + # Deployment. The DRC therefore has to state this itself. + # + # The package manager applies its pod-level defaults only when the DRC + # provides no securityContext at all, so this block has to restate + # them verbatim (runAsNonRoot/runAsUser/runAsGroup = Crossplane's + # documented 2000) — adding seccompProfile alone would drop the uid + # the provider images run as. + securityContext: + runAsNonRoot: true + runAsUser: 2000 + runAsGroup: 2000 + seccompProfile: + type: RuntimeDefault + containers: + - name: package-runtime + # IAM is global, but the provider validates credentials through + # STS before each reconciliation. Pin that call to the planned + # EKS region so the runtime and its exact-host egress policy stay + # aligned instead of falling back to us-east-1. + env: + - name: AWS_REGION + value: eu-central-1 + - name: AWS_STS_REGIONAL_ENDPOINTS + value: regional + # Kubescape C-0017 (immutable container filesystem) + the hardening + # set Kyverno injects at admission (Kubescape scans this stored spec, + # not the live pod). The upjet runtime writes Terraform workspaces to + # /tmp/; this provider has no managed resources today so a + # read-only root does not break it yet, but the writable /tmp emptyDir + # is added defensively (same code path as provider-upjet-unifi, which + # is actively failing on a read-only /tmp) so a future managed resource + # cannot silently fail to reconcile. runAsUser/runAsGroup left to + # Crossplane's package-manager default (2000). + securityContext: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + runAsNonRoot: true + capabilities: + drop: + - ALL + seccompProfile: + type: RuntimeDefault + seLinuxOptions: {} + resources: + requests: + cpu: 10m + memory: 128Mi + limits: + memory: 512Mi + volumeMounts: + - name: tmp + mountPath: /tmp + volumes: + - name: tmp + emptyDir: {} diff --git a/k8s/providers/hetzner/infrastructure/crossplane/kustomization.yaml b/k8s/providers/hetzner/infrastructure/crossplane/kustomization.yaml index 49ddde0b18..9f5df7c567 100644 --- a/k8s/providers/hetzner/infrastructure/crossplane/kustomization.yaml +++ b/k8s/providers/hetzner/infrastructure/crossplane/kustomization.yaml @@ -5,10 +5,12 @@ resources: - provider.yaml - provider-family-aws.yaml - provider-aws-iam.yaml + - provider-aws-sesv2.yaml - provider-upjet-unifi.yaml - deployment-runtime-config.yaml - deployment-runtime-config-family-aws.yaml - deployment-runtime-config-aws-iam.yaml + - deployment-runtime-config-aws-sesv2.yaml - deployment-runtime-config-upjet-unifi.yaml - managed-resource-activation-policy.yaml - managed-resource-activation-policy-arc.yaml diff --git a/k8s/providers/hetzner/infrastructure/crossplane/managed-resource-activation-policy-aws.yaml b/k8s/providers/hetzner/infrastructure/crossplane/managed-resource-activation-policy-aws.yaml index 0aa7099792..66ac9b2213 100644 --- a/k8s/providers/hetzner/infrastructure/crossplane/managed-resource-activation-policy-aws.yaml +++ b/k8s/providers/hetzner/infrastructure/crossplane/managed-resource-activation-policy-aws.yaml @@ -6,6 +6,13 @@ # (aws#4 security hardening: roles the CI principal creates must carry a # boundary, so it cannot mint-and-pass an unbounded role). Broad # Policy/RolePolicyAttachment use stays deliberately off. +# +# Company Email's outbound relay (platform#5481) adds the SES v2 domain +# identity and its MAIL FROM domain, plus the IAM user, policy attachment and +# access key of its send-only SMTP identity. The tenant may write only the two +# SES kinds; the IAM user kinds stay platform-owned, as the EKS CI role does. +# They are activated here, a revision before anything uses them, so no later +# apply waits on a CRD that does not exist yet. --- apiVersion: apiextensions.crossplane.io/v1alpha1 kind: ManagedResourceActivationPolicy @@ -16,3 +23,8 @@ spec: - openidconnectproviders.iam.aws.m.upbound.io - policies.iam.aws.m.upbound.io - roles.iam.aws.m.upbound.io + - users.iam.aws.m.upbound.io + - userpolicyattachments.iam.aws.m.upbound.io + - accesskeys.iam.aws.m.upbound.io + - emailidentities.sesv2.aws.m.upbound.io + - emailidentitymailfromattributes.sesv2.aws.m.upbound.io diff --git a/k8s/providers/hetzner/infrastructure/crossplane/provider-aws-sesv2.yaml b/k8s/providers/hetzner/infrastructure/crossplane/provider-aws-sesv2.yaml new file mode 100644 index 0000000000..5368384691 --- /dev/null +++ b/k8s/providers/hetzner/infrastructure/crossplane/provider-aws-sesv2.yaml @@ -0,0 +1,15 @@ +# provider-aws-sesv2 — the SES v2 family member for company Email's outbound +# relay (platform#5481). It reconciles the sending domain identity and its MAIL +# FROM domain. Canonically named after its package, so Crossplane's dependency +# resolution finds it. Its package version must match provider-family-aws (see +# provider-family-aws.yaml). Resource-bounded via +# deployment-runtime-config-aws-sesv2.yaml. +--- +apiVersion: pkg.crossplane.io/v1 +kind: Provider +metadata: + name: upbound-provider-aws-sesv2 +spec: + package: xpkg.upbound.io/upbound/provider-aws-sesv2:v2.9.1 + runtimeConfigRef: + name: provider-aws-sesv2 diff --git a/scripts/check-upbound-package-signatures.sh b/scripts/check-upbound-package-signatures.sh index a5bd9943a0..ec2e29fc8e 100755 --- a/scripts/check-upbound-package-signatures.sh +++ b/scripts/check-upbound-package-signatures.sh @@ -62,10 +62,11 @@ expected_repository() { case "$1" in provider-aws-iam) echo "${UPBOUND_PREFIX}provider-aws-iam" ;; upbound-provider-family-aws) echo "${UPBOUND_PREFIX}provider-family-aws" ;; + upbound-provider-aws-sesv2) echo "${UPBOUND_PREFIX}provider-aws-sesv2" ;; *) return 1 ;; esac } -for name in provider-aws-iam upbound-provider-family-aws; do +for name in provider-aws-iam upbound-provider-family-aws upbound-provider-aws-sesv2; do repository="$(expected_repository "$name")" yq ea -r "select(.apiVersion == \"pkg.crossplane.io/v1\" and .kind == \"Provider\" and .metadata.name == \"$name\") | .spec.package" \ "$rendered" >"$scratch/named.txt" diff --git a/scripts/tests/crossplane-egress-policy-rules.yaml b/scripts/tests/crossplane-egress-policy-rules.yaml index dd734897fc..1dc89ef880 100644 --- a/scripts/tests/crossplane-egress-policy-rules.yaml +++ b/scripts/tests/crossplane-egress-policy-rules.yaml @@ -63,6 +63,7 @@ rules: {'matchName': 'd3qrbvrml4iuq4.cloudfront.net'}, {'matchName': 'sts.eu-central-1.amazonaws.com'}, {'matchName': 'iam.amazonaws.com'}, + {'matchName': 'email.eu-central-1.amazonaws.com'}, {'matchName': 'api.ui.com'} ], 'toPorts': [{'ports': [ @@ -87,6 +88,7 @@ rules: {'matchName': 'd3qrbvrml4iuq4.cloudfront.net'}, {'matchName': 'sts.eu-central-1.amazonaws.com'}, {'matchName': 'iam.amazonaws.com'}, + {'matchName': 'email.eu-central-1.amazonaws.com'}, {'matchName': 'api.ui.com'}, {'matchPattern': '*.cluster.local'} ]} diff --git a/scripts/tests/test-check-upbound-package-signatures.sh b/scripts/tests/test-check-upbound-package-signatures.sh index b8bf3c7472..6553fa47ad 100755 --- a/scripts/tests/test-check-upbound-package-signatures.sh +++ b/scripts/tests/test-check-upbound-package-signatures.sh @@ -26,6 +26,13 @@ spec: --- apiVersion: pkg.crossplane.io/v1 kind: Provider +metadata: + name: upbound-provider-aws-sesv2 +spec: + package: xpkg.upbound.io/upbound/provider-aws-sesv2:v2.6.1 +--- +apiVersion: pkg.crossplane.io/v1 +kind: Provider metadata: name: provider-upjet-github spec: @@ -61,6 +68,10 @@ sed "s|package: xpkg.upbound.io\/upbound\/provider-aws-iam:v2.6.1|package: ghcr. "$scratch/rendered.yaml" >"$scratch/repointed.yaml" # A privileged provider that is no longer rendered at all. yq ea 'select(.metadata.name != "provider-aws-iam")' "$scratch/rendered.yaml" >"$scratch/missing.yaml" +# The SES provider holds the same AWS credential, so it is guarded by name too. +sed "s|package: xpkg.upbound.io\/upbound\/provider-aws-sesv2:v2.6.1|package: ghcr.io\/evil\/provider-aws-sesv2:v2.6.1|" \ + "$scratch/rendered.yaml" >"$scratch/repointed-sesv2.yaml" +yq ea 'select(.metadata.name != "upbound-provider-aws-sesv2")' "$scratch/rendered.yaml" >"$scratch/missing-sesv2.yaml" # Fake cosign: `cosign verify --certificate-oidc-issuer I --certificate-identity ID REF`. # COSIGN_MODE picks the behaviour; every call is logged so the test can see @@ -129,13 +140,13 @@ expect() { echo "ok: $name" } -expect 'both signed Upbound packages verify' 0 \ - '2 Upbound package signatures verified' "$scratch/rendered.yaml" -if [[ "$(cat "$scratch/events.log")" != $'verify\nsleep:30\nverify\nsleep:30\nverify\nsleep:30\nverify\nsleep:30\nverify\nsleep:30\nverify' ]]; then +expect 'every signed Upbound package verifies' 0 \ + '3 Upbound package signatures verified' "$scratch/rendered.yaml" +if [[ "$(cat "$scratch/events.log")" != $'verify\nsleep:30\nverify\nsleep:30\nverify\nsleep:30\nverify\nsleep:30\nverify\nsleep:30\nverify\nsleep:30\nverify\nsleep:30\nverify\nsleep:30\nverify' ]]; then echo 'FAIL: every consecutive verifier call must be separated, including controls and package boundaries' >&2 failures=$((failures + 1)) fi -if grep -qv '^xpkg\.upbound\.io/upbound/provider-\(family-aws\|aws-iam\):v2\.6\.1$' "$scratch/calls.log"; then +if grep -qv '^xpkg\.upbound\.io/upbound/provider-\(family-aws\|aws-iam\|aws-sesv2\):v2\.6\.1$' "$scratch/calls.log"; then echo 'FAIL: a non-Upbound or non-Provider reference was sent to cosign:' >&2 sed 's/^/ /' "$scratch/calls.log" >&2 failures=$((failures + 1)) @@ -147,7 +158,7 @@ expect 'a verifier that accepts any identity is caught' 1 \ expect 'an outage during the negative control is not read as a refusal' 1 \ 'stopped verifying after the negative control' "$scratch/rendered.yaml" outage-after-first expect 'a registry enforcing burst limits verifies with paced requests' 0 \ - '2 Upbound package signatures verified' "$scratch/rendered.yaml" burst + '3 Upbound package signatures verified' "$scratch/rendered.yaml" burst expect 'an HTTP 429 is not reported as an unsigned package' 1 \ 'FAIL: could not verify' "$scratch/rendered.yaml" registry-rate-limit if grep -qF 'is not signed' "$scratch/out.log"; then @@ -163,7 +174,7 @@ fi expect 'a failed wait before the negative control stops the whole gate' 1 \ 'verification pacing wait failed' "$scratch/rendered.yaml" control-wait-fails if [[ "$(wc -l <"$scratch/calls.log" | tr -d ' ')" -ne 1 ]] || - grep -qF '2 Upbound package signatures verified' "$scratch/out.log"; then + grep -qF '3 Upbound package signatures verified' "$scratch/out.log"; then echo 'FAIL: a missing negative control was accepted after a failed wait' >&2 failures=$((failures + 1)) fi @@ -171,6 +182,10 @@ expect 'a privileged provider repointed to another registry is refused' 1 \ 'Provider provider-aws-iam must use xpkg.upbound.io/upbound/provider-aws-iam' "$scratch/repointed.yaml" expect 'a privileged provider that is not rendered is refused' 1 \ 'expected exactly one rendered Provider named provider-aws-iam' "$scratch/missing.yaml" +expect 'the SES provider repointed to another registry is refused' 1 \ + 'Provider upbound-provider-aws-sesv2 must use xpkg.upbound.io/upbound/provider-aws-sesv2' "$scratch/repointed-sesv2.yaml" +expect 'the SES provider that is not rendered is refused' 1 \ + 'expected exactly one rendered Provider named upbound-provider-aws-sesv2' "$scratch/missing-sesv2.yaml" expect 'a lookalike registry or organisation is not Upbound' 1 \ 'must use xpkg.upbound.io/upbound/provider-' "$scratch/lookalikes.yaml" diff --git a/scripts/tests/test-coroot-risk-acceptance-reconciler.sh b/scripts/tests/test-coroot-risk-acceptance-reconciler.sh index b2dc1a958f..7d2cc74706 100755 --- a/scripts/tests/test-coroot-risk-acceptance-reconciler.sh +++ b/scripts/tests/test-coroot-risk-acceptance-reconciler.sh @@ -39,7 +39,7 @@ acceptances_file="${work_root}/risks.json" yq e -r '.data."risks.json"' "${acceptances_manifest}" >"${acceptances_file}" jq -e ' - type == "array" and length == 37 and + type == "array" and length == 38 and all(.[] | select(has("application")); (.application | type == "string") and (.application | split(":") | length == 3) and @@ -47,7 +47,7 @@ jq -e ' (.type | IN("single-instance-app", "unreplicated-database")) and (.reason | startswith("platform#3812: ")) ) and - ([.[] | select(has("application_pattern"))] | length == 5) and + ([.[] | select(has("application_pattern"))] | length == 6) and any(.[]; .application_pattern? == "^longhorn-system:InstanceManager:instance-manager-[0-9a-f]{32}\\z" and .category == "Availability" and .type == "single-instance-app" and (.reason | startswith("platform#4117: "))) and @@ -63,10 +63,13 @@ jq -e ' any(.[]; .application_pattern? == "^crossplane-system:Deployment:upbound-provider-family-aws-[0-9a-f]{12}\\z" and .category == "Availability" and .type == "single-instance-app" and (.reason | startswith("platform#3812: "))) and + any(.[]; .application_pattern? == "^crossplane-system:Deployment:upbound-provider-aws-sesv2-[0-9a-f]{12}\\z" and + .category == "Availability" and .type == "single-instance-app" and + (.reason | startswith("platform#3812: "))) and ([.[] | [(.application // .application_pattern), .category, .type] | @tsv] | length) == ([.[] | [(.application // .application_pattern), .category, .type] | @tsv] | unique | length) ' "${acceptances_file}" >/dev/null || - fail 'the availability acceptance allowlist must contain exact entries and five narrow generated-name patterns' + fail 'the availability acceptance allowlist must contain exact entries and six narrow generated-name patterns' expected_applications=( 'actual-budget:Deployment:actual-budget-actualbudget' diff --git a/scripts/tests/test-crossplane-egress-policy.sh b/scripts/tests/test-crossplane-egress-policy.sh index f1bf0d03a4..760c1c4d6c 100755 --- a/scripts/tests/test-crossplane-egress-policy.sh +++ b/scripts/tests/test-crossplane-egress-policy.sh @@ -1576,7 +1576,7 @@ https_egress_contract() { ' <<<"$1" } -expected_https_egress=$' - toFQDNs:\n - matchName: ghcr.io\n - matchName: pkg-containers.githubusercontent.com\n - matchName: api.github.com\n - matchName: xpkg.upbound.io\n - matchName: d3qrbvrml4iuq4.cloudfront.net\n - matchName: sts.eu-central-1.amazonaws.com\n - matchName: iam.amazonaws.com\n - matchName: api.ui.com\n toPorts:\n - ports:\n - port: "443"\n protocol: TCP' +expected_https_egress=$' - toFQDNs:\n - matchName: ghcr.io\n - matchName: pkg-containers.githubusercontent.com\n - matchName: api.github.com\n - matchName: xpkg.upbound.io\n - matchName: d3qrbvrml4iuq4.cloudfront.net\n - matchName: sts.eu-central-1.amazonaws.com\n - matchName: iam.amazonaws.com\n - matchName: email.eu-central-1.amazonaws.com\n - matchName: api.ui.com\n toPorts:\n - ports:\n - port: "443"\n protocol: TCP' readonly expected_https_egress assert_direct_https_contract() { @@ -1634,7 +1634,7 @@ assert_dns_contract() { local expected_contract actual_contract="$(dns_egress_contract "${candidate_policy}")" - expected_contract=$' - toEndpoints:\n - matchLabels:\n k8s-app: kube-dns\n k8s:io.kubernetes.pod.namespace: kube-system\n toPorts:\n - ports:\n - port: "53"\n protocol: UDP\n - port: "53"\n protocol: TCP\n rules:\n dns:\n - matchName: ghcr.io\n - matchName: pkg-containers.githubusercontent.com\n - matchName: api.github.com\n - matchName: xpkg.upbound.io\n - matchName: d3qrbvrml4iuq4.cloudfront.net\n - matchName: sts.eu-central-1.amazonaws.com\n - matchName: iam.amazonaws.com\n - matchName: api.ui.com\n - matchPattern: \x27*.cluster.local\x27' + expected_contract=$' - toEndpoints:\n - matchLabels:\n k8s-app: kube-dns\n k8s:io.kubernetes.pod.namespace: kube-system\n toPorts:\n - ports:\n - port: "53"\n protocol: UDP\n - port: "53"\n protocol: TCP\n rules:\n dns:\n - matchName: ghcr.io\n - matchName: pkg-containers.githubusercontent.com\n - matchName: api.github.com\n - matchName: xpkg.upbound.io\n - matchName: d3qrbvrml4iuq4.cloudfront.net\n - matchName: sts.eu-central-1.amazonaws.com\n - matchName: iam.amazonaws.com\n - matchName: email.eu-central-1.amazonaws.com\n - matchName: api.ui.com\n - matchPattern: \x27*.cluster.local\x27' [ "${actual_contract}" = "${expected_contract}" ] || fail 'Crossplane DNS egress must remain the exact reviewed resolver, port, and name contract' } From d3a6ef548c63cc0ec97f1aebc6aa33456abeaa7e Mon Sep 17 00:00:00 2001 From: Nikolai Emil Damm Date: Fri, 13 Nov 2026 06:57:23 +0100 Subject: [PATCH 2/3] chore(security): approve the SES provider's authorization surface Approve the three moved entries of the rendered authorization ledger: the new SES provider package and its runtime config, and the aws tenant Role, whose only change is write access to the two SES kinds. The Role's pinned diagnostic hash moves with it. Part of devantler-tech/platform#5481. Co-Authored-By: Claude Opus 5.5 --- scripts/validate-eks-ci-role-policy/approved-surface.txt | 6 +++++- scripts/validate-eks-ci-role-policy/main.go | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/validate-eks-ci-role-policy/approved-surface.txt b/scripts/validate-eks-ci-role-policy/approved-surface.txt index 0470d2740f..6f42f96c63 100644 --- a/scripts/validate-eks-ci-role-policy/approved-surface.txt +++ b/scripts/validate-eks-ci-role-policy/approved-surface.txt @@ -158,6 +158,8 @@ kustomize.toolkit.fluxcd.io/v1|Kustomization|world-at-ruin|world-at-ruin 9c3f822 pkg.crossplane.io/v1beta1|DeploymentRuntimeConfig||provider-aws-iam 48e8bcc2257a1affdbdf936c4b871becc6f0fdc02bb40e27665d265f00c465b3 +pkg.crossplane.io/v1beta1|DeploymentRuntimeConfig||provider-aws-sesv2 6e177a8aac61328a9bfdb3f482d916b30d88191a9d71f6630adecfba6bdb09cf + pkg.crossplane.io/v1beta1|DeploymentRuntimeConfig||provider-family-aws 064adcc0f15a96fc4015b549214fd9edf1686f73b930a41ba1a5cd4b581d049d pkg.crossplane.io/v1beta1|DeploymentRuntimeConfig||provider-upjet-github 7494260fa757d465dcee4e61028ad683fe1f108f82f65d4fe83439179668c3a5 @@ -170,6 +172,8 @@ pkg.crossplane.io/v1|Provider||provider-upjet-github 719f3ea7799fbb895e20bf9da54 pkg.crossplane.io/v1|Provider||provider-upjet-unifi 134e66f6ec74fb19b8103ba067b1b1fd6366bbdc3afbc0e7e475a3514d60c3a0 +pkg.crossplane.io/v1|Provider||upbound-provider-aws-sesv2 f5ed6aa3381c9b2bfecc2c7f6d2683f39c67bfbe85da714cb8cf768f54519c53 + pkg.crossplane.io/v1|Provider||upbound-provider-family-aws 64c7d602bf7460b7a38657a49539f5fa945ef8216be5e4296dddd04f69a944f8 policies.kyverno.io/v1|GeneratingPolicy||auto-vpa-daemonset 6f099d23ae62bfa0edb816b2cf15efef99a33beb137e3ce82ea92e133676e28d @@ -344,7 +348,7 @@ rbac.authorization.k8s.io/v1|Role|agentic-engineer|lane-store-reader 106d83767c8 rbac.authorization.k8s.io/v1|Role|ate-system|substrate-ca-reader 153cc02bc210a1f00ad70fb8c260500fa9593e634302378d67d91af10cf3fafd -rbac.authorization.k8s.io/v1|Role|aws|aws-managed-resources bcbd97adfa055719ff19364d7341e4952fcb0566f1c1ba16d073b6f1ae4108b0 +rbac.authorization.k8s.io/v1|Role|aws|aws-managed-resources 9207b057fb6d4f1492b13663277658e3bd31849a9aa11dd2185ceb0a0afcbfab rbac.authorization.k8s.io/v1|Role|data-product-controller|data-product-readiness-observer 10df039485be13b0344199a50eacc4fbd942f2bb9b831a84b11c024918a3422a diff --git a/scripts/validate-eks-ci-role-policy/main.go b/scripts/validate-eks-ci-role-policy/main.go index 1d316b7e39..8d20ec4246 100644 --- a/scripts/validate-eks-ci-role-policy/main.go +++ b/scripts/validate-eks-ci-role-policy/main.go @@ -282,7 +282,7 @@ func validateUnifiPruneExemption(document map[string]any, identity resourceIdent var expectedRenderedHashes = map[resourceIdentity]string{ {apiVersion: "iam.aws.m.upbound.io/v1beta1", kind: "Role", namespace: "aws", name: "eks-ci"}: "3c472068dc4dc05ce8063bd35b1237e2ef2803b15997acffcc85805de50e7acf", {apiVersion: "iam.aws.m.upbound.io/v1beta1", kind: "Policy", namespace: "aws", name: "eks-ci-smoke-boundary"}: "9eb6e5e1b43a470a02cb292f8a449a51b7792e50220c7c3d5c08fe6b73e62f02", - {apiVersion: "rbac.authorization.k8s.io/v1", kind: "Role", namespace: "aws", name: "aws-managed-resources"}: "ff4c3264c519b1b4a7ec9b5145412f39ea2ba7b6163d8dc50fb029b1460edcda", + {apiVersion: "rbac.authorization.k8s.io/v1", kind: "Role", namespace: "aws", name: "aws-managed-resources"}: "aa3bf06e937983c375682b762ca1214d4597e43e325e311a18390ea0e5f28349", {apiVersion: "rbac.authorization.k8s.io/v1", kind: "RoleBinding", namespace: "aws", name: "aws-managed-resources"}: "d846c8d9810dd7c0cba33612d2de63183403ccb07c4d5a5c90d0563a444cd714", {apiVersion: "rbac.authorization.k8s.io/v1", kind: "ClusterRole", name: "kro-tenant-rgd"}: "63e57d91d99abd5502413cbd9f3daff6de117265c611f523afda232d56e52ef3", {apiVersion: "rbac.authorization.k8s.io/v1", kind: "ClusterRoleBinding", name: "oidc-cluster-reader"}: "7d896404f02d6418c289065d73f9ad79345217d76c8d89eadca2c06e6066b487", From 48ea069df577ec72838bbc343f814147779379c1 Mon Sep 17 00:00:00 2001 From: Nikolai Emil Damm Date: Fri, 13 Nov 2026 07:48:38 +0100 Subject: [PATCH 3/3] docs(crossplane): describe the SES provider's runtime config accurately The runtime config was copied from the IAM provider and kept its comments about IAM, EKS and having no managed resources. Say instead why the SES provider pins its STS region and keeps a writable /tmp. Part of devantler-tech/platform#5481. Co-Authored-By: Claude Opus 5.5 --- .../deployment-runtime-config-aws-sesv2.yaml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/k8s/providers/hetzner/infrastructure/crossplane/deployment-runtime-config-aws-sesv2.yaml b/k8s/providers/hetzner/infrastructure/crossplane/deployment-runtime-config-aws-sesv2.yaml index 6d0f648331..88632cd335 100644 --- a/k8s/providers/hetzner/infrastructure/crossplane/deployment-runtime-config-aws-sesv2.yaml +++ b/k8s/providers/hetzner/infrastructure/crossplane/deployment-runtime-config-aws-sesv2.yaml @@ -31,10 +31,10 @@ spec: type: RuntimeDefault containers: - name: package-runtime - # IAM is global, but the provider validates credentials through - # STS before each reconciliation. Pin that call to the planned - # EKS region so the runtime and its exact-host egress policy stay - # aligned instead of falling back to us-east-1. + # The provider validates credentials through STS before each + # reconciliation. Pin that call to the account's region, where + # the SES resources also live, so the runtime and its exact-host + # egress policy stay aligned instead of falling back to us-east-1. env: - name: AWS_REGION value: eu-central-1 @@ -43,12 +43,10 @@ spec: # Kubescape C-0017 (immutable container filesystem) + the hardening # set Kyverno injects at admission (Kubescape scans this stored spec, # not the live pod). The upjet runtime writes Terraform workspaces to - # /tmp/; this provider has no managed resources today so a - # read-only root does not break it yet, but the writable /tmp emptyDir - # is added defensively (same code path as provider-upjet-unifi, which - # is actively failing on a read-only /tmp) so a future managed resource - # cannot silently fail to reconcile. runAsUser/runAsGroup left to - # Crossplane's package-manager default (2000). + # /tmp/, so a writable /tmp emptyDir keeps the read-only root + # from breaking reconciliation of the SES resources. + # runAsUser/runAsGroup left to Crossplane's package-manager default + # (2000). securityContext: allowPrivilegeEscalation: false readOnlyRootFilesystem: true