Repository navigation
Conversation
The CAS in devel/compose.labs.yml crashes on startup because of two regressions: - CAS_PUBLIC_KEY_PATH points at cas.pem, which is the private key. Since chainloop-dev#3225 (v1.105.0) the key is parsed at startup, so the CAS panics with "failed to parse public key: x509: malformed tbs certificate". - chainloop-dev#3365 (v1.110.0) made staging_dir required, but the scratch image has no directory that user 1001 can write to, so the CAS panics before it reaches the key. Point the key path at cas.pub. Ship an empty /tmp-staging-fs owned by 1001 in the image, which is the path the Helm chart already mounts its emptyDir on, and back it with a named volume in the lab compose. Assisted-by: Claude Code Signed-off-by: Daniel Kmak <4950658+e00dan@users.noreply.github.com>
PR validation —
|
| Status | Policy | Material | Messages |
|---|---|---|---|
pr-min-approvals |
pr-info |
PR/MR #3797 has 0 approving reviews, 1 required. | |
| ✅ Passed | pr-description-required |
pr-info |
- |
| ✅ Passed | pr-user-story-linked |
pr-info |
- |
AI Session Checks — ⏭️ bypassed by label
AI Coding Session Check Bypassed
This PR carries the skip-ai-session label, so the AI coding session check was bypassed.
Learn more about Chainloop Trace.
Security Checks — ✅ 6 passing
✅ Nothing this change touches re-opens a recorded security fix.
View in Chainloop ↗ · How this works ↗
✅ Nothing this change touches re-opens a recorded security fix.
View in Chainloop ↗ · How this works ↗
✅ secret-scan
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | secrets-detection |
- |
✅ sast-scan
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | owasp-top10-2025 |
- |
| ✅ Passed | cwe-top25 |
- |
| ✅ Passed | sast |
- |
| ✅ Passed | cwe-top26-40-cusp |
- |
✅ iac-scan
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | iac-misconfiguration |
- |
Scans not applied (2)
| Scan | Reason |
|---|---|
vulnerability-scan |
no manifest/lockfile changed |
github-actions-scan |
no workflow files changed |
Powered by Chainloop and Chainloop Trace
With a non-inline CAS backend, attestation push against the lab stack fails with an internal error. The control plane uploads the attestation bundle to the CAS at cas_server.grpc.addr, which config.devel.yaml sets to 0.0.0.0:9001. Inside the control-plane container that is the container itself, so the dial times out. The value has no env placeholder, so compose could not override it. Add a CAS_SERVER_ADDR placeholder that defaults to the current value, so running the control plane on the host is unchanged, and set CP_CAS_SERVER_ADDR to cas:8001 in the lab compose. Like the Helm chart, this targets the CAS shared endpoint rather than the deprecated gRPC-only listener. Assisted-by: Claude Code Signed-off-by: Daniel Kmak <4950658+e00dan@users.noreply.github.com>
|
Thanks for tracking this down. I reproduced all three problems against One change request: please drop the The production image doesn't need it: Helm mounts an emptyDir at A tmpfs mount with the right owner works with today's cas:
tmpfs:
- /tmp-staging-fs:uid=1001,gid=1001
environment:
CAS_VAULT_ADDRESS: http://vault:8200
CAS_PUBLIC_KEY_PATH: /devkeys/cas.pub
CAS_STAGING_DIR: /tmp-staging-fsWith that, the The |
Keep the production image unchanged, as requested in review. Revert the Dockerfile change and mount a tmpfs owned by 1001 at /tmp-staging-fs in the lab compose, replacing the named volume. This works with the released artifact-cas:latest image, so the lab stack works as soon as this lands rather than after the next release. Assisted-by: Claude Code Signed-off-by: Daniel Kmak <4950658+e00dan@users.noreply.github.com>
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
View guided diff | Re-trigger cubic
|
Feedback addressed. Please re-review. |
Summary
The lab stack (
devel/compose.labs.yml, the README's "Self-host / Local stack") doesn't work on current releases. The CAS crashes on startup because of two regressions, and once it starts,attestation pushwith a real storage backend fails because the control plane can't reach the CAS.CAS_PUBLIC_KEY_PATHis set to/devkeys/cas.pem, which is the EC private key. The public key iscas.pub, which the CAS devel config already uses as its default. This was harmless while the key was parsed per request, but since perf(artifact-cas): parse the EC public key once instead of per request #3225 (v1.105.0) it is parsed at startup, and the CAS panics withfailed to parse public key: x509: malformed tbs certificate.staging_dirrequired. The image isFROM scratchwithUSER 1001and has no directory that user can write to, so the CAS panics before it reaches the key. The Helm chart mounts an emptyDir at/tmp-staging-fs; the compose file has nothing equivalent.cas_server.grpc.addr, whichapp/controlplane/configs/config.devel.yamlsets to0.0.0.0:9001. Inside the control-plane container that address is the container itself, soattestation pushfails with an internal error after the dial times out (creating the gRPC client: ... DeadlineExceeded). The value has no env placeholder, so compose couldn't override it. This one predates the two regressions; it only shows up with a non-inline backend.Changes
All changes are dev-only. The production images and the Helm chart are unchanged.
devel/compose.labs.yml(CAS):CAS_PUBLIC_KEY_PATHatcas.pub/tmp-staging-fs:uid=1001,gid=1001)CAS_STAGING_DIR: /tmp-staging-fsapp/controlplane/configs/config.devel.yaml:cas_server.grpc.addrbecomes${CAS_SERVER_ADDR:0.0.0.0:9001}. The default is unchanged, so running the control plane on the host behaves as before.devel/compose.labs.yml(control plane):CP_CAS_SERVER_ADDR: cas:8001. Like the Helm chart, this targets the CAS's shared endpoint rather than the deprecated gRPC-only listener on 9001.This works with the released
:latestimages, so the lab stack works as soon as this is merged.Testing
On Linux arm64 (Docker 29.9.3, rootless), with
docker compose -f devel/compose.labs.yml upand the releasedartifact-cas:latestandcontrol-plane:latestimages:/devkeys/cas.puband listens on:8001and:9001. The staging dir is a tmpfs owned by 1001.attestation init, thenattestation addof a new 5 MB artifact: the CAS staged it, verified its digest and uploaded it to the backend.attestation push: the control plane uploaded the signed bundle to the CAS overcas:8001. The run issuccess.artifact downloadreturned the 5 MB file with a matching SHA-256.AI disclosure
Investigation and changes were done with Claude Code (
Assisted-by: Claude Codeon all commits). I reviewed and tested the changes myself.🤖 Generated with Claude Code