Improved .deb creation and installation process for Ubuntu

Added support for Systemd Units for MongoDB and Island; Some more
installation fixes
This commit is contained in:
itsikkes 2016-07-28 17:42:20 +03:00
parent f8ca808ad5
commit 73d9914923
9 changed files with 62 additions and 8 deletions

View File

@ -1,7 +1,8 @@
Package: gc-monkey-island
Architecture: amd64
Maintainer: Uri Hershcovits <uri@guardicore.com>
Maintainer: Guardicore
Homepage: http://www.guardicore.com
Priority: optional
Version: VERSION
Description: Guardicore Chaos Monkey C&C installation package
Description: Guardicore Infection Monkey Island (C&C) installation package
Depends: openssl, python-pip

View File

@ -13,9 +13,16 @@ pip install -r $MONKEY_FOLDER/pip_requirements.txt --no-index --find-links file:
rm -rf ${INSTALLATION_FOLDER}
rm -f ${MONKEY_FOLDER}/pip_requirements.txt
mv ${MONKEY_FOLDER}/ubuntu/* /etc/init/
cp ${MONKEY_FOLDER}/ubuntu/* /etc/init/
if [ -d "/etc/systemd/network" ]; then
cp ${MONKEY_FOLDER}/ubuntu/systemd/*.service /lib/systemd/system/
chmod +x ${MONKEY_FOLDER}/ubuntu/systemd/start_server.sh
systemctl daemon-reload
fi
${MONKEY_FOLDER}/create_certificate.sh
service monkey-island start
service monkey-mongo start
echo Monkey Island installation ended

View File

@ -5,3 +5,5 @@ service monkey-mongo stop || true
rm -f /etc/init/monkey-island.conf
rm -f /etc/init/monkey-mongo.conf
rm /lib/systemd/system/monkey-island.service
rm /lib/systemd/system/monkey-mongo.service

View File

@ -2,3 +2,5 @@ flask
Flask-Pymongo
Flask-Restful
python-dateutil
impacket
pycrypto

View File

@ -0,0 +1,14 @@
#!/bin/bash
MACHINE_TYPE=`uname -m`
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
# 64-bit stuff here
ARCH=64
else
# 32-bit stuff here
ARCH=32
fi
MONKEY_FILE=monkey-linux-$ARCH
cp -f /var/monkey_island/cc/binaries/$MONKEY_FILE /tmp
/tmp/$MONKEY_FILE m0nk3y $@

View File

@ -0,0 +1,10 @@
[Unit]
Description=Monkey Island Service
After=network.target
[Service]
Type=simple
ExecStart=/var/monkey_island/ubuntu/systemd/start_server.sh
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,12 @@
[Unit]
Description=Monkey Island Mongo Service
After=network.target
[Service]
ExecStart=/var/monkey_island/bin/mongodb/bin/mongod --quiet --dbpath /var/monkey_island/db
KillMode=process
Restart=always
ExecStop=/var/monkey_island/bin/mongodb/bin/mongod --shutdown
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,4 @@
#!/bin/bash
cd /var/monkey_island/cc
python main.py

View File

@ -2,3 +2,5 @@ flask
Flask-Pymongo
Flask-Restful
python-dateutil
impacket
pycrypto