diff --git a/k8s/providers/hetzner/apps/aws/kustomization.yaml b/k8s/providers/hetzner/apps/aws/kustomization.yaml index c2cc48f624..86324f13ba 100644 --- a/k8s/providers/hetzner/apps/aws/kustomization.yaml +++ b/k8s/providers/hetzner/apps/aws/kustomization.yaml @@ -11,6 +11,7 @@ resources: - provider-config.yaml - policy-eks-ci-smoke-boundary.yaml - role-eks-ci.yaml + - role-ses-account-setup.yaml - external-secret.yaml - oci-repository.yaml - flux-kustomization.yaml diff --git a/k8s/providers/hetzner/apps/aws/role-ses-account-setup.yaml b/k8s/providers/hetzner/apps/aws/role-ses-account-setup.yaml new file mode 100644 index 0000000000..d3d8fc8aaa --- /dev/null +++ b/k8s/providers/hetzner/apps/aws/role-ses-account-setup.yaml @@ -0,0 +1,73 @@ +# GitHub OIDC role for devantler-tech/aws's main-only "Set Up SES Account" +# workflow (platform#5481). It sets the account's SES pricing plan to +# pay-per-use and requests SES production access, then reads the account back. +# Neither has a Crossplane resource. Platform-owned, like the EKS CI role, so +# the public aws tenant cannot widen it. +# +# Trust is limited to workflows running on that repository's protected main +# branch. The three account-level SES actions have no resource scope, so the +# policy limits them to the relay's region. The role cannot send mail, read +# mail or change identities. +apiVersion: iam.aws.m.upbound.io/v1beta1 +kind: Role +metadata: + name: ses-account-setup + namespace: aws + labels: + app.kubernetes.io/managed-by: ksail +spec: + managementPolicies: + - Observe + - Create + - Update + - LateInitialize + forProvider: + description: >- + GitHub OIDC role for devantler-tech/aws's main-only SES account set-up + workflow: pricing plan, production access request and account readback. + maxSessionDuration: 3600 + assumeRolePolicy: | + { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Federated": "arn:aws:iam::939001610192:oidc-provider/token.actions.githubusercontent.com" + }, + "Action": "sts:AssumeRoleWithWebIdentity", + "Condition": { + "StringEquals": { + "token.actions.githubusercontent.com:aud": "sts.amazonaws.com", + "token.actions.githubusercontent.com:sub": "repo:devantler-tech/aws:ref:refs/heads/main" + } + } + } + ] + } + inlinePolicy: + - name: ses-account-setup + policy: | + { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "SesAccountSetUp", + "Effect": "Allow", + "Action": [ + "ses:GetAccount", + "ses:PutAccountDetails", + "ses:PutAccountPricingAttributes" + ], + "Resource": "*", + "Condition": { + "StringEquals": { + "aws:RequestedRegion": "eu-central-1" + } + } + } + ] + } + providerConfigRef: + kind: ProviderConfig + name: default diff --git a/scripts/validate-eks-ci-role-policy/approved-surface.txt b/scripts/validate-eks-ci-role-policy/approved-surface.txt index 0470d2740f..fff8c4b449 100644 --- a/scripts/validate-eks-ci-role-policy/approved-surface.txt +++ b/scripts/validate-eks-ci-role-policy/approved-surface.txt @@ -128,6 +128,8 @@ iam.aws.m.upbound.io/v1beta1|Policy|aws|eks-ci-smoke-boundary 019210611429956763 iam.aws.m.upbound.io/v1beta1|Role|aws|eks-ci c40205b3f48d193e8be1a39abda738865b954c90733039a49854f0bac5844306 +iam.aws.m.upbound.io/v1beta1|Role|aws|ses-account-setup 7faa58457f4a17a3c14368d3a956bb07da4f40bb2689c61149ee31eae9693b6b + kro.run/v1alpha1|ResourceGraphDefinition||tenant.kro.run 72f3f972cecdf3ca2e315deb4224bd28c1df1244fc7973a88eb7f4fc03ac1d05 kro.run/v1alpha1|Tenant|flux-system|business-site 5854dbac8e7f4ff52f5d858ee7e673e82cd758f0c770c3203b9409c8dc15aba2