Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stick to version and check it from requests and urllib3 #911

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 31 additions & 0 deletions helpers/helpers_emba_dependency_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,43 @@ dependency_check()
# Docker for EMBA with docker
#######################################################################################
if [[ "${USE_DOCKER}" -eq 1 ]] && [[ "${ONLY_DEP}" -ne 2 ]]; then
local TMP_VER=0
check_dep_tool "docker"
check_dep_tool "docker-compose"
check_docker_env
check_cve_search 1
check_dep_tool "inotifywait"
check_dep_tool "notify-send"
print_output " urllib3 version - \\c" "no_log"
TMP_VER=$(pip3 list | grep "^urllib3\ " | awk '{print $2}')
if [[ "$(version "${TMP_VER}")" -ge "$(version "1.99.99")" ]]; then
echo -e "${RED}""not ok""${NC}"
echo -e "${ORANGE}"" urllib3 version ${TMP_VER} - not optimal""${NC}"
echo -e "${ORANGE}"" Downgrade your urllib3 pip package to version <2""${NC}"
DEP_ERROR=1
elif [[ "$(version "${TMP_VER}")" == "0000000000" ]]; then
echo -e "${RED}""not ok""${NC}"
echo -e "${ORANGE}"" urllib3 package missing""${NC}"
echo -e "${ORANGE}"" Install urllib3 pip package with version <2""${NC}"
DEP_ERROR=1
else
echo -e "${GREEN}""ok""${NC}"
fi
print_output " requests version - \\c" "no_log"
TMP_VER=$(pip3 list | grep "^requests\ " | awk '{print $2}')
if [[ "$(version "${TMP_VER}")" -ge "$(version "2.29.0")" ]]; then
echo -e "${RED}""not ok""${NC}"
echo -e "${ORANGE}"" requests version ${TMP_VER} - not optimal""${NC}"
echo -e "${ORANGE}"" Downgrade your requests pip package to version <2.29.0""${NC}"
DEP_ERROR=1
elif [[ "$(version "${TMP_VER}")" == "0000000000" ]]; then
echo -e "${RED}""not ok""${NC}"
echo -e "${ORANGE}"" requests package missing""${NC}"
echo -e "${ORANGE}"" Install requests pip package with version <2.29.0""${NC}"
DEP_ERROR=1
else
echo -e "${GREEN}""ok""${NC}"
fi
fi

#######################################################################################
Expand Down
10 changes: 6 additions & 4 deletions installer/IF20_cve_search.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ IF20_cve_search() {

# we do not need to install the Flask web environment - we do it manually
# python3 -m pip install -r requirements.txt
# stick to requests==2.28.1 -> see also https://github.com/e-m-b-a/emba/issues/187
pip_install "requests==2.28.1"
pip_install "Whoosh==2.7.4"
pip_install "tqdm==4.64.0"
pip_install "pymongo==3.12.1"
Expand All @@ -79,8 +77,12 @@ IF20_cve_search() {
pip_install "dnspython==2.2.1"
pip_install "Werkzeug"
pip_install "python-dateutil"
# pip_install "CveXplore"
pip_install "git+https://github.com/cve-search/CveXplore"
pip_install "CveXplore"
# pip_install "git+https://github.com/cve-search/CveXplore"
# stick to requests<2.29 -> see also https://github.com/e-m-b-a/emba/issues/187
# stick to urllib3<2 -> see also https://github.com/YKonovalov/tf-kolla-ansible/commit/3e92d742715da68d49a1c8e874b4e3defbe3a183
pip_install "requests<2.29.0"
pip_install "urllib3<2"

REDIS_PW="$(tr -dc A-Za-z0-9 </dev/urandom | head -c 13 || true)"

Expand Down