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 secrets file access mode - for real! #1064

Merged
merged 2 commits into from
Jan 4, 2024
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: 4 additions & 0 deletions lib/tasks/encrypted_key.rake
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ namespace :rmt do

Rails::Generators::EncryptionKeyFileGenerator
.new.add_key_file('config/secrets.yml.key')

FileUtils.chmod(0o640, 'config/secrets.yml.key')
end

desc 'Create the `secret_key_base` for Rails'
task create_secret_key_base: :environment do
Rails::Secrets.write(
{ 'production' => { 'secret_key_base' => SecureRandom.hex(64) } }.to_yaml
)

FileUtils.chmod(0o640, 'config/secrets.yml.enc')
end
end
end
2 changes: 1 addition & 1 deletion package/files/update_rmt_app_dir_permissions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fi
# Change secrets encrypted and key files to nginx readable
secret_key_files=('config/secrets.yml.key' 'config/secrets.yml.enc')

for secretFile in $secret_key_files; do
for secretFile in ${secret_key_files[@]}; do
file_path="$app_dir/$secretFile"
if [[ -e $file_path ]]; then
if [[ "$(stat -c "%U %G" $file_path)" == "root root" ]]; then
Expand Down
2 changes: 2 additions & 0 deletions package/obs/rmt-server.changes
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Wed Oct 04 13:23:00 UTC 2023 - Felix Schnizlein <fschnizlein@suse.com>
allow transmitting system information dynamically. (jsc#PED-3734)
* Fix secrets access for server user (bsc#1215176)
* rmt-client-setup-res script: fix for CentOS8 clients (bsc#1214709)
* Updated supportconfig script (bsc#1216389)

-------------------------------------------------------------------
Thu Jun 06 15:44:00 UTC 2023 - Luís Caparroz <lcaparroz@suse.com>

Expand Down
Loading