Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not set recursive ACLs on dhcp #621

Merged
merged 1 commit into from
Oct 12, 2020
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
4 changes: 2 additions & 2 deletions manifests/proxydhcp.pp
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@

[$dhcp::dhcp_dir, dirname($foreman_proxy::dhcp_leases)].each |$path| {
exec { "Allow ${foreman_proxy::user} to read ${path}":
command => "setfacl -R -m u:${foreman_proxy::user}:rx ${path}",
command => "setfacl -m u:${foreman_proxy::user}:rx ${path}",
path => ['/bin', '/usr/bin'],
unless => "getfacl -p ${path} | grep user:${foreman_proxy::user}:r-x",
require => Package['acl'],
require => [Class['dhcp'], Package['acl']],
}
}

Expand Down
8 changes: 4 additions & 4 deletions spec/classes/foreman_proxy__proxydhcp__spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@
it { is_expected.to contain_class('dhcp').with_conf_dir_mode('0750') }

it do should contain_exec('Allow foreman-proxy to read /etc/dhcp').
with_command("setfacl -R -m u:foreman-proxy:rx /etc/dhcp")
with_command("setfacl -m u:foreman-proxy:rx /etc/dhcp")
end

it do should contain_exec("Allow foreman-proxy to read #{leases_dir}").
with_command("setfacl -R -m u:foreman-proxy:rx #{leases_dir}")
with_command("setfacl -m u:foreman-proxy:rx #{leases_dir}")
end
end

context "as manager of ACLs for dhcp for RedHat and Debian by default" do
case facts[:osfamily]
when 'RedHat', 'Debian'
it do should contain_exec('Allow foreman-proxy to read /etc/dhcp').
with_command('setfacl -R -m u:foreman-proxy:rx /etc/dhcp').
with_command('setfacl -m u:foreman-proxy:rx /etc/dhcp').
with_unless('getfacl -p /etc/dhcp | grep user:foreman-proxy:r-x')
end
else
Expand All @@ -89,7 +89,7 @@
case facts[:osfamily]
when 'RedHat', 'Debian'
it do should contain_exec("Allow foreman-proxy to read #{leases_dir}").
with_command("setfacl -R -m u:foreman-proxy:rx #{leases_dir}").
with_command("setfacl -m u:foreman-proxy:rx #{leases_dir}").
with_unless("getfacl -p #{leases_dir} | grep user:foreman-proxy:r-x")
end
else
Expand Down