Changelog what changed, release by release.
All notable changes are listed here. The project follows semantic
versioning; the language version (version 1 in rule files) is separate
from the tool version.
-
- The first release built in public: it carries a build provenance
attestation, and SECURITY.md explains how to verify a download with
gh attestation verifyor cosign. - moat now needs Go 1.26 to build from source (golang.org/x/sys 0.49); Go 1.25 no longer gets fixes.
- The spec lists known issues; the first is the Linux 6.17 verifier bug
that refuses some programs
--backend cbuilds.
- The first release built in public: it carries a build provenance
attestation, and SECURITY.md explains how to verify a download with
-
moat load --sharedruns moat alongside other XDP programs on the same interface, as one program of a libxdp multiprog dispatcher: the wayxdp-loadershares the hook, and interoperating with it in both directions (tested against libxdp from Ubuntu, 1.5.0 and 1.6.3).--priorityand--chainset where moat runs and when the next program does;--dispatcher-versionpicks the dispatcher moat creates when the hook is free, and a dispatcher already there keeps its version and mode.reloadkeeps the run config,unloadtakes out only moat,enablerecords it for boot, andstatuslists the dispatcher's programs in run order.moat doctorrecognises a dispatcher and points to--shared; a plainloadon such an interface says to add it.status --jsongainsattach(linkordispatcher) anddispatcher; the manifest recordsattach,shared,program_idandboot_id.metricsexportsmoat_attachedandmoat_problem.std.fragmentsdrops TCP fragments whose header moat cannot read, which rules on TCP fields never see.- Limits count IPv6 sources by their /64 always, also with
per ip.src/N, so a host cannot start fresh buckets from addresses of its own /64. A burst too long to measure is an error; a bit burst no larger than one frame warns. - Flows: a SYN on the ports of a closing flow starts a new connection, inbound packets alone no longer keep a closing flow alive, and a time read before another CPU stamped a flow no longer expires it.
- Reliability: after the new program attaches, moat repins what the CLI needs and writes the manifest first, and reports any later failure while saying that the new rules run. A failed reload puts back the egress program it replaced. Counters kept across a reload include what the new program counted meanwhile. Writers can no longer be starved by readers of the same interface, busy set walks are retried, and a race with another tool changing the dispatcher starts the load over.
- The boot unit retries a failed load every 3 seconds, except for errors
in the rules, and starts at most 10 times a minute.
enablekeeps the mode, refuses an interface with a dispatcher unless--shared, and takes the running rules' priority and chain unless given. - Security:
enablerefuses a moat binary a user other than root could replace, installs the rules it checked, and keeps copies no more readable than the originals;trace -wwrites its capture as 0600; set file messages no longer quote the file's lines; the importers and the language server are hardened against hostile input; the install script checks downloads against the release checksums. Releases are built with the latest Go 1.26 patch (Go 1.25 no longer gets fixes), and SECURITY.md lists the environment variables moat trusts. - Smaller: not being root exits 2 and a verifier rejection exits 3,
versiontakes no arguments,--jsonis refused where nothing is printed,set syncignores duplicate entries, and the help lists every flag. On Linux 6.17, use the default backend: that kernel's verifier rejects some programs clang builds.
-
moat loadandreloadno longer crash on rules with address or prefix literals, which 0.4.0 did while recording the rules for keeping their counters across reloads.
-
- Flows: connection state for rules.
flow.new,flow.establishedandflow.src_countlet rules let the replies to the host's own connections in, drop TCP packets that belong to no connection, and cap the TCP connections of one source. A second program on the interface's egress learns the connections the protected side opens or answers. They are confirmed once the other side answers, so a flood that never answers back cannot push real connections out of the table.flows ttl D size Nsizes it,reloadkeeps it, and when it starts learning it adopts the connections that were already open for a minute. Needs Linux 6.6 (TCX);moat doctorsays whether the kernel has it.statusandmetricsshow the table. Case files describe what the host sends withdir = "out", and an echo's identifier withicmp_id. - Rates over other periods:
limit 5/m,30/h,2/dor10/90s, for slow attacks such as SSH password guessing.moat importkeeps the period of hashlimit and nft limits instead of skipping the ones that are not a whole number per second. reloadkeeps the counters of the rules it leaves unchanged (same name, same condition and actions, constants included) and of the default while its verdict stays. Changed and new rules start at zero. The first reload after upgrading still starts every counter afresh.- Keyed sets:
set lists prefixes keyedholds one list per key in the same maps as a plain set, tested asip.src in lists[345]orgeo[ES, PT], and filled by rules withadd ip.src to bans[12]. Keys are numbers or country codes. A file with many lists no longer runs out of the 64 maps a program can use. Set files holdKEY ENTRYlines, andmoat set sync SET FILE --key Kreplaces one list without touching the others;set add,del,showandflushtake--keytoo. moat set syncrefuses to fill an addresses set beyond its size, where it used to let the set forget some of the entries.tcp.mss existsandtcp.mss missing(and the same forvlan.id) test whether a packet carries an optional field, so a rule can drop SYNs without an MSS option on purpose. The warning aboutnotaround such a field now points tomissing.payload containslooks for texts of up to 128 bytes (was 32), and a file can hold 24 different searches (was 16). Measured on Linux 6.8: a 512-byte window costs the verifier about 22000 instructions whatever the text's length.status --jsonandstats --jsonuse lowercase keys (name,packets,set_sizes...) and these stay stable from now on. Scripts that read the old capitalised keys need the new names.statusalso gives the sha256 of each set's live entries (set_sha256) and of the rules file a boot loads (boot_sha256), so a control plane can check that a node holds what it pushed.- moat now needs Go 1.25 to build from source. It moves to cilium/ebpf v0.22, which fixes an integer overflow when reading a malformed object file. moat only reads objects it has just built itself, so it was not exposed.
- Flows: connection state for rules.
-
- One-line install on Linux:
curl -fsSL https://moatfw.dev/install.sh | sudo sh. It uses the apt repository on Debian and Ubuntu, the release's .rpm with dnf or yum, and otherwise puts the binary in /usr/local/bin. - Debian and Ubuntu packages are published to an apt repository:
apt install moatfwafter adding apt.moatfw.dev (see the install instructions). Every release lands there. - Packages name moat maintainers [email protected] as their maintainer.
moat statusnotices when the pinned counters, events or variables map was removed by hand, and names the missing map, as it already did for sets and the configuration.vlan.idmatches with rx VLAN offload on, when the kernel is 6.8 or newer, the program runs in native mode and the driver reports the tags it strips (veth, mlx5, ice):moat loadthen asks the driver for the tag and loads the program bound to the interface. In the other casesloadstill warns, andmoat doctor --ifacesays which case applies.- moat now needs Go 1.24 to build from source (cilium/ebpf v0.21).
stats,status,var listand the set listings wait while a load, reload or set change is running on the interface, so they never show one program's rule names with another program's counters.
- One-line install on Linux:
-
moat import iptablesalso reads the PREROUTING chains of the raw and mangle tables, where anti-DDoS rulesets usually live, in the order the kernel runs them.-m stringbecomespayload contains, and chains it does not read are listed.moat import iptables --ipsets FILEreadsipset saveoutput and writes the ipsets the rules use as set files, loaded with the rules.moat import nftablestranslates the JSON ofnft -j list ruleset: the filter base chains on the ingress, prerouting and input hooks, named sets, meters, limits and raw payload matches.moat test --modelruns case files and captures in a model of the program written in Go: no kernel, no root, any system. Off Linux,moat testuses it on its own. The differential tests check it against the kernel packet by packet.moat doctor --ifacesays whether the interface already runs an XDP program, and whether moat attached it.moat loadexplains a program another tool attached instead of failing with "device or resource busy". In a namespace entered with nsenter, doctor finds the namespace's interfaces.moat explainsays, rule by rule, why each case's packet got its verdict: the test that failed and what the packet had instead.moat fmt --checklists the files that are not in canonical form and exits with 1, for CI.- Fixed:
moat loadafter the interface was removed and came back (what the unitmoat enableinstalls does) failed with "already loaded"; it now attaches afresh and keeps the sets, asreloaddoes too. - Fixed: a failure after the program was attached (writing the manifest) removed the pins of the maps the running program uses.
- Fixed: a reload that failed could leave the running program with the new file's set contents; shared maps now change only once the new program runs.
- Fixed: a variable kept across a reload could hold a value the new rules cannot use; it goes back to the file's value, with a note.
- Fixed:
set syncinto a set too small to hold the old and new entries at once failed; it now removes the leaving entries first in that case. - Fixed:
set addwithout--ttlcould shorten a permanent entry to the set's ttl; like a rule's add, it never shortens an entry now. - Fixed:
moat tracerunning across a reload waited forever; it ends and says why.stats --watchfollowsmoat auditchanges. - Fixed in
moat import: a non-terminating iptables target such as SET or MARK counted as an accept, so a final DROP after it was left out;! --icmp-type anylost its negation;-p udpalone (and! -p tcp) now becomesip.proto, which holds for fragments as iptables does; an ipset with a netmask now writes networks; an nft match after a limit or set statement stays a comment; input the importers refuse exits with 2. - Fixed:
::ffff:0:0/96in a set file became0.0.0.0/0and matched every IPv4 packet; the whole IPv4-mapped range now stays IPv6, as it does in a rule. - Fixed: a limit with a variable rate accepted a burst of 0 or one so large that the burst in nanoseconds overflowed, and dropped every packet; both are refused now, and so is a packet rate above 1e9/s next to a variable burst.
- Fixed: on IPv6,
ip.lenwrapped to a small number for the largest payload lengths; it is now held at 65535. - Fixed:
moat test --pcapignored the case file's[vars]andaudit, and its[[case]]entries; it applies the first two now and refuses the cases. In case files, a 0 written for a port, TTL or window is 0. moat loadwarns, andmoat doctor --ifacenotes, when the interface strips VLAN tags before XDP (rx VLAN offload), which makesvlan.idrules never match.- Fixed:
moat import nftablesleftmeter NAME { ip saddr limit rate over R }as a comment, the form nft 1.0.9 prints; it becomes a limit per source. - Fixed: the C backend could pass garbage arguments to a block of rules that clang proved can never match, and the kernel refused the program.
moat lspcompletes: declaration keywords,stdmodules, fields, protocols, sets, constants, variables, TCP flags and actions, each where it can go.moat lspoffers quick fixes: a misspelled field or name becomes the onemoat checksuggests, and a prefix with host bits set its network.moat lspfinds the references to a set, constant, variable or rule, and renames one everywhere in the file.
-
First public version.
- The moat language: protocol tests, header fields for Ethernet, VLAN,
IPv4, IPv6, TCP, UDP and ICMP, payload slices, constants, lists and
ranges, prefix and address sets,
pass,drop,limitandadd. moat checkwith static warnings (unused names, conditions that are never true, rules that never match, misleadingnot, small bursts) andmoat fmt.moat buildcompiles to a BPF object with no compiler involved: moat generates the instructions and writes the object file itself.--backend ccompiles through C and clang instead, and--emit-cwrites the C for reading. Random packets through both builds of random rule files must agree on every verdict.moat testruns the program in the kernel against case files with simulated time, or against pcap and pcapng captures.moat load,reload,unload,status,audit,set,stats,enableanddisableattach rules to an interface and manage them.- Runtime variables (
var,moat var set) change rates and switch rules on and off without reloading. - Standard modules:
use std.bogons,std.private_sources,std.amplification,std.tcp_sanity. moat traceshows or captures the packets a rule decides, andmoat benchtimes the rules per packet.moat metricsprints or serves counters, sets and variables in the Prometheus format.moat import iptablestranslates the INPUT chain of iptables-save output and keeps what it cannot translate as comments.moat lsp, a VS Code extension and a tree-sitter grammar.payload contains "text"(andnot contains) finds text or bytes anywhere in a window of the payload.moat doctorchecks that a machine can run moat, and releases include Debian and RPM packages namedmoatfw.
- The moat language: protocol tests, header fields for Ethernet, VLAN,
IPv4, IPv6, TCP, UDP and ICMP, payload slices, constants, lists and
ranges, prefix and address sets,