diff --git a/archive.sh b/archive.sh index e2ba41b..2571ff8 100644 --- a/archive.sh +++ b/archive.sh @@ -15,3 +15,4 @@ for VERSION in `echo ${VERSIONS}`; do fi find . -maxdepth 1 -type d -name MISP_v${VERSION}\* -exec rm -rv {} \; done + diff --git a/build_vbox.sh b/build_vbox.sh index c0725d7..01fa9a0 100755 --- a/build_vbox.sh +++ b/build_vbox.sh @@ -13,58 +13,22 @@ fi SHA_SUMS="1 256 384 512" checkInstaller () { -if [[ "${FLAVOUR}" == "rhel" ]] || [[ "${FLAVOUR}" == "centos" ]] || [[ "${FLAVOUR}" == "fedora" ]]; then - INSTsum=$(sha512sum ${0} | cut -f1 -d\ ) - /usr/bin/wget --no-cache -q -O /tmp/INSTALL.sh.sha512 https://raw.githubusercontent.com/MISP/MISP/2.4/INSTALL/INSTALL.sh.sha512 - chsum=$(cat /tmp/INSTALL.sh.sha512) - if [[ "${chsum}" == "${INSTsum}" ]]; then - echo "SHA512 matches" - else - echo "SHA512: ${chsum} does not match the installer sum of: ${INSTsum}" - # exit 1 # uncomment when/if PR is merged - fi - else - # TODO: Implement $FLAVOUR checks and install depending on the platform we are on - if [[ $(which shasum > /dev/null 2>&1 ; echo $?) -ne 0 ]]; then - checkAptLock - sudo apt install libdigest-sha-perl -qyy + for sum in $(echo ${SHA_SUMS}); do + /usr/bin/wget -q -O scripts/INSTALL.sh.sha${sum} https://raw.githubusercontent.com/MISP/MISP/2.4/INSTALL/INSTALL.sh.sha${sum} + INSTsum=$(shasum -a ${sum} scripts/INSTALL.sh | cut -f1 -d\ ) + chsum=$(cat scripts/INSTALL.sh.sha${sum} | cut -f1 -d\ ) + + if [[ "$chsum" == "$INSTsum" ]]; then + echo "sha${sum} matches" + else + echo "sha${sum}: ${chsum} does not match the installer sum of: ${INSTsum}" + echo "Deleting installer, please run again." + rm scripts/INSTALL.sh + exit 1 fi - # SHAsums to be computed, not the -- notatiation is for ease of use with rhash - SHA_SUMS="--sha1 --sha256 --sha384 --sha512" - for sum in $(echo ${SHA_SUMS} |sed 's/--sha//g'); do - /usr/bin/wget --no-cache -q -O /tmp/INSTALL.sh.sha${sum} https://raw.githubusercontent.com/MISP/MISP/2.4/INSTALL/INSTALL.sh.sha${sum} - INSTsum=$(shasum -a ${sum} ${0} | cut -f1 -d\ ) - chsum=$(cat /tmp/INSTALL.sh.sha${sum} | cut -f1 -d\ ) - - if [[ "${chsum}" == "${INSTsum}" ]]; then - echo "sha${sum} matches" - else - echo "sha${sum}: ${chsum} does not match the installer sum of: ${INSTsum}" - echo "Delete installer, re-download and please run again." - exit 1 - fi - done -fi + done } - -#checkInstaller () { -# for sum in $(echo ${SHA_SUMS}); do -# /usr/bin/wget -q -O scripts/INSTALL.sh.sha${sum} https://raw.githubusercontent.com/MISP/MISP/2.4/INSTALL/INSTALL.sh.sha${sum} -# INSTsum=$(shasum -a ${sum} scripts/INSTALL.sh | cut -f1 -d\ ) -# chsum=$(cat scripts/INSTALL.sh.sha${sum} | cut -f1 -d\ ) - -# if [[ "$chsum" == "$INSTsum" ]]; then -# echo "sha${sum} matches" -# else -# echo "sha${sum}: ${chsum} does not match the installer sum of: ${INSTsum}" -# echo "Deleting installer, please run again." -# rm scripts/INSTALL.sh -# exit 1 -# fi -# done -#} - # Fetch and check installer if [[ -f "scripts/INSTALL.sh" ]]; then echo "Checking checksums" diff --git a/config.sh b/config.sh index 7512f56..0bc8b4f 100644 --- a/config.sh +++ b/config.sh @@ -39,6 +39,8 @@ PATH_TO_INSTALLER="scripts/${NAME_OF_INSTALLER}" URL_TO_INSTALLER="https://raw.githubusercontent.com/${REPO}/${BRANCH}/INSTALL/${NAME_OF_INSTALLER}" URL_TO_LICENSE="https://raw.githubusercontent.com/${REPO}/${BRANCH}/LICENSE" +UBUNTU_VERSION="20.04" # Update to Ubuntu 20.04 + if [[ ! -z $DEBUG ]]; then echo "Debug mode enabled." echo "-------------------" diff --git a/misp.json b/misp.json index 197fc82..d731455 100644 --- a/misp.json +++ b/misp.json @@ -248,7 +248,7 @@ "iso_checksum_type": "sha512", "iso_name": "ubuntu-20.04.6-server-amd64.iso", "iso_path": "iso", - "iso_url": "http://cdimage.ubuntu.com/ubuntu/releases/bionic/release/ubuntu-20.04.6-server-amd64.iso", + "iso_url": "http://cdimage.ubuntu.com/ubuntu/releases/focal/release/ubuntu-20.04.6-server-amd64.iso", "memory": "3072", "no_proxy": "{{env `no_proxy`}}", "ovftool_path": "ovftool", diff --git a/preseeds/preseed.cfg b/preseeds/preseed.cfg index 047c32c..a035324 100644 --- a/preseeds/preseed.cfg +++ b/preseeds/preseed.cfg @@ -70,3 +70,4 @@ d-i pkgsel/upgrade select safe-upgrade d-i grub-installer/only_debian boolean true d-i finish-install/reboot_in_progress note + diff --git a/scripts/users.sh b/scripts/users.sh index 5aa3d29..5fec9ed 100644 --- a/scripts/users.sh +++ b/scripts/users.sh @@ -4,12 +4,22 @@ ##useradd -U -G sudo -m -s /bin/bash thehive ##echo -e "thehive1234\nthehive1234" | passwd thehive -echo "--- Configuring sudo " +#echo "--- Configuring sudo " ##echo %thehive ALL=NOPASSWD:ALL > /etc/sudoers.d/thehive -echo "%misp ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/misp +#echo "%misp ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/misp ##chmod 0440 /etc/sudoers.d/thehive -chmod 0440 /etc/sudoers.d/misp +#chmod 0440 /etc/sudoers.d/misp # Disable fancy progressbar -echo 'Dpkg::Progress-Fancy "0";' > /etc/apt/apt.conf.d/99progressbar -echo 'Dpkg::Use-Pty "0";' >> /etc/apt/apt.conf.d/99progressbar +#echo 'Dpkg::Progress-Fancy "0";' > /etc/apt/apt.conf.d/99progressbar +#echo 'Dpkg::Use-Pty "0";' >> /etc/apt/apt.conf.d/99progressbar + + + + +echo "--- Configuring sudo" +echo "misp ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/misp +chmod 0440 /etc/sudoers.d/misp + +echo 'APT::ProgressBar::Fancy "0";' > /etc/apt/apt.conf.d/99progressbar +echo 'APT::Use-Pty "0";' >> /etc/apt/apt.conf.d/99progressbar