From c61ec9516291b3e0399b845c5c4ff0cb42879b03 Mon Sep 17 00:00:00 2001 From: xeaon Date: Thu, 13 Aug 2020 10:54:40 +0200 Subject: [PATCH] reduce analyzer installation time while your solution to install all analyzer requirements looks clean and easy to understand, i've always been annoyed about how time consuming it is to watch pip & pip3 going through all requirements.txt. I've recently tried to reduce the actual steps by deduplicating all dependencies and combining them, which speeds up the process a lot. --- installation/install-guide.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/installation/install-guide.md b/installation/install-guide.md index b499e6a..9708508 100644 --- a/installation/install-guide.md +++ b/installation/install-guide.md @@ -462,8 +462,10 @@ git clone https://github.com/TheHive-Project/Cortex-Analyzers Each analyzer comes with its own, pip compatible `requirements.txt` file. You can install all requirements with the following commands: ``` -for I in $(find Cortex-Analyzers -name 'requirements.txt'); do sudo -H pip2 install -r $I; done && \ -for I in $(find Cortex-Analyzers -name 'requirements.txt'); do sudo -H pip3 install -r $I || true; done +for I in $(find Cortex-Analyzers -name 'requirements.txt'); do cat >> combined_requirements.txt < $I; sort -u -o combined_requirements.txt combined_requirements.txt; done +sudo -H pip2 install -r combined_requirements.txt +sudo -H pip3 install -r combined_requirements.txt +rm combined_requirements.txt ``` Next, you'll need to tell Cortex where to find the analyzers. Analyzers may be in different directories as shown in this dummy example of the Cortex configuration file (`application.conf`):