Skip to content

Commit

Permalink
1021119 - make sure private keys are never world readable
Browse files Browse the repository at this point in the history
This should prevent similar mistakes in future.
  • Loading branch information
iNecas committed Oct 22, 2013
1 parent 8c8c706 commit 592f8f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/puppet/provider/katello_ssl_tool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def exists?
end

def create
File.open(resource[:path], "w") { |f| f << expected_content }
File.open(resource[:path], "w", mode) { |f| f << expected_content }
end

protected
Expand All @@ -198,6 +198,10 @@ def source_path
raise NotImplementedError
end

def mode
0644
end

def cert_details
return @cert_details if defined? @cert_details
if cert_resource = @resource[:cert]
Expand Down
4 changes: 4 additions & 0 deletions lib/puppet/provider/privkey/katello_ssl_tool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ def source_path
cert_details[:privkey]
end

def mode
0400
end

end

0 comments on commit 592f8f8

Please sign in to comment.