Lightweight Docker Based Secure Sandbox for Running Python Code
To Run untrusted Python code securely is a critical requirement for many modern platforms such as online IDEs, educational tools and cloud services. This paper presents a lightweight sandbox solution using Docker containers combined with a FastAPI interface to execute Python scripts safely in isolated environments. We discuss the system's design, implementation details and resource control mechanisms. Our evaluation shows that the sandbox effectively enforces strict network restrictions, resource limits and execution timeouts, preventing common security threats like unauthorized access, resource abuse and container escapes. While acknowledging some limitations, this approach provides a practical foundation for secure Python code execution in scalable interactive applications.
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2025-05-25
- DOI
- https://doi.org/10.5281/zenodo.15514254
- Primary Topic
- Security and Verification in Computing
- Type
- article
- Field-Weighted Citation Impact
- 0.00