Allow container stop and restart in container-runtime profile - #21
Merged
axellpadilla merged 2 commits intoAug 14, 2026
Merged
Conversation
DockerRunLauncher.terminate() cancels runs via POST /containers/{id}/stop,
which the container-runtime profile still denied. Grant stop alongside the
other launcher lifecycle endpoints; kill, restart, pause, unpause, rename,
update, resize, attach, and commit stay denied.
Restart is compositionally stop+start (SIGTERM -> timeout -> SIGKILL -> start), so denying it while granting both parts is a ceremonial boundary. Grant restart as a legitimate orchestrator lifecycle op; kill, pause, unpause, rename, update, resize, attach, and commit stay denied.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
container-runtimeprofile claims to supportDockerRunLauncherlifecycle calls, but it deniedPOST /containers/{id}/stop— the exact endpointDockerRunLauncher.terminate()uses to cancel runs. Since deny-overrides blocks any allowlist override while the profile is active, run termination failed with 403 and runs hung inCANCELINGwith worker containers still running.Closes #20.
Changes
src/security.rs: grantPOST /containers/{id}/stopandPOST /containers/{id}/restartin thecontainer-runtimeprofile by adding them toRUNTIME_ENDPOINTSand removing them from the profile's retained write-denial list.container_runtime_profile_allows_launcher_workflow, andcontainer_runtime_profile_keeps_destructive_ops_deniedconfirms kill, pause, unpause, rename, update, resize, attach, and commit stay denied.README.md: document that graceful termination and restart are included;CHANGELOG.md:[Unreleased]Fixed entry.Design decision
Only stop and restart are granted.
DockerRunLauncherin dagster-docker never calls kill/pause, so those remain denied (least privilege, no behavior loss). Stop is the graceful, reversible SIGTERM path; restart is compositionally stop+start, so denying it once stop and start are both granted would be a ceremonial boundary with no security value — the profile already granted the irreversibleDELETE /containers/{id}, so this closes the lifecycle gap rather than widening it.Validation
cargo fmt --all --check— passcargo clippy --all-targets -- -D warnings— cleancargo test --locked— 88 passed / 0 failed