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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/adr/email-outbound-relay.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ sign-in, recovery or public submission work, and it cannot reach any mailbox.
- **Custody.** A platform PushSecret copies the key ID and the derived SMTP
password to `apps/business-site/smtp` in OpenBao, as `username` and
`password`. The business site reads that one key through its dedicated role,
which also reads its public disclosure and nothing else.
which otherwise reads only its public disclosure and its portal billing
keys (platform#6337).
- **Use.** The site's mail client connects to
`email-smtp.eu-central-1.amazonaws.com` on port 587 with STARTTLS and SMTP
authentication, sending from `no-reply@devantler.tech`. The tenant owns its
Expand Down
15 changes: 9 additions & 6 deletions docs/tenant-abstraction.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,10 @@ application.

The maintained `vault-config` Job declares the `business-site` Kubernetes auth
role for the same-named service account in only that namespace. Its sole token
policy reads the exact KV-v2 disclosure entry used by the source-owned
SecretStore; it grants no value writes, metadata listing or other application
policy reads four exact KV-v2 entries through the source-owned SecretStore: the
public disclosure, the platform-written SES SMTP credential, and the portal's
Numina (`apps/business-site/numina`) and Stripe (`apps/business-site/stripe`)
billing keys. It grants no value writes, metadata listing or other application
paths. The only other permissions are lookup and revocation of the token itself,
which the pinned ESO client uses when reusing and closing its authenticated
connection. These do not authorize lookup or revocation of another token. The
Expand All @@ -228,15 +230,16 @@ it does not guess a separate audience absent from that store. The pinned ESO
2.13.0 Kubernetes connector passes the store's service-account audiences through
to TokenRequest, without the `vault` default of its separate JWT connector.

The tenant owner materializes and maintains the confirmed disclosure privately
through the supported operator entry path. This role creates no value, enables
no WebApp and grants no customer identity or payment access. Missing/unsafe
The tenant owner materializes and maintains the confirmed disclosure and the
billing keys privately through the supported operator entry path. This role
creates no value, enables no WebApp and grants no customer identity access.
Reading the billing keys does not switch on either portal billing flag. Missing/unsafe
projection refusal, actual ESO authentication and rotation, HTTPS staging and
private-route closure remain live acceptance under #5247. Normal production
reconciliation owns installation; a suspended deployment is not manually bypassed.

`bash scripts/tests/test-business-disclosure-reader.sh` checks the actual rendered
role/policy payload and twenty-two invalid-payload controls without authenticating or
role/policy payload and twenty-nine invalid-payload controls without authenticating or
reading any value. OpenBao supports the policy's native
[JSON syntax](https://openbao.org/docs/concepts/policies/); the
[Kubernetes role API](https://openbao.org/docs/api/auth/kubernetes/) defines the
Expand Down
18 changes: 13 additions & 5 deletions k8s/bases/infrastructure/vault-config/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -836,10 +836,12 @@ spec:
}
POLICY

# The business site reads two exact entries: its owner-maintained
# public disclosure, and its send-only SES SMTP credential, which a
# platform PushSecret writes (platform#5400). It has no value
# writer, metadata listing or shared infrastructure policy.
# The business site reads four exact entries: its owner-maintained
# public disclosure, its send-only SES SMTP credential, which a
# platform PushSecret writes (platform#5400), and the portal's
# owner-maintained Numina and Stripe billing keys (platform#6337).
# It has no value writer, metadata listing or shared
# infrastructure policy.
bao policy write app-business-site-disclosure-readonly - <<'BUSINESS_SITE_POLICY'
{
"path": {
Expand All @@ -849,6 +851,12 @@ spec:
"secret/data/apps/business-site/smtp": {
"capabilities": ["read"]
},
"secret/data/apps/business-site/numina": {
"capabilities": ["read"]
},
"secret/data/apps/business-site/stripe": {
"capabilities": ["read"]
},
"auth/token/lookup-self": {
"capabilities": ["read"]
},
Expand Down Expand Up @@ -1269,7 +1277,7 @@ spec:

# The source-owned SecretStore uses only this namespaced identity.
# Explicit JSON preserves array/boolean types; no default policy is
# added to the one-entry reader. The tenant owner supplies values.
# added to the exact-entry reader. The tenant owner supplies values.
bao write auth/kubernetes/role/business-site - <<'BUSINESS_SITE_ROLE'
{
"bound_service_account_names": ["business-site"],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Cilium enforces a toFQDNs rule only for names its DNS proxy has seen, and the
# proxy sees a lookup only when an L7 `rules.dns` rule covers that traffic. The
# generated `allow-dns` policy is L4-only, and restrict-tenant-network-policies
# refuses a tenant selector naming kube-system, so the tenant cannot add this
# rule itself. It opens nothing new: `allow-dns` already allows the same port
# to the same peer, and matchPattern "*" leaves resolution unrestricted. The
# tenant's own toFQDNs rules (api.numina.app, api.stripe.com) still decide
# where traffic may go (platform#6337).
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: business-site-dns-visibility
namespace: business-site
spec:
endpointSelector:
matchLabels:
app.kubernetes.io/name: business-site
egress:
- toEndpoints:
- matchLabels:
k8s:io.kubernetes.pod.namespace: kube-system
k8s-app: kube-dns
toPorts:
- ports:
- port: "53"
protocol: UDP
- port: "53"
protocol: TCP
rules:
dns:
- matchPattern: "*"
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ kind: Kustomization
resources:
- tenant.yaml
- cilium-network-policy-customer-identity-hold.yaml
- cilium-network-policy-dns-visibility.yaml
- certificate.yaml
- reference-grant.yaml
2 changes: 2 additions & 0 deletions scripts/check-business-disclosure-reader/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ func expectedPayload(kind string) string {
return `{"path":{
"secret/data/apps/business-site/public-disclosure":{"capabilities":["read"]},
"secret/data/apps/business-site/smtp":{"capabilities":["read"]},
"secret/data/apps/business-site/numina":{"capabilities":["read"]},
"secret/data/apps/business-site/stripe":{"capabilities":["read"]},
"auth/token/lookup-self":{"capabilities":["read"]},
"auth/token/revoke-self":{"capabilities":["update"]}}}`
default:
Expand Down
9 changes: 7 additions & 2 deletions scripts/tests/test-business-disclosure-reader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ valid_policy() {
}

valid_role "${role}" || fail 'role must bind one exact identity and one read-only policy with a bounded lifetime'
valid_policy "${policy}" || fail 'policy must read only the selected disclosure and SMTP credential entries'
valid_policy "${policy}" || fail 'policy must read only the selected disclosure, SMTP credential and billing key entries'

for kind in role policy; do
if [ "${kind}" = role ]; then value="${role}"; else value="${policy}"; fi
Expand Down Expand Up @@ -84,6 +84,11 @@ for change in \
'.path["secret/data/apps/business-site/other"] = {"capabilities": ["read"]}' \
'.path["secret/data/apps/business-site/smtp"].capabilities += ["update"]' \
'.path["secret/metadata/apps/business-site/smtp"] = {"capabilities": ["read", "list"]}' \
'.path["secret/data/apps/business-site/numina"].capabilities += ["update"]' \
'.path["secret/data/apps/business-site/stripe"].capabilities += ["create"]' \
'.path["secret/metadata/apps/business-site/stripe"] = {"capabilities": ["read", "list"]}' \
'del(.path["secret/data/apps/business-site/numina"])' \
'del(.path["secret/data/apps/business-site/stripe"])' \
'.path["auth/token/*"] = {"capabilities": ["read", "update"]}' \
'.path["auth/token/lookup-self"].capabilities += ["update"]' \
'del(.path["auth/token/revoke-self"])'; do
Expand All @@ -96,4 +101,4 @@ grep -Fq "'scripts/tests/test-business-disclosure-reader.sh'" "${root_dir}/.gith
grep -Fq 'bash scripts/tests/test-business-disclosure-reader.sh' "${root_dir}/.github/workflows/ci.yaml" ||
fail 'CI must execute this contract'

printf 'PASS: rendered business disclosure identity and 24 invalid-payload controls\n'
printf 'PASS: rendered business disclosure identity and 29 invalid-payload controls\n'
Loading