TCP Warden Changelog & Release Notes β
All notable changes to TCP Warden (github.com/routewarden/tcp-warden) are documented here.
The format is based on Keep a Changelog, and TCP Warden adheres to Semantic Versioning.
[v3.4.0] - 2026-10-06 (Latest) β
π Security Hardening Release: Protocol Plugin Boundary Fixes, UDP Ban Fast-Path & Installer Path Traversal Protection β
TCP Warden v3.4.0 is a comprehensive security hardening release, closing a set of boundary-condition vulnerabilities identified during an internal audit of the plugin ecosystem and the core daemon's UDP engine and plugin installer subsystems. All 21 official protocol plugins were audited; seven received targeted fixes.
1. UDP Engine β Synchronous Ban Fast-Path β
- Synchronous Pre-Goroutine Drop: The UDP datagram engine (
core/udp_engine.go) now checks the active ban list and CrowdSec block list before allocating a session goroutine or NAT socket for incoming datagrams. - Zero-Goroutine-Leak DoS Mitigation: Previously, a banned sender triggering high-frequency UDP floods could saturate the goroutine pool before per-session ban checks executed. Bans from permanently blacklisted IPs are now dropped inline on the receive loop without scheduling any goroutine.
- Tests:
TestUDPEngine_BannedIP_Droppedverifies the fast-path verdict for active bans.
2. Plugin Installer β Path Traversal & Symlink Safety β
- Plugin Name Allowlist: Plugin names passed to
tcp-warden plugins installare now validated against a strict allowlist ([a-zA-Z0-9_-]+). Names containing path separators, dot-dot sequences (../), or shell metacharacters are rejected before any filesystem or network operation. - Git Subpath Escape Prevention: Resolved a vulnerability where a crafted Git repository could use
.githooks or nested submodule paths to write files outside the plugin staging directory duringgo build. - Symlink Dereferencing Block: The installer now verifies that the resolved real path of every file in a cloned plugin directory remains inside the staging root, blocking symlink escape attacks.
- Tests:
TestPluginInstaller_SecurityBoundariescovers traversal names, symlink attempts, and allowlist enforcement.
3. Protocol Plugin Hardening (All 21 Plugins Audited) β
MQTT (plugins/mqtt) β
- CONNACK 0x02 Emission on Oversized ClientID: When
max_client_id_lenis configured and a connecting client exceeds the limit, the inspector now sends a well-formed MQTTCONNACKresponse with return code0x02(Identifier Rejected) before closing the connection, as required by the MQTT 3.1.1 specification. - Previously the connection was silently closed mid-handshake, causing compliant client libraries to retry indefinitely.
- Security event:
blocked_mqtt_client_id_too_longemitted viactx.OnSecurityEvent.
AMQP 0-9-1 (plugins/amqp) β
- Empty VHost Normalization:
extractVHostnow treats a zero-length vhost field inConnection.Openas the AMQP default vhost (/), preventing an attacker from bypassingallowed_vhostsenforcement by sending a zero-length vhost byte when the server default is included in the allowlist. - Tests:
TestAMQP_ExtractVHostβ boundary matrix covering truncated payload, zero-length vhost, out-of-bounds length, and valid vhosts.
BitTorrent DHT (plugins/bittorrent) β
- Allowlist Enforcement on Unparseable DHT Methods: When
allowed_dht_methodsis configured and a DHT query arrives with a missing or undecodable method name (e.g., malformed bencode length prefix), the packet is now dropped (bt_dht_query_missing_method) rather than silently allowed through the allowlist. - Bounded Bencode Length Scanning: The
extractDHTMessageTypeparser caps its length-prefix digit scan to 4 digits (colonOffset <= 4), preventing CPU amplification from arbitrarily long synthetic length fields in crafted DHT packets. - Tests:
TestBTUDPInspector_DHTAllowlist_RejectsMissingMethodverifies the allowlist drop on unparseable query methods.
Minecraft Java Edition (plugins/minecraft) β
- TCP Fragmentation Bypass Fix: The Minecraft inspector previously read the handshake with a single non-blocking
client.Read(). A client fragmenting the handshake across multiple TCP segments could causereadVarIntto receive insufficient bytes for multi-byte protocol version VarInts (e.g., version 760 / 1.19.2 encoded as0xF8 0x05), resulting in the version check being skipped entirely and an uninspected connection being forwarded to the upstream server. - The inspector now accumulates the full packet body (up to 512 bytes) across TCP segment boundaries before evaluating
blocked_protocol_versions. - Strict Packet ID Enforcement: When protocol version blocking is configured, a non-zero Packet ID (not a handshake packet) is now rejected immediately (
invalid minecraft handshake packet id) rather than silently forwarded. - Tests:
TestMinecraft_Run_BlockedProtocolVersion_FragmentedandTestMinecraft_Run_MalformedHandshake_Rejected.
SMTP, LDAP, FTP, IMAP, POP3, Memcached (plugins/*) β
- Unbounded Line Read Protection:
bufio.Scannerreplaced rawbufio.ReadLinecalls with enforced per-line limits (MaxScanTokenSize) across SMTP, FTP, IMAP, and POP3, preventing a connected client from sending an infinitely long line to exhaust inspector heap memory. - Authentication Failure Cap (
max_auth_failures): All authentication-inspecting plugins (SMTP, LDAP, IMAP, POP3, FTP) now enforceMaxAuthFailuresby sending a protocol-appropriate rejection and closing the connection once the cap is reached, withctx.OnAuthFailure()andctx.OnSecurityEventemitted on every excess attempt. - LDAP DN Suffix Spoofing Prevention: The LDAP inspector validates that the
BindDNin a Bind Request matches only literal suffixes from theallowed_bind_dn_suffixeslist (case-folded), preventing evasion via Unicode homoglyphs or LDAP attribute reordering. - Memcached Storage Length Validation: The Memcached inspector rejects
set/add/replace/append/prependcommands with a declaredbytesfield that is negative or exceeds 1 MB (configurable), preventing heap exhaustion via synthetic large-object commands.
[v3.3.0] - 2026-10-05 β
π Hardening & Protocol Handover Release: BufferedConn Fallthrough, IPv6 Zone Normalization & Extended API Coverage β
TCP Warden v3.3.0 delivers critical protocol transport fixes, IPv6 zone normalization across CIDR filters, and comprehensive test suite additions.
1. Transport & Handover Reliability β
BufferedConn.ReadFallthrough: Fixed an issue where peeking or draining headers during protocol inspection could stall downstream readers.BufferedConn.Read()now cleanly falls through to the underlying network connection when the initial buffer is exhausted or nil.- Large Stream Transfer Resilience: Added verification for high-throughput, multi-chunk stream forwarding in
protocol.Proxy().
2. IPv6 Scope & CIDR Integrity β
- Zone Identifier Normalization in Config: Updated
isValidIPOrCIDR()to strip RFC 4007 zone identifiers (e.g.,fe80::1%eth0), preventing false validation errors during configuration parsing. - IPv6 CIDR Precedence & Evaluation: Verified that IPv6 CIDR ranges (such as
2001:db8::/32) evaluate correctly across global allowlists, service allowlists, and denylists.
3. Management API & Ban Administration β
- Banlist Listing & Dynamic Unban: Validated JSON serialization of active bans on
/api/banlistand tested dynamic unbanning via/api/unban. - Service Discovery: Verified
/api/servicesendpoint reporting configured proxy services and operational metadata.
[v3.2.1] - 2026-10-04 β
π Maintenance & Bug Fix Release: SemVer 2.0.0 Pre-Release Parsing & SDK Synchronization β
TCP Warden v3.2.1 resolves a version comparison defect in the dynamic plugin registry and synchronizes the Plugin SDK and host daemon release versions.
1. Plugin Registry & Semantic Versioning Pre-Release Ordering β
- SemVer 2.0.0 Pre-Release Precedence: Replaced dot-separated integer splitting in
plugins.CompareVersions()with strict SemVer 2.0.0 compliance viasdk.ParseSemVer()andsdk.CompareSemVer(). - Pre-Release Tag Sorting: Pre-release versions (e.g.
1.2.0-rc.1,1.2.0-beta.1) are now correctly evaluated as having lower precedence than their corresponding normal releases (1.2.0), and dot-separated pre-release identifiers are properly compared lexicographically and numerically in accordance with the SemVer 2.0.0 specification. - Unit Test Coverage: Added comprehensive test cases in
plugins/registry_test.gocovering pre-release tags, release candidates, and version equality checks.
2. Ecosystem Synchronization β
- Plugin SDK v3.2.1 Alignment: Synchronized the Plugin SDK version constant
sdk.Version = "3.2.1"inplugins/sdk/sdk.gowith the host daemon version. - Version Metadata & Test Verification: Synchronized
version.json,main.go,VERSIONING.md, and automated test validationTestVersionMatchesJSONacross the repository.
[v3.2.0] - 2026-10-04 β
π Feature & Hardening Release: Comprehensive Concurrency, Persistence, and Security Fixes β
TCP Warden v3.2.0 brings comprehensive security hardening, concurrency stability, and memory optimizations across all core subsystems, resolving 24 edge-case vulnerabilities and operational defects identified across the UDP datagram engine, SQLite ban persistence, GeoIP resolver, API server, and Plugin SDK.
1. Core Proxy & Transport Hardening β
- TCP Half-Close Preservation: Fixed bidirectional stream proxying in
protocol.Proxy()to invokeCloseWrite()on*net.TCPConnrather than closing the underlying socket prematurely. Connections requiring half-close handshakes (such as HTTP/1.1 pipelining, SMTP TLS upgrades, and custom RPCs) now transfer payloads completely without EOF truncation. BufferedConnHalf-Close Delegation: AddedCloseRead()forwarding inprotocol.BufferedConn, ensuring that wrapped or peeked connections propagate half-close read shutdowns cleanly without breaking ongoing writes.- Active Connection Underflow Defense: Replaced plain atomic decrement with a compare-and-swap (CAS) guard in
ServiceStats.ConnClosed(), guaranteeing thatActiveConnectionsnever underflows below zero during rapid client disconnects or aborted handshakes. - Cancellation Context Propagation in Plugin Inspection: Threaded active connection contexts (
context.Context) through tosdk.DefaultContextincore/pipeline.go. Protocol inspectors listening onctx.Context().Done()now receive immediate cancellation when connections terminate or the daemon initiates graceful shutdown. - Pipeline Panic Recovery: Protected inspector executions and pipeline evaluation stages with defensive panic recovery handlers. Malformed protocol payloads or panicking plugin inspectors are caught, logged, and isolated without crashing the daemon process.
- Platform-Agnostic Listener Accept Error Handling: Added
use of closed network connectionstring fallback in TCP listener accept error checks, ensuring uniform clean shutdown across all operating systems. - Port Range Forwarding: Added support for 1:1 and N:1 port mapping ranges with strict validation ensuring non-overlapping ranges and matching source/destination widths.
2. Network Protocol & IPv6 Integrity β
- IPv6 Scope / Zone Identifier Stripping: Added RFC 4007 zone ID stripping across
parseClientIP(),cleanIPString(),matchIP(),crowdsec.Client.Check(), and the management API (/api/ban,/api/unban). Link-local addresses with interface suffixes (e.g.,[fe80::1%eth0]:1234) are now cleanly resolved, preventing erroneous drops bynet.ParseIP, properly classifying them asLAN(IsPrivate: true) in GeoIP lookups, and matching CrowdSec ban decisions.
3. Management API & Stream Hardening β
- Constant-Time API Token Authentication: Replaced standard string equality comparison in API
requireAuthmiddleware withcrypto/subtle.ConstantTimeCompare, neutralizing timing side-channel attacks against the daemon's bearer authentication token. - API Health Endpoint Version Alignment: Updated
/healthresponse payload to report the daemon's release version (sdk.Version/3.2.0) as"version"instead of the config schema version ("1.0"), while preserving"config_version": "1.0". - SSE Stream Broken Client Resource Leak Fix: Handled write errors on Server-Sent Events (
/api/events) immediately, allowing disconnected streaming clients to exit promptly and execute deferredunsubscribe()callbacks to avoid channel retention. - Management API Route Parity (
/api/tcp/*): Added/api/tcp/*route aliases (/api/tcp/stats,/api/tcp/services,/api/tcp/banlist,/api/tcp/unban,/api/tcp/ban,/api/tcp/events) matching/api/guard/*and/api/*, and implementedhttp.HandleronAPIServer.ServeHTTP.
4. Layer 4 UDP Datagram Engine β
- Session Table Race Condition Fix: Eliminated a race condition in
UDPSessionTable.GetOrCreateunder concurrent UDP packet bursts using atomic synchronization, preventing duplicate upstream socket creation and spurious connection close logs. - High-Precision Idle Session Reaper: Added a periodic idle reaper to clean inactive NAT sessions according to
udp.session_timeout, reclaiming memory and socket handles under high packet churn. - Datagram Metrics Lifecycle: Integrated UDP packet counters and datagram throughput metrics directly into
StatsRegistryand the JSONL event logging stream.
5. SQLite Banlist Persistence & Hardening β
- Thread-Safe SQLite Persistence (
bans.db): Persists dynamic and permanent bans across daemon restarts using SQLite in WAL mode with connection serialization (SetMaxOpenConns(1)), eliminating database lock contention. - SQL Injection Prevention: Parameterized all queries across
Unban()andIsBanned(), preventing malicious IP payloads from escaping SQL statements. - Permanent Ban Expiry Sentinel: Stored a far-future sentinel timestamp (
9999-12-31) rather than zero-time timestamps, eliminating false expirations in SQL engines. - TOCTOU Read Eviction Protection: Upgrades locks cleanly when evicting expired bans on read without risking concurrent re-ban loss.
- Automated Legacy JSON Migration: Automatically migrates pre-v3.0
bans.jsonfiles into SQLite on boot.
6. GeoIP Engine Memory Bounding & Hardening β
- High-Cardinality Cache Bounding: Capped in-memory GeoIP cache to
maxGeoCacheEntries = 50,000entries with atomic threshold pruning, preventing memory exhaustion attacks from spoofed random IP scans. - Extended Network Classification: Added automatic classification for Carrier-Grade NAT (CGNAT
100.64.0.0/10), Tailscale IPv6 ULA (fd7a:115c:a1e0::/48), RFC 5737 test nets, and benchmark ranges toIsPrivateOrLocal(). - Corrupted MMDB Buffer Boundary Checks: Added strict bounds checking in MMDB binary parsing, eliminating slice bounds out-of-range panics when reading truncated or malformed GeoLite2 databases.
7. Plugin SDK & Dynamic Registry β
- Manifest Traversal Protection: Validated plugin manifest names, versions, and protocol lists, forbidding path traversal (
../) and illegal directory characters. - Semantic Version Compatibility & Auto-Disable: Verifies plugin manifest compatibility against the running host SDK version, automatically disabling incompatible or faulty plugins with clear warning logs instead of aborting startup.
- SDK Version Bump: Synchronized Plugin SDK constant
Version = "3.2.0"inplugins/sdk/sdk.go.
[v3.1.0] - 2026-10-02 β
π Minor Release: Leveled Security Events & RouteWarden Observability Integration β
TCP Warden v3.1.0 introduces native log severity classification directly into the structured SecurityEvent pipeline, enabling seamless ingestion, filtering, and visual correlation within the RouteWarden Observability Stack (Grafana, Loki, and Alloy).
1. Structured Security Event Log Levels (Level) β
- First-Class
LevelField: AddedLevel(json:"level,omitempty") toSecurityEventpayloads emitted across all active listeners and bastions. - Automatic Pipeline Severity Assignment:
warn: Automatically assigned to blocked requests, banned IPs (ip_denied,crowdsec_ban), and rate-limited traffic (throttled).error: Assigned to pipeline or internal proxy failures.info: Assigned to clean, allowed TCP and UDP connections.
- Alloy & Loki Stream Labeling: Grafana Alloy automatically indexes
levelas a primary Loki stream label, allowing instant querying via{app="routewarden", level="warn"}.
2. Enhanced L4 Event Metadata for SIEM Correlation β
- Emits comprehensive connection metadata on all security triggers:
client_ip: Remote socket address (IPv4 and IPv6).country_code,country_name, andflag_emoji: MaxMind GeoIP resolution (e.g.π©πͺ Germany,π Local Network).service,protocol, andtransport: Protocol context (ssh,postgres,dns,smtp,udp,tcp).actionandreason: Specific defense rule or trigger (ip_denied,rate_limit_exceeded,blocked_domain).
- Full compatibility with the Pure Opt-In logging model via Docker label
routewarden.logs=true.
3. Plugin SDK v3.1.0 Synchronization β
- Synchronized Plugin SDK version constant to
3.1.0(plugins/sdk/sdk.go). - Retained full backward compatibility with manifest schema version
1.0.0.
[v3.0.0] - 2026-09-30 β
π Major Release: Layer 4 UDP Transport Engine & Multi-Protocol Expansion (DNS & BitTorrent) β
TCP Warden v3.0.0 introduces native Layer 4 UDP Proxying, enabling multi-transport protection across both TCP and UDP. It introduces two major official pluginsβDNS Guard and BitTorrent Guardβand extends the Plugin SDK with datagram-level protocol inspection.
1. Native UDP Transport & Multi-Stage Datagram Pipeline β
- Dual-Transport Listeners (
transport: "both"): A single service definition can bind both TCP and UDP sockets on the same port (ideal for DNS on:53or BitTorrent on:6881). - Full Pipeline Defense for Datagrams: Inbound UDP datagrams pass through the complete security pipeline before reaching upstreams:
- Stage 1 (Active Banlist): Drops datagrams from banned IPs immediately.
- Stage 2 (CrowdSec LAPI Bouncer): Enforces real-time community ban decisions.
- Stage 3 (CIDR IP Filter): Enforces service-level and global subnet allow/denylists.
- Stage 4 (GeoIP Blocking): Filters countries using MaxMind GeoIP (
allow_countries&deny_countries). - Stage 5 (Token Bucket Rate Limiting): Throttles datagram rates per client IP (
connections_per_minuteandburst). - Stage 6 (Session Table & Concurrency Caps):
udp.max_sessionscaps active unique client sessions;udp.session_timeoutreaps idle NAT states.
- Zero-Reflection Anti-Amplification Architecture: Blocked UDP datagrams are discarded silently rather than sending error responses, guaranteeing RouteWarden cannot be weaponized as a reflection/amplification vector for spoofed attacks.
2. Plugin SDK v3.0.0 & UDP Datagram Inspector β
sdk.UDPPlugin&sdk.UDPInspector: New optional interfaces for protocol plugins handling datagram traffic.sdk.UDPPacket: Inspects raw datagram payloads, client address metadata, and traffic direction (IsReply).- In-Place Payload Mutation: Inspectors can mutate packet payloads in-place (e.g. rewriting DNS records or stripping metadata) before forwarding.
sdk.UDPVerdict: Explicit inspection verdicts (UDPVerdictAllow,UDPVerdictDrop,UDPVerdictReject).- 100% Backward Compatible: Type-asserted at runtime (
plugin.(sdk.UDPPlugin)). Existing TCP plugins continue operating without modification; manifest schema remains1.0.0.
3. Official DNS Guard Plugin (plugins/all/dns) β
- Dual UDP & TCP Inspection: Full RFC 1035 inspection for resolvers and authoritatives.
- Malicious Domain Blocking: Regex and wildcard domain pattern filtering (
blocked_domains/allowed_domains). - Query Type Filtering: Block dangerous query types (
blocked_qtypes: ["ANY", "AXFR"]) to mitigate amplification and unauthorized zone transfers. - DNS Rebinding Defense:
block_private_ipsscans upstream answers and blocks responses resolving to RFC1918 or loopback addresses. - Cache Poisoning & Amplification Defense: Enforces
min_ttlresponse rewriting and caps EDNS0 buffer sizes withmax_packet_size.
4. Official BitTorrent Guard Plugin (plugins/all/bittorrent) β
- Three-Transport Protocol Coverage: Inspects Peer Wire Protocol (TCP), Mainline DHT (UDP), and Micro Transport Protocol (uTP over UDP).
- Info-Hash Enforcement: Filter swarms by 40-character SHA-1 info-hash (
blocked_info_hashes/allowed_info_hashes). - Client Identity Validation: Enforces standard Azureus peer ID convention (
require_peer_id_format) and filters client prefixes (allowed_peer_id_prefixese.g.-qB-,-TR-,-DE-). - Private Tracker Protection:
private_tracker_modeblocks peers advertising DHT capability in their handshake flags. - DHT Abuse Defense: Block specific DHT methods (
announce_peerto stop swarm poisoning), cap packet sizes (max_dht_packet_size), and toggle discovery transports (block_dht,block_utp).
[v2.1.0] - 2026-09-30 β
π Feature Release: Configurable Log Levels & Dual-Stream Filtering β
TCP Warden v2.1.0 introduces fine-grained, leveled logging across both human-readable operational output and structured JSONL security event streams, featuring a zero-dependency leaf logger package and default warn filtering.
1. Configurable Log Levels (debug, info, warn, error, off) β
- Granular Verbosity Control: Added
global.log_levelsupporting case-insensitive levels:debug,info,warn(orwarning),error, andoff(orsilent). - Environment Variable Override: Supports
ROUTEWARDEN_LOG_LEVELfor containerized environments, taking precedence over YAML configuration. - Startup Banner: Active log level is dynamically displayed in the daemon startup banner during boot.
2. Dual-Stream Logging Architecture β
- Operational Logs (
stderr): Human-readable daemon lifecycle events, banners, plugin compilation status, API listener confirmations, and system warnings. - Security Event Stream (
stdout+log_fileJSONL): Structured audit records consumed by dashboards, SIEMs, and CrowdSec. - Action-to-Level Event Gating:
allowedevents: Emitted only atdebugandinfo.auth_failureevents: Emitted atwarn,info, anddebug.blocked/bannedevents: Emitted aterror,warn,info, anddebug.off: Completely silences both output streams.
3. Default Log Level: warn (Optimized for Production & CrowdSec) β
- High-Volume Log Suppression: Defaulting to
warnprevents millions of routineallowedconnection records from bloating disk storage. - CrowdSec Ready Out of the Box: Keeps
/var/log/routewarden/tcp-warden.jsonlstrictly focused on actionable threat signals (auth_failureandblockedevents), minimizing CrowdSec parser CPU and disk I/O overhead.
4. New Zero-Dependency logger Package β
- Leaf Architecture: Introduced [
github.com/routewarden/tcp-warden/logger](file:///Users/aman/git/routewarden/tcp-warden/logger) with zero internal imports, eliminating any risk of import cycles. - Plugin Integration: External protocol plugins in
github.com/routewarden/pluginscan now directly importloggerto emit leveled trace, warning, and error diagnostics vialogger.Default().Debug(...)/logger.Default().Warn(...).
[v2.0.0] - 2026-09-29 β
π Major Release: Complete Protocol Modularization & Architecture V2 β
TCP Warden v2.0.0 marks a major architectural milestone. All protocol inspectors have been extracted from the core codebase into the standalone, independently versioned github.com/routewarden/plugins repository. The core tcp-warden daemon is now an ultra-fast, zero-bloat Layer 4 transparent reverse proxy and security engine.
1. Complete Protocol Plugin Extraction β
- Decoupled Core Architecture: Removed legacy internal protocol framing packages (
protocol/ssh,protocol/postgres,protocol/redis, etc.) from the core binary repository. - 19 Standalone Protocol Plugins: All protocol guards now live in
github.com/routewarden/plugins:- Remote Access & Mail:
ssh,smtp,pop3,imap,ftp,vnc. - Databases & Caches:
postgres,mysql,redis,mongodb,memcached. - Messaging & Directory:
amqp,mqtt,ldap. - Web, Routing & Games:
http,tls_sni,minecraft,generic,echo_filter.
- Remote Access & Mail:
- Embedded Manifests (
//go:embed plugin.yaml):- All plugins embed their
plugin.yamlmanifests directly into compiled binaries usingsdk.MustParseManifest(). - Enables zero-disk in-memory capability discovery, schema validation, and health reporting.
- All plugins embed their
2. High-Performance Runtime Caching & Boot Optimization β
- Recompiled Binary Caching:
- Container entrypoint automatically persists recompiled daemon binaries in
/var/lib/routewarden/bin/tcp-wardenand active plugin imports in/var/lib/routewarden/all.go. - Subsequent container boots restore the precompiled binary instantly, eliminating Go compiler latency on container restarts.
- Container entrypoint automatically persists recompiled daemon binaries in
- Dynamic Plugin Boot Integration:
- Support for
AUTO_INSTALL_PLUGINS="ssh postgres redis"in Docker environments to automatically pull, verify, and compile plugins on first boot. - Automatic protocol detection activates plugin inspectors declared in
tcp-warden.yaml.
- Support for
3. Dual API Architecture & Unix Socket Support β
- Dual API Route Prefixes:
- Management API endpoints now respond both at root paths (
/stats,/services,/banlist,/ban,/unban,/events,/ping) and standard REST paths (/api/stats,/api/services,/api/banlist,/api/events). - Added dedicated
/servicesendpoint returning the active catalog of registered services, protocols, listeners, and upstreams.
- Management API endpoints now respond both at root paths (
- IPC Unix Domain Sockets:
- Secure local inter-process communication via
api.socketand environment variablesROUTEWARDEN_API_SOCKET/ROUTEWARDEN_API_LISTEN. - Automated file permissions handling (
0660socket mode).
- Secure local inter-process communication via
4. Hardened Security, Privileges & Concurrency β
- Non-Root Port Capabilities:
- Automatically applies
setcap 'cap_net_bind_service=+ep'to recompiled binaries in Docker, allowing unprivilegedroutewardenuser (UID 1000) to bind low ports (<1024) safely.
- Automatically applies
- Stream Buffer Preservation (
protocol.BufferedConn):- Guarantees zero byte loss during protocol inspection handshakes before transitioning to raw bidirectional streaming.
- Race Condition & Thread Safety:
- 100% race-condition free concurrency across all proxy pipelines and plugin inspectors verified with
go test -race -count=1 ./.... - Converted internal byte and packet metrics to lock-free atomic counters (
atomic.Int64).
- 100% race-condition free concurrency across all proxy pipelines and plugin inspectors verified with
5. Sample Configurations & Deployment Topologies β
- Overhauled Configuration Samples:
- Modernized
samples/directory with dedicated manifests:databases.yaml,crowdsec.yaml,gaming-iot.yaml,local-test.yaml, anddocker-compose.yaml. - Cleaned default
tcp-warden.yamltemplate to showcase modular plugin registration and upstream proxying.
- Modernized
[v1.1.1] - 2026-09-29 β
Improvements & Hardening β
- Instant Recompiled Binary Caching:
- Container entrypoint automatically persists recompiled daemon binaries in
/var/lib/routewarden/bin/tcp-warden. - Subsequent container boots and restarts load the cached binary immediately without invoking
go build, reducing startup time from seconds to milliseconds.
- Container entrypoint automatically persists recompiled daemon binaries in
- Dual API Route Prefixes:
- Management API now exposes convenience aliases directly at the root (
/stats,/services,/banlist,/ban,/unban,/events,/ping) alongside their/api/counterparts (/api/stats,/api/services, etc.).
- Management API now exposes convenience aliases directly at the root (
- Container Permissions & Capability Security:
- Automatically provisions
cap_net_bind_serviceon recompiled binaries, enabling unprivilegedroutewardenuser to bind low ports (<1024) safely under Docker.
- Automatically provisions
[v1.1.0] - 2026-09-28 β
Major Architecture Updates β
- Full Plugin Modularization:
- Decoupled all protocol inspectors (
ssh,smtp,pop3,imap,postgres,mysql,redis, etc.) from the core binary into the dedicatedroutewarden/pluginsrepository. - Core binary remains a lean, zero-bloat Layer 4 transparent proxy (
generic/tcp).
- Decoupled all protocol inspectors (
- Port Range Forwarding:
- 1:1 Port Mapping: Maps continuous ingress port ranges directly to matching upstream port offsets (e.g.
:8000-8005to10.0.0.1:9000-9005). - Many-to-One Mapping: Routes an entire range of ingress ports into a single backend ingress pool (e.g.
:8080-8085to10.0.0.1:80).
- 1:1 Port Mapping: Maps continuous ingress port ranges directly to matching upstream port offsets (e.g.
- Auto-Installation on Boot:
- Added support for
AUTO_INSTALL_PLUGINS="ssh postgres redis"in Docker Compose. - Automatic protocol enablement: the daemon automatically detects protocols used in
tcp-warden.yamland activates the corresponding plugin.
- Added support for
- Unix Domain Socket API:
- Added support for local IPC via
api.socketand environment variablesROUTEWARDEN_API_LISTEN/ROUTEWARDEN_API_SOCKET.
- Added support for local IPC via
[v1.0.5] - 2026-09-26 β
Key Highlights β
- Embedded Manifests (
//go:embed plugin.yaml):- Standardized manifest embedding across all official plugins via Go 1.16+
//go:embed plugin.yamlandsdk.MustParseManifest(). - Enables in-memory metadata inspection without needing loose YAML files on disk at runtime.
- Standardized manifest embedding across all official plugins via Go 1.16+
- Manifest Versioning Separation (
manifest_version):- Decoupled
manifest_version(format schema version, e.g."1.0.0") from plugin releaseversion(e.g."1.1.0"). - Plugin releases can now be updated and bumped independently without mutating or breaking manifest schema validation.
- Decoupled
- 4-Step Plugin Verification Pipeline:
- Implemented a strict 4-step installation pipeline when running
tcp-warden plugins install <source>:[1/4] Validating manifest: Validatesplugin.yamlsyntax, uniqueness, and required fields.[2/4] Checking manifest compatibility: Confirms the manifest format is supported by the running SDK.[3/4] Compiling plugin: Runs Go compiler sanity checks (go vetand dry-run build).[4/4] Running tests: Executesgo test -race -count=1 ./...inside the plugin directory. If tests fail or race conditions are detected, the plugin is rejected before installation.
- Simplified and standardized CLI progress reporting to clean single-line status messages.
- Implemented a strict 4-step installation pipeline when running
- Stream Buffer Preservation (
protocol.BufferedConn):- Resolved potential data loss when transitioning from initial protocol inspection (using
bufio.Reader) to raw bidirectional proxying (protocol.Proxy). BufferedConnensures any unconsumed buffered bytes are forwarded to the upstream connection before streaming raw packets.
- Resolved potential data loss when transitioning from initial protocol inspection (using
- Race Condition Hardening:
- Audited all 14 official plugins with
go test -race -count=1 ./...with zero race warnings. - Atomic byte counters (
atomic.Int64) implemented across all inspectors.
- Audited all 14 official plugins with
[v1.0.4] - 2026-09-25 β
Improvements & Fixes β
- Docker Volume Mounting & State Persistence:
- Hardened Docker volume configuration for
/var/lib/routewarden/pluginsand/var/lib/routewarden/data. - Ensured dynamic plugin registration survives container restarts and image updates.
- Hardened Docker volume configuration for
- Plugin Module Resolution:
- Improved local directory plugin resolution (
tcp-warden plugins install ./path). - Added automatic fallback to shallow cloning for Git plugin repositories.
- Improved local directory plugin resolution (
[v1.0.3] - 2026-09-24 β
Features & Usability β
- Fast Plugin Installs (
--no-build):- Added
--no-buildflag totcp-warden plugins installto allow batching multiple plugin installations before triggering a single compilation step.
- Added
- Plugin Dependency Management:
- Handled nested dependency resolution when plugins require external third-party Go packages.
- Added cache management via
tcp-warden plugins install --forceto purge corrupted plugin staging directories.
[v1.0.2] - 2026-09-22 β
Optimizations β
- Lightweight Docker Image (~25MB):
- Migrated Docker distribution to a multi-stage Alpine build.
- Stripped debug symbols and minimized binary footprint while preserving full statically linked CGO-free portability.
- CLI Flag Normalization:
- Added short flags (
-cfor--config,-vfor--version) across all root and subcommands. - Improved error messages for invalid YAML syntax with line and column indicators.
- Added short flags (
[v1.0.1] - 2026-09-20 β
Security & Engine β
- High-Performance IP Banning Engine:
- In-memory concurrent hash table for instant $\mathcal{O}(1)$ connection lookups.
- Embedded SQLite database for crash-resilient ban persistence across daemon restarts.
- Management API & SSE Stream:
- Added lightweight HTTP management API on
127.0.0.1:9091. - Endpoints for querying metrics (
/health,/metrics), managing bans (GET /bans,POST /ban,POST /unban), and streaming live security audit logs via Server-Sent Events (GET /events).
- Added lightweight HTTP management API on
- Token-Bucket Rate Limiting:
- Configurable per-service and global rate limits (
connections_per_minuteandburst). - Sub-millisecond connection evaluation with zero socket allocation overhead.
- Configurable per-service and global rate limits (
[v1.0.0] - 2026-09-18 β
Initial Release β
- Core L4 Security Proxy & Firewall:
- High-speed Layer 4 TCP proxy engine built on Go.
- Anti-brute-force failure tracking with automatic IP banning.
- Native support for SSH, SMTP, POP3, IMAP, and raw TCP pass-through.
- Modular Plugin SDK (
plugins/sdk):- Extensible plugin architecture enabling custom protocol inspectors.
- In-memory self-testing interface (
SelfTest()). - Security event auditing (
ctx.OnSecurityEvent()) and auth failure reporting (ctx.OnAuthFailure()).
- CrowdSec LAPI Integration (Optional):
- Optional real-time ban decision synchronizer with CrowdSec Local API.
- Fallback action policies:
ban,throttle, orbypass.
- Port Range Forwarding:
- Support for 1:1 and many-to-one port range mappings (e.g.
:8000-8005).
- Support for 1:1 and many-to-one port range mappings (e.g.