Firewall panel advertises service-name rules the backend rejects #9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Broken out from ECO-15 (bread-ecosystem audit, 2026-09-05). Verified still present on main as of 2026-09-09.
The Firewall panel UI and its validator disagree:
frontend/src/lib/views/Firewall.svelte:102sets the "Add rule" hint to:e.g. "8080/tcp", "22/tcp", or a service name like "OpenSSH".and the input placeholder (line 104) isport/proto or service name.src/src/commands/firewall.rsvalid_firewall_ruleis port-only by design (kept strict fromf7b114f). Its own test asserts!valid_firewall_rule("OpenSSH")(line 165).So a user who follows the UI hint and types
OpenSSHgets a rejection.Pick one:
util::valid_cli_value(still argv-safe: blocks flags,;, and control characters) and let ufw resolve the service name, orBSET-5's PR body flagged this as an unresolved product call. The cheapest option is removing the service-name wording (one line each in
Firewall.svelte). Whichever way it goes, the UI copy and the validator should agree, and thefirewall.rstest should reflect the decision.PR: #10
Took option 2: updated the "Add rule" hint and input placeholder in
frontend/src/lib/views/Firewall.svelteto describe the port/proto formsvalid_firewall_ruleactually accepts, instead of advertising service names the port-only validator rejects. No backend change;valid_firewall_ruleand its!valid_firewall_rule("OpenSSH")test already match this copy. Verified withnpm run buildandnpm run check(0 errors, 0 warnings).Went with option 2 rather than loosening the validator because keeping it port-only is a deliberate argv-safety measure (
f7b114f); supporting service names is a security-sensitive product decision better handled as its own feature.Reviewed and merged (squash, PR #10).
Acceptance criteria: make the UI hint and validator agree, and update the firewall.rs test if the behavior changes. Went with option 2 (drop the service-name wording from the hint and placeholder), which needed no backend change since valid_firewall_rule was already port-only and its test already asserted rejection of "OpenSSH". Minimal, correct, matches the issue's own cheapest-option recommendation. CI green, no conflicts.