Repository navigation
feat(agents): issue-992-p1-workflow-parameters-are-interpolated - #1812
Conversation
Proposal: platform-gitops/agents-state/mctl-gitops/proposals/issue-992-p1-workflow-parameters-are-interpolated/ Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Claude finished @mctl-agents[bot]'s task in 6m 11s —— View job Reviewing PR #1812
SummaryThis converts the remaining Verified:
One P3 posted inline (non-blocking): the new No P1/P2 findings. Approved. |
Antigravity (agy) review — informationalModel: gemini-3.8-flash-medium · commit No significant issues found. |
| HTTP_CODE=$(curl -sS -o /tmp/vault-write.json -w "%{http_code}" \ | ||
| # vault_path lands in a URL: reject anything but a plain relative path. | ||
| case "$PARAM_VAULT_PATH" in | ||
| ""|/*|*..*|*[!A-Za-z0-9/_-]*) |
There was a problem hiding this comment.
P3: the *..* / char-class guard rejects path traversal and shell/URL metacharacters, but still accepts a leading/embedded/trailing / sequence like a//b or a/. Not an injection (the character / is in the allowlist by design, since vault_path is itself a sub-path), just a minor hygiene gap — Vault will likely just normalize it, but consider also rejecting //* or a leading/trailing / if that matters for the secret/data/${PARAM_VAULT_PATH} URL this feeds.
There was a problem hiding this comment.
No P1/P2 findings (1 P3). Converts the remaining direct {{inputs.parameters.X}} interpolations in tpl-git-commit/tpl-validate-tenant/tpl-vault-write and the assert-attempt templates to env-var bindings read as "$PARAM_X" — closing the shell-injection class tracked in #992. Verified: unquoted heredocs (<<ENVEOF etc.) still can't be terminator-injected because the shell matches the delimiter against the literal script text before parameter expansion runs, every
The merge with main left validate with two env keys: main's PARAM_* bindings from #1812 and the branch's PARAM_CONTAINER_REGISTRY. YAML keeps only the last one, so every PARAM_* read by the script was unset. One env list now holds all ten bindings (yamllint key-duplicates and validate-shell-param-interpolation both pass). Claude-Session: https://claude.ai/code/session_012TfVcukEh7ry8MiLNN89N4
Three cases passed without executing a single parameter read: their prelude ran `apk add` first, which exits 127 off-cluster, so `set -e` stopped before the first PARAM_* line and the canary could never appear. The review flagged cleanup-db-from-gitops; write-service-secrets and delete-service-secrets from #1812 had the same shape. Each case now runs once with valid values and must reach a sentinel at the end of its prelude, and the payload runs render the source the way Argo does, so a placeholder put back into the script trips the canary rather than only the static check. A missing jq fails instead of skipping. validate-local-workdir's smoke check now asserts the jq form of provision_database, and the ban's docstring states its scope. Refs #1836 Claude-Session: https://claude.ai/code/session_01XgvCTQf5obEJr8NyKp73jC
Implements accepted proposal
mctl-gitops/issue-992-p1-workflow-parameters-are-interpolated.Spec: https://github.com/mctlhq/mctl-gitops/tree/main/platform-gitops/agents-state/mctl-gitops/proposals/issue-992-p1-workflow-parameters-are-interpolated/
Generated by mctl-agents Tier 2 implementer. Review carefully — this PR was opened automatically and the spec may have gaps.
Refs #992
Scope note (operator): this PR is the first slice of #992 (proposal tasks 1-5: injection test harness,
tpl-validate-tenant,tpl-git-commit,tpl-vault-write,assert-attempt). Still open on #992: task 6 (wft-smoke-test), task 7 (create/delete/deploy/provision/retire sites), task 8 (validator ratchet becomes a ban), task 10 (live smoke). The API-side follow-up from task 9 is mctlhq/mctl-api#559. #992 stays open.