Repository navigation
Open container ports to the LAN with firewall drop-ins - #47
Merged
Merged
Conversation
sibyl.nft includes /etc/nftables/sibyl.d/*.nft in its input chain. An administrator opens a published container port with one rule file there, and the image ships none, so a local file does not stop bootc from updating sibyl.nft. At boot, nft-load falls back to the base rules if a drop-in fails, so one bad file cannot leave the host without a firewall. The reload now loads only the sibyl table instead of flushing the whole ruleset, which kept other programs' rules, such as tailscaled's, from being dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The change
sibyl.nftincludes/etc/nftables/sibyl.d/*.nftin its input chain. An administrator opens a port that a container publishes with one rule file there, such astcp dport 9000 accept.READMEinsibyl.d. A local rule file therefore does not stop bootc from updatingsibyl.nft.nftables.servicestarts with/usr/libexec/sibyl/nft-load. If the rules fail to load at boot, the script loadssibyl.nftwithout the drop-ins, so a bad file cannot leave the host with no firewall.nft -f /etc/sysconfig/nftables.conf. The stock reload flushes the whole ruleset, which also drops the rules of other programs such as tailscaled.sibyl.nftstarts withdestroy table, so the new reload replaces only thesibyltable.AGENTS.mddescribe the directory.Verification
With nftables in a
fedora:44container:sibyl.dloads, because a glob include that matches no file is not an error.nft-loadlogs the error and loads the base rules withpolicy dropand SSH. If the base file is broken too, it exits 1.The arm64 host image builds. It has the script and the unit drop-in, and
bootc container lintpasses 14 checks.shellcheckpasses.🤖 Generated with Claude Code