Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
{
"name": "VoxBox",
"image": "ghcr.io/voxpupuli/voxbox:latest"
Expand Down
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

modulesync_config_version: '10.5.0'
modulesync_config_version: '10.6.0'
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
inherit_from: .rubocop_todo.yml

# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

Expand Down
12 changes: 12 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This configuration was generated by
# `rubocop --auto-gen-config --no-auto-gen-timestamp`
# using RuboCop version 1.85.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 6
RSpec/LeakyLocalVariable:
Exclude:
- 'spec/acceptance/ferm_spec.rb'
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

group :test do
gem 'voxpupuli-test', '~> 13.0', :require => false
gem 'voxpupuli-test', '~> 14.0', :require => false
gem 'puppet_metadata', '~> 6.0', :require => false
end

Expand All @@ -18,7 +18,7 @@ group :system_tests do
end

group :release do
gem 'voxpupuli-release', '~> 5.0', :require => false
gem 'voxpupuli-release', '~> 5.3', :require => false
end

gem 'rake', :require => false
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/ferm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
[
'-A INPUT -p tcp -m tcp --dport 22 -m comment --comment allow_acceptance_tests -j ACCEPT',
'-A INPUT -p tcp -m tcp --dport 80 -m comment --comment jump_http -j HTTP',
'-A HTTP -s 127.0.0.1/32 -p tcp -m tcp --dport 80 -m comment --comment allow_http_localhost -j ACCEPT'
'-A HTTP -s 127.0.0.1/32 -p tcp -m tcp --dport 80 -m comment --comment allow_http_localhost -j ACCEPT',
]
else
[
'-A INPUT -p tcp -m comment --comment ["]*allow_acceptance_tests["]* -m tcp --dport 22 -j ACCEPT',
'-A INPUT -p tcp -m comment --comment ["]*jump_http["]* -m tcp --dport 80 -j HTTP',
'-A HTTP -s 127.0.0.1/32 -p tcp -m comment --comment ["]*allow_http_localhost["]* -m tcp --dport 80 -j ACCEPT'
'-A HTTP -s 127.0.0.1/32 -p tcp -m comment --comment ["]*allow_http_localhost["]* -m tcp --dport 80 -j ACCEPT',
]
end

Expand Down
18 changes: 9 additions & 9 deletions spec/classes/ferm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
# the following string exists only if we preserve chains

it do
expect(subject).to contain_concat__fragment('ferm.conf'). \
without_content(%r{@preserve;})
expect(subject).to contain_concat__fragment('ferm.conf')
.without_content(%r{@preserve;})
end

it { is_expected.to contain_concat__fragment('raw-PREROUTING-config-include') }
Expand Down Expand Up @@ -181,25 +181,25 @@
let :params do
{
manage_configfile: true,
preserve_chains_in_tables: { 'nat' => %w[PREROUTING POSTROUTING] }
preserve_chains_in_tables: { 'nat' => %w[PREROUTING POSTROUTING] },
}
end

it { is_expected.to compile.with_all_deps }

it do
expect(subject).to contain_concat__fragment('ferm.conf'). \
with_content(%r{domain \(ip ip6\) table nat \{})
expect(subject).to contain_concat__fragment('ferm.conf')
.with_content(%r{domain \(ip ip6\) table nat \{})
end

it do
expect(subject).to contain_concat__fragment('ferm.conf'). \
with_content(%r{chain PREROUTING @preserve;})
expect(subject).to contain_concat__fragment('ferm.conf')
.with_content(%r{chain PREROUTING @preserve;})
end

it do
expect(subject).to contain_concat__fragment('ferm.conf'). \
with_content(%r{chain POSTROUTING @preserve;})
expect(subject).to contain_concat__fragment('ferm.conf')
.with_content(%r{chain POSTROUTING @preserve;})
end
end

Expand Down
28 changes: 14 additions & 14 deletions spec/defines/chain_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@
let :params do
{
disable_conntrack: false,
log_dropped_packets: true
log_dropped_packets: true,
}
end

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_concat__fragment('filter-INPUT2-config-include') }

it do
expect(subject).to contain_concat__fragment('filter-INPUT2-policy'). \
with_content(%r{ESTABLISHED RELATED})
expect(subject).to contain_concat__fragment('filter-INPUT2-policy')
.with_content(%r{ESTABLISHED RELATED})
end

it do
expect(subject).to contain_concat__fragment('filter-INPUT2-footer'). \
with_content(%r{LOG log-prefix 'INPUT2: ';})
expect(subject).to contain_concat__fragment('filter-INPUT2-footer')
.with_content(%r{LOG log-prefix 'INPUT2: ';})
end

if facts[:os]['name'] == 'Debian'
Expand All @@ -47,21 +47,21 @@
let :params do
{
disable_conntrack: true,
log_dropped_packets: false
log_dropped_packets: false,
}
end

it { is_expected.to compile.with_all_deps }

it do
expect(subject).to contain_concat__fragment('filter-INPUT2-policy')
expect(subject).not_to contain_concat__fragment('filter-INPUT2-policy'). \
with_content(%r{ESTABLISHED RELATED})
expect(subject).not_to contain_concat__fragment('filter-INPUT2-policy')
.with_content(%r{ESTABLISHED RELATED})
end

it do
expect(subject).not_to contain_concat__fragment('filter-INPUT2-footer'). \
with_content(%r{LOG log-prefix 'INPUT2: ';})
expect(subject).not_to contain_concat__fragment('filter-INPUT2-footer')
.with_content(%r{LOG log-prefix 'INPUT2: ';})
end
end

Expand All @@ -71,7 +71,7 @@
chain: 'INPUT2',
policy: 'DROP',
disable_conntrack: true,
log_dropped_packets: false
log_dropped_packets: false,
}
end

Expand All @@ -82,16 +82,16 @@
let(:title) { 'FERM-DSL' }
let :params do
{
content: 'mod rpfilter invert DROP;'
content: 'mod rpfilter invert DROP;',
}
end

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_concat__fragment('filter-FERM-DSL-config-include') }

it do
expect(subject).to contain_concat__fragment('filter-FERM-DSL-custom-content'). \
with_content(%r{mod rpfilter invert DROP;})
expect(subject).to contain_concat__fragment('filter-FERM-DSL-custom-content')
.with_content(%r{mod rpfilter invert DROP;})
end

it do
Expand Down
4 changes: 2 additions & 2 deletions spec/defines/ipset_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
{
sets: {
office: 'ACCEPT',
internet: 'DROP'
}
internet: 'DROP',
},
}
end

Expand Down
34 changes: 17 additions & 17 deletions spec/defines/rule_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
chain: 'INPUT',
proto: 'tcp',
dport: 22,
saddr: '127.0.0.1'
saddr: '127.0.0.1',
}
end

Expand All @@ -35,7 +35,7 @@
action: 'ACCEPT',
proto: 'tcp',
dport: 22,
saddr: '127.0.0.1'
saddr: '127.0.0.1',
}
end

Expand All @@ -55,7 +55,7 @@
proto: 'tcp',
dport: 22,
saddr: '127.0.0.1',
interface: 'eth0'
interface: 'eth0',
}
end

Expand All @@ -74,7 +74,7 @@
proto: 'tcp',
dport: 22,
daddr: ['127.0.0.1', '123.123.123.123', ['10.0.0.1', '10.0.0.2']],
interface: 'eth0'
interface: 'eth0',
}
end

Expand All @@ -93,7 +93,7 @@
proto: 'tcp',
dport: 22,
daddr: ['127.0.0.1', '123.123.123.123', ['10.0.0.1', '10.0.0.2']],
negate: %w[saddr daddr sport]
negate: %w[saddr daddr sport],
}
end

Expand All @@ -112,7 +112,7 @@
action: 'ACCEPT',
proto: %w[tcp udp],
dport: [8301, 8302],
saddr: '127.0.0.1'
saddr: '127.0.0.1',
}
end

Expand All @@ -131,7 +131,7 @@
action: 'ACCEPT',
proto: 'tcp',
dport: '20000:25000',
saddr: '127.0.0.1'
saddr: '127.0.0.1',
}
end

Expand All @@ -151,7 +151,7 @@
proto: 'tcp',
dport: '20000:25000',
saddr: '127.0.0.1',
negate: %w[saddr dport]
negate: %w[saddr dport],
}
end

Expand All @@ -170,7 +170,7 @@
action: 'ACCEPT',
proto: 'tcp',
sport: '25000:20000',
saddr: '127.0.0.1'
saddr: '127.0.0.1',
}
end

Expand All @@ -185,7 +185,7 @@
action: 'ACCEPT',
proto: 'tcp',
dport: '50000:65538',
saddr: '127.0.0.1'
saddr: '127.0.0.1',
}
end

Expand All @@ -200,7 +200,7 @@
action: 'ACCEPT',
proto: 'tcp',
dport: '65538',
saddr: '127.0.0.1'
saddr: '127.0.0.1',
}
end

Expand All @@ -215,7 +215,7 @@
action: 'ACCEPT',
proto: 'tcp',
sport: 65_538,
saddr: '127.0.0.1'
saddr: '127.0.0.1',
}
end

Expand All @@ -238,17 +238,17 @@
chain: 'INPUT',
action: 'SSH',
proto: 'tcp',
dport: 22
dport: 22,
}
end

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_concat__fragment('filter-SSH-policy') }

it do
expect(subject).to contain_concat__fragment('INPUT-filter-ssh'). \
with_content("mod comment comment 'filter-ssh' proto tcp dport 22 jump SSH;\n"). \
that_requires('Ferm::Chain[check-ssh]')
expect(subject).to contain_concat__fragment('INPUT-filter-ssh')
.with_content("mod comment comment 'filter-ssh' proto tcp dport 22 jump SSH;\n")
.that_requires('Ferm::Chain[check-ssh]')
end

it { is_expected.to contain_concat__fragment('filter-INPUT-config-include') }
Expand Down Expand Up @@ -277,7 +277,7 @@
action: 'ACCEPT',
proto: 'tcp',
dport: 22,
saddr: '127.0.0.1'
saddr: '127.0.0.1',
}
end

Expand Down
Loading