Merge pull request #90 from wickedyoda/fix/critical-security-updates-v2

fix: critical security issues in update and docker setup scripts
This commit is contained in:
WickedYoda authored and GitHub committed 2026-08-05 14:13:54 -05:00
commit 6a574dcf44
3 files changed
+24 -18

No files matched your search

+11 -4
View File
@@ -1,5 +1,10 @@
#remove previous conflicting packages
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt remove $pkg; done
#!/usr/bin/env bash
set -euo pipefail
# Remove previous conflicting packages
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do
sudo apt remove "$pkg" -y
done
#updates, setup souces and install.
sudo install -m 0755 -d /etc/apt/keyrings
@@ -14,8 +19,10 @@ sudo apt update
#install docker
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y
#Adduser to docker
sudo usermod -aG docker $USER && su $USER
# Add user to docker group
sudo usermod -aG docker "$USER"
echo "[*] Added $USER to docker group."
echo "[!] Log out and log back in for Docker group changes to take effect."
# create download dir:
export DOWNLOAD_DIR=$HOME/greenbone-community-container && mkdir -p $DOWNLOAD_DIR
+4 -8
View File
@@ -9,14 +9,10 @@ sh get-docker.sh
# Script: install_docker_compose.sh
# Description: Script to install Docker Compose and its dependencies on Linux
# Install Docker Compose using pip
sudo pip3 install docker-compose
# Download Docker Compose executable
DOCKER_COMPOSE_VERSION=2.20.3
sudo curl -L --fail https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
# Make Docker Compose executable
# Install Docker Compose (v2) binary (standalone method)
DOCKER_COMPOSE_VERSION=2.27.0
sudo curl -L --fail "https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-linux-x86_64" \
-o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# Check if Docker Compose installation was successful
+9 -6
View File
@@ -1,10 +1,13 @@
# /bin/bash
#!/usr/bin/env bash
set -euo pipefail
# Backup of existing sources.list file
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
# Create variable from /etc/os-release file to get ID
ID=$(grep -oP '(?<=^ID=).+' /etc/os-release)
# shellcheck disable=SC1091
. /etc/os-release
ID="${ID:-}"
if [ "$ID" == "debian" ]; then
echo "ID_LIKE is debian"
@@ -22,10 +25,10 @@ fi
if [ "$ID" == "ubuntu" ]; then
echo "ID_LIKE is ubuntu"
echo "Updating sources.list file"
echo "deb http://archive.ubuntu.com/ubuntu/ Minotaur restricted universe multiverse" | sudo tee /etc/apt/sources.list
echo "deb http://archive.ubuntu.com/ubuntu/ Minotaur main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
echo "deb http://archive.ubuntu.com/ubuntu/ Minotaur main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
echo "deb http://security.ubuntu.com/ubuntu Minotaur main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
CODENAME="${VERSION_CODENAME:?missing VERSION_CODENAME}"
echo "deb http://archive.ubuntu.com/ubuntu/ ${CODENAME} main restricted universe multiverse" | sudo tee /etc/apt/sources.list
echo "deb http://archive.ubuntu.com/ubuntu/ ${CODENAME}-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
echo "deb http://security.ubuntu.com/ubuntu ${CODENAME}-security main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
fi
# update repositories