linux: add docker_daemon_privilege_escalation

Install docker from the community cookbook and add some users in the
docker group from attributes.
I created the `attributes/default.rb` attribute file to configure which
users are added in the `docker` group. I suggest to put all configurable
values here, such as users, passwords etc..
This commit is contained in:
Sliim 2017-03-15 23:59:51 +01:00
parent 5d36ad0306
commit dbe3947d22
4 changed files with 30 additions and 0 deletions

5
Vagrantfile vendored
View File

@ -149,6 +149,10 @@ Vagrant.configure("2") do |config|
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = [ 'chef/cookbooks' ]
chef.json = { 'metasploitable' => {
# Customizations here
}
}
chef.add_recipe "metasploitable::mysql"
chef.add_recipe "metasploitable::apache_continuum"
@ -157,6 +161,7 @@ Vagrant.configure("2") do |config|
chef.add_recipe "metasploitable::phpmyadmin"
chef.add_recipe "metasploitable::proftpd"
chef.add_recipe "metasploitable::users"
chef.add_recipe "metasploitable::docker"
end
end
end

View File

@ -0,0 +1,9 @@
#
# Cookbook:: metasploitable
# Attributes:: default
#
default['metasploitable']['docker_users'] = ['boba_fett',
'jabba_hutt',
'greedo',
'chewbacca',]

View File

@ -18,4 +18,5 @@ version '0.1.0'
#
# source_url 'https://github.com/<insert_org_here>/metasploitable3' if respond_to?(:source_url)
depends 'docker'
depends 'mysql'

View File

@ -0,0 +1,15 @@
#
# Cookbook:: metasploitable
# Recipe:: docker
#
docker_service 'default' do
action [:create, :start]
group 'docker'
end
group 'docker' do
action [:create, :modify]
append true
members node['metasploitable']['docker_users']
end