diff --git a/chef/cookbooks/metasploitable/recipes/system_config.rb b/chef/cookbooks/metasploitable/recipes/system_config.rb new file mode 100644 index 00000000..94f0f873 --- /dev/null +++ b/chef/cookbooks/metasploitable/recipes/system_config.rb @@ -0,0 +1,11 @@ +# See https://www.openssl.org/blog/blog/2021/09/13/LetsEncryptRootCertExpire/ and https://github.com/chef/chef/issues/12126 + +bash 'disable expired DST Root CA X3 certificate' do + code <<-EOS + sed -i 's:^mozilla/DST_Root_CA_X3.crt:!mozilla/DST_Root_CA_X3.crt:' /etc/ca-certificates.conf + update-ca-certificates + EOS + not_if "grep -q '^!mozilla/DST_Root_CA_X3.crt' /etc/ca-certificates.conf" +end + +ENV['SSL_CERT_FILE'] = '/etc/ssl/certs/ca-certificates.crt' diff --git a/chef/dev/ub1404/Vagrantfile b/chef/dev/ub1404/Vagrantfile index ed1859d2..02be4239 100644 --- a/chef/dev/ub1404/Vagrantfile +++ b/chef/dev/ub1404/Vagrantfile @@ -24,6 +24,7 @@ Vagrant.configure("2") do |config| chef.add_recipe "apt::default" chef.add_recipe "iptables::default" + chef.add_recipe "metasploitable:system_config" chef.add_recipe "metasploitable::users" chef.add_recipe "metasploitable::mysql" chef.add_recipe "metasploitable::apache_continuum" diff --git a/packer/templates/ubuntu_1404.json b/packer/templates/ubuntu_1404.json index b6c995be..f99a0919 100644 --- a/packer/templates/ubuntu_1404.json +++ b/packer/templates/ubuntu_1404.json @@ -158,6 +158,8 @@ ], "run_list": [ "apt::default", + "iptables::default", + "metasploitable::system_config", "metasploitable::users", "metasploitable::mysql", "metasploitable::apache_continuum",