fix: rely on engine default seccomp profile - #54
Merged
Conversation
There was a problem hiding this comment.
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 runinvocation (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 thatunconfinedis 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_unconfinedduplicates theseccomp=unconfinedassertion already covered bytest_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 |
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
Verification