tpt-portcullis

Rust

Rust-native, memory-safe OPNsense-equivalent firewall/router. Structured filter/NAT/traffic-shaping rule model with graph-based verification, built to compose with separate dataplane, privileged-execution, HA, and DPI components. Dual-licensed MIT/Apache-2.0.

0 stars0 forks0 watchersApache License 2.0

Languages

Rust100.0%
README

tpt-portcullis

CI License MSRV

Rust-native OPNsense-equivalent firewall/router — the rule model and product-level glue that wires dataplane, privileged execution, and (later) HA/declarative config into one coherent thing a person can install and run.

Spec: spec.txt · Checklist: todo.md

What this is

Most of the hard technical dependencies are deliberately not built here:

DependencyRepoRoleStatus
Dataplane enactmenttpt-netctlapplies filter/NAT/rate-limit state to nftables/eBPFreal code
Privileged executiontpt-privdthe only process allowed to touch the kernelreal code
HA / failovertpt-quorum2-node active/passive coordinationmissing
Declarative config enginetpt-bastion (+ network provider)plan/apply/drift-detectionmissing
VPN (WireGuard)boringtun (external, BSD-3-Clause)adopted, not builtexternal
DNS resolverhickory-dns (external, MIT/Apache dual)adopted, not builtexternal
Protocol/packet inspectiontpt-fathomDPI, logging substratemissing
Admin UI frameworktpt-appfrontcross-platform Rust UIreal code
Secrets/certstpt-citadelVPN keys, cert storagereal code
Admin authtpt-aegisIAM, 2FAmissing

What's actually new in this repo is the rule model and the product-level glue. Phases 1–2 of the build (this checklist) cover portcullis-rules plus a minimal single-box portcullis-daemon. HA, declarative config, admin UI, and WireGuard/DNS adoption are tracked as follow-ups in todo.md.

Crates

CrateDescription
portcullis-rulesBackend-independent rule model + lint/verify pass
portcullis-daemonSingle-box daemon: config → verify → netctl apply, privd health-check
portcullis-cliAdmin CLI (validate / apply / reload / status)

MSRV note

Workspace MSRV is 1.82 so portcullis-rules remains a valid path dependency for tpt-netctl (also 1.82). portcullis-daemon and portcullis-cli declare rust-version = "1.85" because they depend on tpt-privd (edition 2024 / rust 1.85). CI tests 1.82 against -p portcullis-rules only; stable runs the full workspace.

Path dependencies

This repo expects sibling checkouts for local development:

Open Source/
├── tpt-portcullis/   # this repo
├── tpt-netctl/
└── tpt-privd/

CI checks out those repositories as siblings so path deps resolve.

Quickstart (Phase 2+)

# Validate a config offline (parse + lint, no apply):
cargo run -p portcullis-cli -- validate path/to/rules.toml

# Run the daemon (loads config, applies via netctl, serves control socket):
cargo run -p portcullis-daemon -- --config path/to/rules.toml

# Ask the running daemon to (re)apply:
cargo run -p portcullis-cli -- apply path/to/rules.toml
cargo run -p portcullis-cli -- status

See each crate's rustdoc for details.

License

Licensed under either of

at your option.