-
Notifications
You must be signed in to change notification settings - Fork 54
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
[JEX-687] Update sensitive property #200
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jaymalasinha, let's pair on this. A lot of these should not be masked by sensitive properties and there are several occurrences of noops.
libraries/omnitruck_handler.rb
Outdated
@@ -57,6 +57,7 @@ def configure_version(installer) | |||
end | |||
else | |||
execute install_command_resource do | |||
sensitive new_resource.sensitive if new_resource.sensitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed here
resources/automate.rb
Outdated
@@ -109,6 +114,7 @@ | |||
end | |||
|
|||
file '/var/opt/delivery/nginx/etc/addon.d/99-installer_internal.conf' do | |||
sensitive new_resource.sensitive if new_resource.sensitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed here
resources/automate.rb
Outdated
@@ -122,6 +128,7 @@ | |||
|
|||
Array(new_resource.enterprise).each do |ent| | |||
execute "create enterprise #{ent}" do | |||
sensitive new_resource.sensitive if new_resource.sensitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed here
resources/backend.rb
Outdated
@@ -72,6 +75,7 @@ | |||
|
|||
peers.each do |peer| | |||
begin | |||
sensitive new_resource.sensitive if new_resource.sensitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove. this is not a chef resource
resources/backend.rb
Outdated
@@ -82,11 +86,13 @@ | |||
Chef::Config['http_retry_count'] = http_retry_count | |||
|
|||
execute 'chef-backend-ctl create-cluster --accept-license --yes' do | |||
sensitive new_resource.sensitive if new_resource.sensitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed here
resources/wf_builder.rb
Outdated
@@ -66,6 +67,7 @@ | |||
new_resource.supermarket_fqdn, | |||
].each do |server| | |||
execute "fetch ssl cert for #{server}" do | |||
sensitive new_resource.sensitive if new_resource.sensitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed here
resources/wf_builder.rb
Outdated
owner 'root' | ||
group 'dbuild' | ||
mode '0640' | ||
end | ||
|
||
file new_resource.chef_config_path do | ||
sensitive new_resource.sensitive if new_resource.sensitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed here
resources/wf_builder.rb
Outdated
mode '0644' | ||
end | ||
|
||
Dir.glob('/etc/chef/trusted_certs/*').each do |fn| | ||
file fn do | ||
sensitive new_resource.sensitive if new_resource.sensitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed here
resources/wf_builder.rb
Outdated
mode '0644' | ||
end | ||
end | ||
|
||
case new_resource.job_dispatch_version | ||
when 'v1' | ||
execute 'tag node as legacy build-node' do | ||
sensitive new_resource.sensitive if new_resource.sensitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed here
resources/wf_builder.rb
Outdated
@@ -217,6 +232,7 @@ | |||
home_dir = '/home/job_runner' | |||
|
|||
execute 'tag node as job-runner' do | |||
sensitive new_resource.sensitive if new_resource.sensitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed here
@wrightp updated as per review comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chef_server and chef_supermarket resources have not been updated with the necessary sensitive properties.
Please note the "remove" lines.We do not need to protect resources that do not write any private info.
resources/client.rb
Outdated
@@ -81,6 +81,7 @@ | |||
end | |||
|
|||
template 'client.rb' do | |||
sensitive new_resource.sensitive if new_resource.sensitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
resources/client.rb
Outdated
@@ -143,6 +147,7 @@ | |||
# end | |||
|
|||
file 'delete validation.pem' do | |||
sensitive new_resource.sensitive if new_resource.sensitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is required here because of the delete action. Doesn't hurt I suppose, but I don't think the log will display the deleted file's content.
resources/wf_builder.rb
Outdated
@@ -47,6 +47,7 @@ | |||
|
|||
action :create do | |||
chef_ingredient 'chefdk' do | |||
sensitive new_resource.sensitive if new_resource.sensitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
resources/wf_builder.rb
Outdated
@@ -97,6 +99,7 @@ | |||
group 'dbuild' | |||
|
|||
user 'dbuild' do | |||
sensitive new_resource.sensitive if new_resource.sensitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
resources/wf_builder.rb
Outdated
@@ -129,6 +134,7 @@ | |||
|
|||
%w(etc/delivery.rb .chef/knife.rb).each do |dir| | |||
file "#{workspace}/#{dir}" do | |||
sensitive new_resource.sensitive if new_resource.sensitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
resources/wf_builder.rb
Outdated
@@ -204,6 +214,7 @@ | |||
end | |||
|
|||
remote_file init_file do | |||
sensitive new_resource.sensitive if new_resource.sensitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
resources/wf_builder.rb
Outdated
@@ -238,6 +249,7 @@ | |||
end | |||
|
|||
file "#{home_dir}/.ssh/authorized_keys" do | |||
sensitive new_resource.sensitive if new_resource.sensitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
resources/wf_builder.rb
Outdated
@@ -272,6 +284,7 @@ | |||
end | |||
|
|||
file ::File.join('/etc/sudoers.d', build_user) do | |||
sensitive new_resource.sensitive if new_resource.sensitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
resources/wf_builder.rb
Outdated
@@ -287,12 +300,14 @@ | |||
end | |||
|
|||
file ::File.join(home_dir, '.ssh/authorized_keys') do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
resources/wf_builder.rb
Outdated
@@ -287,12 +300,14 @@ | |||
end | |||
|
|||
file ::File.join(home_dir, '.ssh/authorized_keys') do | |||
sensitive new_resource.sensitive if new_resource.sensitive | |||
owner build_user | |||
group build_user | |||
mode '0600' | |||
end | |||
|
|||
file '/usr/local/bin/delivery-cmd' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
Signed-off-by: Jaymala Sinha <[email protected]> [JEX-687] Address review comments on sensitive property Signed-off-by: Jaymala Sinha <[email protected]> Updated with review comments Signed-off-by: Jaymala Sinha <[email protected]> add tests Signed-off-by: Patrick Wright <[email protected]> remove sensitive props Signed-off-by: Patrick Wright <[email protected]> Fix travis errors Signed-off-by: Jaymala Sinha <[email protected]>
c15b862
to
e80aa81
Compare
Signed-off-by: Jaymala Sinha [email protected]
Description
sensitive property set at top level resources will be passed down to resources
Issues Resolved
#198
Check List