diff --git a/monkey/monkey_island/deb-package/DEBIAN_MONGO/postinst b/monkey/monkey_island/deb-package/DEBIAN_MONGO/postinst index 6d6a2e26f..ec37b07a4 100644 --- a/monkey/monkey_island/deb-package/DEBIAN_MONGO/postinst +++ b/monkey/monkey_island/deb-package/DEBIAN_MONGO/postinst @@ -48,14 +48,16 @@ if [ -d "/etc/systemd/network" ]; then fi echo "Creating server certificate..." -${MONKEY_FOLDER}/monkey_island/create_certificate.sh ${MONKEY_FOLDER}/monkey_island/ +${MONKEY_FOLDER}/monkey_island/create_certificate.sh ${MONKEY_FOLDER}/monkey_island/cc echo "Starting services..." service monkey-island start service monkey-mongo start +echo "" echo "Monkey Island installation ended." -echo "The server should be accessible soon via https://localhost:5000/" +echo "The server should be accessible soon via https://:5000/" echo "To check the Island's status, run 'sudo service monkey-island status'" +echo "" exit 0 \ No newline at end of file diff --git a/monkey/monkey_island/linux/create_certificate.sh b/monkey/monkey_island/linux/create_certificate.sh index 78d1b8712..8bb2a5571 100644 --- a/monkey/monkey_island/linux/create_certificate.sh +++ b/monkey/monkey_island/linux/create_certificate.sh @@ -2,6 +2,7 @@ server_root=${1:-"./cc"} +echo "Creating server cetificate. Server root: $server_root" # We override the RANDFILE determined by default openssl.cnf # This is a known issue with the current version of openssl on Ubuntu 18.04 - once they release # a new version, we can delete this command. See @@ -10,8 +11,11 @@ server_root=${1:-"./cc"} dd bs=1024 count=2 ~/.rnd chmod 666 ~/.rnd +echo "Generating key in $server_root/server.key" openssl genrsa -out "$server_root"/server.key 2048 +echo "Generating csr in $server_root/server.csr" openssl req -new -key "$server_root"/server.key -out "$server_root"/server.csr -subj "/C=GB/ST=London/L=London/O=Global Security/OU=Monkey Department/CN=monkey.com" +echo "Generating certificate in $server_root/server.crt" openssl x509 -req -days 366 -in "$server_root"/server.csr -signkey "$server_root"/server.key -out $server_root/server.crt # Shove some new random data into the file to override the original seed.