Skip to content

Fix failures in running firewalld service #13903

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: 3.0-dev
Choose a base branch
from

Conversation

Sumynwa
Copy link
Contributor

@Sumynwa Sumynwa commented May 28, 2025

Merge Checklist

All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)

  • The toolchain has been rebuilt successfully (or no changes were made to it)
  • The toolchain/worker package manifests are up-to-date
  • Any updated packages successfully build (or no packages were changed)
  • Packages depending on static components modified in this PR (Golang, *-static subpackages, etc.) have had their Release tag incremented.
  • Package tests (%check section) have been verified with RUN_CHECK=y for existing SPEC files, or added to new SPEC files
  • All package sources are available
  • cgmanifest files are up-to-date and sorted (./cgmanifest.json, ./toolkit/scripts/toolchain/cgmanifest.json, .github/workflows/cgmanifest.json)
  • LICENSE-MAP files are up-to-date (./LICENSES-AND-NOTICES/SPECS/data/licenses.json, ./LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md, ./LICENSES-AND-NOTICES/SPECS/LICENSE-EXCEPTIONS.PHOTON)
  • All source files have up-to-date hashes in the *.signatures.json files
  • sudo make go-tidy-all and sudo make go-test-coverage pass
  • Documentation has been updated to match any changes to the build system
  • Ready to merge

Summary

This commit introduces changes to fix firewalld issues in AzureLinux 3.0.
The list of changes is as below:
(a) Bump dbus-python version to 1.3.2.

  • This fixes the failure to start firewalld service due to error in dbus-python:
    File "/usr/lib/python3.12/site-packages/dbus/decorators.py", line 330, in decorator
    args = inspect.getargspec(func)[0]
    ^^^^^^^^^^^^^^^^^^
    Looking at the upstream release notes, there is no breaking API/compatibility changes wrt python 3.12.

(b) Disable IPv6_rpfilter in configuration. The present kernel config does not support running firewalld daemon with this configuration. If left enabled, firewalld daemon fails to start.

(c) Fix testsuite provided by the firewalld-test sub-package based on the firewalld configuration provided in Azurelinux 3.0.

  • disable rpfilter tests, due to missing kernel config
  • add MDNS routes data and rules
  • add FedoraServer & FedoraWorkStation zone info
  • handle error code 255 instead of 1 for ebtables
  • remove webcache/tcp from tests
    NOTE: It becomes a loop to add a check section inside the firewalld spec. This is because during build, the chroot environment running the test does not install the final configuration. As a result, the package test passing during the build will fail when running the testsuite after installing the test sub-package due to change in configuration.
    Neither the upstream SPEC, nor fedora specs adds a check section for this package.

More details are mentioned in this Bug.

Change Log
  • Bump dbus-python sources to version 1.3.2.
  • Disable IPv6_rpfilter in configuration
  • Add firewalld patch to fix tests under src/tests
Does this affect the toolchain?

NO

Associated issues
  • #xxxx
Links to CVEs
Test Methodology

Follow below steps to run firewalld testsuite:

  1. Install the built firewalld and dbus-python package
    sudo tdnf install -y python3-dbus firewalld ebtables firewalld-test

  2. Adjust below configs

  • Disable ipv6 rpfilter configuration. As the kernel does not support it, the firewalld service will fail to start, causing test failures.
    sudo sed -i 's/^IPv6_rpfilter.*/IPv6_rpfilter=no/' /etc/firewalld/firewalld.conf

  • Switch iptables to legacy mode for testing backend = iptables configuration
    sudo update-alternatives --set ebtables /usr/sbin/ebtables-legacy
    sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
    sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy

  1. Run the test
    sudo /usr/share/firewalld/testsuite/testsuite -j8
    As of now, there are 15 known failures which occur due to disabling rpfilter in configuration.
    List of failing test number: 61 107 120 124 192 193 194 195 196 197 200 240 252 306 324
    firewalld_testsuite

@microsoft-github-policy-service microsoft-github-policy-service bot added Packaging 3.0-dev PRs Destined for AzureLinux 3.0 labels May 28, 2025
@Sumynwa Sumynwa marked this pull request as ready for review May 28, 2025 10:24
@Sumynwa Sumynwa requested a review from a team as a code owner May 28, 2025 10:24
This commit patches the testsuite to successfully run tests based on
the firewalld configuration files in Azurelinux 3.0. The list of
changes include:
- disable rpfilter tests, due to missing kernel config
- add MDNS routes data and rules
- add FedoraServer & FedoraWorkStation zone info
- handle error code 255 instead of 1 for ebtables
- remove webcache/tcp from tests
@Sumynwa Sumynwa changed the title Bump dbus-python version to 1.3.2. Fix failure to start firewalld service Jun 16, 2025
@Sumynwa Sumynwa changed the title Fix failure to start firewalld service Fix failures in running firewalld service Jun 16, 2025
@Sumynwa
Copy link
Contributor Author

Sumynwa commented Jun 24, 2025

PR check failures are not related to the changes.
The failures are due to failing package tests.

AMD64: PTest Failure in systemd & valkey
ARM64: PTest failure in systemd

Copy link
Member

@mfrw mfrw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)
Very well explained. Thank you for being so verbose and meticulous.

Would request a few more eyes to take a look though.

table inet firewalld {
chain filter_IN_public_allow {
tcp dport 22 accept
+ ip daddr 224.0.0.251 udp dport 5353 accept
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the significance of this specific address ?

Copy link
Contributor Author

@Sumynwa Sumynwa Jun 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ipv4/ipv6 address and port is part of the MDNS configuration.

We patch public/work zone configs to add mdns service. These configs are installed under /usr/lib/firewalld.
As such, running firewalld testsuite adds additional rules in zone specific chains under firewalld table.
Since the testsuite binary compiled from sources do not include these rules in their expected result, they fail due to mismatch.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you :)
makes sense

@Sumynwa Sumynwa requested a review from jslobodzian June 25, 2025 16:24
@Sumynwa
Copy link
Contributor Author

Sumynwa commented Jun 25, 2025

Looked into 3.0 Ptest run.
The failures exist:
systemd-255-21.azl3 - Same 9 failures as in this PR check
valkey-8.0.3-3.azl3 - Different failure (no dependency install of python3-dbus or firewalld-*)

@@ -56,7 +56,7 @@ firewall with a D-Bus interface.
%{?python_provide:%python_provide python3-firewall}
Summary: Python3 bindings for firewalld

Requires: python3-dbus
Requires: python3-dbus >= 1.3.2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1
Although, I think we only ship only one version of python3-dbus at a given point of time :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0-dev PRs Destined for AzureLinux 3.0 Packaging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants