containers / containers/netavark

[Feature]: Ability to change firewalld zone

Open
#573 12 comments 17 reactions 0 assignees View on GitHub
kind/feature network
Dominant language
Rust
Stars
794
Forks
161
Avg merge
8d 17h
Merged PRs (30d)
3

Description

### Feature request description

I suggest you consider adding the ability to change zone when using a firewalld backend.

Currently, podman automatically adds containers to the trusted zone. It means that a pod or container that binds to all interfaces always has ports open for outside connections. But in many cases, services need to be available on any interface, but not outside. In addition, administrator must be able to open ports explicitly. Traditionally, firewall rules are used for this, but docker and podman de facto ignore the presence of a firewall.

### Suggest potential solution

This can be implemented as a configuration option in the `containers.conf` file for global setting and as a command line option for networks, pods and containers.

### Have you considered any alternatives?

- [Firewalld Rich Language](https://firewalld.org/documentation/man-pages/firewalld.richlanguage.html). This requires exploring the rules generated by podman and then writing an own rule with a specific syntax. When we have zones, it seems like overcomplication.
- Setting up a container with a proxy server that can reject traffic from untrusted networks. It seems very dirty because we have open external port but all traffic is rejected. When we have a firewall, we can choose not to open this port at all.
- Allow requests only from trusted networks in the service settings. Of course, but I would like no one to know that I have this service, because it is internal.

### Additional context

Using of zones with firewalld seems as non-breaking and elegant solution. When using iptables or nftables directly, administrator can add the necessary firewall rules to block the ports. Special option for firewalld will not affect them.

With a zone-based firewall zones should be used. Of course, zones are currently in use by podman, but the zone cannot be changed. This can be fixed. Default zone for podman will be `trusted`, as it is now.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.