- packer spawns everything headless

- missing modules added
- php.ini automagically amended to MISP recommendations
pull/3/head
Steve Clement 2017-10-04 13:35:35 +02:00
parent 01a22b84fb
commit cd21b7d957
2 changed files with 20 additions and 4 deletions

View File

@ -9,6 +9,7 @@
"builders": [{ "builders": [{
"type": "virtualbox-iso", "type": "virtualbox-iso",
"headless": "true",
"guest_os_type": "Ubuntu_64", "guest_os_type": "Ubuntu_64",
"format": "ova", "format": "ova",
"vm_name": "{{user `vm_name`}}", "vm_name": "{{user `vm_name`}}",
@ -48,6 +49,7 @@
}, },
{ {
"type": "vmware-iso", "type": "vmware-iso",
"headless": "true",
"guest_os_type": "ubuntu-64", "guest_os_type": "ubuntu-64",
"vm_name": "{{user `vm_name`}}", "vm_name": "{{user `vm_name`}}",
@ -100,6 +102,6 @@
"post-processors":[{ "post-processors":[{
"type": "checksum", "type": "checksum",
"checksum_types": ["sha1", "sha512"] "checksum_types": ["sha1", "sha256", "sha384", "sha512"]
}] }]
} }

View File

@ -12,7 +12,7 @@ DBPASSWORD_MISP="$(openssl rand -hex 32)"
# Webserver configuration # Webserver configuration
PATH_TO_MISP='/var/www/MISP' PATH_TO_MISP='/var/www/MISP'
MISP_BASEURL='http://127.0.0.1' MISP_BASEURL='http://'
MISP_LIVE='1' MISP_LIVE='1'
FQDN='localhost' FQDN='localhost'
@ -31,6 +31,12 @@ GPG_EMAIL_ADDRESS='info@localhost'
GPG_KEY_LENGTH='2048' GPG_KEY_LENGTH='2048'
GPG_PASSPHRASE='' GPG_PASSPHRASE=''
# php.ini configuration
upload_max_filesize=50M
post_max_size=50M
max_execution_time=300
memory_limit=512M
PHP_INI=/etc/php/7.0/apache2/php.ini
@ -96,6 +102,11 @@ sudo a2ensite default-ssl > /dev/null 2>&1
echo "--- Installing PHP-specific packages ---" echo "--- Installing PHP-specific packages ---"
sudo apt-get install -y libapache2-mod-php php php-cli php-crypt-gpg php-dev php-json php-mysql php-opcache php-readline php-redis php-xml > /dev/null 2>&1 sudo apt-get install -y libapache2-mod-php php php-cli php-crypt-gpg php-dev php-json php-mysql php-opcache php-readline php-redis php-xml > /dev/null 2>&1
echo "--- Configuring PHP ---"
for key in upload_max_filesize post_max_size max_execution_time max_input_time memory_limit
do
sudo sed -i "s/^\($key\).*/\1 = $(eval echo \${$key})/" $PHP_INI
done
echo "--- Restarting Apache ---" echo "--- Restarting Apache ---"
sudo systemctl restart apache2 > /dev/null 2>&1 sudo systemctl restart apache2 > /dev/null 2>&1
@ -266,7 +277,7 @@ EOF
sudo chown -R www-data:www-data $PATH_TO_MISP/app/Config sudo chown -R www-data:www-data $PATH_TO_MISP/app/Config
sudo chmod -R 750 $PATH_TO_MISP/app/Config sudo chmod -R 750 $PATH_TO_MISP/app/Config
# Set some MISP directives with the command line tool # Set some MISP directives with the command line tool
sudo $PATH_TO_MISP/app/Console/cake Baseurl $MISP_BASEURL sudo $PATH_TO_MISP/app/Console/cake Baseurl ""
sudo $PATH_TO_MISP/app/Console/cake Live $MISP_LIVE sudo $PATH_TO_MISP/app/Console/cake Live $MISP_LIVE
@ -323,12 +334,15 @@ sudo sed -i -e '$i \sudo -u www-data bash /var/www/MISP/app/Console/worker/start
echo "--- Installing MISP modules... ---" echo "--- Installing MISP modules... ---"
sudo apt-get install -y python3-dev python3-pip libpq5 libjpeg-dev > /dev/null 2>&1 sudo apt-get install -y python3-dev python3-pip libpq5 libjpeg-dev libfuzzy-dev > /dev/null 2>&1
cd /usr/local/src/ cd /usr/local/src/
sudo git clone https://github.com/MISP/misp-modules.git sudo git clone https://github.com/MISP/misp-modules.git
cd misp-modules cd misp-modules
sudo pip3 install -I -r REQUIREMENTS > /dev/null 2>&1 sudo pip3 install -I -r REQUIREMENTS > /dev/null 2>&1
sudo pip3 install -I . > /dev/null 2>&1 sudo pip3 install -I . > /dev/null 2>&1
sudo pip install pymisp python-magic > /dev/null 2>&1
sudo pip install git+https://github.com/kbandla/pydeep.git > /dev/null 2>&1
sudo pip install https://github.com/lief-project/packages/raw/lief-master-latest/pylief-0.7.0.dev.zip
# With systemd: # With systemd:
# sudo cat > /etc/systemd/system/misp-modules.service <<EOF # sudo cat > /etc/systemd/system/misp-modules.service <<EOF
# [Unit] # [Unit]