Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 7, 2025

This PR configures firewalld to open unprivileged ports (1024-65535) by default, matching Fedora Workstation's approach. This enables desktop applications like LocalSend to work out of the box without requiring manual firewall configuration.

Changes Made

Firewall Zone Configuration:

  • Added FedoraWorkstation.xml zone definition that allows TCP/UDP ports 1024-65535
  • Includes essential services: dhcpv6-client, ssh, samba-client
  • Blocks privileged ports (1-1023) except for explicitly allowed services

System Configuration:

  • Set FedoraWorkstation as the default firewall zone in firewalld.conf
  • Added explicit firewalld package installation to ensure availability
  • Enabled firewalld service to start automatically on boot

Security Model

This maintains a secure-by-default approach while enabling desktop functionality:

  • ✅ All unprivileged ports (1024+) open for incoming connections
  • ✅ Essential services (SSH, DHCP, Samba client) allowed
  • ❌ Privileged ports (1-1023) blocked except for allowed services
  • ❌ No changes to outgoing connection restrictions

Benefits

Applications that will work out of the box:

  • LocalSend - Cross-platform file sharing
  • Development servers - Running on ports 8080, 3000, etc.
  • P2P applications - Using dynamic high port ranges
  • Local media servers - Network streaming applications

This brings Bluefin LTS in line with Fedora Workstation's user-friendly firewall policy while maintaining the same security boundaries.

Fixes #715.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cdn01.quay.io
    • Triggering command: podman build --build-arg MAJOR_VERSION=stream10 --build-arg IMAGE_NAME=bluefin --build-arg IMAGE_VENDOR=ublue-os --build-arg ENABLE_DX=0 --build-arg ENABLE_GDX=0 --build-arg ENABLE_HWE=0 --build-arg SHA_HEAD_SHORT=a708a00 --pull=newer --tag bluefin:lts . (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Consider opening unprivileged ports Add firewalld configuration to open unprivileged ports by default Sep 7, 2025
Copilot AI requested a review from hanthor September 7, 2025 06:51
Copilot finished work on behalf of hanthor September 7, 2025 06:51
@hanthor hanthor marked this pull request as ready for review September 7, 2025 06:56
Copilot AI review requested due to automatic review settings September 7, 2025 06:56
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 7, 2025
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Sep 7, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR configures firewalld to provide a more desktop-friendly firewall configuration by opening unprivileged ports (1024-65535) by default, following Fedora Workstation's approach. This enables applications like LocalSend and development servers to work without manual firewall configuration while maintaining security for privileged ports.

Key changes:

  • Added custom FedoraWorkstation firewall zone that allows unprivileged ports while blocking privileged ones
  • Configured firewalld as the default zone and enabled the service
  • Added firewalld package installation to the build process

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
system_files/usr/lib/firewalld/zones/FedoraWorkstation.xml Defines custom firewall zone allowing unprivileged ports 1024-65535 and essential services
system_files/etc/firewalld/firewalld.conf Sets Workstation as the default firewall zone with standard firewalld configuration
build_scripts/40-services.sh Enables firewalld service to start automatically on boot
build_scripts/20-packages.sh Adds firewalld package to the installation list

@hanthor hanthor changed the title Add firewalld configuration to open unprivileged ports by default feat(firewalld): configuration to open unprivileged ports by default Sep 7, 2025
@dosubot dosubot bot added the enhancement New feature or request label Sep 7, 2025
@castrojo
Copy link
Collaborator

castrojo commented Sep 7, 2025

Can we keep it as Workstation to keep it generic? I'd like to reuse this config in the wolfi port too.

@hanthor hanthor enabled auto-merge September 7, 2025 06:58
@hanthor
Copy link
Collaborator

hanthor commented Sep 7, 2025

Verified this is the same config in fedora workstation

@hanthor
Copy link
Collaborator

hanthor commented Sep 7, 2025

AI-enabled DadOps

@castrojo
Copy link
Collaborator

castrojo commented Sep 7, 2025

When they come for us, they will come through this firewall.

@p5 p5 disabled auto-merge September 10, 2025 16:34
@p5 p5 enabled auto-merge September 10, 2025 16:34
@gbrsni
Copy link
Contributor

gbrsni commented Sep 12, 2025

We should probably consider explicitly including mDNS too as a service that is open by default. Being on port 5353 it will be open with this config, but maybe adding it as an explicit service might prevent people from unintentionally closing it?

I found that it makes certain printers (Epson in my case) plug-and-play without needing any drivers.

@p5 p5 added this pull request to the merge queue Nov 22, 2025
github-merge-queue bot pushed a commit that referenced this pull request Nov 22, 2025
…719)

This PR configures firewalld to open unprivileged ports (1024-65535) by
default, matching Fedora Workstation's approach. This enables desktop
applications like LocalSend to work out of the box without requiring
manual firewall configuration.

## Changes Made

**Firewall Zone Configuration:**
- Added `FedoraWorkstation.xml` zone definition that allows TCP/UDP
ports 1024-65535
- Includes essential services: dhcpv6-client, ssh, samba-client
- Blocks privileged ports (1-1023) except for explicitly allowed
services

**System Configuration:**
- Set `FedoraWorkstation` as the default firewall zone in
`firewalld.conf`
- Added explicit firewalld package installation to ensure availability
- Enabled firewalld service to start automatically on boot

## Security Model

This maintains a secure-by-default approach while enabling desktop
functionality:
- ✅ All unprivileged ports (1024+) open for incoming connections
- ✅ Essential services (SSH, DHCP, Samba client) allowed
- ❌ Privileged ports (1-1023) blocked except for allowed services
- ❌ No changes to outgoing connection restrictions

## Benefits

Applications that will work out of the box:
- **LocalSend** - Cross-platform file sharing
- **Development servers** - Running on ports 8080, 3000, etc.
- **P2P applications** - Using dynamic high port ranges
- **Local media servers** - Network streaming applications

This brings Bluefin LTS in line with Fedora Workstation's user-friendly
firewall policy while maintaining the same security boundaries.

Fixes #715.

> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more
addresses (expand for details)</summary>
>
> #### I tried to connect to the following addresses, but was blocked by
firewall rules:
>
> - `cdn01.quay.io`
> - Triggering command: `podman build --build-arg MAJOR_VERSION=stream10
--build-arg IMAGE_NAME=bluefin --build-arg IMAGE_VENDOR=ublue-os
--build-arg ENABLE_DX=0 --build-arg ENABLE_GDX=0 --build-arg
ENABLE_HWE=0 --build-arg SHA_HEAD_SHORT=a708a00 --pull=newer --tag
bluefin:lts .` (dns block)
>
> If you need me to access, download, or install something from one of
these locations, you can either:
>
> - Configure [Actions setup
steps](https://gh.io/copilot/actions-setup-steps) to set up my
environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to the custom allowlist in this
repository's [Copilot coding agent
settings](https://github.com/ublue-os/bluefin-lts/settings/copilot/coding_agent)
(admins only)
>
> </details>



<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: hanthor <[email protected]>
Co-authored-by: James Reilly <[email protected]>
Merged via the queue into main with commit b83d260 Nov 22, 2025
32 checks passed
@p5 p5 deleted the copilot/fix-715 branch November 22, 2025 14:03
@dosubot
Copy link

dosubot bot commented Nov 22, 2025

Documentation Updates

1 document(s) were updated by changes in this PR:

bluefin

How did I do? Any feedback?  Join Discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider opening unprivileged ports

6 participants