Commit Graph

30 Commits

Author SHA1 Message Date
Joe Cooper
9eff352005 Make perlcritic happy again 2026-05-17 22:25:03 -05:00
Ilia Ross
065ce627a0 Add quick service and port forward controls
* Note: Add lightweight quick controls for allowed ports, services, and port forwards, with service autocomplete, ACLs, and structured NAT redirect/DNAT editing.
2026-05-16 15:55:28 +02:00
Ilia Ross
361d3b5175 Add ability to discover profile service ports dynamically
* Note: Resolve nftables profile service ports from supported Webmin module configs and /etc/services, with safe fallbacks and SSH custom-port regression coverage.

https://github.com/webmin/webmin/issues/2706
2026-05-15 21:26:15 +02:00
Joe Cooper
a9aae79fcd perlcritic fixes 2026-05-11 20:37:30 -05:00
Ilia Ross
95fee0cc33 Add nice header generation for saved nftables rules
Some checks failed
webmin.dev: webmin/webmin / build (push) Has been cancelled
2026-05-04 17:42:40 +02:00
Ilia Ross
44ff20e5c6 Fix to perltidy new nftables module to convert spaces to tabs
Some checks failed
webmin.dev: webmin/webmin / build (push) Has been cancelled
2026-05-03 22:36:31 +02:00
Ilia Ross
159cc14dfc Add a warning message if any foreign firewall modules are detected 2026-05-03 21:39:28 +02:00
Ilia Ross
aa84044375 Add boot-time apply support for nftables rules
* Note: The boot action applies saved module-managed nftables tables, creates the needed wrapper, fixes executable permissions, and removes generated boot files when disabled.
2026-05-03 20:23:48 +02:00
Ilia Ross
2c608b2c71 Fix to bump sets elements limit
[no-build]
2026-05-03 19:02:32 +02:00
Ilia Ross
d1523b9648 Add nftables profile ruleset helper
* Note: Add a reusable save_profile_ruleset() API for other modules (like Virtualmin Config), and.

Example:

foreign_require("nftables");
nftables::save_profile_ruleset('profile_virtualmin', 'virtualmin', '*');
2026-05-03 19:00:01 +02:00
Ilia Ross
83eb3eeffc Fix to factor nftables profile ruleset generation into library 2026-05-03 18:41:57 +02:00
Ilia Ross
e65c88e7ef Fix to drop another footgun with configurable rules file 2026-05-03 18:05:59 +02:00
Ilia Ross
2bcf00b50d Fix nftables and firewall modules title for consistency and clarity
* Note: Rename legacy iptables firewalls and make nftables the Linux Firewall
2026-05-03 17:57:48 +02:00
Ilia Ross
eb4fafc504 Add missing comments 2026-05-03 17:17:40 +02:00
Ilia Ross
5101871760 Add manual editing for nftables configuration files 2026-05-03 17:12:35 +02:00
Ilia Ross
0c8f74597b Add proper ACLs to nftables module
[no-build]
2026-05-03 16:44:26 +02:00
Ilia Ross
f4fea0026f Fix to generate nftables profiles with service port sets instead
* Note: Create profile rulesets using named inet_service sets for selected service ports instead of emitting one accept rule per port. Keep scoped rules such as DHCPv6 and mDNS explicit, split TCP and UDP port sets to avoid widening access, and normalize interval set elements so ranges are valid and non-overlapping.
2026-05-03 15:40:30 +02:00
Ilia Ross
5671bd4ce6 Fix file locking 2026-05-03 14:49:32 +02:00
Ilia Ross
12eff54277 Add nftables apply-needed header action
* Note: Track saved nftables configuration changes with Apache-style config/apply timestamp flags, expose the standard restart.cgi header action for themes, and use it as the single apply endpoint. The button expands to “Apply Changes” when saved rules need applying, while the existing Apply Configuration action now routes through restart.cgi and clears the pending state after a successful apply.
2026-05-03 13:59:58 +02:00
Ilia Ross
91f7d5b5c5 Add a quick allow and quick block UI feature 2026-05-03 13:05:31 +02:00
Ilia Ross
fd567e6860 Fix to delete nftables tables from active ruleset
* Note: When a table is deleted from the nftables module, also remove that same table from the active kernel ruleset. The delete path now updates the saved Webmin configuration first, then runs a targeted nft delete table for the selected table only, after checking that the active table is not externally managed.
2026-05-03 00:44:54 +02:00
Ilia Ross
2fe57dd456 Fix to validate nftables set usage in rules
* Note: Prevent incompatible nftables sets from being used in rule fields. The rule editor now only offers address sets for address matches and port/service sets for port matches, while save and apply paths validate existing set references before writing or loading rules. This avoids nft datatype mismatch errors such as using inet_proto sets with tcp dport.
2026-05-03 00:44:54 +02:00
Ilia Ross
272a8715f7 Add profiles support 2026-05-03 00:44:54 +02:00
Ilia Ross
3c9d53109b Fix to rework nftables management around saved tables
Rework the nftables module so Webmin manages its saved nftables configuration as the source of truth instead of directly editing the live ruleset. Add an active ruleset view for inspecting live tables and importing copies into Webmin-managed config if needed, track managed and imported tables with metadata, and prevent externally managed tables from being overwritten during apply.

Co-authored-by: Copilot <copilot@github.com>
2026-05-02 19:02:37 +02:00
Ilia Ross
7f2b4b00aa Fix to scope direct-mode changes to selected tables
Fix nftables direct-mode operations so create, edit, delete, and move actions apply only the selected table instead of rewriting or applying the full ruleset. This avoids copying firewalld-owned rules, or any other externally managed rules, into Webmin’s save file and prevents operations from failing against externally managed tables. Also remove previously added unsafe full-ruleset flush action and keep Apply Configuration out of direct mode (will be further reworked).
2026-05-02 17:08:35 +02:00
Ilia Ross
6fb304e384 Add a separate button for flushing active rulesets
Some checks failed
webmin.dev: webmin/webmin / build (push) Has been cancelled
[rebuild-all-modules]
2026-05-02 02:00:11 +02:00
Ilia Ross
2dcb17c408 Fix parser to accept chain priorities 2026-05-02 01:10:53 +02:00
Ilia Ross
684bb4cc67 Fix module check 2026-05-02 00:38:19 +02:00
Ilia Ross
1d67452a00 Fix to factor out command check 2026-05-02 00:34:15 +02:00
Ilia Ross
4f3e993ae6 Merge swelljoe/nftables as new nftables module
Import https://github.com/swelljoe/nftables into the Webmin tree under nftables/ while preserving upstream history.
2026-04-17 15:19:20 +02:00