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

[JEX-687] Update sensitive property #200

Merged
merged 1 commit into from
Oct 2, 2017
Merged

[JEX-687] Update sensitive property #200

merged 1 commit into from
Oct 2, 2017

Conversation

jaymalasinha
Copy link

@jaymalasinha jaymalasinha commented Sep 25, 2017

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

Copy link

@wrightp wrightp left a 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.

@@ -57,6 +57,7 @@ def configure_version(installer)
end
else
execute install_command_resource do
sensitive new_resource.sensitive if new_resource.sensitive
Copy link

Choose a reason for hiding this comment

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

Not needed here

@@ -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
Copy link

Choose a reason for hiding this comment

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

Not needed here

@@ -122,6 +128,7 @@

Array(new_resource.enterprise).each do |ent|
execute "create enterprise #{ent}" do
sensitive new_resource.sensitive if new_resource.sensitive
Copy link

Choose a reason for hiding this comment

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

Not needed here

@@ -72,6 +75,7 @@

peers.each do |peer|
begin
sensitive new_resource.sensitive if new_resource.sensitive
Copy link

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

@@ -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
Copy link

Choose a reason for hiding this comment

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

Not needed here

@@ -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
Copy link

Choose a reason for hiding this comment

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

Not needed here

owner 'root'
group 'dbuild'
mode '0640'
end

file new_resource.chef_config_path do
sensitive new_resource.sensitive if new_resource.sensitive
Copy link

Choose a reason for hiding this comment

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

Not needed here

mode '0644'
end

Dir.glob('/etc/chef/trusted_certs/*').each do |fn|
file fn do
sensitive new_resource.sensitive if new_resource.sensitive
Copy link

Choose a reason for hiding this comment

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

Not needed here

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
Copy link

Choose a reason for hiding this comment

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

Not needed here

@@ -217,6 +232,7 @@
home_dir = '/home/job_runner'

execute 'tag node as job-runner' do
sensitive new_resource.sensitive if new_resource.sensitive
Copy link

Choose a reason for hiding this comment

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

Not needed here

@jaymalasinha
Copy link
Author

@wrightp updated as per review comments.

Copy link

@wrightp wrightp left a 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.

@@ -81,6 +81,7 @@
end

template 'client.rb' do
sensitive new_resource.sensitive if new_resource.sensitive
Copy link

Choose a reason for hiding this comment

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

remove

@@ -143,6 +147,7 @@
# end

file 'delete validation.pem' do
sensitive new_resource.sensitive if new_resource.sensitive
Copy link

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.

@@ -47,6 +47,7 @@

action :create do
chef_ingredient 'chefdk' do
sensitive new_resource.sensitive if new_resource.sensitive
Copy link

Choose a reason for hiding this comment

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

remove

@@ -97,6 +99,7 @@
group 'dbuild'

user 'dbuild' do
sensitive new_resource.sensitive if new_resource.sensitive
Copy link

Choose a reason for hiding this comment

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

remove

@@ -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
Copy link

Choose a reason for hiding this comment

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

remove

@@ -204,6 +214,7 @@
end

remote_file init_file do
sensitive new_resource.sensitive if new_resource.sensitive
Copy link

Choose a reason for hiding this comment

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

remove

@@ -238,6 +249,7 @@
end

file "#{home_dir}/.ssh/authorized_keys" do
sensitive new_resource.sensitive if new_resource.sensitive
Copy link

Choose a reason for hiding this comment

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

remove

@@ -272,6 +284,7 @@
end

file ::File.join('/etc/sudoers.d', build_user) do
sensitive new_resource.sensitive if new_resource.sensitive
Copy link

Choose a reason for hiding this comment

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

remove

@@ -287,12 +300,14 @@
end

file ::File.join(home_dir, '.ssh/authorized_keys') do
Copy link

Choose a reason for hiding this comment

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

remove

@@ -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
Copy link

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]>
@wrightp wrightp merged commit 9af1f6e into master Oct 2, 2017
@tas50 tas50 deleted the jsinha/JEX-687 branch November 30, 2017 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants