Skip to content

Commit

Permalink
Set Default file mode to 0600 as config could contain connection strings
Browse files Browse the repository at this point in the history
  • Loading branch information
voxel01 committed Apr 29, 2024
1 parent bd3cb26 commit 39f4dd2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Data type: `Stdlib::Filemode`

mode of config_file

Default value: `'0644'`
Default value: `'0600'`

##### <a name="-otelcol--receivers"></a>`receivers`

Expand Down
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
String $config_file = "/etc/${package_name}/config.yaml",
String $config_file_owner = 'root',
String $config_file_group = 'root',
Stdlib::Filemode $config_file_mode = '0644',
Stdlib::Filemode $config_file_mode = '0600',
Hash[String, Hash] $receivers = {},
Hash[String, Hash] $processors = {},
Hash[String, Hash] $exporters = {},
Expand Down
5 changes: 3 additions & 2 deletions spec/classes/otelcol_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
is_expected.to contain_concat('otelcol-config').with({
'path' => '/etc/otelcol/config.yaml',
'format' => 'yaml',
'mode' => '0600',
})
is_expected.to contain_concat__fragment('otelcol-config-header')
is_expected.to contain_concat__fragment('otelcol-config-baseconfig')
Expand Down Expand Up @@ -150,7 +151,7 @@
{
config_file_owner: 'root',
config_file_group: 'root',
config_file_mode: '0600',
config_file_mode: '0640',
}
end

Expand All @@ -160,7 +161,7 @@
is_expected.to contain_concat('otelcol-config').with(
'owner' => 'root',
'group' => 'root',
'mode' => '0600'
'mode' => '0640'
)
}
end
Expand Down

0 comments on commit 39f4dd2

Please sign in to comment.