Skip to content

fix: rely on engine default seccomp profile - #54

Merged
blondres04 merged 1 commit into
mainfrom
codex/ci-seccomp-alignment
May 4, 2026
Merged

fix: rely on engine default seccomp profile#54
blondres04 merged 1 commit into
mainfrom
codex/ci-seccomp-alignment

Conversation

@blondres04

Copy link
Copy Markdown
Owner

Summary

  • rely on Docker's implicit default seccomp policy during detonation
  • remove the Linux-only explicit seccomp override that breaks GitHub runners
  • update unit and integration tests to assert the intended security contract: default behavior is allowed, unconfined is not

Verification

  • python -m pytest tests/ -x -q
  • python -m mypy src/ --ignore-missing-imports
  • python -m ruff check src/

Copilot AI review requested due to automatic review settings May 4, 2026 23:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Docker detonation path to rely on Docker Engine’s implicit default seccomp profile (instead of explicitly passing --security-opt seccomp=default), improving portability across GitHub-hosted runners and Docker Desktop environments.

Changes:

  • Removed the Linux-only explicit seccomp override from the attacker docker run invocation (now relying on engine defaults).
  • Updated unit tests to assert that detonation does not pass a seccomp override and never passes seccomp=unconfined.
  • Updated the integration test to validate that no seccomp override is configured via HostConfig.SecurityOpt (and that unconfined is not requested).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
shield-claw/src/shieldclaw/sandbox/docker_orchestrator.py Stops explicitly setting seccomp and relies on Docker’s default behavior during detonation.
shield-claw/tests/test_docker_orchestrator.py Adjusts unit tests to match the “engine default, never unconfined” security contract.
shield-claw/tests/test_docker_orchestrator_integration.py Updates integration assertions to check for absence of seccomp overrides (and absence of unconfined).
Comments suppressed due to low confidence (1)

shield-claw/tests/test_docker_orchestrator.py:249

  • test_detonate_never_uses_unconfined duplicates the seccomp=unconfined assertion already covered by test_detonate_uses_engine_default_seccomp_profile. Consider merging these tests or removing one to reduce redundant coverage and maintenance overhead.
def test_detonate_never_uses_unconfined(mocker: MockerFixture) -> None:
    """Detonation must never opt out of seccomp via ``unconfined``."""
    mocker.patch.object(DockerOrchestrator, "_ensure_docker", autospec=True)
    completed = subprocess.CompletedProcess(["docker", "run"], 0, "", "")
    run_mock = mocker.patch(
        "shieldclaw.sandbox.docker_orchestrator.subprocess.run",
        return_value=completed,
    )
    payload = ExploitPayload(
        payload_id=uuid.uuid4(),
        raw_code="import sys\nsys.exit(0)\n",
        target_dns="web",
        execution_command="python -",
        language="python",
    )

    outcome = DockerOrchestrator().detonate(payload, "net", "rid", timeout=5)

    assert outcome.exit_code == 0
    cmd = run_mock.call_args[0][0]
    assert "seccomp=unconfined" not in cmd

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

cmd = run_mock.call_args[0][0]
assert "--security-opt" in cmd
assert "seccomp=default" in cmd
assert "--security-opt" not in cmd
@blondres04
blondres04 merged commit 1d32985 into main May 4, 2026
9 checks passed
@blondres04
blondres04 deleted the codex/ci-seccomp-alignment branch May 4, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants