Securely Running Untrusted Code with Layered SandboxingSecurely Running Untrusted Code with Layered Sandboxing
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
How do you let strangers run code on your server… safely? 🔒
That was the core problem behind CompileHub, my online code editor for 13+ languages. Every "Run" click executes code someone else wrote. So every run goes through 5 layers:
① A throwaway Docker container, destroyed after the run
② --network none: no internet, so no data exfiltration or outbound calls
③ A non-root user, so escape attempts start with zero privileges
④ A memory-backed /app (tmpfs): code runs in RAM and never touches the host disk
⑤ Hard caps of 1 CPU core and 256 MB RAM, plus a 15-second watchdog that kills runaway code
All of it runs on Kubernetes (AWS EKS), provisioned with Terraform and monitored with Prometheus and Grafana.
Security usually isn't one big wall. It's many small, boring limits stacked together.
The full case study is on my profile.
Post image
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started