Network Sandbox Engine v2 - testing nftables rules in a real kernel environment, risk-free

Network Sandbox Engine v2 - testing nftables rules in a real kernel environment, risk-free

●1 ●5 ●18
calendar_today • schedule1 min read

I built NSE (Network Sandbox Engine) because testing nftables rules on a live system is dangerous. One bad rule can leave orphan tables behind.

NSE solves this by creating an ephemeral Linux network namespace, loading your ruleset, injecting synthetic packets, and capturing kernel verdicts via nft monitor trace. The host firewall never gets touched.

What's new in v2.0.0:

  • In-process architecture - removed the rootd socket daemon. Everything runs in a single process.
  • Pydantic core - all data models are strongly typed. The entire codebase passes mypy --strict.
  • Deterministic trace harvesting - no more hardcoded sleep delays. NSE waits for kernel traces to be ready and returns real verdicts (ACCEPT/DROP/REJECT).
  • Automated cleanup - startup sweeps orphaned namespaces. Teardown uses exponential backoff retries.
  • Gateway topologies - support for router + server namespaces to test NAT and forwarding rules.
  • MkDocs documentation with mkdocstrings for API reference.
  • import-linter enforces architectural boundaries between core and GUI.

How to use it:

  • As a Python library - import nse and write packet-level tests.
  • As a CLI for CI/CD - write YAML test definitions and run nse-runner.
  • With the web UI - FastAPI backend + Svelte frontend for real-time packet tracing and conntrack visualization.

Requirements: Linux (kernel 5.4+), Python 3.10+, nftables, iproute2, root privileges.

Links:

I'm looking for feedback. What would make this useful for your workflow? What's missing?

Want more #devops & #security deep dives?

Join 6,178+ developers sharing real benchmarks, code breakdowns, and projects. Free forever.

4 Comments

2 votes
1
2 votes
0

More Posts

The cleanup failed on the night there was nothing to clean

BashSnippets - Dec 2

The Rowling-Galbraith Mystery: Testing Stylometry with Burrows’ Delta

nevmenandr - Oct 10

Free SEO Tools Every Small Business Should Use (2026) | FloxoLab

floxolab - Oct 20

FluidCloud's CEO on Why NSX Firewall Rules, Not Disk Copies, Stall VMware Exits

Tom Smithverified - Nov 17

MCP Is the USB-C of AI. So Why Are You Plugging Everything In?

Ken W. Algerverified - Jun 10
chevron_left
252 Points • 24 Badges
2Posts
6Comments
5Connections
https://github.com/onyks-os

Related Jobs

Commenters (This Week)

20 comments
13 comments
3 comments

Contribute meaningful comments to climb the leaderboard and earn badges!