tobami / littlechef

Cook with Chef without a Chef Server
Apache License 2.0
473 stars 70 forks source link

Chef11: suppress SSL validation warning #207

Closed thekorn closed 10 years ago

thekorn commented 10 years ago

When depoloying a node running Chef11 with current HEAD of littlechef I get a huge warning at the beginning of the run:

(DEVOPS11)markus@thekorn ~/devel/devops/config_management (git)-[master] % fix node:xxx.yyy.net
/home/markus/devel/.virtualenvs/DEVOPS11/local/lib/python2.7/site-packages/pkg_resources.py:991: UserWarning: /home/markus/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
  warnings.warn(msg, UserWarning)

== Configuring xxx.yyy.net ==
Synchronizing nodes, environments, roles, cookbooks and data bags...

Cooking...
sudo password:
[2014-05-22T08:30:21+00:00] INFO: Forking chef instance to converge...
[2014-05-22T08:30:21+00:00] WARN: 
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
SSL validation of HTTPS requests is disabled. HTTPS connections are still
encrypted, but chef is not able to detect forged replies or man in the middle
attacks.

To fix this issue add an entry like this to your configuration file:

``
  # Verify all HTTPS connections (recommended)
  ssl_verify_mode :verify_peer

  # OR, Verify only connections to chef-server
  verify_api_cert true
``

To check your SSL configuration, or troubleshoot errors, you can use the
`knife ssl check` command like so:

``
  knife ssl check -c /etc/chef/solo.rb
``

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 

[2014-05-22T08:30:21+00:00] INFO: *** Chef 11.12.4 ***
[2014-05-22T08:30:21+00:00] INFO: Chef-client pid: 7324
[2014-05-22T08:30:24+00:00] INFO: Setting the run_list to ["role[env_production]"] from CLI options
[2014-05-22T08:30:24+00:00] INFO: Run List is [role[env_production]]
[2014-05-22T08:30:24+00:00] INFO: Run List expands to [chef-solo-search, chef_handler, apt, users::sysadmins, sudo, iptables, munin::client, edelight::reporting, packages]
[2014-05-22T08:30:24+00:00] INFO: Starting Chef Run for xxx.yyy.net
[2014-05-22T08:30:24+00:00] INFO: Running start handlers
[2014-05-22T08:30:24+00:00] INFO: Start handlers complete.
[2014-05-22T08:30:25+00:00] INFO: Chef Handlers will be at: /tmp/chef-solo/handlers
[2014-05-22T08:30:25+00:00] INFO: remote_directory[/tmp/chef-solo/handlers] owner changed to 0
[2014-05-22T08:30:25+00:00] WARN: Cloning resource attributes for ruby_block[reset group list] from prior resource (CHEF-3694)
[2014-05-22T08:30:25+00:00] WARN: Previous ruby_block[reset group list]: /tmp/chef-solo/site-cookbooks/users/recipes/sysadmins.rb:78:in `block in from_file'
[2014-05-22T08:30:25+00:00] WARN: Current  ruby_block[reset group list]: /tmp/chef-solo/site-cookbooks/users/recipes/sysadmins.rb:78:in `block in from_file'
[2014-05-22T08:30:25+00:00] WARN: Cloning resource attributes for ruby_block[reset group list] from prior resource (CHEF-3694)
[2014-05-22T08:30:25+00:00] WARN: Previous ruby_block[reset group list]: /tmp/chef-solo/site-cookbooks/users/recipes/sysadmins.rb:78:in `block in from_file'
[2014-05-22T08:30:25+00:00] WARN: Current  ruby_block[reset group list]: /tmp/chef-solo/site-cookbooks/users/recipes/sysadmins.rb:78:in `block in from_file'
[2014-05-22T08:30:26+00:00] INFO: Enabling chef_handler[Reporting::S3Handler] as a report handler
[2014-05-22T08:30:26+00:00] INFO: Enabling chef_handler[Reporting::S3Handler] as a exception handler
[2014-05-22T08:30:27+00:00] INFO: Chef Run complete in 2.410429447 seconds
[2014-05-22T08:30:27+00:00] INFO: Running report handlers
[2014-05-22T08:30:27+00:00] INFO: Report handlers complete

SUCCESS: Node correctly configured

Done.
Disconnecting from xxx.yyy.net... done.

We should suppress this warning by only try to verify connections to a chef_server, which will never happen, as we are running chef in solo mode