guardicore / monkey

Infection Monkey - An open-source adversary emulation platform
https://www.guardicore.com/infectionmonkey/
GNU General Public License v3.0
6.67k stars 785 forks source link

Remove unnecessary mongo binaries from build artifacts #1913

Closed mssalvatore closed 2 years ago

mssalvatore commented 2 years ago

The Mongo installation includes a number of binaries that are not necessary for Infection Monkey to function. For example, here is the complete listing on Linux:

total 298M
drwxr-x--- 3 ubuntu ubuntu 4.0K Nov  7 23:48 ../
-rwxr-x--- 1 ubuntu ubuntu  13M Nov  7 23:48 bsondump*
-rwxr-x--- 1 ubuntu ubuntu  17M Nov  7 23:48 mongostat*
-rwxr-x--- 1 ubuntu ubuntu  17M Nov  7 23:48 mongoexport*
-rwxr-x--- 1 ubuntu ubuntu  18M Nov  7 23:48 mongoreplay*
-rwxr-x--- 1 ubuntu ubuntu  46M Nov  7 23:48 mongo*
-rwxr-x--- 1 ubuntu ubuntu  17M Nov  7 23:48 mongoimport*
-rwxr-x--- 1 ubuntu ubuntu  18M Nov  7 23:48 mongorestore*
-rwxr-x--- 1 ubuntu ubuntu  39M Nov  7 23:48 mongos*
-rwxr-x--- 1 ubuntu ubuntu  16M Nov  7 23:48 mongotop*
-rwxr-x--- 1 ubuntu ubuntu  17M Nov  7 23:48 mongodump*
-rwxr-x--- 1 ubuntu ubuntu  69M Nov  7 23:48 mongod*
-rwxr-x--- 1 ubuntu ubuntu  17M Nov  7 23:48 mongofiles*
-rw-r----- 1 ubuntu ubuntu  30K Nov  7 23:48 LICENSE-Community.txt
-rwxr-x--- 1 ubuntu ubuntu 7.6K Apr  1 00:16 install_compass*
drwxr-x--- 2 ubuntu ubuntu 4.0K Apr  1 00:16 ./

I suspect we only need mongod and LICENSE-Community.txt

For the AppImage and MSI builds, remove unnecessary binaries.

UPDATE

It appears the AppImage artifact does not contain anything other than the license and mongod binary.

Tasks

ilija-lazoroski commented 2 years ago

I have removed the unneeded binaries from the storage and tested. There is no need of updating the aip file as it gets automatically synchronized.

There is drastic size reduction: from 225Mb to 149Mb for the executable, similar as AppImage and Docker. Also the installation of the MSI: 1.3Gb to 612Mb. Great Success! 😄

image

Old:

image

New:

image