-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Additional rules for podman root containers
This class defines additional forwarding rules to let root containers reach external networks when using Netavark (since v4.0) or CNI (deprecated). At the time of writing, Podman supports automatic configuration of firewall rules with iptables and firewalld only.
- Loading branch information
1 parent
3413220
commit 08b9f1d
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# @summary | ||
# Rules for Podman, a tool for managing OCI containers and pods. | ||
# This class defines additional forwarding rules to let root containers | ||
# reach external networks when using Netavark (since v4.0) or CNI (deprecated). | ||
# At the time of writing, Podman supports automatic configuration | ||
# of firewall rules with iptables and firewalld only. | ||
# | ||
class nftables::rules::podman { | ||
nftables::rule { | ||
'default_fwd-podman_establised': | ||
content => 'ip daddr 10.88.0.0/16 ct state related,established accept', | ||
} | ||
nftables::rule { | ||
'default_fwd-podman_accept': | ||
content => 'ip saddr 10.88.0.0/16 accept', | ||
} | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
describe 'nftables::rules::podman' do | ||
on_supported_os.each do |os, os_facts| | ||
context "on #{os}" do | ||
let(:facts) { os_facts } | ||
|
||
context 'default options' do | ||
it { is_expected.to compile } | ||
it { is_expected.to contain_nftables__rule('default_fwd-podman_establised').with_content('ip daddr 10.88.0.0/16 ct state related,established accept') } | ||
it { is_expected.to contain_nftables__rule('default_fwd-podman_accept').with_content('ip saddr 10.88.0.0/16 accept') } | ||
end | ||
end | ||
end | ||
end |