V9.14.016.2026.06.06
🛡️ Retrieve DNSSEC status of coresecret.dev. / 🛡️ Retrieve DNSSEC status of coresecret.dev. (push) Has been cancelled
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Has been cancelled
💙 Generating a PUBLIC Live ISO. / 💙 Generating a PUBLIC Live ISO. (push) Has been cancelled
🔐 Generating a Private Live ISO TRIXIE. / 🔐 Generating a Private Live ISO TRIXIE. (push) Has been cancelled
🛡️ Retrieve DNSSEC status of coresecret.dev. / 🛡️ Retrieve DNSSEC status of coresecret.dev. (push) Has been cancelled
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Has been cancelled
💙 Generating a PUBLIC Live ISO. / 💙 Generating a PUBLIC Live ISO. (push) Has been cancelled
🔐 Generating a Private Live ISO TRIXIE. / 🔐 Generating a Private Live ISO TRIXIE. (push) Has been cancelled
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
+24
-24
@@ -30,13 +30,13 @@ guard_sourcing || return "${ERR_GUARD_SRCE}"
|
||||
# 0: on success
|
||||
#######################################
|
||||
hardening_ultra() {
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 %s starting ... \e[0m\n" "${BASH_SOURCE[0]}"
|
||||
printf "\e[95m🧪 %s starting ... \e[0m\n" "${BASH_SOURCE[0]}"
|
||||
|
||||
# shellcheck disable=SC2164
|
||||
cd "${VAR_WORKDIR}"
|
||||
|
||||
### ./config/bootloaders -----------------------------------------------------------------------------------------------------
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 Copying ./config/bootloaders ... \e[0m\n"
|
||||
printf "\e[95m🧪 Copying ./config/bootloaders ... \e[0m\n"
|
||||
|
||||
if [[ ! -d "${VAR_HANDLER_BUILD_DIR}/config/bootloaders" ]]; then
|
||||
|
||||
@@ -49,11 +49,11 @@ hardening_ultra() {
|
||||
|
||||
fi
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ Copying ./config/bootloaders done.\e[0m\n"
|
||||
printf "\e[92m✅ Copying ./config/bootloaders done.\e[0m\n"
|
||||
|
||||
|
||||
### ./config/includes.binary -------------------------------------------------------------------------------------------------
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 Copying ./config/includes.binary ... \e[0m\n"
|
||||
printf "\e[95m🧪 Copying ./config/includes.binary ... \e[0m\n"
|
||||
|
||||
if [[ ! -d "${VAR_HANDLER_BUILD_DIR}/config/includes.binary" ]]; then
|
||||
|
||||
@@ -66,11 +66,11 @@ hardening_ultra() {
|
||||
|
||||
fi
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ Copying ./config/includes.binary done.\e[0m\n"
|
||||
printf "\e[92m✅ Copying ./config/includes.binary done.\e[0m\n"
|
||||
|
||||
|
||||
### ./config/includes.chroot -------------------------------------------------------------------------------------------------
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 Copying ./config/includes.chroot ... \e[0m\n"
|
||||
printf "\e[95m🧪 Copying ./config/includes.chroot ... \e[0m\n"
|
||||
|
||||
if [[ ! -d "${VAR_HANDLER_BUILD_DIR}/config/includes.chroot" ]]; then
|
||||
|
||||
@@ -87,13 +87,13 @@ hardening_ultra() {
|
||||
|
||||
fi
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ Copying ./config/includes.chroot done.\e[0m\n"
|
||||
printf "\e[92m✅ Copying ./config/includes.chroot done.\e[0m\n"
|
||||
|
||||
|
||||
### ./config/hooks/early -----------------------------------------------------------------------------------------------------
|
||||
if [[ -d "${VAR_WORKDIR}/config/hooks/early" ]]; then
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 Copying ./config/hooks/early ... \e[0m\n"
|
||||
printf "\e[95m🧪 Copying ./config/hooks/early ... \e[0m\n"
|
||||
|
||||
if [[ ! -d "${VAR_HANDLER_BUILD_DIR}/config/hooks/early" ]]; then
|
||||
|
||||
@@ -106,13 +106,13 @@ hardening_ultra() {
|
||||
|
||||
fi
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ Copying ./config/hooks/early done.\e[0m\n"
|
||||
printf "\e[92m✅ Copying ./config/hooks/early done.\e[0m\n"
|
||||
|
||||
fi
|
||||
|
||||
|
||||
### ./config/hooks/live ------------------------------------------------------------------------------------------------------
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 Copying ./config/hooks/live ... \e[0m\n"
|
||||
printf "\e[95m🧪 Copying ./config/hooks/live ... \e[0m\n"
|
||||
|
||||
if [[ ! -d "${VAR_HANDLER_BUILD_DIR}/config/hooks/live" ]]; then
|
||||
|
||||
@@ -125,11 +125,11 @@ hardening_ultra() {
|
||||
|
||||
fi
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ Copying ./config/hooks/live done.\e[0m\n"
|
||||
printf "\e[92m✅ Copying ./config/hooks/live done.\e[0m\n"
|
||||
|
||||
|
||||
### ./config/package-lists ---------------------------------------------------------------------------------------------------
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 Copying ./config/package-lists ... \e[0m\n"
|
||||
printf "\e[95m🧪 Copying ./config/package-lists ... \e[0m\n"
|
||||
if [[ ! -d "${VAR_HANDLER_BUILD_DIR}/config/package-lists" ]]; then
|
||||
mkdir -p "${VAR_HANDLER_BUILD_DIR}/config/package-lists"
|
||||
fi
|
||||
@@ -145,7 +145,7 @@ hardening_ultra() {
|
||||
declare arch_comment="# arm64 specific packages"
|
||||
;;
|
||||
*)
|
||||
printf "\e[91m++++ ++++ ++++ ++++ ++++ ++++ ++ ❌ Unsupported architecture '%s'.\e[0m\n" "${VAR_ARCHITECTURE}"
|
||||
printf "\e[91m❌ Unsupported architecture '%s'.\e[0m\n" "${VAR_ARCHITECTURE}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -173,12 +173,12 @@ hardening_ultra() {
|
||||
print
|
||||
}
|
||||
' "${VAR_HANDLER_BUILD_DIR}/config/package-lists/live.list.chroot" >| temp && mv temp "${VAR_HANDLER_BUILD_DIR}/config/package-lists/live.list.chroot"
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ Copying ./config/package-lists done.\e[0m\n"
|
||||
printf "\e[92m✅ Copying ./config/package-lists done.\e[0m\n"
|
||||
|
||||
|
||||
|
||||
### Updating SSH Keys, Ports -------------------------------------------------------------------------------------------------
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 Updating SSH Keys, Ports ... \e[0m\n"
|
||||
printf "\e[95m🧪 Updating SSH Keys, Ports ... \e[0m\n"
|
||||
|
||||
### ./config/includes.chroot/root/.ssh ---------------------------------------------------------------------------------------
|
||||
install -d -m 0700 "${VAR_HANDLER_BUILD_DIR}/config/includes.chroot/root/.ssh"
|
||||
@@ -212,7 +212,7 @@ hardening_ultra() {
|
||||
|
||||
if [[ -z "${line}" ]]; then
|
||||
|
||||
printf "\e[91m++++ ++++ ++++ ++++ ++++ ++++ ++ ❌'ufw default deny forward' not found in: '%s'\e[0m\n" "${file}" >&2
|
||||
printf "\e[91m❌'ufw default deny forward' not found in: '%s'\e[0m\n" "${file}" >&2
|
||||
exit 1
|
||||
|
||||
fi
|
||||
@@ -229,13 +229,13 @@ hardening_ultra() {
|
||||
|
||||
fi
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ Updating SSH Keys, Ports done. \e[0m\n"
|
||||
printf "\e[92m✅ Updating SSH Keys, Ports done. \e[0m\n"
|
||||
|
||||
|
||||
### ./config/includes.chroot/etc/hosts. --------------------------------------------------------------------------------------
|
||||
if [[ -f "${VAR_WORKDIR}/hosts.allow" ]]; then
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 SSH Hardening Ultra ... \e[0m\n"
|
||||
printf "\e[95m🧪 SSH Hardening Ultra ... \e[0m\n"
|
||||
|
||||
mv "${VAR_WORKDIR}/hosts.allow" "${VAR_HANDLER_BUILD_DIR}/config/includes.chroot/etc"
|
||||
mv "${VAR_WORKDIR}/hosts.deny" "${VAR_HANDLER_BUILD_DIR}/config/includes.chroot/etc"
|
||||
@@ -243,7 +243,7 @@ hardening_ultra() {
|
||||
chmod 0644 "${VAR_HANDLER_BUILD_DIR}/config/includes.chroot/etc/hosts.allow"
|
||||
chmod 0644 "${VAR_HANDLER_BUILD_DIR}/config/includes.chroot/etc/hosts.deny"
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ SSH Hardening Ultra done.\e[0m\n"
|
||||
printf "\e[92m✅ SSH Hardening Ultra done.\e[0m\n"
|
||||
|
||||
fi
|
||||
|
||||
@@ -251,7 +251,7 @@ hardening_ultra() {
|
||||
### ./config/hooks/live/9950_hardening_fail2ban.chroot -----------------------------------------------------------------------
|
||||
if ((${#ARY_HANDLER_JUMPHOST[@]} > 0)); then
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 Updating fail2ban Jumphosts IPs ... \e[0m\n"
|
||||
printf "\e[95m🧪 Updating fail2ban Jumphosts IPs ... \e[0m\n"
|
||||
|
||||
# Join array entries with spaces, preserving any newlines
|
||||
declare ips="${ARY_HANDLER_JUMPHOST[*]}"
|
||||
@@ -265,19 +265,19 @@ hardening_ultra() {
|
||||
# Perform an in-place replacement of IGNORE_IP_MUST_BE_SET with the cleaned list
|
||||
sed -i -E "/^[[:space:]]*ignoreip[[:space:]]*=/ s|IGNORE_IP_MUST_BE_SET|${flat_ips}|g" "${VAR_HANDLER_BUILD_DIR}/config/hooks/live/9950_hardening_fail2ban.chroot"
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ Updating fail2ban Jumphosts IPs done. \e[0m\n"
|
||||
printf "\e[92m✅ Updating fail2ban Jumphosts IPs done. \e[0m\n"
|
||||
|
||||
else
|
||||
|
||||
printf "\e[93m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 No jump hosts configured, removing placeholder ... \e[0m\n"
|
||||
printf "\e[93m🧪 No jump hosts configured, removing placeholder ... \e[0m\n"
|
||||
|
||||
sed -i 's/IGNORE_IP_MUST_BE_SET//g' "${VAR_HANDLER_BUILD_DIR}/config/hooks/live/9950_hardening_fail2ban.chroot"
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ Placeholder removed. \e[0m\n"
|
||||
printf "\e[92m✅ Placeholder removed. \e[0m\n"
|
||||
|
||||
fi
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ %s successfully applied. \e[0m\n" "${BASH_SOURCE[0]}"
|
||||
printf "\e[92m✅ %s successfully applied. \e[0m\n" "${BASH_SOURCE[0]}"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user