Skip to content

Conversation

@valeriy42
Copy link
Contributor

Overview

This PR introduces Sandbox2 security integration to enhance the security posture of the PyTorch inference process in the ML-CPP codebase.

Changes

Security Enhancements

  • Sandbox2 Integration: Added comprehensive Sandbox2 security framework integration
  • Process Isolation: Implemented secure process spawning with privilege dropping
  • Security Testing: Added comprehensive test suite to validate security constraints

Build System Updates

  • CMake Integration: Updated build system to include Sandbox2 dependencies
  • Third-party Dependencies: Added Abseil and Sandbox2 as third-party dependencies
  • License Compliance: Added proper license files for all new dependencies

Key Components

  • Core implementation for secure process spawning
  • Comprehensive test suite validating security constraints
  • Updated CMakeLists.txt files across multiple components
  • Proper license attribution for all dependencies

Security Benefits

  • Process Isolation: PyTorch inference processes run in isolated sandboxes
  • Privilege Dropping: Processes run with minimal required privileges
  • Resource Constraints: Sandbox2 enforces memory, CPU, and system call limitations
  • Attack Surface Reduction: Malicious PyTorch models cannot escape sandbox constraints

Testing

  • Added comprehensive unit tests validating security constraints
  • Tests verify privilege dropping, resource limits, and sandbox enforcement
  • All existing tests continue to pass

Dependencies

  • Sandbox2: Google's sandboxing framework for Linux
  • Abseil: Google's C++ common libraries (required by Sandbox2)

This enhancement significantly improves the security posture of the ML-CPP system by ensuring that PyTorch inference processes cannot compromise the host system.

@prodsecmachine
Copy link

prodsecmachine commented Oct 28, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Licenses 0 0 0 0 0 issues
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@valeriy42 valeriy42 changed the title Add Sandbox2 security integration for PyTorch inference [ML] Add Sandbox2 security integration for PyTorch inference Oct 28, 2025
@valeriy42 valeriy42 marked this pull request as draft October 28, 2025 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants