Chef chef-validator.pem security

*爱你&永不变心* 提交于 2019-11-30 20:07:45

This was one of the items discussed at a recent Foodfight episode on managing "secrets" in chef. Highly recommended watching:

The knife bootstrap operation uploads this key when initializing new chef clients. Possession of this key enables the client to register itself against your chef server. That is actually its only function, once the client is up and running the validation key is no longer needed.

But it can be abused.... As @cbl has pointed out, if an unauthorized 3rd party gets access to this key they can create new clients that can see everything on your chef server that normal clients can see. It can theoretically be used to create a Denial of Service attack on your chef server, by flooding it with registration requests.

The foodfight panel recommend a simple solution. Enable the chef-client cookbook on all nodes. It contains a "delete_validation" recipe that will remove the validation key and reduce your risk exposure.

The validator key is used to create new clients on the Chef Server.

Once the attacker gets hold of it, he can pretend he's a node in your infrastructure and have access to the same information any node has.

If you have sensitive information in an unencrypted data bag, for example, he'll have access to that.

Basically he'll be able to run any recipe from any cookbook, do searches (and have access to all your other nodes' attributes), read data bags, etc.

Keep that in mind when writing cookbooks and populating the other objects in the server. You could also somehow monitor the chef server for any suspicious client creation activity, and if you have any reason believe that the validator key has been stolen, revoke it and issue a new one.

It's probably a good idea to rotate the key periodically as well.

lamont

As of Chef 12.2.0 the validation key is no longer required:

https://blog.chef.io/2015/04/16/validatorless-bootstraps/

You can delete your validation key on your workstation and then knife will use your user credentials to create the node and client.

There's also some other nice features of this since whatever you supply for the run_list and environment is also applied to the node when it is created. No more relying on the first-boot.json file to be read by the chef-client and the run having to complete before the node.save creates the node at the end of the bootstrapping process.

Basically, chef-client uses 2 mode authentication for to the server :- 1) organization validator.pem and 2) user.pem

Unless and until there is the correct combination of these 2 keys. chef-client wont be able to authenticate with the chef server.

They can even connect any node to the chef server with the stolen key via the following steps.

  1. Copying and pasting the validator key into /etc/chef folder on any machine

  2. Creating client.rb file with the following details

    log_location     STDOUT
    chef_server_url  "https://api.chef.io/organizations/ORGNAME"    
    validation_client_name 'ORGNAME-validator'                      
    validation_key      '/etc/chef/validater.pem'                   
    

3: Run chef-client to connect to the chef server

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!