PR #45: the api container gets the tombstone salt, and the deploy tests have gaps #46
Labels
No labels
boundary:crosses
bug
enhancement
epic
needs-info
needs-triage
ready-for-agent
ready-for-human
svd:go
svd:hold
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dev/messages-mind-mcp#46
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two reviews of PR #45 (issue #18, head
abd3005) ran before the merge gate. PR CI is green. The PR is held because of item 1.Blocker
The api container gets the tombstone salt. Since #33 (
b5413cf), the api verb never reads the salt file (TOMBSTONE_SALT_VERBSischeckandsync; README: "The api never opens the tombstone salt file"). But the deploy files copy it into the api:deploy/k8s/base/messagesmind.yaml:53-58(the api items of the Secret) and:82(the api init command);tests/compose_stack.py:28(the api set ofmake_secrets).A compromised api would then hold the salt and, on the shared data volume,
tombstones.db. With both, it can test message guids against the Tombstones and learn which messages were Forgotten (ADR 0006, ADR 0007). The test locks this in:tests/test_deploy.py:29-31buildsPROCESS_SECRETSfromcfg.secret_files()(the files that a config names), not from the files that a verb opens. The README and the overlay README say that each process sees only its own secret files.Fix: drop
tombstone-saltfrom the api Secret items, the api init command and the api set ofmake_secrets.api.tomlstill names the path, becauseStoreConfigrequires it. BuildPROCESS_SECRETSfromstartup.SECRET_FILE_VERBS. Correct the expectedstatoutput in the overlay README.Cause: the spec was written before #33, and its rebaseline on
b5413cfchecked line positions, not the secret sets of each process.Should fix
compose.yaml: no service setsread_only: true,cap_drop: [ALL]orsecurity_opt: [no-new-privileges:true]./etc/messagesmindis owned by uid 10001 (Containerfile:13), so a compromised api can write there. Add the three keys and atmpfsfor/tmp, and make/etc/messagesmindowned by root.compose.yaml:60: the smoke service mounts every api secret, the store key included, but needs only the read token.deploy/k8s/base/networkpolicy.yaml:11: the ingress rule has nofrom, so any pod in any namespace can reach port 8420, and the bearer token is the only control. The overlay should add a namespace or pod selector for the proxy, and the README should say so.tests/test_deploy.py:281: the image pin is not tested. Withimages: [], kustomize deploysmessagesmind, which resolves todocker.io/library/messagesmind:latest. Assert exactly one entry formessagesmindwith a digest.tests/test_deploy.py:98-106, 302: "nothing else" is checked only on the base policy and its patch. An overlay that adds an allow-all NetworkPolicy, an overlay CIDR of198.0.0.0/8, and a base CIDR of0.0.0.0/0all pass. Pin the overlayresources, require/32, and assert that the base CIDR is in192.0.2.0/24.tests/test_deploy.py:277: aRUN apt-get installor anADD https://…in the Containerfile passes. Allow-list everyRUNandADDline.Notes
.dockerignore.COPY src/…copies host__pycache__files and host file modes; a checkout made with umask 077 gives files that uid 10001 cannot read.python -madds the working directory tosys.path;-Ior-Premoves that.fsGroupmakes the store files group-writable (0660); considerfsGroupChangePolicy: OnRootMismatch.syncservice mountingapi.toml,/var/lib/messagesmindmissing from theinstall -dline, a container without the/tmpmount,volumes_from: [api]on smoke, and an exec probe on/healthz/sync.tests/compose_stack.py:89retries on every exception, so a persistent401reports astimeout.Acceptance criteria
startup.SECRET_FILE_VERBS.Human act
eyes-on verify: the compose smoke passes under Podman on the host (CONV-40)
Blocked by
Filed under: operator word "Grant" sha256:78b7d0379d5e
Triage
startup.SECRET_FILE_VERBS.fromselector..dockerignore,python -I,fsGroupChangePolicy: OnRootMismatchand the401retry.ready-for-human. One acceptance criterion cannot run in CI: the compose smoke needs a container engine.Disposition: close this issue when the #18 rework PR merges and the compose smoke passes on the host.
Closed: both conditions of the disposition hold.
13a2fc8. The merge tree equals the verified headb116792.smoke=ok messages=9, exit 0.store-keyandread-tokenonly.syncholdsstore-key,tombstone-saltandfeeder-token. Each file is mode0400and owned by uid 10001 (item 1).no-new-privileges. The api publishes on127.0.0.1:8420only (items 2 and 3).The two merge-gate reviews of PR #51 found no blocker. Their should-fix items are filed as #52.