Hide 7 of diamonds in docker container

This commit is contained in:
James Barnett 2017-07-14 15:13:15 -05:00
parent d088960490
commit 268537fa5d

View File

@ -4,6 +4,9 @@
#
# Copyright:: 2017, Rapid7, All Rights Reserved.
include_recipe 'metasploitable::knockd'
include_recipe 'metasploitable::docker'
directory '/opt/knock_knock' do
mode 0700
end
@ -26,7 +29,7 @@ directory '/home/artoo_detoo/music' do
mode 700
end
cookbook_file '/home/artoo_detoo//music/10_of_clubs.wav' do
cookbook_file '/home/artoo_detoo/music/10_of_clubs.wav' do
source 'flags/10_of_clubs.wav'
mode 400
end
@ -44,3 +47,29 @@ bash "load 8 of hearts into DB" do
EOH
not_if "mysql -h 127.0.0.1 --user=\"root\" --password=\"sploitme\" --execute=\"SHOW DATABASES LIKE 'super_secret_db'\" | grep -c drupal"
end
directory '/opt/docker' do
mode 700
end
cookbook_file '/opt/docker/Dockerfile' do
source '/flags/Dockerfile'
mode 700
end
cookbook_file '/opt/docker/7_of_diamonds.zip' do
source '/flags/7_of_diamonds.zip'
mode 700
end
bash 'build docker image for 7 of diamonds' do
code <<-EOH
cd /opt/docker
docker build -t "7_of_diamonds" .
docker run -dit --restart always 7_of_diamonds
EOH
end
file '/opt/docker/7_of_diamonds.zip' do
action :delete
end