From 1d3810b3150d653314437471d7858cdbf76b62c7 Mon Sep 17 00:00:00 2001 From: Ward Vandewege Date: Mon, 24 Mar 2014 15:55:29 -0400 Subject: [PATCH] Do not print secrets in the config:check rake task. --- apps/workbench/lib/tasks/config_check.rake | 6 +++++- services/api/lib/tasks/config_check.rake | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/workbench/lib/tasks/config_check.rake b/apps/workbench/lib/tasks/config_check.rake index c9f12fc1a9..b74e03d907 100644 --- a/apps/workbench/lib/tasks/config_check.rake +++ b/apps/workbench/lib/tasks/config_check.rake @@ -2,7 +2,11 @@ namespace :config do desc 'Ensure site configuration has all required settings' task check: :environment do $application_config.sort.each do |k, v| - $stderr.puts "%-32s %s" % [k, eval("Rails.configuration.#{k}")] + if /(password|secret)/.match(k) then + $stderr.puts "%-32s %s" % [k, '*********'] + else + $stderr.puts "%-32s %s" % [k, eval("Rails.configuration.#{k}")] + end end end end diff --git a/services/api/lib/tasks/config_check.rake b/services/api/lib/tasks/config_check.rake index c9f12fc1a9..b74e03d907 100644 --- a/services/api/lib/tasks/config_check.rake +++ b/services/api/lib/tasks/config_check.rake @@ -2,7 +2,11 @@ namespace :config do desc 'Ensure site configuration has all required settings' task check: :environment do $application_config.sort.each do |k, v| - $stderr.puts "%-32s %s" % [k, eval("Rails.configuration.#{k}")] + if /(password|secret)/.match(k) then + $stderr.puts "%-32s %s" % [k, '*********'] + else + $stderr.puts "%-32s %s" % [k, eval("Rails.configuration.#{k}")] + end end end end -- 2.30.2