Skip to content

Conversation

@ddstreet
Copy link
Contributor

@ddstreet ddstreet commented Feb 5, 2026

This closes the mdns port in the public zone, which is the default zone.

@@ -0,0 +1,11 @@
diff -urpN a/config/zones/public.xml firewalld-2.4.0/config/zones/public.xml
Copy link
Member

Choose a reason for hiding this comment

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

Remind me -- is the base Fedora version of this XML file a loose file in the dist-git repo for firewalld, or does it come upstream-upstream from the repo housing firewalld's code base? (Or are they one and the same?)

If it's a loose file in the package (and not buried in a tarball), we have 2 choices:

  • Apply a patch like this.
  • Use an overlay to directly edit the file (e.g., textually remove the mdns entry).

If it's not, this is really the only option.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok clearly I didn't spend enough time actually looking at what I was doing here...as upstream firewalld actually doesn't include mdns in the public zone, it's added by fedora:
https://src.fedoraproject.org/rpms/firewalld/blob/rawhide/f/fedora-only-MDNS-default.patch

So if we do decide to remove it, we should simply remove fedora's patch, instead of adding our own.

It is good to see that fedora provided analysis/justification for including mdns in their patch; I'm inclined to follow their lead on this one, unless someone with more security expertise on our team thinks we should close the mdns port.


[[components.firewalld.overlays]]
type = "spec-add-tag"
description = "Close mdns port in public (i.e. default) zone"
Copy link
Member

Choose a reason for hiding this comment

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

Something that I think is important is documenting the why/rationale for changes made via overlays or patches so that the current state of this repo is sufficient to understand the deviations made from upstream.

What do you think would be a good pattern for doing this? Do you think we should add a required reason field?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the best place for a more detailed description of whatever change we are making is the actual commit message in git. I don't think putting it into the toml file is the best place for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the exception is an added patch file; i think all patch files we add should ideally be full git format-patch format (preferably actually generated by git) and should include the commit description (which should be a complete description/rationale in every patch)

Copy link
Member

Choose a reason for hiding this comment

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

If it's an added patch, I 100% agree that the detailed description belongs in the patch itself, with a short hint in the TOML file.

Do you know if there are any scripts/tools out there that can validate if a patch is a well-formatted git format-patch style patch? That seems like a linter we'd want to enable -- or at least something we'd want AI code reviewing to "watch out for".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you know if there are any scripts/tools out there that can validate if a patch is a well-formatted git format-patch style patch?

I am (yet again) only really familiar with the deb-world tooling for this, and over there patches are supposed to conform to DEP-3, and there is a patchedit tool that can check them (as well as some of the build tooling including built-in checking, IIRC).

Copy link
Member

Choose a reason for hiding this comment

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

Good to know. I see https://docs.fedoraproject.org/en-US/packaging-guidelines/PatchUpstreamStatus/ but couldn't quickly find guidelines on patch formats, nor could I find clear evidence as to whether rpmlint inspects patches. (It does look some at how the patches are referenced in .spec files.) Possibly an opportunity for contribution?

@ddstreet ddstreet marked this pull request as draft February 6, 2026 13:43
@ddstreet ddstreet force-pushed the firewalld branch 2 times, most recently from 97c5fad to fc314d9 Compare February 6, 2026 19:35
Upstream firewalld does not open the mdns port by default, while
Fedora does with reasoning:
https://fedoraproject.org/wiki/Desktop/Whiteboards/AvahiDefault

However, the use cases for mdns do not seem to apply for AZL4 whose
primary use case is enterprise systems, mainly in the cloud. So we
remove the Fedora patch and revert to upstream configuration without
mdns exposed.
@ddstreet
Copy link
Contributor Author

ddstreet commented Feb 6, 2026

Ok, I updated this to remove the fedora patch, instead of adding our own patch. The git commit has a bit of reasoning on why.

tag = "Patch0"

[[components.firewalld.overlays]]
type = "file-remove"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is potentially a policy choice...when we "remove" existing upstream patches, should we simply remove their PatchN: line in the spec and leave the actual patch file? Or remove the patch file as well?

Also, this policy decision could be moved into azldev if a spec-remove-patch command type is added.

Copy link
Member

@reubeno reubeno Feb 9, 2026

Choose a reason for hiding this comment

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

Agreed on spec-remove-patch abstracting that. Would you mind filing an issue on the azldev repo to request that?

It could also be less brittle -- being able to, say, match a patch by filename pattern. That would be resilient against the patch being renamed to, say, Patch1.

@ddstreet ddstreet marked this pull request as ready for review February 6, 2026 19:51
Copy link
Member

@reubeno reubeno left a comment

Choose a reason for hiding this comment

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

I think this is a reasonable way to disable the patch for now, with some clear follow-ups to extend azldev to simplify adding/removing patches.

@reubeno reubeno merged commit d4aafbf into microsoft:tomls/base/main Feb 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants