Skip to content

Commit

Permalink
Fix config permissions
Browse files Browse the repository at this point in the history
The default permissions were too strict. We didn't want the config files
writeable by PowerDNS becuase it's not necessary for operation but they
need to be readable x.x

This splits the difference by not making them world readable but making
the pdns user the group.

This might be a touch too far and we may want to 644 and make the user
and group that set by the resource. Feedback welcome.

Signed-off-by: David Aronsohn <WagThatTail@Me.com>
  • Loading branch information
onlyhavecans committed Mar 1, 2018
1 parent 6b80d46 commit 4e901a4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions resources/authoritative_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@
property :variables, Hash, default: lazy { |resource| { bind_config: "#{resource.config_dir}/bindbackend.conf" } }

action :create do
directory new_resource.config_dir do
owner 'root'
group 'root'
mode '0755'
action :create
end

user new_resource.run_user do
home new_resource.run_user_home
shell new_resource.run_user_shell
Expand All @@ -80,11 +73,18 @@
action :create
end

directory new_resource.config_dir do
owner 'root'
group new_resource.run_group
mode '0750'
action :create
end

template "#{new_resource.config_dir}/#{authoritative_instance_config(new_resource.instance_name)}" do
source new_resource.source
cookbook new_resource.cookbook
owner 'root'
group 'root'
group new_resource.run_group
mode '0640'
variables(
launch: new_resource.launch,
Expand Down
16 changes: 8 additions & 8 deletions resources/recursor_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@
property :variables, Hash, default: {}

action :create do
directory new_resource.config_dir do
owner 'root'
group 'root'
mode '0755'
action :create
end

user new_resource.run_user do
home new_resource.run_user_home
shell new_resource.run_user_shell
Expand All @@ -79,11 +72,18 @@
action :create
end

directory new_resource.config_dir do
owner 'root'
group new_resource.run_group
mode '0750'
action :create
end

template "#{new_resource.config_dir}/#{recursor_instance_config(new_resource.instance_name)}" do
source new_resource.source
cookbook new_resource.cookbook
owner 'root'
group 'root'
group new_resource.run_group
mode '0640'
variables(
socket_dir: new_resource.socket_dir,
Expand Down

0 comments on commit 4e901a4

Please sign in to comment.