<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged nftables</title>
<link>https://coderlegion.com/tag/nftables</link>
<description>Powered by Question2Answer</description>
<item>
<title>Network Sandbox Engine v2 - testing nftables rules in a real kernel environment, risk-free</title>
<link>https://coderlegion.com/24688/network-sandbox-engine-v2-testing-nftables-rules-in-a-real-kernel-environment-risk-free</link>
<description>&lt;p&gt;I built NSE (Network Sandbox Engine) because testing nftables rules on a live system is dangerous. One bad rule can leave orphan tables behind.&lt;/p&gt;
&lt;p&gt;NSE solves this by creating an ephemeral Linux network namespace, loading your ruleset, injecting synthetic packets, and capturing kernel verdicts via &lt;code&gt;nft monitor trace&lt;/code&gt;. The host firewall never gets touched.&lt;/p&gt;
&lt;p&gt;What's new in v2.0.0:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In-process architecture - removed the rootd socket daemon. Everything runs in a single process.&lt;/li&gt;
&lt;li&gt;Pydantic core - all data models are strongly typed. The entire codebase passes &lt;code&gt;mypy --strict&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Deterministic trace harvesting - no more hardcoded sleep delays. NSE waits for kernel traces to be ready and returns real verdicts (ACCEPT/DROP/REJECT).&lt;/li&gt;
&lt;li&gt;Automated cleanup - startup sweeps orphaned namespaces. Teardown uses exponential backoff retries.&lt;/li&gt;
&lt;li&gt;Gateway topologies - support for router + server namespaces to test NAT and forwarding rules.&lt;/li&gt;
&lt;li&gt;MkDocs documentation with mkdocstrings for API reference.&lt;/li&gt;
&lt;li&gt;import-linter enforces architectural boundaries between core and GUI.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;How to use it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;As a Python library - import nse and write packet-level tests.&lt;/li&gt;
&lt;li&gt;As a CLI for CI/CD - write YAML test definitions and run nse-runner.&lt;/li&gt;
&lt;li&gt;With the web UI - FastAPI backend + Svelte frontend for real-time packet tracing and conntrack visualization.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Requirements: Linux (kernel 5.4+), Python 3.10+, nftables, iproute2, root privileges.&lt;/p&gt;
&lt;p&gt;Links:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Repo: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/onyks-os/NetworkSandboxEngine&quot;&gt;https://github.com/onyks-os/NetworkSandboxEngine&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Docs: &lt;a rel=&quot;nofollow&quot; href=&quot;https://onyks-os.github.io/nse/&quot;&gt;https://onyks-os.github.io/nse/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Changelog: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/onyks-os/NetworkSandboxEngine/blob/main/CHANGELOG.md&quot;&gt;https://github.com/onyks-os/NetworkSandboxEngine/blob/main/CHANGELOG.md&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I'm looking for feedback. What would make this useful for your workflow? What's missing?&lt;/p&gt;
</description>
<category>Discussions</category>
<guid isPermaLink="true">https://coderlegion.com/24688/network-sandbox-engine-v2-testing-nftables-rules-in-a-real-kernel-environment-risk-free</guid>
<pubDate>Sat, 15 Aug 2026 18:43:40 +0000</pubDate>
</item>
</channel>
</rss>