Skip to content

a torn-down pod deploy leaves its provisioned podman secrets in the engine store: provisioning has a verb, teardown has none #64

Closed

Description

@aitrawog

Finding (RCA, R1) — tearing a deploy down leaves its provisioned podman secrets in the engine store

Provisioning has a verb; teardown does not. Measured while running the new
check-pod-secret-diagnostic bed on a disposable: true pod:

$ charly deploy del / charly remove  (the bed's own cleanup phase: PASS)
$ charly remove pod-secret-diag
Removed /home/atrawog/.config/containers/systemd/charly-pod-secret-diag.container
Reloaded systemd user daemon
$ charly status pod-secret-diag --json
{"status":"not configured","secrets":["charly-pod-secret-diag-webui-secret-key"]}

The container, the quadlet and the deploy entry are gone; the podman secret the same deploy
provisioned is still in the engine store, visible to charly status forever.

Mechanism. deploykit.ProvisionPodmanSecrets creates/rotates secrets (EnsurePodmanSecret,
RotateOnConfig); the removal paths (config_remove.go, charly deploy del, charly remove) tear down
the container/quadlet/ledger and never call an engine secret delete. candy/plugin-deploy-pod/AGENTS.md
says pod teardown is "charly remove + drop overlay images" — the secrets are simply absent from that
sentence.

Missed control. No test asserts that a removed deploy leaves no engine-side secret. The R3
adverb table in /charly-internals:strict-policy maps podman secret ls to charly status <box> — so the
gap is visible through the sanctioned surface — but its podman secret rm row maps to
charly config <box> --refresh-secret <name|all>, which RE-creates a secret rather than removing it. There
is no charly verb for "remove this deploy's secret", so the gap cannot be worked around without the engine
CLI, which the same table forbids.

Blast radius. Every disposable bed that provisions a required or auto-generated secret (this repo's own
beds included) leaves one behind per instance name, and the residue is indistinguishable from a live
deployment's secret on a shared host — the next run of the same bed reuses it ("kept (already
provisioned)"), which can mask a provisioning defect by carrying a stale value across runs.

Root fix (owner decision, hence filed): charly remove / charly deploy del should delete the
deploy-scoped podman secrets it provisioned (or charly clean should sweep the <box>-* secret set), with
the engine-agnostic path used by EnsurePodmanSecret. Doing it in THIS repo is the natural home — it owns
provisioning — but whether teardown is destructive by default (a --purge-secrets flag?) is a product
decision, and a wrong default deletes a credential an operator wanted to keep.

Assisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system)

Activity

  1. self-assigned this
    on Nov 16, 2026
  2. aitrawog commented on Nov 16, 2026

    @aitrawog
    ContributorAuthor

    RESOLVED — landed as opencharly/plugin-pod#28 (squash, round two) . The owner of this gap is
    opencharly/plugin-pod, not this repo
    : charly remove's orchestration lives in
    candy/plugin-pod/remove_orchestration.go, which is where the module-cache grep pointed when I went looking
    for the code behind the message. This issue was filed here because #64's measurement came from a
    plugin-deploy-pod bed; the code was never in this repo.

    What landed:

    Proof in the PR body: six unit tests (both sibling directions, sidecar exactness, unreadable-config
    conservatism), two mutations including the round-one bug, the live engine proof on a real leftover
    (engine holds 1 → removed → the engine lists none), charly box validate 0 warnings, and
    charly check run check-pod PASS with its [cleanup] phase driving charly remove on the changed tree.

    Agent: charly

    Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions