From 9ce2c5eb8386f5fb7f279d161143a29e71af680e Mon Sep 17 00:00:00 2001 From: Shay Nehmad Date: Wed, 8 Jul 2020 15:56:48 +0300 Subject: [PATCH 1/4] Sort and lock pip requirement files --- .gitignore | 3 ++ monkey/infection_monkey/requirements.txt | 28 ++++++------- monkey/monkey_island/requirements.txt | 52 ++++++++++++------------ 3 files changed, 43 insertions(+), 40 deletions(-) diff --git a/.gitignore b/.gitignore index 1536a4841..2f48a6781 100644 --- a/.gitignore +++ b/.gitignore @@ -93,3 +93,6 @@ profiler_logs/ # Server config might contain credentials. Don't commit by default. /monkey/monkey_island/cc/server_config.json + +# Virtualenv +venv/ diff --git a/monkey/infection_monkey/requirements.txt b/monkey/infection_monkey/requirements.txt index dd4addcbd..374aef2fd 100644 --- a/monkey/infection_monkey/requirements.txt +++ b/monkey/infection_monkey/requirements.txt @@ -1,20 +1,20 @@ -impacket -pycryptodome -cffi -requests -odict -paramiko -psutil +WinSys-3.x>=0.5.2 +cffi>=1.14 +ecdsa==0.15 git+https://github.com/guardicore/pyinstaller -ecdsa -netifaces -ipaddress +impacket>=0.9 +ipaddress>=1.0.23 +netifaces>=0.10.9 +odict==1.7.0 +paramiko>=2.7.1 +psutil>=5.7.0 +pycryptodome==3.9.8 +pyftpdlib==1.5.6 +pymssql<3.0 +pypykatz==0.3.12 +requests>=2.24 # Locking WMI since version 1.5 introduced breaking change on Linux agent compilation. # See breaking change here: https://github.com/tjguk/wmi/commit/dcf8e3eca79bb8c0101ffb83e25c066b0ba9e16d # Causes pip to error with: # Could not find a version that satisfies the requirement pywin32 (from wmi->-r /src/infection_monkey/requirements.txt (line 12)) (from versions: none) wmi==1.4.9 ; sys_platform == 'win32' -pymssql<3.0 -pyftpdlib -WinSys-3.x -pypykatz diff --git a/monkey/monkey_island/requirements.txt b/monkey/monkey_island/requirements.txt index aa90c1916..9525d2d33 100644 --- a/monkey/monkey_island/requirements.txt +++ b/monkey/monkey_island/requirements.txt @@ -1,26 +1,26 @@ -pytest -python-dateutil -tornado -werkzeug -flask -Flask-Pymongo -Flask-Restful -Flask-JWT -jsonschema -netifaces -ipaddress -pycryptodome -boto3 -botocore -PyInstaller -awscli -cffi -virtualenv -wheel -mongoengine -mongomock -requests -dpath -ring -stix2 -tqdm +Flask-JWT>=0.3.2 +Flask-Pymongo>=2.3.0 +Flask-Restful>=0.3.8 +PyInstaller>=4.0 +awscli>=1.18 +boto3>=1.14 +botocore>=1.17.18,<1.18.0 +cffi>=1.8,!=1.11.3 +dpath>=2.0 +flask>=1.1 +ipaddress>=1.0.23 +jsonschema==3.2.0 +mongoengine>=0.20 +mongomock>=3.19 +netifaces>=0.10.9 +pycryptodome==3.9.8 +pytest>=5.4 +python-dateutil>=2.1,<3.0.0 +requests>=2.24 +ring>=0.7.3 +stix2>=2.0.2 +tornado>=6.0.4 +tqdm>=4.47 +virtualenv>=20.0.26 +werkzeug>=1.0.1 +wheel>=0.34.2 From 45035cc3c37e471355dab2d26c67af502aa06035 Mon Sep 17 00:00:00 2001 From: Shay Nehmad Date: Wed, 8 Jul 2020 16:04:32 +0300 Subject: [PATCH 2/4] Unlock pyinstaller On systems where you have one venv for agent and server, the pyinstaller version is our own build from the GC repo --- monkey/monkey_island/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey/monkey_island/requirements.txt b/monkey/monkey_island/requirements.txt index 9525d2d33..4a384990d 100644 --- a/monkey/monkey_island/requirements.txt +++ b/monkey/monkey_island/requirements.txt @@ -1,7 +1,7 @@ Flask-JWT>=0.3.2 Flask-Pymongo>=2.3.0 Flask-Restful>=0.3.8 -PyInstaller>=4.0 +PyInstaller awscli>=1.18 boto3>=1.14 botocore>=1.17.18,<1.18.0 From d501bf3b00c6843ec4db6329d4b09e0b23f44a9b Mon Sep 17 00:00:00 2001 From: Shay Nehmad Date: Wed, 8 Jul 2020 16:43:52 +0300 Subject: [PATCH 3/4] Add six minimum requirement to explicitly resolve conflict Added pip freeze to travis to ease debugging --- .travis.yml | 2 ++ monkey/monkey_island/requirements.txt | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e07196159..51fc10ff7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,10 +18,12 @@ os: linux install: # Python +- pip freeze - pip install -r monkey/monkey_island/requirements.txt # for unit tests - pip install flake8 pytest dlint # for next stages - pip install coverage # for code coverage - pip install -r monkey/infection_monkey/requirements.txt # for unit tests +- pip freeze # node + npm + eslint - node --version diff --git a/monkey/monkey_island/requirements.txt b/monkey/monkey_island/requirements.txt index 4a384990d..59428bd0d 100644 --- a/monkey/monkey_island/requirements.txt +++ b/monkey/monkey_island/requirements.txt @@ -1,7 +1,7 @@ Flask-JWT>=0.3.2 Flask-Pymongo>=2.3.0 Flask-Restful>=0.3.8 -PyInstaller +PyInstaller==3.6 awscli>=1.18 boto3>=1.14 botocore>=1.17.18,<1.18.0 @@ -19,6 +19,7 @@ python-dateutil>=2.1,<3.0.0 requests>=2.24 ring>=0.7.3 stix2>=2.0.2 +six>=1.13.0 tornado>=6.0.4 tqdm>=4.47 virtualenv>=20.0.26 From 638e6d61de4e1eac053d54fc39bc9dd246a80d9f Mon Sep 17 00:00:00 2001 From: Shay Nehmad Date: Wed, 8 Jul 2020 17:03:50 +0300 Subject: [PATCH 4/4] Added pipdeptree to build process --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 51fc10ff7..84b8a5f7a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,9 @@ install: - pip install flake8 pytest dlint # for next stages - pip install coverage # for code coverage - pip install -r monkey/infection_monkey/requirements.txt # for unit tests -- pip freeze +- pip install pipdeptree +# Fail builds on possible conflicting dependencies. +- pipdeptree --warn fail # node + npm + eslint - node --version