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

Fix permissions, based on scheme introduced by RabbitMQ 3.7.* #796

Closed
wants to merge 1 commit into from
Closed
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
16 changes: 8 additions & 8 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,14 @@
file { '/etc/rabbitmq':
ensure => directory,
owner => '0',
group => '0',
mode => '0755',
group => $rabbitmq_group,
mode => '2755',
}

file { '/etc/rabbitmq/ssl':
ensure => directory,
owner => '0',
group => '0',
group => $rabbitmq_group,
mode => '0755',
}

Expand All @@ -161,7 +161,7 @@
content => template($config),
owner => '0',
group => $rabbitmq_group,
mode => '0640',
mode => '0644',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the directories themselves are readable by the group, as are the files, I think these files can (and should?) stay 0640?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have my doubts, too. On the one hand, SSL certificates should not be readable by everyone, but on the other hand these defaults are given by the SGID bit via /etc/rabbitmq.

Maybe this question can be answered by someone who has more experience with RabbitMQ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean given by the sgid bit on the directory? You can have files with mode 0640 in a directory that’s world readable or executable w sgid bit (say 2755 or 2751). Sgid bit just affects default group ownership of files created in the directory afaik

}

file { 'rabbitmq-env.config':
Expand All @@ -170,7 +170,7 @@
content => template($env_config),
owner => '0',
group => $rabbitmq_group,
mode => '0640',
mode => '0644',
}

file { 'rabbitmq-inetrc':
Expand All @@ -179,7 +179,7 @@
content => template($inetrc_config),
owner => '0',
group => $rabbitmq_group,
mode => '0640',
mode => '0644',
}

if $use_config_file_for_plugins {
Expand All @@ -189,7 +189,7 @@
content => template('rabbitmq/enabled_plugins.erb'),
owner => '0',
group => $rabbitmq_group,
mode => '0640',
mode => '0644',
require => File['/etc/rabbitmq'],
}
}
Expand All @@ -201,7 +201,7 @@
content => template('rabbitmq/rabbitmqadmin.conf.erb'),
owner => '0',
group => $rabbitmq_group,
mode => '0640',
mode => '0644',
require => File['/etc/rabbitmq'],
}
}
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/rabbitmq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@
it {
is_expected.to contain_file('/etc/rabbitmq').with(
'ensure' => 'directory',
'mode' => '0755'
'mode' => '2755'
)
}
end
Expand All @@ -332,7 +332,7 @@
is_expected.to contain_file('rabbitmq.config').with(
'owner' => '0',
'group' => 'rabbitmq',
'mode' => '0640'
'mode' => '0644'
)
}
end
Expand Down