pankaj@portfolio
>
cd ..
⚔️ Sandboxed Execution Engine

IronJudge

RustAxumRedisDockerLinuxseccomp

IronJudge is a production-ready, highly scalable, and secure code execution engine built entirely in Rust. It is designed to act as the core backend for competitive programming platforms, online IDEs, and interview tools where untrusted user code needs to be executed safely.

Architecture

The system consists of two main microservices connected via a Redis stream:

  1. HTTP API Server (Axum): Validates incoming execution requests, enqueues jobs onto a Redis Stream, and provides endpoints to poll execution status.
  2. Worker Engine: Continuously pulls jobs from the Redis Stream, orchestrates the secure execution environment, compiles/runs the code, checks against expected outputs, and pushes results back to Redis.

Security Model (Defense in Depth)

The core challenge in building IronJudge was securely running arbitrary code without relying on heavy VM hypervisors. It uses Linux-native isolation techniques:

  • Namespaces (PID, Mount, UTS, NET): Ensures the running code cannot see other processes on the host, cannot access the host filesystem (chroot), cannot view the hostname, and has no internet access.
  • Cgroups v2: Enforces strict limitations on memory consumption and CPU sharing. If a process exceeds its memory limit (e.g., 256MB), it is instantly OOM-killed.
  • Seccomp BPF (Secure Computing Mode): A whitelist of allowed system calls is applied to the untrusted process. Any attempt to use dangerous syscalls (like execve, ptrace, or fork) immediately terminates the process with a SIGKILL.

Performance

Because it bypasses the overhead of spinning up entire Docker containers per submission, IronJudge can initialize a sandbox, compile C++, execute the binary, and tear down the environment in under 100 milliseconds.