enhancement(docker): Add Python runtime with nsjail sandboxing #399
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.

This change adds production-grade sandboxing capabilities to the Docker runtime for secure execution of Python DSL security rules. The implementation uses nsjail, a lightweight process isolation tool developed by Google, providing defense-in-depth protection against untrusted code execution. The runtime includes Python 3.13.9 for DSL rule execution and the codepathfinder library installed from PyPI. Network isolation prevents any outbound connections, filesystem isolation restricts access to sensitive system files, and process isolation ensures complete separation from the host system. Resource limits enforce strict boundaries on CPU time, memory usage, and file sizes to prevent resource exhaustion attacks. All security features have been validated through a comprehensive test suite covering network access, file permissions, process visibility, and resource consumption. The sandbox runs with minimal privileges using the nobody user account and operates within an isolated chroot environment. This foundation enables safe execution of community-contributed security rules without compromising system security.