Repository navigation
docs: recommend Cloud Registry deployment settings - #60
Conversation
Make the Cloud Registry page recommend the settings decided for the ELIXIR On-Cloud deployment, each with a short justification, in the existing sections: service types `controlled`, environments `prod` and `test`, `https` service URLs, at most 20 services per user and default invitations (both from 1.0.0rc1, marked as such), blocking `/admin/`, rate limits, the app's NetworkPolicy, 2 replicas, backups, required signature checks, and the front end's image, hardening, replicas and one LS Login client per front end. Also point the front end links to the UI's documentation, where the README sections moved. Closes #59 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideThe documentation now provides a version-aware, production-oriented Cloud Registry deployment guide covering recommended configuration, ingress and network security, release verification, hardened front-end deployment, backups and restore testing, and operational checks, while noting the chart's current replica limitation. Sequence diagram for verified Cloud Registry installationsequenceDiagram
actor Operator
participant GitHub
participant RegistryImage
participant Helm
participant Kubernetes
Operator->>GitHub: gh release download
Operator->>GitHub: gh attestation verify
GitHub-->>Operator: Verified chart
Operator->>RegistryImage: gh attestation verify
RegistryImage-->>Operator: Verified image
alt verification succeeds
Operator->>Helm: helm install
Helm->>Kubernetes: Create Cloud Registry resources
Kubernetes-->>Operator: rollout status
else verification fails
Operator-->>Operator: Do not install
end
Sequence diagram for Cloud Registry backup and restore testingsequenceDiagram
actor Operator
participant CronJob
participant MongoDB
participant OffsiteStorage
participant RestoreMongoDB
participant Registry
CronJob->>MongoDB: mongodump
CronJob->>OffsiteStorage: rclone copy
CronJob->>OffsiteStorage: rclone delete
Operator->>OffsiteStorage: Download backup
Operator->>RestoreMongoDB: mongorestore
Operator->>RestoreMongoDB: mongosh
Operator->>Registry: curl service list
Operator->>Operator: Compare restored and live data
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 4 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="docs/services/cloudregistry.md" line_range="653" />
<code_context>
+ annotations:
+ # Applies to the whole host, also to other apps on it
+ nginx.ingress.kubernetes.io/server-snippet: |
+ location /admin/ { return 404; }
+ ```
+
</code_context>
<issue_to_address>
**Other Ingress paths remain public**
When an operator chooses the chart's Ingress option, the chart Ingress forwards paths other than `/admin/` to the app, including paths outside `/ga4gh/registry/v1/`, so endpoints beyond the stated allowlist remain reachable.
Configure the Ingress to forward only the allowed API paths and reject all other paths.
</issue_to_address>
### Comment 2
<location path="docs/services/cloudregistry.md" line_range="1040" />
<code_context>
+ mountPath: /app/.next/cache
+ volumes:
+ - name: next-cache
+ emptyDir: {}
+```
+
</code_context>
<issue_to_address>
**Non-root workloads cannot write volumes**
When these manifests run with the default `emptyDir` ownership and no ownership adjustment, the UI process running as UID 1000 cannot write its cache, and the backup containers running as UID 999 cannot write their temporary config or archive, so the UI cache fails and backups are not produced.
Configure writable ownership, such as an appropriate `fsGroup`, for the UI and backup volumes.
Also at `docs/services/cloudregistry.md:1248-1249`.
</issue_to_address>
### Comment 3
<location path="docs/services/cloudregistry.md" line_range="1316-1320" />
<code_context>
+
+```bash
+kubectl scale deploy/cloud-registry --replicas=0 -n <namespace>
+kubectl exec -i deploy/cloud-registry-mongodb -n <namespace> -- sh -c 'mongorestore \
+ -u "$MONGO_INITDB_ROOT_USERNAME" -p "$MONGO_INITDB_ROOT_PASSWORD" \
+ --authenticationDatabase admin --gzip --archive --drop' \
+ < cloud-registry-<timestamp>.archive.gz
+kubectl scale deploy/cloud-registry --replicas=1 -n <namespace>
+```
+
</code_context>
<issue_to_address>
**Failed restore restarts app**
When `mongorestore` fails after changing the database, `mongorestore` can exit after `--drop` has removed or replaced some collections, but the shell continues to the final `kubectl scale` command; the app then serves a partially restored database.
Make the restore sequence stop on failure and only scale the app back up after a successful restore.
</issue_to_address>
### Comment 4
<location path="docs/services/cloudregistry.md" line_range="1212-1216" />
<code_context>
+ - |
+ set -e
+ printf 'password: "%s"\n' "$MONGO_PASSWORD" > /tmp/mongodump.yaml
+ mongodump --config /tmp/mongodump.yaml \
+ --host cloud-registry-mongodb --port 27017 \
+ --username "$MONGO_USER" --authenticationDatabase serviceStore \
+ --db serviceStore --gzip \
+ --archive="/backup/cloud-registry-$(date -u +%Y%m%dT%H%M%SZ).archive.gz"
+ securityContext:
+ readOnlyRootFilesystem: true
</code_context>
<issue_to_address>
**Backup can mix database states**
When a service is written while the CronJob traverses the database, `mongodump` reads collections at different times without using an oplog, so the archive can combine inconsistent states and cannot provide a consistent point-in-time recovery.
Use a backup method that provides a consistent point-in-time snapshot, or pause writes while the dump runs.
</issue_to_address>Linked issues
#59 docs: recommend Cloud Registry deployment settings · 8 of 8 met
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Recommend service types controlled, leave max_unused_service_types at its default, and set environments to prod and test. |
✅ Met | The Service types and Service environments sections give the recommendations and explain them; the values example includes both settings. |
| 2 | Recommend https service URLs, at most 20 services per user, and default invitation settings. |
✅ Met | The Service URL schemes, Services per user, and Invitations sections document these choices; the latter two are marked as available from 1.0.0rc1. |
| 3 | Block /admin/, enable the app NetworkPolicy with the ingress controller as peer, and recommend ingress rate limits per client IP. |
✅ Met | The exposure and Network policies sections provide the requested configurations and examples, including 10 writes per minute with a burst of 5 and 300 requests per minute overall. |
| 4 | Recommend two registry replicas with default Gunicorn settings, backups, restore testing, and signature verification on every install and upgrade. | ✅ Met | The Replicas, Backups, Verifying the chart and the image, Installation, and Upgrades sections cover these recommendations and procedures, including the chart's current replica limitation. |
| 5 | Document the front-end image source, hardening, two replicas, and one LS Login client per front end in the registry audience. | ✅ Met | The Front end guidance and Deployment example cover these recommendations, and the Audience section lists separate client IDs for the UI, Krini, and dashboard. |
| 6 | Mark 1.0.0rc1-only settings, retain the page's 0.6.0 version and chart URLs, and warn against putting unsupported settings in a 0.6.0 values file. | ✅ Met | The warning and values-file comments identify the rc1-only settings and explain that 0.6.0 rejects unknown config.custom keys; the page retains its 0.6.0 references. |
| 7 | Use placeholders only, with no secrets, tokens, or real client IDs. | ✅ Met | The examples use placeholders for client IDs, namespaces, hosts, and credentials; no real secrets or tokens are included. |
| 8 | State each decided setting with its reason and exact keys or commands, and pass mkdocs build --strict. |
✅ Met | The recommendations include justifications and configuration keys or commands; the pull request's verification notes report that mkdocs build --strict passed. |
Sourcery assessment
Approval pending. 4 findings to address first.
Blocking findings: docs/services/cloudregistry.md:653, docs/services/cloudregistry.md:1040, docs/services/cloudregistry.md:1320, docs/services/cloudregistry.md:1216
Stop the restore before restarting the app if mongorestore fails, note that dumps of the single MongoDB server are not point-in-time copies, and say that an Ingress of your own is the stricter way to expose only the API. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="docs/services/cloudregistry.md" line_range="1232" />
<code_context>
+ drop: [ALL]
+ volumeMounts:
+ - {name: backup, mountPath: /backup}
+ - {name: tmp, mountPath: /tmp}
+ containers:
+ - name: upload
</code_context>
<issue_to_address>
**Uploader can read database password**
When the rclone container or image is compromised, the dump container writes `MONGO_PASSWORD` to `/tmp/mongodump.yaml`, and both containers mount the same `tmp` volume at `/tmp`; a compromised rclone container can read the MongoDB password and use it to access the production database.
Use separate temporary volumes for the dump and upload containers so the uploader cannot access the MongoDB credential file.
Also at `docs/services/cloudregistry.md:1254`.
</issue_to_address>
### Comment 2
<location path="docs/services/cloudregistry.md" line_range="1015" />
<code_context>
+ containers:
+ - name: cloud-registry-ui
+ # The recorded build (see "UI version"); for releases, pin the digest
+ image: <registry>/cloud-registry-ui:<commit>
+ ports:
+ - name: http
</code_context>
<issue_to_address>
**Retagged UI image runs**
When an actor with write access to the UI image registry overwrites the commit tag after it was pushed, kubernetes resolves `image: <registry>/cloud-registry-ui:<commit>` when starting a pod; after a registry writer moves that tag, a new pod on a node without the old image runs the replacement rather than the recorded build, allowing attacker-controlled UI code to make authenticated API requests as users.
Pin the pushed UI image by digest in the Deployment example, including for builds made before UI releases exist.
</issue_to_address>Linked issues
#59 docs: recommend Cloud Registry deployment settings · 7 of 7 met
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Recommend the registry settings: controlled service types with the unused-types limit at its default, prod/test environments, HTTPS-only service URLs, a 20-services-per-user limit, and default invitation settings. | ✅ Met | The page explains these settings and their keys; it marks the user limit and invitations as 1.0.0rc1-only. |
| 2 | Block /admin/, enable the app NetworkPolicy with the ingress controller as peer, and recommend per-client-IP rate limits. | ✅ Met | It gives chart and custom-Ingress approaches, ingress-nginx examples for 10 writes/minute with burst 5 and 300 requests/minute, and explains applying the rate limits without the chart Ingress. |
| 3 | Recommend two registry replicas with default Gunicorn settings, backups and a tested restore, and signature verification on every install and upgrade. | ✅ Met | The page recommends two replicas while disclosing the chart limitation, documents snapshot and CronJob backup options plus restore steps, and directs operators to verify chart and image signatures. |
| 4 | Document the front-end image source, hardening, two replicas, and a separate LS Login client per front end listed in the registry audience. | ✅ Met | The page covers recorded commits until releases exist, signed release images pinned by digest, container hardening, a two-replica Deployment example, and separate audience entries. |
| 5 | Keep the page and chart references at 0.6.0, and warn against adding 1.0.0rc1-only settings to a 0.6.0 deployment. | ✅ Met | The warning identifies the strict config validation and the values-file example comments out the rc1-only user limit. |
| 6 | Use placeholders only; include no secrets, tokens, or real client IDs. | ✅ Met | The examples use placeholders and refer to credentials stored in Secrets. |
| 7 | Pass mkdocs build --strict. | ✅ Met | The PR verification reports that the strict build passed. |
Sourcery assessment
Approval pending. 2 findings to address first.
Blocking findings: docs/services/cloudregistry.md:1232, docs/services/cloudregistry.md:1015
Use separate scratch volumes for the dump and upload containers, so the uploader cannot read the MongoDB password file, and pin the UI image by digest in the Deployment example and the build instructions. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Summary
Makes the Cloud Registry page (
docs/services/cloudregistry.md) recommend the 16 settings that the maintainer decided for the ELIXIR On-Cloud deployment, each with a short justification and exact keys or commands, in the page's existing sections rather than as a list at the end:controlled(max_unused_service_typesleft at its default); environmentsprod,test(plusNEXT_PUBLIC_SERVICE_ENVIRONMENTS=prod,testfor the UI); new sections "Service URL schemes" (httpsonly, the default), "Services per user" (20) and "Invitations" (defaults); "Audience": one LS Login client per front end (registry UI, Krini, dashboard), each ID inaudience./admin/, either with an Ingress of your own for/ga4gh/registry/v1/only (chart Ingress and Route off), or with the chart's Ingress and a block at the proxy (example for ingress-nginx withserver-snippet). New "Rate limits": writes 10/min with a burst of 5, all requests 300/min, per client IP (example for ingress-nginx:limit-rpmplus a write-onlylimit_reqzone in the controller'shttp-snippet), and how to apply it without the chart's Ingress. "Network policies": app policy enabled, ingress controller as the only peer.values-prod.yaml: collects the settings (network policy, audience with three placeholders, environments,controlled;max_services_per_user: 20commented out as rc1-only).gh attestation verifyfor chart and image, 0.6.0); Installation and Upgrades now install the verified chart file.mongodumpCronJob to an S3-compatible bucket outside the cluster via rclone, kept 14 days, with the NetworkPolicy that MongoDB's policy needs for the job; a one-time restore test (dump and snapshot) and a real restore.ai-post-deployuntil UI releases exist, then the signed release image pinned by digest; hardening (readOnlyRootFilesystem,runAsNonRootwithrunAsUser: 1000, as the image's userbunisn't numeric, all capabilities dropped,emptyDiron/app/.next/cache); 2 replicas without sticky sessions; an example Deployment./admin/blocked, write rate limit, app NetworkPolicy.Versions: the page stays "last checked against v0.6.0" with its 0.6.0 URLs.
max_services_per_userandinvitationsexist only from 1.0.0rc1 (git log v0.6.0..dev: elixir-cloud-aai/cloud-registry#286, elixir-cloud-aai/cloud-registry#274) and are marked from 1.0.0rc1, with a warning box: 0.6.0 validatesconfig.customwithextra="forbid"(FOCAFOCABaseConfig), and the chart's schema doesn't checkconfig.custom, so the pods would crash on startup.url_schemes,environments,service_typesandmax_unused_service_typesexist in 0.6.0 (controlledfrom 0.5.0).Also points the front end links to the UI's documentation on Read the Docs: the README sections that the page linked (
#docker,#login,#sessions-and-logout, …) moved there (elixir-cloud-aai/cloud-registry-ui#118), so the anchors were broken.No secrets, tokens or real client IDs: placeholders only.
Sources: cloud-registry
dev(574d569) and v0.6.0 (docs/configuration.md, docs/access-control.md, docs/operations.md, deployment/README.md, values.yaml, values.schema.json,cloud_registry/service_models/custom_config.py), foca-common chart 0.2.0 (_deployment.tpl), cloud-registry-uiai-post-deploy(a791ca7: Dockerfile,src/app/auth/api/*,src/lib/login-flow.ts, docs/operator-guide), oven/bun Dockerfile (userbun= UID 1000).Light lane: docs only, one page, no logic; reviewed the diff myself.
Verification
mkdocs build --strict(Python venv,mkdocs[i18n],mkdocs-material,pillow,cairosvg, as in the deploy workflow): passed. The repo has no PR CI (its workflows run on pushes tomainonly) and no link check.deployment/#server,configuration/#service-url-schemes; latestconfiguration/#services-per-user,access-control/#invitations; UI docsuser-guide/registering/#known-limitations,operator-guide/deployment/#verifying-images,#docker,#registry,login/#sessions-and-logout,#copying-the-access-token,admins/#admin-mode).mongorestore, dumps noted as not point-in-time (single server, no oplog; snapshots for exact copies), own Ingress noted as the stricter allow list (9d1ad24);emptyDirownership declined (emptyDiris world-writable, nofsGroupneeded).mkdocs build --strictpassed again after the fixes.Follow-up (not blocking)
dev/1.0.0rc1, via foca-common 0.2.0) hard-codesreplicas: 1and has no values key. The page recommends 2 replicas but says the deployment runs 1 until the chart can set it. A values key (e.g.,cloudRegistry.replicas, plus a PodDisruptionBudget) would need an issue in foca (library chart) and cloud-registry.Closes #59
🤖 Generated with Claude Code
Summary by Sourcery
Document a secure, verifiable, and recoverable production deployment profile for the Cloud Registry and its front end.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests: