Bug 1057875
| Summary: | firewalld input_zones has default rule for public zone | |||
|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Andy Wang <dopey> | |
| Component: | firewalld | Assignee: | Thomas Woerner <twoerner> | |
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | |
| Severity: | urgent | Docs Contact: | ||
| Priority: | high | |||
| Version: | 20 | CC: | dopey, jpopelka, toby, twoerner | |
| Target Milestone: | --- | |||
| Target Release: | --- | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | firewalld-0.3.9.3-1.fc19 | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1058339 (view as bug list) | Environment: | ||
| Last Closed: | 2014-02-11 23:02:59 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 1058339 | |||
|
Description
Andy Wang
2014-01-25 15:47:47 UTC
Please check if your interface is really named eth0. ethX is not used on any of my machines anymore. The default rule will match for anything that is not named eth0 in your case. Yes it is using eth0. This is within a kvm virtual machine using virtio device. I've noticed that virtio network devices seem to be still named ethX.
That said, I'm not sure you're comment is accurate.
For example, here's another machine of mine:
0 0 IN_public all -- p128p1 * 0.0.0.0/0 0.0.0.0/0
0 0 IN_public all -- + * 0.0.0.0/0 0.0.0.0/0
The way i understand how the iptables rules are parsed, the + is a wildcard.
When I define a custom zone it creates the following IN_zone chain:
Chain IN_zone (2 references)
pkts bytes target prot opt in out source destination
0 0 IN_zone_log all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 IN_zone_deny all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 IN_zone_allow all -- * * 0.0.0.0/0 0.0.0.0/0
If the packet doesn't match one of the rules in one of those targets, it'll simply be passed along the chain passing it through the:
0 0 IN_public all -- + * 0.0.0.0/0 0.0.0.0/0
For example, if I create a zone that I only intended to allow https, but didn't explicitly deny ssh in the zone, the ssh connection would pass through to the public chain, which by default allows ssh.
(In reply to Andy Wang from comment #2) > For example, if I create a zone that I only intended to allow https, but > didn't explicitly deny ssh in the zone, the ssh connection would pass > through to the public chain, which by default allows ssh. Correct. Thank you for the investigation. We had already fixed this problem (bug #912782) some time ago by using --goto instead of --jump, but then I made one incomplete fix and reintroduced this problem. Sorry! Should be fixed upstream with https://git.fedorahosted.org/cgit/firewalld.git/commit/?id=b2b5b88c56feffe09ddacf5ed348bc587f84160c I can confirm that I saw the same behavior as well. I did my rebuild onto Fedora 20 yesterday and noticed this (I try to run with full shields up before I hook up the external interface and start downloading updates with yum) - try as I might, I couldn't get the firewall to start blocking ssh (I was using Shields Up to scan the machine from outside).
I ended up working around it by setting the default zone to block (instead of default). I just finished verifying all the docs to make sure I had a bug on my hand and then starting scanning the bug list when I came across this one. :-)
Glad to see the fix is in progress (and Andy Wang's analysis looks just like mine did)!
For what it's worth, here are my chains (after setting the default zone to block):
Chain FORWARD_IN_ZONES (1 references)
pkts bytes target prot opt in out source destination
32 1751 FWDI_trusted all -- p6p1 any anywhere anywhere
0 0 FWDI_external all -- p1p1 any anywhere anywhere
0 0 FWDI_block all -- + any anywhere anywhere
Chain FORWARD_OUT_ZONES (1 references)
pkts bytes target prot opt in out source destination
0 0 FWDO_trusted all -- any p6p1 anywhere anywhere
0 0 FWDO_external all -- any p1p1 anywhere anywhere
0 0 FWDO_block all -- any + anywhere anywhere
firewalld-0.3.9.3-1.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/firewalld-0.3.9.3-1.fc20 firewalld-0.3.9.3-1.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/FEDORA-2014-0752/firewalld-0.3.9.3-1.fc19 Package firewalld-0.3.9.3-1.fc20: * should fix your issue, * was pushed to the Fedora 20 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing firewalld-0.3.9.3-1.fc20' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2014-2100/firewalld-0.3.9.3-1.fc20 then log in and leave karma (feedback). firewalld-0.3.9.3-1.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report. firewalld-0.3.9.3-1.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report. |