From f706d9149db74338aa8adee96c43f5191041d46b Mon Sep 17 00:00:00 2001 From: Nikolai Emil Damm Date: Fri, 13 Nov 2026 06:20:29 +0100 Subject: [PATCH 1/2] feat(email): declare the SES sending identity for company mail Company Email's outbound mail is relayed through Amazon SES. Declare the mail domain as an SES identity with 2048-bit Easy DKIM, and a custom MAIL FROM domain so SPF aligns for DMARC. Both are in the account's existing region and omit Delete from their management policies. CI now validates the SES v2 kinds against their provider package and compares each declared provider pin with the platform's. The platform must activate and grant these kinds first (devantler-tech/platform#5481). Co-Authored-By: Claude Opus 5.5 --- .github/crossplane-validate/extensions.yaml | 13 +++++-- .github/workflows/ci.yaml | 39 ++++++++++--------- AGENTS.md | 6 ++- .../email-identity-mail-from-attributes.yaml | 24 ++++++++++++ deploy/email/email-identity.yaml | 24 ++++++++++++ deploy/email/kustomization.yaml | 13 +++++++ deploy/kustomization.yaml | 1 + 7 files changed, 97 insertions(+), 23 deletions(-) create mode 100644 deploy/email/email-identity-mail-from-attributes.yaml create mode 100644 deploy/email/email-identity.yaml create mode 100644 deploy/email/kustomization.yaml diff --git a/.github/crossplane-validate/extensions.yaml b/.github/crossplane-validate/extensions.yaml index 30e1721..af9941c 100644 --- a/.github/crossplane-validate/extensions.yaml +++ b/.github/crossplane-validate/extensions.yaml @@ -1,10 +1,10 @@ # The Crossplane packages whose schemas CI validates deploy/ against, offline, with # `crossplane resource validate` (scripts/validate-crossplane-schemas.sh). # -# This is the single place the provider version is declared. Keep it equal to the +# This is the single place the provider versions are declared. Keep each equal to the # platform's pin in devantler-tech/platform -# k8s/providers/hetzner/infrastructure/crossplane/provider-aws-iam.yaml: the `aws` tenant -# reconciles against that version. CI compares the two on every run and reports a +# k8s/providers/hetzner/infrastructure/crossplane/.yaml: the `aws` +# tenant reconciles against those versions. CI compares each on every run and reports a # mismatch as a warning on the run. apiVersion: pkg.crossplane.io/v1 kind: Provider @@ -12,3 +12,10 @@ metadata: name: provider-aws-iam spec: package: xpkg.upbound.io/upbound/provider-aws-iam:v2.9.1 +--- +apiVersion: pkg.crossplane.io/v1 +kind: Provider +metadata: + name: provider-aws-sesv2 +spec: + package: xpkg.upbound.io/upbound/provider-aws-sesv2:v2.9.1 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0782285..6cd66be 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -139,27 +139,30 @@ jobs: - name: 🧩 Validate deploy/ and prove the gate blocks run: bash scripts/test-validate-crossplane-schemas.sh "$RUNNER_TEMP/crossplane" - - name: 🔎 Compare the provider version with the platform's pin - # Reported, not enforced: the platform moves its pin in its own repository, and a + - name: 🔎 Compare the provider versions with the platform's pins + # Reported, not enforced: the platform moves its pins in its own repository, and a # failure here would turn every unrelated pull request red until this file follows. + # Each declared provider is compared with the platform file of the same name. run: | pkg='^xpkg\.upbound\.io/[a-z0-9/-]+:v[0-9]+\.[0-9]+\.[0-9]+$' - url=https://raw.githubusercontent.com/devantler-tech/platform/main/k8s/providers/hetzner/infrastructure/crossplane/provider-aws-iam.yaml - ours=$(sed -n 's/^ package: //p' .github/crossplane-validate/extensions.yaml) - if ! platform=$(curl -fsSL --retry 3 "$url" | sed -n 's/^ package: //p'); then - echo "::warning title=Provider pin not compared::could not read the platform's provider-aws-iam pin" - exit 0 - fi - # Only a plain package reference is echoed, so file content cannot reach a workflow command. - if ! [[ $ours =~ $pkg && $platform =~ $pkg ]]; then - echo "::warning title=Provider pin not compared::a package line is missing or not a plain package reference" - exit 0 - fi - if [ "$ours" != "$platform" ]; then - echo "::warning title=Provider pin mismatch::validated against ${ours}, but the platform runs ${platform}; update .github/crossplane-validate/extensions.yaml" - else - echo "Provider pin matches the platform: ${ours}" - fi + base=https://raw.githubusercontent.com/devantler-tech/platform/main/k8s/providers/hetzner/infrastructure/crossplane + for name in provider-aws-iam provider-aws-sesv2; do + ours=$(awk -v n="$name" '/^ name: /{cur=$2} /^ package: / && cur == n {print $2}' .github/crossplane-validate/extensions.yaml) + if ! platform=$(curl -fsSL --retry 3 "$base/$name.yaml" | sed -n 's/^ package: //p'); then + echo "::warning title=Provider pin not compared::could not read the platform's $name pin" + continue + fi + # Only a plain package reference is echoed, so file content cannot reach a workflow command. + if ! [[ $ours =~ $pkg && $platform =~ $pkg ]]; then + echo "::warning title=Provider pin not compared::a $name package line is missing or not a plain package reference" + continue + fi + if [ "$ours" != "$platform" ]; then + echo "::warning title=Provider pin mismatch::validated against ${ours}, but the platform runs ${platform}; update .github/crossplane-validate/extensions.yaml" + else + echo "Provider pin matches the platform: ${ours}" + fi + done ci-required-checks: name: CI - Required Checks diff --git a/AGENTS.md b/AGENTS.md index 6fc5661..d772260 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -27,8 +27,10 @@ It mirrors the `devantler-tech/.github` repo's `github-config` tenant pattern. - **Layout:** all managed resources live under `deploy/`, referenced from `deploy/kustomization.yaml`. Keep manifests namespace-agnostic (the platform-side tenant Kustomization injects the namespace). -- **What this tenant may own:** today, only the account's GitHub Actions OIDC identity - provider (`OpenIDConnectProvider`). The platform decides which AWS resource kinds are +- **What this tenant may own:** the account's GitHub Actions OIDC identity provider + (`OpenIDConnectProvider`), and company Email's SES domain identity and its MAIL FROM + domain (`EmailIdentity`, `EmailIdentityMailFromAttributes`). The SMTP sending identity + (IAM user, policy and access key) is platform-owned. The platform decides which AWS resource kinds are active and which of them this tenant may write. The EKS CI `Role` and its permissions boundary stay platform-owned on purpose, because the cap on what that identity may create lives inside the `Role`. diff --git a/deploy/email/email-identity-mail-from-attributes.yaml b/deploy/email/email-identity-mail-from-attributes.yaml new file mode 100644 index 0000000..0c653f0 --- /dev/null +++ b/deploy/email/email-identity-mail-from-attributes.yaml @@ -0,0 +1,24 @@ +# A custom MAIL FROM domain for the company mail identity, so the envelope +# sender is under the mailbox domain and SPF aligns for DMARC. Its MX and SPF +# records are published by the DNS owner. Until they resolve, SES falls back to +# its own MAIL FROM domain (UseDefaultValue), so mail keeps flowing and DMARC +# still passes through the aligned DKIM signature. +apiVersion: sesv2.aws.m.upbound.io/v1beta1 +kind: EmailIdentityMailFromAttributes +metadata: + name: company-mail-domain + annotations: + crossplane.io/external-name: devantler.tech +spec: + managementPolicies: + - Observe + - Create + - Update + - LateInitialize + forProvider: + region: eu-central-1 + mailFromDomain: bounce.devantler.tech + behaviorOnMxFailure: UseDefaultValue + providerConfigRef: + kind: ProviderConfig + name: default diff --git a/deploy/email/email-identity.yaml b/deploy/email/email-identity.yaml new file mode 100644 index 0000000..f60344d --- /dev/null +++ b/deploy/email/email-identity.yaml @@ -0,0 +1,24 @@ +# The company mail domain as an SES identity, verified by Easy DKIM. SES signs +# every relayed message with this domain's 2048-bit key; the three DKIM tokens +# appear in status.atProvider.dkimSigningAttributes.tokens and are published as +# CNAME records by the DNS owner. Delete is omitted so a prune can never +# remove the identity that outbound company mail depends on. +apiVersion: sesv2.aws.m.upbound.io/v1beta1 +kind: EmailIdentity +metadata: + name: company-mail-domain + annotations: + crossplane.io/external-name: devantler.tech +spec: + managementPolicies: + - Observe + - Create + - Update + - LateInitialize + forProvider: + region: eu-central-1 + dkimSigningAttributes: + nextSigningKeyLength: RSA_2048_BIT + providerConfigRef: + kind: ProviderConfig + name: default diff --git a/deploy/email/kustomization.yaml b/deploy/email/kustomization.yaml new file mode 100644 index 0000000..0e4bba4 --- /dev/null +++ b/deploy/email/kustomization.yaml @@ -0,0 +1,13 @@ +# Company Email's outbound relay (devantler-tech/platform#5481): the Amazon SES +# domain identity that signs relayed mail with Easy DKIM, and its custom MAIL +# FROM domain so SPF aligns with the mailbox domain for DMARC. +# +# This repository owns only these two SES resources, which grant no AWS +# permission to anyone. The SMTP sending identity (IAM user, policy and access +# key) is owned by devantler-tech/platform, for the same reason the EKS CI role +# is: what caps a credential must not be editable by this public artifact. +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - email-identity.yaml + - email-identity-mail-from-attributes.yaml diff --git a/deploy/kustomization.yaml b/deploy/kustomization.yaml index 757e3d7..6c80f71 100644 --- a/deploy/kustomization.yaml +++ b/deploy/kustomization.yaml @@ -12,4 +12,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - eks-ci/ + - email/ From 1a25c3a625e5b46344f6f33e2c9688f9ae4ecd17 Mon Sep 17 00:00:00 2001 From: Nikolai Emil Damm Date: Fri, 13 Nov 2026 11:13:34 +0100 Subject: [PATCH 2/2] chore(email): validate against the platform's v2.9.4 AWS providers The platform moved the AWS provider family to v2.9.4, and the SES provider follows it (devantler-tech/platform#6184). Validate this tenant's manifests against the same release for both declared providers. Part of devantler-tech/platform#5481. Co-Authored-By: Claude Opus 5.5 --- .github/crossplane-validate/extensions.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/crossplane-validate/extensions.yaml b/.github/crossplane-validate/extensions.yaml index af9941c..86d32b0 100644 --- a/.github/crossplane-validate/extensions.yaml +++ b/.github/crossplane-validate/extensions.yaml @@ -11,11 +11,11 @@ kind: Provider metadata: name: provider-aws-iam spec: - package: xpkg.upbound.io/upbound/provider-aws-iam:v2.9.1 + package: xpkg.upbound.io/upbound/provider-aws-iam:v2.9.4 --- apiVersion: pkg.crossplane.io/v1 kind: Provider metadata: name: provider-aws-sesv2 spec: - package: xpkg.upbound.io/upbound/provider-aws-sesv2:v2.9.1 + package: xpkg.upbound.io/upbound/provider-aws-sesv2:v2.9.4