cliffe / SecGen

Create randomly insecure VMs
GNU General Public License v3.0
2.65k stars 318 forks source link

/usr/bin/apt-get update --fix-missing returned 100 instead of one of [0] #289

Closed AmeliaYeah closed 1 year ago

AmeliaYeah commented 1 year ago

So I seem to be getting this error that I don't think I'm able to solve. I've solved the other errors that popped up but this one seems impossible to me.

This occurs during the actual VM creation process and I'm using the default scenario with Debian 9, or the _modules_bases_debian_stretchserver box. No changes have been applied to the XML config.

Here is the actual vagrant build process (after the project files successfully get completed):

==> escalation: Importing base box 'modules_bases_debian_stretch_server'...
==> escalation: Matching MAC address for NAT networking...
==> escalation: Setting the name of the VM: SecGen20230723_001454_escalation_1690085735257_45021
==> escalation: Clearing any previously set network interfaces...
==> escalation: Preparing network interfaces based on configuration...
    escalation: Adapter 1: nat
    escalation: Adapter 2: hostonly
==> escalation: Forwarding ports...
    escalation: 22 (guest) => 2222 (host) (adapter 1)
==> escalation: Running 'pre-boot' VM customizations...
==> escalation: Booting VM...
==> escalation: Waiting for machine to boot. This may take a few minutes...
    escalation: SSH address: 127.0.0.1:2222
    escalation: SSH username: vagrant
    escalation: SSH auth method: private key
    escalation: 
    escalation: Vagrant insecure key detected. Vagrant will automatically replace
    escalation: this with a newly generated keypair for better security.
    escalation: 
    escalation: Inserting generated public key within guest...
    escalation: Removing insecure key from the guest if it's present...
    escalation: Key inserted! Disconnecting and reconnecting using new SSH key...
==> escalation: Machine booted and ready!
==> escalation: Checking for guest additions in VM...
    escalation: The guest additions on this VM do not match the installed version of
    escalation: VirtualBox! In most cases this is fine, but in rare cases it can
    escalation: prevent things such as shared folders from working properly. If you see
    escalation: shared folder errors, please make sure the guest additions within the
    escalation: virtual machine match the version of VirtualBox you have installed on
    escalation: your host and reload your VM.
    escalation: 
    escalation: Guest Additions Version: 5.1.24
    escalation: VirtualBox Version: 6.1
==> escalation: Setting hostname...
==> escalation: Rsyncing folder: /home/amelia/SecGen/projects/SecGen20230723_001454/environments/ => /tmp/vagrant-puppet/environments
==> escalation: Rsyncing folder: /home/amelia/SecGen/projects/SecGen20230723_001454/puppet/escalation/modules/unix_update/ => /tmp/vagrant-puppet/manifests-8d5990089b7146bd7f3c837ba0ca351f
==> escalation: Rsyncing folder: /home/amelia/SecGen/projects/SecGen20230723_001454/puppet/escalation/modules/ => /tmp/vagrant-puppet/modules-4afbc0408d33fef2c1afe6457a0a6b80
==> escalation: Rsyncing folder: /home/amelia/SecGen/projects/SecGen20230723_001454/puppet/escalation/modules/apache_couchdb/ => /tmp/vagrant-puppet/manifests-5d316620c051e2a7aef0398be93d2a29
==> escalation: Rsyncing folder: /home/amelia/SecGen/projects/SecGen20230723_001454/puppet/escalation/modules/moinmoin_195/ => /tmp/vagrant-puppet/manifests-0f61eab600d5b6db1507d05843119070
==> escalation: Rsyncing folder: /home/amelia/SecGen/projects/SecGen20230723_001454/puppet/escalation/modules/suid_root_less/ => /tmp/vagrant-puppet/manifests-7b2d8d921a1bac801636084216030ede
==> escalation: Rsyncing folder: /home/amelia/SecGen/projects/SecGen20230723_001454/puppet/escalation/modules/apache/ => /tmp/vagrant-puppet/manifests-0650bc51821003ceec691e470aa1dfdc
==> escalation: Rsyncing folder: /home/amelia/SecGen/projects/SecGen20230723_001454/puppet/escalation/modules/phish_me_website/ => /tmp/vagrant-puppet/manifests-7c782fa386c636a3bc5ad63344f58c93
==> escalation: Mounting shared folders...
    escalation: /vagrant => /home/amelia/SecGen/projects/SecGen20230723_001454
==> escalation: Running provisioner: puppet...
==> escalation: Running Puppet with environment production...
==> escalation: Warning: Facter: Error loading fact /tmp/vagrant-puppet/modules-4afbc0408d33fef2c1afe6457a0a6b80/vcsrepo/lib/facter/vcsrepo_svn_ver.rb: /tmp/vagrant-puppet/modules-4afbc0408d33fef2c1afe6457a0a6b80/vcsrepo/lib/facter/vcsrepo_svn_ver.rb:15: syntax error, unexpected keyword_rescue, expecting keyword_end
==> escalation:   rescue StandardError
==> escalation:         ^
==> escalation: Notice: Compiled catalog for secgen-default-scenario-escalation in environment production in 0.16 seconds
==> escalation: Notice: /Stage[main]/Unix_update::Unix/Exec[update]/returns: Ign:1 http://security.debian.org/debian-security stretch/updates InRelease
==> escalation: Notice: /Stage[main]/Unix_update::Unix/Exec[update]/returns: Err:2 http://security.debian.org/debian-security stretch/updates Release
==> escalation: Notice: /Stage[main]/Unix_update::Unix/Exec[update]/returns:   404  Not Found [IP: 199.232.162.132 80]
==> escalation: Notice: /Stage[main]/Unix_update::Unix/Exec[update]/returns: Ign:3 http://cdn-fastly.deb.debian.org/debian stretch InRelease
==> escalation: Notice: /Stage[main]/Unix_update::Unix/Exec[update]/returns: Ign:4 http://cdn-fastly.deb.debian.org/debian stretch-updates InRelease
==> escalation: Notice: /Stage[main]/Unix_update::Unix/Exec[update]/returns: Err:5 http://cdn-fastly.deb.debian.org/debian stretch Release
==> escalation: Notice: /Stage[main]/Unix_update::Unix/Exec[update]/returns:   404  Not Found [IP: 146.75.34.132 80]
==> escalation: Notice: /Stage[main]/Unix_update::Unix/Exec[update]/returns: Err:6 http://cdn-fastly.deb.debian.org/debian stretch-updates Release
==> escalation: Notice: /Stage[main]/Unix_update::Unix/Exec[update]/returns:   404  Not Found [IP: 146.75.34.132 80]
==> escalation: Notice: /Stage[main]/Unix_update::Unix/Exec[update]/returns: Reading package lists...
==> escalation: Notice: /Stage[main]/Unix_update::Unix/Exec[update]/returns: E: The repository 'http://security.debian.org/debian-security stretch/updates Release' does no longer have a Release file.
==> escalation: Notice: /Stage[main]/Unix_update::Unix/Exec[update]/returns: E: The repository 'http://http.debian.net/debian stretch Release' does no longer have a Release file.
==> escalation: Notice: /Stage[main]/Unix_update::Unix/Exec[update]/returns: E: The repository 'http://http.debian.net/debian stretch-updates Release' does no longer have a Release file.
==> escalation: Error: /usr/bin/apt-get update --fix-missing returned 100 instead of one of [0]
==> escalation: Error: /Stage[main]/Unix_update::Unix/Exec[update]/returns: change from notrun to 0 failed: /usr/bin/apt-get update --fix-missing returned 100 instead of one of [0]
==> escalation: Notice: Applied catalog in 156.97 seconds
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
Non-zero exit status...
Error provisioning VMs, destroying VMs and exiting SecGen.
Loading vagrant (destroy -f) in /home/amelia/SecGen/projects/SecGen20230723_001454
==> escalation: Forcing shutdown of VM...
==> escalation: Destroying VM and associated drives...

It appears that since Debian 10/11 don't exist as bases yet that updating won't seem to work, since the URLs do seem dead. Thanks if you're willing to help :>

cliffe commented 1 year ago

Hi -- you will need to open the base box and update the url to the archive mirror. Something like: deb http://archive.debian.org/debian/ stretch contrib main non-free (double check this). You can create a buster base, as we have good compatibility with buster

ST-AR-X commented 1 year ago

Hi -- you will need to open the base box and update the url to the archive mirror. Something like: deb http://archive.debian.org/debian/ stretch contrib main non-free (double check this)

Can I have any help on how to update the base box? Having the same issue here but struggle to find how to update it. I'm still a bit new on vagrant/puppet thing.

Daniel-Ayz commented 1 year ago

same here

Hi -- you will need to open the base box and update the url to the archive mirror. Something like: deb http://archive.debian.org/debian/ stretch contrib main non-free (double check this). You can create a buster base, as we have good compatibility with buster

I am struggling too with the update. where should I rewrite the urls? or what should I update exactly? thx