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 2 14
calendar_today agoschedule1 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?

2 Comments

1 vote
1 vote
🔥 Join developers growing publicly
Share your knowledge, build in public, and grow your developer presence with a global community.

More Posts

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

onyks - Aug 15

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

Ken W. Algerverified - Jun 10

Comparison: Universal Import vs. Plaid/Yodlee

Pocket Portfolio - Mar 12

The Interface of Uncertainty: Designing Human-in-the-Loop

Pocket Portfolio - Mar 10

My Nginx Died at 2 AM and Nobody Noticed for 6 Hours. Now I Have a Watchdog Script

BashSnippets - May 21
chevron_left
215 Points18 Badges
2Posts
3Comments
3Connections
https://github.com/onyks-os

Related Jobs

View all jobs →

Commenters (This Week)

1 comment
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!