From bed8513cb1d55d3592d733cd4bf4be99f3f36913 Mon Sep 17 00:00:00 2001 From: prdai Date: Thu, 26 Nov 2026 09:53:21 +0530 Subject: [PATCH 1/5] fix(deploy): use OIDC auth and drop GHCR login Co-authored-by: Codex --- .github/workflows/deploy.yml | 7 ------- docs/deploy.md | 4 +--- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 919fc57..d8c5eec 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -83,12 +83,5 @@ jobs: printf '%s' "$CSAV_SSH_KEY_B64" | base64 -d >.ssh/csav-key.pem chmod 400 .ssh/csav-key.pem - - name: Log in to GHCR - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ vars.GHCR_USER || github.repository_owner }} - password: ${{ secrets.GHCR_TOKEN }} - - name: Deploy run: scripts/deploy.sh deploy all diff --git a/docs/deploy.md b/docs/deploy.md index 1ce5edf..c5774ed 100644 --- a/docs/deploy.md +++ b/docs/deploy.md @@ -94,14 +94,12 @@ certificates are looked up by hostname in ACM. | `REGISTRY_HOST_RADS`, `EXECUTION_HOST_RADS` | rads registry and execution API hostnames | | `VERIFIER_JWKS_URL`, `VERIFIER_JWKS_PUBKEY_SHA256` | JWKS endpoint and pin used by pdm/log/kms | | `VERIFIER_PUBKEY_SHA256`, `VERIFIER_HOST_PUBKEY_SHA256`, `PDM_HOST_PUBKEY_SHA256`, `KMS_HOST_PUBKEY_SHA256`, `LOG_HOST_PUBKEY_SHA256`, `TELEMETRY_HOST_PUBKEY_SHA256` | TLS pins baked into the registry image | -| `GHCR_USER` | account that can pull `ghcr.io/secure-rads/nsjail-docker` | | `CLOUDFLARE_ZONE` | Cloudflare zone | ## Repository secrets | Secret | Purpose | | --- | --- | -| `GHCR_TOKEN` | pull the private nsjail base image | | `REGISTRY_TLS_CERT_B64`, `REGISTRY_TLS_KEY_B64` | base64 of the existing `secure/csav/registry-service/tls/client.{crt,key}` | | `CSAV_SSH_KEY_B64` | base64 of `.ssh/csav-key.pem`, used to ship the registry image | | `CLOUDFLARE_EMAIL`, `CLOUDFLARE_API_TOKEN` | Cloudflare API credentials | @@ -116,7 +114,7 @@ The secure registry-service image builds on a 2 vCPU Blacksmith arm64 runner, so `--platform linux/arm64` is native and needs no QEMU. That runner holds one job at a time here, so the image build gets the full runner. The `eif-build-base` cargo step is the heavy part; bump to `blacksmith-4vcpu-ubuntu-2404-arm` if that build dominates. It builds `sce-unit-base` and -`eif-build-base` first, pulls the private `ghcr.io/secure-rads/nsjail-docker` base, ships the tarball +`eif-build-base` first, pulls the public `ghcr.io/secure-rads/nsjail-docker` base, ships the tarball over SSH, and restarts the compose service on the CSAV host. ## Known gaps From 83da17c05df96da30abd89e991727d4f7587d264 Mon Sep 17 00:00:00 2001 From: prdai Date: Thu, 26 Nov 2026 09:59:39 +0530 Subject: [PATCH 2/5] fix(deploy): pass Serverless access key to CI Co-authored-by: Codex --- .github/workflows/deploy.yml | 1 + docs/deploy.md | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d8c5eec..8bab087 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -48,6 +48,7 @@ jobs: CLOUDFLARE_ZONE: ${{ vars.CLOUDFLARE_ZONE }} CLOUDFLARE_EMAIL: ${{ secrets.CLOUDFLARE_EMAIL }} CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + SERVERLESS_ACCESS_KEY: ${{ secrets.SERVERLESS_ACCESS_KEY }} steps: - uses: actions/checkout@v5 diff --git a/docs/deploy.md b/docs/deploy.md index c5774ed..ab64502 100644 --- a/docs/deploy.md +++ b/docs/deploy.md @@ -103,6 +103,7 @@ certificates are looked up by hostname in ACM. | `REGISTRY_TLS_CERT_B64`, `REGISTRY_TLS_KEY_B64` | base64 of the existing `secure/csav/registry-service/tls/client.{crt,key}` | | `CSAV_SSH_KEY_B64` | base64 of `.ssh/csav-key.pem`, used to ship the registry image | | `CLOUDFLARE_EMAIL`, `CLOUDFLARE_API_TOKEN` | Cloudflare API credentials | +| `SERVERLESS_ACCESS_KEY` | Serverless Framework v4 license key; required because unattended runs cannot sign in | `REGISTRY_TLS_CERT_B64` must be the same client certificate the verifier truststore was created from. Generating a new certificate rotates the trust material and breaks registration until the From 41b02ed8d64240441c5d9ec4392f0d62351276cd Mon Sep 17 00:00:00 2001 From: prdai Date: Thu, 26 Nov 2026 10:09:52 +0530 Subject: [PATCH 3/5] fix(deploy): sync units with PDM mTLS count endpoint Co-authored-by: Codex --- .env.example | 2 ++ .github/workflows/deploy.yml | 14 ++++++++++++++ docs/deploy.md | 5 ++++- scripts/lib/units.sh | 28 ++++++++++++++++++++++------ 4 files changed, 42 insertions(+), 7 deletions(-) diff --git a/.env.example b/.env.example index 77ce8e1..df36c71 100644 --- a/.env.example +++ b/.env.example @@ -28,6 +28,8 @@ TELEMETRY_HOST_SECURE_RADS=telemetry.sr.secure-rads.org COST_HOST_RADS=cost.r.secure-rads.org COST_HOST_SECURE_RADS=cost.sr.secure-rads.org PDM_HOST=pdm.sr.secure-rads.org +# mTLS-only domain for the execution-service -> PDM record count call. +PDM_MTLS_HOST=pdm-mtls.sr.secure-rads.org KMS_HOST=kms.sr.secure-rads.org PDM_HOST_RADS=pdm.r.secure-rads.org REGISTRY_HOST_RADS=registry.r.secure-rads.org diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8bab087..f811bfd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -30,6 +30,7 @@ jobs: COST_HOST_RADS: ${{ vars.COST_HOST_RADS }} COST_HOST_SECURE_RADS: ${{ vars.COST_HOST_SECURE_RADS }} PDM_HOST: ${{ vars.PDM_HOST }} + PDM_MTLS_HOST: ${{ vars.PDM_MTLS_HOST || 'pdm-mtls.sr.secure-rads.org' }} PDM_HOST_RADS: ${{ vars.PDM_HOST_RADS }} REGISTRY_HOST_RADS: ${{ vars.REGISTRY_HOST_RADS }} EXECUTION_HOST_RADS: ${{ vars.EXECUTION_HOST_RADS }} @@ -74,6 +75,19 @@ jobs: printf '%s' "$REGISTRY_TLS_KEY_B64" | base64 -d >secure/csav/registry-service/tls/client.key chmod 600 secure/csav/registry-service/tls/client.crt secure/csav/registry-service/tls/client.key + - name: Write PDM client trust material + env: + PDM_CLIENT_CERT_B64: ${{ secrets.PDM_CLIENT_CERT_B64 }} + PDM_CLIENT_KEY_B64: ${{ secrets.PDM_CLIENT_KEY_B64 }} + run: | + set -euo pipefail + [ -n "$PDM_CLIENT_CERT_B64" ] || { echo "PDM_CLIENT_CERT_B64 is not set" >&2; exit 1; } + [ -n "$PDM_CLIENT_KEY_B64" ] || { echo "PDM_CLIENT_KEY_B64 is not set" >&2; exit 1; } + mkdir -p secure/pdm-service/tls + printf '%s' "$PDM_CLIENT_CERT_B64" | base64 -d >secure/pdm-service/tls/client.crt + printf '%s' "$PDM_CLIENT_KEY_B64" | base64 -d >secure/pdm-service/tls/client.key + chmod 600 secure/pdm-service/tls/client.crt secure/pdm-service/tls/client.key + - name: Write CSAV SSH key env: CSAV_SSH_KEY_B64: ${{ secrets.CSAV_SSH_KEY_B64 }} diff --git a/docs/deploy.md b/docs/deploy.md index ab64502..8184bf4 100644 --- a/docs/deploy.md +++ b/docs/deploy.md @@ -89,7 +89,7 @@ certificates are looked up by hostname in ACM. | `LOG_HOST_RADS`, `LOG_HOST_SECURE_RADS` | log-service hostnames | | `TELEMETRY_HOST_RADS`, `TELEMETRY_HOST_SECURE_RADS` | telemetry-service hostnames | | `COST_HOST_RADS`, `COST_HOST_SECURE_RADS` | cost-service hostnames | -| `PDM_HOST`, `PDM_HOST_RADS` | PDM hostnames | +| `PDM_HOST`, `PDM_HOST_RADS`, `PDM_MTLS_HOST` | PDM hostnames; `PDM_MTLS_HOST` is the mTLS-only count endpoint | | `KMS_HOST`, `VERIFIER_HOST`, `VERIFIER_ATTEST_HOST`, `VERIFIER_URL` | secure service hostnames | | `REGISTRY_HOST_RADS`, `EXECUTION_HOST_RADS` | rads registry and execution API hostnames | | `VERIFIER_JWKS_URL`, `VERIFIER_JWKS_PUBKEY_SHA256` | JWKS endpoint and pin used by pdm/log/kms | @@ -102,6 +102,7 @@ certificates are looked up by hostname in ACM. | --- | --- | | `REGISTRY_TLS_CERT_B64`, `REGISTRY_TLS_KEY_B64` | base64 of the existing `secure/csav/registry-service/tls/client.{crt,key}` | | `CSAV_SSH_KEY_B64` | base64 of `.ssh/csav-key.pem`, used to ship the registry image | +| `PDM_CLIENT_CERT_B64`, `PDM_CLIENT_KEY_B64` | base64 of `secure/pdm-service/tls/client.{crt,key}`; the execution-service -> PDM count client identity | | `CLOUDFLARE_EMAIL`, `CLOUDFLARE_API_TOKEN` | Cloudflare API credentials | | `SERVERLESS_ACCESS_KEY` | Serverless Framework v4 license key; required because unattended runs cannot sign in | @@ -126,3 +127,5 @@ over SSH, and restarts the compose service on the CSAV host. - The verifier JWT signing key must already exist at the SSM path the service reads. See `docs/getting-started.md`. - The CSAV key pair and the CSAV instance must already exist before the registry image ships. +- A DNS-only CNAME for `PDM_MTLS_HOST` must point at the `PdmMtlsRegionalDomainName` output of + `secure-rads-pdm-service-dev`. The deploy does not manage Cloudflare DNS. diff --git a/scripts/lib/units.sh b/scripts/lib/units.sh index 8f0e336..396e216 100644 --- a/scripts/lib/units.sh +++ b/scripts/lib/units.sh @@ -118,13 +118,31 @@ unit_secure_verifier_service() { } unit_secure_pdm_service() { - need PDM_HOST LOG_HOST_SECURE_RADS COST_HOST_SECURE_RADS VERIFIER_JWKS_URL VERIFIER_JWKS_PUBKEY_SHA256 - local arn + need PDM_HOST PDM_MTLS_HOST LOG_HOST_SECURE_RADS COST_HOST_SECURE_RADS VERIFIER_JWKS_URL VERIFIER_JWKS_PUBKEY_SHA256 + local arn mtls_arn truststore version arn=$(cert_for "$PDM_HOST") + mtls_arn=$(cert_for "$PDM_MTLS_HOST") + truststore=secure/pdm-service/tls/client.crt + [ -f "$truststore" ] || run make -C secure/pdm-service gen-client-cert + run make -C secure/pdm-service store-client-cert sls secure/pdm-service \ --param="region=$region" \ --param="domainName=$PDM_HOST" \ - --param="certificateArn=$arn" + --param="certificateArn=$arn" \ + --param="mtlsDomainName=$PDM_MTLS_HOST" \ + --param="mtlsCertificateArn=$mtls_arn" + version=$(aws s3api put-object \ + --bucket "$(stack_output secure-rads-pdm-service-dev PdmTruststoreBucketName)" \ + --key truststore.pem \ + --body "$truststore" \ + --query VersionId --output text) + sls secure/pdm-service \ + --param="region=$region" \ + --param="domainName=$PDM_HOST" \ + --param="certificateArn=$arn" \ + --param="mtlsDomainName=$PDM_MTLS_HOST" \ + --param="mtlsCertificateArn=$mtls_arn" \ + --param="truststoreVersionId=$version" } unit_secure_kms_service() { @@ -223,7 +241,7 @@ unit_rads_execution_service() { need EXECUTION_HOST_RADS PDM_HOST_RADS RADS_EXECUTOR_AMI_ID AVAILABILITY_ZONE \ LOG_HOST_RADS TELEMETRY_HOST_RADS COST_HOST_RADS local arn images_bucket algorithm_table run_results_table run_results_queue_url \ - run_results_queue_arn pdm_table vpc + run_results_queue_arn vpc arn=$(cert_for "$EXECUTION_HOST_RADS") vpc=$(default_vpc) images_bucket=$(stack_output rads-registry-service-dev ImagesBucketName) @@ -231,7 +249,6 @@ unit_rads_execution_service() { run_results_table=$(stack_output rads-result-consumer-dev RunResultsTableName) run_results_queue_url=$(stack_output rads-result-consumer-dev RunResultsQueueUrl) run_results_queue_arn=$(stack_output rads-result-consumer-dev RunResultsQueueArn) - pdm_table=$(stack_output rads-pdm-service-dev PersonalDataTableName) sls rads/sce/execution-service \ --param="region=$region" \ --param="vpcId=$vpc" \ @@ -241,7 +258,6 @@ unit_rads_execution_service() { --param="runResultsQueueUrl=$run_results_queue_url" \ --param="runResultsQueueArn=$run_results_queue_arn" \ --param="pdmUrl=https://$PDM_HOST_RADS" \ - --param="pdmTable=$pdm_table" \ --param="domainName=$EXECUTION_HOST_RADS" \ --param="certificateArn=$arn" } From 529d5642f248cff541d5907b08f338a21b1fd582 Mon Sep 17 00:00:00 2001 From: prdai Date: Thu, 26 Nov 2026 10:19:56 +0530 Subject: [PATCH 4/5] fix(pdm): correct count route integration target Co-authored-by: Codex --- secure/pdm-service/serverless.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/secure/pdm-service/serverless.yml b/secure/pdm-service/serverless.yml index e88a483..41fcc2e 100644 --- a/secure/pdm-service/serverless.yml +++ b/secure/pdm-service/serverless.yml @@ -109,7 +109,7 @@ resources: ApiId: !Ref CountHttpApi RouteKey: GET /count AuthorizationType: NONE - Target: !Join ["integrations/", !Ref CountIntegration] + Target: !Sub "integrations/${CountIntegration}" CountLambdaPermission: Type: AWS::Lambda::Permission From 6000c10f8fbcdfab59673a0be36bafe7334fc75b Mon Sep 17 00:00:00 2001 From: prdai Date: Thu, 26 Nov 2026 11:27:34 +0530 Subject: [PATCH 5/5] chore(deploy): drop redundant PDM mTLS comment Co-authored-by: Codex --- .env.example | 1 - 1 file changed, 1 deletion(-) diff --git a/.env.example b/.env.example index df36c71..02a2dee 100644 --- a/.env.example +++ b/.env.example @@ -28,7 +28,6 @@ TELEMETRY_HOST_SECURE_RADS=telemetry.sr.secure-rads.org COST_HOST_RADS=cost.r.secure-rads.org COST_HOST_SECURE_RADS=cost.sr.secure-rads.org PDM_HOST=pdm.sr.secure-rads.org -# mTLS-only domain for the execution-service -> PDM record count call. PDM_MTLS_HOST=pdm-mtls.sr.secure-rads.org KMS_HOST=kms.sr.secure-rads.org PDM_HOST_RADS=pdm.r.secure-rads.org