pull/24/head
Rawane Boubrima 2023-05-25 13:12:11 +02:00
parent 5378398ef5
commit e3cc666e9f
3 changed files with 52 additions and 17 deletions

View File

@ -13,22 +13,58 @@ fi
SHA_SUMS="1 256 384 512" SHA_SUMS="1 256 384 512"
checkInstaller () { checkInstaller () {
for sum in $(echo ${SHA_SUMS}); do if [[ "${FLAVOUR}" == "rhel" ]] || [[ "${FLAVOUR}" == "centos" ]] || [[ "${FLAVOUR}" == "fedora" ]]; then
/usr/bin/wget -q -O scripts/INSTALL.sh.sha${sum} https://raw.githubusercontent.com/MISP/MISP/2.4/INSTALL/INSTALL.sh.sha${sum} INSTsum=$(sha512sum ${0} | cut -f1 -d\ )
INSTsum=$(shasum -a ${sum} scripts/INSTALL.sh | 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 scripts/INSTALL.sh.sha${sum} | cut -f1 -d\ ) chsum=$(cat /tmp/INSTALL.sh.sha512)
if [[ "${chsum}" == "${INSTsum}" ]]; then
if [[ "$chsum" == "$INSTsum" ]]; then echo "SHA512 matches"
echo "sha${sum} matches" else
else echo "SHA512: ${chsum} does not match the installer sum of: ${INSTsum}"
echo "sha${sum}: ${chsum} does not match the installer sum of: ${INSTsum}" # exit 1 # uncomment when/if PR is merged
echo "Deleting installer, please run again." fi
rm scripts/INSTALL.sh else
exit 1 # 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
fi fi
done # 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
} }
#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 # Fetch and check installer
if [[ -f "scripts/INSTALL.sh" ]]; then if [[ -f "scripts/INSTALL.sh" ]]; then
echo "Checking checksums" echo "Checking checksums"

View File

@ -258,7 +258,7 @@
"ssh_pass": "Password1234", "ssh_pass": "Password1234",
"update": "true", "update": "true",
"vm_description": "MISP, is an open source software solution for collecting, storing, distributing and sharing cyber security indicators and threat about cyber security incidents analysis and malware analysis. MISP is designed by and for incident analysts, security and ICT professionals or malware reverser to support their day-to-day operations to share structured informations efficiently.", "vm_description": "MISP, is an open source software solution for collecting, storing, distributing and sharing cyber security indicators and threat about cyber security incidents analysis and malware analysis. MISP is designed by and for incident analysts, security and ICT professionals or malware reverser to support their day-to-day operations to share structured informations efficiently.",
"vm_name": "MISP_rawane_demo", "vm_name": "1",
"vm_version": "2.4" "vm_version": "2.4"
} }
} }

View File

@ -1,5 +1,5 @@
### Base system install ### Base system install
d-i base-installer/kernel/override-image string linux-generic-lts-hwe-20.04 d-i base-installer/kernel/override-image string linux-server
# Account setup # Account setup
d-i passwd/user-fullname string misp d-i passwd/user-fullname string misp
@ -60,8 +60,7 @@ d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-auto-lvm/guided_size string max d-i partman-auto-lvm/guided_size string max
# No proxy, plx # No proxy, plx
#d-i mirror/http/proxy string d-i mirror/http/proxy string
d-i mirror/http/mirror select archive.ubuntu.com
# Whether to upgrade packages after debootstrap. # Whether to upgrade packages after debootstrap.
# Allowed values: none, safe-upgrade, full-upgrade # Allowed values: none, safe-upgrade, full-upgrade