mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-08-23 11:26:55 +00:00
Compare commits
16 commits
b5e8b2be17
...
f6f9e0bf42
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f6f9e0bf42 | ||
![]() |
5a69b3d460 | ||
![]() |
cbcf7871ec | ||
![]() |
c38fab7670 | ||
![]() |
444b181075 | ||
![]() |
59c6672df7 | ||
![]() |
87733c6b65 | ||
![]() |
f609e20567 | ||
![]() |
78acb5f5c0 | ||
![]() |
99abefe98e | ||
![]() |
82147ba4bd | ||
![]() |
a7af16f69a | ||
![]() |
5e333eba59 | ||
![]() |
c2748f9904 | ||
![]() |
d94207e56e | ||
![]() |
cb8933cddb |
4 changed files with 80 additions and 24 deletions
|
@ -326,11 +326,11 @@ Once you are familiar with how things work you should choose a network you suspe
|
|||
| Distribution Name | x64 | arm64 |
|
||||
| :--------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [Alma Linux OS 9.6 Boot ISO](https://almalinux.org) | [download](https://repo.almalinux.org/almalinux/9.6/isos/x86_64/AlmaLinux-9.6-x86_64-boot.iso) | [download](https://repo.almalinux.org/almalinux/9.6/isos/aarch64/AlmaLinux-9.6-aarch64-boot.iso) |
|
||||
| [Debian 12 Network Install](https://www.debian.org/CD/netinst/index.en.html) | [download](https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.11.0-amd64-netinst.iso) | [download](https://cdimage.debian.org/debian-cd/current/arm64/iso-cd/debian-12.11.0-arm64-netinst.iso) |
|
||||
| [Debian 13 Network Install](https://www.debian.org/CD/netinst/index.en.html) | [download](https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-13.0.0-amd64-netinst.iso) | [download](https://cdimage.debian.org/debian-cd/current/arm64/iso-cd/debian-13.0.0-arm64-netinst.iso) |
|
||||
| [Fedora Server 42 Network Install](https://fedoraproject.org/server/download) | [download](https://download.fedoraproject.org/pub/fedora/linux/releases/42/Server/x86_64/iso/Fedora-Server-netinst-x86_64-42-1.1.iso) | [download](https://download.fedoraproject.org/pub/fedora/linux/releases/42/Server/aarch64/iso/Fedora-Server-netinst-aarch64-42-1.1.iso) |
|
||||
| [OpenSuse Tumbleweed Network Image](https://get.opensuse.org/tumbleweed/#download) | [download](https://download.opensuse.org/tumbleweed/iso/openSUSE-Tumbleweed-NET-x86_64-Current.iso) | [download](https://download.opensuse.org/ports/aarch64/tumbleweed/iso/openSUSE-Tumbleweed-NET-aarch64-Current.iso) |
|
||||
| [Rocky Linux OS 9.6 Boot ISO](https://rockylinux.org/download) | [download](https://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-9.6-x86_64-minimal.iso) | [download](https://download.rockylinux.org/pub/rocky/9/isos/aarch64/Rocky-9.6-aarch64-minimal.iso) |
|
||||
| [Ubuntu 24.04.2 Live Server](https://ubuntu.com/download/server) | [download](https://releases.ubuntu.com/24.04/ubuntu-24.04.2-live-server-amd64.iso) | [download](https://cdimage.ubuntu.com/releases/24.04/release/ubuntu-24.04.2-live-server-arm64.iso) |
|
||||
| [Ubuntu 24.04.3 Live Server](https://ubuntu.com/download/server) | [download](https://releases.ubuntu.com/24.04/ubuntu-24.04.3-live-server-amd64.iso) | [download](https://cdimage.ubuntu.com/releases/24.04/release/ubuntu-24.04.3-live-server-arm64.iso) |
|
||||
|
||||
<br>
|
||||
|
||||
|
|
24
install.sh
24
install.sh
|
@ -206,17 +206,23 @@ if [ ! -f installer/install/tpot.yml ] && [ ! -f tpot.yml ];
|
|||
fi
|
||||
|
||||
# Check type of sudo access
|
||||
sudo -n true > /dev/null 2>&1
|
||||
if [ $? -eq 1 ];
|
||||
if myANSIBLE_TAG="Debian";
|
||||
# Debian 13 - sudo seems to apply stricter settings, we now ask for the become password
|
||||
then
|
||||
myANSIBLE_BECOME_OPTION="--ask-become-pass"
|
||||
echo "### ‘sudo‘ not acquired, setting ansible become option to ${myANSIBLE_BECOME_OPTION}."
|
||||
echo "### Ansible will ask for the ‘BECOME password‘ which is typically the password you ’sudo’ with."
|
||||
echo
|
||||
myANSIBLE_BECOME_OPTION="--become --ask-become-pass"
|
||||
else
|
||||
myANSIBLE_BECOME_OPTION="--become"
|
||||
echo "### ‘sudo‘ acquired, setting ansible become option to ${myANSIBLE_BECOME_OPTION}."
|
||||
echo
|
||||
sudo -n true > /dev/null 2>&1
|
||||
if [ $? -eq 1 ];
|
||||
then
|
||||
myANSIBLE_BECOME_OPTION="--ask-become-pass"
|
||||
echo "### ‘sudo‘ not acquired, setting ansible become option to ${myANSIBLE_BECOME_OPTION}."
|
||||
echo "### Ansible will ask for the ‘BECOME password‘ which is typically the password you ’sudo’ with."
|
||||
echo
|
||||
else
|
||||
myANSIBLE_BECOME_OPTION="--become"
|
||||
echo "### ‘sudo‘ acquired, setting ansible become option to ${myANSIBLE_BECOME_OPTION}."
|
||||
echo
|
||||
fi
|
||||
fi
|
||||
|
||||
# Run Ansible Playbook
|
||||
|
|
24
uninstall.sh
24
uninstall.sh
|
@ -63,17 +63,23 @@ if [[ "${myANSIBLE_DISTRIBUTIONS[@]}" =~ "${myCURRENT_DISTRIBUTION}" ]];
|
|||
fi
|
||||
|
||||
# Check type of sudo access
|
||||
sudo -n true > /dev/null 2>&1
|
||||
if [ $? -eq 1 ];
|
||||
if myANSIBLE_TAG="Debian";
|
||||
# Debian 13 - sudo seems to apply stricter settings, we now ask for the become password
|
||||
then
|
||||
myANSIBLE_BECOME_OPTION="--ask-become-pass"
|
||||
echo "### ‘sudo‘ not acquired, setting ansible become option to ${myANSIBLE_BECOME_OPTION}."
|
||||
echo "### Ansible will ask for the ‘BECOME password‘ which is typically the password you ’sudo’ with."
|
||||
echo
|
||||
myANSIBLE_BECOME_OPTION="--become --ask-become-pass"
|
||||
else
|
||||
myANSIBLE_BECOME_OPTION="--become"
|
||||
echo "### ‘sudo‘ acquired, setting ansible become option to ${myANSIBLE_BECOME_OPTION}."
|
||||
echo
|
||||
sudo -n true > /dev/null 2>&1
|
||||
if [ $? -eq 1 ];
|
||||
then
|
||||
myANSIBLE_BECOME_OPTION="--ask-become-pass"
|
||||
echo "### ‘sudo‘ not acquired, setting ansible become option to ${myANSIBLE_BECOME_OPTION}."
|
||||
echo "### Ansible will ask for the ‘BECOME password‘ which is typically the password you ’sudo’ with."
|
||||
echo
|
||||
else
|
||||
myANSIBLE_BECOME_OPTION="--become"
|
||||
echo "### ‘sudo‘ acquired, setting ansible become option to ${myANSIBLE_BECOME_OPTION}."
|
||||
echo
|
||||
fi
|
||||
fi
|
||||
|
||||
# Run Ansible Playbook
|
||||
|
|
52
update.sh
52
update.sh
|
@ -53,6 +53,7 @@ function fuCHECKINET () {
|
|||
function fuSELFUPDATE () {
|
||||
echo
|
||||
echo "### Now checking for newer files in repository ..."
|
||||
echo "### T-Pot... TPOT_TYPE is set to: $myTPOT_TYPE"
|
||||
git fetch --all
|
||||
myREMOTESTAT=$(git status | grep -c "up-to-date")
|
||||
if [ "$myREMOTESTAT" != "0" ];
|
||||
|
@ -67,13 +68,31 @@ function fuSELFUPDATE () {
|
|||
echo "###### $myBLUE""Found newer version, will be pulling updates and restart myself.""$myWHITE"
|
||||
git reset --hard
|
||||
git pull --force
|
||||
exec ./update.sh -y
|
||||
exit 1
|
||||
else
|
||||
# check if myTPOT_TYPE is set
|
||||
if [ -z "$myTPOT_TYPE" ]; then
|
||||
exec ./update.sh
|
||||
else
|
||||
exec ./update.sh -y $myTPOT_TYPE
|
||||
fi
|
||||
else
|
||||
echo "###### $myBLUE""Pulling updates from repository.""$myWHITE"
|
||||
git reset --hard
|
||||
git pull --force
|
||||
fi
|
||||
if [ -z "$myTPOT_TYPE" ]; then
|
||||
echo
|
||||
else
|
||||
grep -q "^TPOT_TYPE=" .env && sed -i "s/^TPOT_TYPE=.*/TPOT_TYPE=${myTPOT_TYPE}/" .env
|
||||
echo "### T-Pot type set to: $myTPOT_TYPE in .env"
|
||||
if [ "$myTPOT_TYPE" == "SENSOR" ]; then
|
||||
echo "### Copying compose/sensor.yml to docker-compose.yml"
|
||||
cp compose/sensor.yml docker-compose.yml
|
||||
else
|
||||
echo
|
||||
fi
|
||||
fi
|
||||
exit 1
|
||||
|
||||
echo
|
||||
}
|
||||
|
||||
|
@ -194,6 +213,19 @@ function fuRESTORE () {
|
|||
sed -i "s/^TPOT_VERSION=.*/TPOT_VERSION=${newVERSION}/" $HOME/tpotce/.env
|
||||
}
|
||||
|
||||
function fuREADTPOT_TYPE () {
|
||||
if [ -f .env ]; then
|
||||
# reads the TPOT_TYPE from the .env file
|
||||
myTPOT_TYPE=$(grep -E '^TPOT_TYPE=' .env | cut -d '=' -f2)
|
||||
# Verify if TPOT_TYPE is set
|
||||
if [ -z "$myTPOT_TYPE" ]; then
|
||||
myTPOT_TYPE="HIVE"
|
||||
fi
|
||||
else
|
||||
myTPOT_TYPE="HIVE"
|
||||
fi
|
||||
}
|
||||
|
||||
################
|
||||
# Main section #
|
||||
################
|
||||
|
@ -211,11 +243,23 @@ if [ "$1" != "-y" ]; then
|
|||
exit
|
||||
fi
|
||||
|
||||
# if exists second argument, use it as T-Pot type, only if SENSOR or HIVE
|
||||
if [ -n "$2" ]; then
|
||||
if [[ "$2" == "SENSOR" || "$2" == "HIVE" ]]; then
|
||||
myTPOT_TYPE="$2"
|
||||
else
|
||||
myTPOT_TYPE="HIVE"
|
||||
fi
|
||||
else
|
||||
myTPOT_TYPE="HIVE"
|
||||
fi
|
||||
|
||||
fuREADTPOT_TYPE
|
||||
fuCHECK_VERSION
|
||||
fuCHECKINET "https://index.docker.io https://github.com"
|
||||
fuSTOP_TPOT
|
||||
fuBACKUP
|
||||
fuSELFUPDATE "$0" "$@"
|
||||
fuSELFUPDATE "$0" "$@" "$myTPOT_TYPE"
|
||||
fuUPDATER
|
||||
fuRESTORE
|
||||
|
||||
|
|
Loading…
Reference in a new issue