Repository navigation
Description
SandboxPolicy has no way to carry a seccomp profile, so a container sandbox runs with the engine's default profile and devops sandbox audit (#698) can only report that default.
Context
#698's third part would add SandboxPolicy.seccomp_profile and render it as seccomp=<JSON> in security_opt. It was dropped from #698 by the owner's decision of 2026-10-22, for two reasons found while analysing it:
- No command or setting builds a custom container
SandboxPolicy: a search ofsrc/finds onlyDEFAULT_SANDBOX_POLICYand the host default. A new field would be unused surface untilsandbox deploy,docker sandboxandtest sandboxgrow a--seccomp-profileoption. - Podman accepts an inline JSON profile in the compat API only from podman PR #29726 (merged around September 2026); before it, the value is read as a file path. The workstation's Podman version has not been checked.
Proposed remedy
When a profile is wanted for a real sandbox, add --seccomp-profile <file> to the three commands above, validate the file at load (exists, is JSON, has a defaultAction, and does not allow everything by default), carry it on SandboxPolicy, and render it per engine after checking the engine version that accepts it. Until then the audit reports the engine default.
Proposed design
Problem statement
SandboxPolicy has no field for a seccomp profile. A container sandbox always runs with the engine's default profile, and devops sandbox audit (#698) can only report that default. This issue adds a --seccomp-profile option to the sandbox commands, validates the profile file, carries it on SandboxPolicy, and renders it per engine with a version check for Podman.
Acceptance criteria
- Criterion 1: SandboxPolicy has an optional seccomp_profile field that is null by default.
Verification: Import SandboxPolicy and confirm the field exists and defaults to None. Run: python -c "from devops_cli.sandbox.models import SandboxPolicy; p = SandboxPolicy(); assert p.seccomp_profile is None" - Criterion 2: sandbox deploy, docker sandbox, and test sandbox each accept --seccomp-profile .
Verification: Run each command with --help and confirm the flag appears. Run: devops sandbox deploy --help | grep seccomp-profile - Criterion 3: The profile file is validated at load: it exists, is valid JSON, contains a defaultAction key, and defaultAction is not SCMP_ACT_ALLOW.
Verification: Pass a non-existent file, a non-JSON file, a JSON file without defaultAction, and a file with defaultAction=SCMP_ACT_ALLOW. Each must produce a clear error. Pass a valid file and confirm it loads. - Criterion 4: For Docker, the profile renders as seccomp= inside the security_opt list.
Verification: Build a Docker sandbox with a seccomp profile and inspect the create kwargs. Confirm security_opt contains the seccomp entry. Run the existing test at tests/test_sandbox_lifecycle.py:660 pattern with a profile set. - Criterion 5: For Podman, the profile renders as inline JSON when the engine version supports it (PR #29726), and as a file path otherwise.
Verification: Mock Podman versions above and below the PR #29726 threshold. Confirm the rendered value is inline JSON for the newer version and a file path for the older version. - Criterion 6: When no profile is set, the existing behavior is unchanged: security_opt is ("no-new-privileges:true",) and no seccomp entry appears.
Verification: Run the existing test at tests/test_sandbox_lifecycle.py:660 and confirm it still passes without modification.
Key questions
- Which commands receive the --seccomp-profile flag?: sandbox deploy, docker sandbox, and test sandbox. (proposed) [sources: src/devops_cli/docker/sandbox.py:73, src/devops_cli/sandbox/init.py:55]
- What validation must the profile file pass before it is carried on SandboxPolicy?: The file must exist, parse as valid JSON, contain a defaultAction key, and defaultAction must not be SCMP_ACT_ALLOW. (proposed) [sources: src/devops_cli/sandbox/models.py:465]
- How is the profile rendered for the Docker engine?: As seccomp= appended to the security_opt tuple. [sources: src/devops_cli/sandbox/models.py:465, src/devops_cli/sandbox/models.py:481]
- How is the profile rendered for the Podman engine?: Inline JSON when the Podman version includes PR #29726 (merged around September 2026); a file path otherwise. The engine version is checked at render time. [sources: src/devops_cli/docker/sandbox.py:73]
- What was the owner's decision regarding this feature in feat(cli): sandbox enforcement audit declared vs engine vs enforced (
devops sandbox audit) #698?: The owner dropped the seccomp profile from feat(cli): sandbox enforcement audit declared vs engine vs enforced (devops sandbox audit) #698 on 2026-10-22. This issue (feat(sandbox): SandboxPolicy carries a seccomp profile the container engines apply #1822) is the re-home for that work. (proposed) [sources: src/devops_cli/sandbox/models.py:465]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsReady
- StatusShow more project fieldsNew
Activity
dan-petty commentedon Oct 24, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.
This feature improves sandbox security but is not critical for core functionality.Adds security hardening capability that benefits users running sandboxes.Requires changes to policy handling, validation, and engine rendering logic across multiple commands.devops sandbox audit) #698, which asks for a different change.Both items relate to sandbox security features; however, #698 deals with audit functionality while this candidate proposes adding seccomp profile support to SandboxPolicy.dan-petty commentedon Oct 28, 2026
Status set to Ready at 4da1e34 (see proposed design in issue body).
feat(sandbox): sandbox commands take a seccomp profile file (#2588)