Skip to content

Conversation

troglobit
Copy link
Contributor

Description

This PR adds support for a basic zone-based firewall to Infix. It builds on top of firewalld using the concepts and limitations laid out in #448

Fixes #448

Checklist

Tick relevant boxes, this PR is-a or has-a:

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Test changes
    • Checked in changed Readme.adoc (make test-spec)
    • Added new test to group Readme.adoc and yaml file
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
    • ChangeLog updated (for major changes)
  • Other (please describe):

@troglobit troglobit added the ci:main Build default defconfig, not minimal label Aug 24, 2025
Highlights:
 - fixes to systemd and s6 type services
 - bare-bones libsystemd replacement with #include <systemd/sd-daemon.h>
 - new reload:script mimicking systemd ExecReload, and
 - new stop:script mimicking systemd ExecStop

Full changelog at:
 <https://github.com/troglobit/finit/releases/tag/4.13>

Signed-off-by: Joachim Wiberg <[email protected]>
Signed-off-by: Joachim Wiberg <[email protected]>
Signed-off-by: Joachim Wiberg <[email protected]>
Signed-off-by: Joachim Wiberg <[email protected]>
Used by infix-firewall.c when figuring out interfaces that are not
explicitly assigned to any zone.  Placing them in the default zone

Signed-off-by: Joachim Wiberg <[email protected]>
We have pre-defined policys that have 'continue'.

Signed-off-by: Joachim Wiberg <[email protected]>
Signed-off-by: Joachim Wiberg <[email protected]>
Signed-off-by: Joachim Wiberg <[email protected]>
Not really, just fix the reload functionality so we don't block forever
in Finit.  The D-Bus API is *much* quicker and less buggy that the old
firewall-cmd command.

Signed-off-by: Joachim Wiberg <[email protected]>
No need for all the complexity, firewalld handles the diffs anyway.

Signed-off-by: Joachim Wiberg <[email protected]>
Also, add check for overlap between zones that have a port forward rule
to an IP network that lives in another zone.  Raise conditional in the
zone matrix overview!

Signed-off-by: Joachim Wiberg <[email protected]>
Prepared also for zones, which we don't have any yet.

Signed-off-by: Joachim Wiberg <[email protected]>
Signed-off-by: Joachim Wiberg <[email protected]>
 - Sort packages alphabetically
 - Add nmap for firewall tests

Signed-off-by: Joachim Wiberg <[email protected]>
Signed-off-by: Joachim Wiberg <[email protected]>
Turns out we never got any update events because the change callback ate
them all.  This commit fixes all that and adds policy inference now that
we have rich rules supporting the subset of the allow-host-ipv6 policy.

Signed-off-by: Joachim Wiberg <[email protected]>
The firewalld policy rules, including rich rules, have this obnoxious
priority field which is extremely hard to get right, so in Infix we use
the far superior YANG construct 'ordered-by user;'.  This commit ensure
all rules are generated in that order by setting the priority field, on
read-back from firewalld (operational) this priority field is used to
sort the output of rules in the CLI.

Signed-off-by: Joachim Wiberg <[email protected]>
 - Drop 'local', not available in POSIX shell scripts
 - Check for an assortment of backup file combos
 - Simplify nested if-statements, skip whitelist first

Signed-off-by: Joachim Wiberg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:main Build default defconfig, not minimal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for basic firewall, NAT, IP masquerading, port forwarding
1 participant