V8.02.512.2025.05.30
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
27
config/hooks/live/0000_generate_backup_dir.chroot
Normal file
27
config/hooks/live/0000_generate_backup_dir.chroot
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
mkdir -p /root/.ciss/dlb/backup
|
||||
chmod 0700 /root/.ciss/dlb/backup
|
||||
|
||||
mkdir -p /root/git
|
||||
chmod 0700 /root/git
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
294
config/hooks/live/0001_initramfs_modules.chroot
Normal file
294
config/hooks/live/0001_initramfs_modules.chroot
Normal file
@@ -0,0 +1,294 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.hardened.installer framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
#######################################
|
||||
# Get all NIC Driver of the current Host-machine
|
||||
# Arguments:
|
||||
# None
|
||||
#######################################
|
||||
grep_nic_driver_modules() {
|
||||
declare _mods
|
||||
# Gather all Driver and sort unique
|
||||
readarray -t _mods < <(
|
||||
lspci -k \
|
||||
| grep -A2 -i ethernet \
|
||||
| grep 'Kernel driver in use' \
|
||||
| awk '{print $5}' \
|
||||
| sort -u
|
||||
)
|
||||
|
||||
declare nic_module
|
||||
declare nic_modules
|
||||
if [[ "${#_mods[@]}" -eq 1 ]]; then
|
||||
nic_module="${_mods[0]}"
|
||||
echo "${nic_module}"
|
||||
else
|
||||
nic_modules="${_mods[*]}"
|
||||
echo "${nic_modules}"
|
||||
fi
|
||||
}
|
||||
|
||||
# shellcheck disable=SC2155
|
||||
declare nic_driver="$(grep_nic_driver_modules)"
|
||||
cat << EOF >| /etc/initramfs-tools/modules
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.hardened.installer framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
# List of modules that you want to include in your initramfs.
|
||||
# They will be loaded at boot time in the order below.
|
||||
#
|
||||
# Syntax: module_name [args ...]
|
||||
#
|
||||
# You must run update-initramfs(8) to effect this change.
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# raid1
|
||||
# sd_mod
|
||||
|
||||
### QEMU Bochs-compatible virtual machine support
|
||||
bochs
|
||||
|
||||
### Device-mapper core module (required for all dm_* features)
|
||||
dm_mod
|
||||
|
||||
### Device-mapper integrity target (provides integrity checking)
|
||||
dm-integrity
|
||||
|
||||
### Device-mapper crypt target (provides disk encryption)
|
||||
dm-crypt
|
||||
|
||||
### Generic AES block cipher implementation (used by dm-crypt)
|
||||
aes_generic
|
||||
|
||||
### Generic SHA-256 hashing algorithm (used by various crypto and integrity targets)
|
||||
sha256_generic
|
||||
|
||||
### Generic CRC32C checksum implementation (used by btrfs and other filesystems)
|
||||
crc32c_generic
|
||||
|
||||
### Main btrfs filesystem module
|
||||
btrfs
|
||||
|
||||
### Zstandard compression support for btrfs
|
||||
zstd_compress
|
||||
|
||||
### XOR parity implementation for RAID functionality
|
||||
xor
|
||||
|
||||
### RAID6 parity generation module
|
||||
raid6_pq
|
||||
|
||||
### Combined RAID4/5/6 support module
|
||||
raid456
|
||||
|
||||
### Network Driver Host-machine
|
||||
"${nic_driver}"
|
||||
|
||||
EOF
|
||||
|
||||
cat << 'EOF' >| /etc/initramfs-tools/update-initramfs.conf
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.hardened.installer framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
#
|
||||
# The Configuration file for update-initramfs(8)
|
||||
#
|
||||
|
||||
#
|
||||
# update_initramfs [ yes | all | no ]
|
||||
#
|
||||
# Default is yes
|
||||
# If set to all update-initramfs will update all initramfs
|
||||
# If set to no disables any update to initramfs besides kernel upgrade
|
||||
|
||||
update_initramfs=yes
|
||||
|
||||
#
|
||||
# backup_initramfs [ yes | no ]
|
||||
#
|
||||
# Default is no
|
||||
# If set to no leaves no .bak backup files.
|
||||
|
||||
backup_initramfs=no
|
||||
|
||||
EOF
|
||||
|
||||
cat << 'EOF' >| /etc/initramfs-tools/initramfs.conf
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.hardened.installer framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
#
|
||||
# initramfs.conf
|
||||
# Configuration file for mkinitramfs(8). See initramfs.conf(5).
|
||||
#
|
||||
# Note that configuration options from this file can be overridden
|
||||
# by config files in the /etc/initramfs-tools/conf.d directory.
|
||||
|
||||
#
|
||||
# MODULES: [ most | netboot | dep | list ]
|
||||
#
|
||||
# most - Add most filesystem and all hard-drive drivers.
|
||||
#
|
||||
# dep - Try and guess that module to load.
|
||||
#
|
||||
# netboot - Add the base modules, network modules, but skip block devices.
|
||||
#
|
||||
# list - Only include modules from the 'additional modules' list
|
||||
#
|
||||
|
||||
MODULES=most
|
||||
|
||||
#
|
||||
# BUSYBOX: [ y | n | auto ]
|
||||
#
|
||||
# Use busybox shell and utilities. If set to n, klibc utilities will be used.
|
||||
# If set to auto (or unset), busybox will be used if installed and klibc will
|
||||
# be used otherwise.
|
||||
#
|
||||
|
||||
BUSYBOX=auto
|
||||
|
||||
#
|
||||
# KEYMAP: [ y | n ]
|
||||
#
|
||||
# Load a keymap during the initramfs stage.
|
||||
#
|
||||
|
||||
KEYMAP=n
|
||||
|
||||
#
|
||||
# COMPRESS: [ gzip | bzip2 | lz4 | lzma | lzop | xz | zstd ]
|
||||
#
|
||||
|
||||
COMPRESS=zstd
|
||||
|
||||
#
|
||||
# COMPRESSLEVEL: ...
|
||||
#
|
||||
# Set a compression level for the compressor.
|
||||
# Defaults vary by compressor.
|
||||
#
|
||||
# Valid values are:
|
||||
# 1–9 for gzip|bzip2|lzma|lzop
|
||||
# 0–9 for lz4|xz
|
||||
# 0–19 for zstd
|
||||
# COMPRESSLEVEL=3
|
||||
|
||||
#
|
||||
# DEVICE: ...
|
||||
#
|
||||
# Specify a specific network interface, like eth0
|
||||
# Overridden by optional ip= or BOOTIF= bootarg
|
||||
#
|
||||
|
||||
DEVICE=
|
||||
|
||||
#
|
||||
# NFSROOT: [ auto | HOST:MOUNT ]
|
||||
#
|
||||
|
||||
NFSROOT=auto
|
||||
|
||||
#
|
||||
# RUNSIZE: ...
|
||||
#
|
||||
# The size of the /run tmpfs mount point, like 256M or 10%
|
||||
# Overridden by optional initramfs.runsize= bootarg
|
||||
#
|
||||
|
||||
RUNSIZE=10%
|
||||
|
||||
#
|
||||
# FSTYPE: ...
|
||||
#
|
||||
# The filesystem type(s) to support, or "auto" to use the current root
|
||||
# filesystem type
|
||||
#
|
||||
|
||||
FSTYPE=auto
|
||||
|
||||
EOF
|
||||
|
||||
cat << 'EOF' >> /etc/initramfs-tools/hooks/ciss_debian_live_builder
|
||||
#!/bin/sh
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.hardened.installer framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
set -e
|
||||
|
||||
PREREQ=""
|
||||
prereqs() { echo "$PREREQ"; }
|
||||
case $1 in
|
||||
prereqs) prereqs; exit 0 ;;
|
||||
esac
|
||||
|
||||
. /usr/share/initramfs-tools/hook-functions
|
||||
|
||||
mkdir -p "${DESTDIR}/bin" "${DESTDIR}/usr/bin" "${DESTDIR}/usr/local/bin"
|
||||
|
||||
# Include Bash
|
||||
copy_exec /usr/bin/bash /usr/bin
|
||||
|
||||
# Include lsblk (block device information tool)
|
||||
copy_exec /usr/bin/lsblk /usr/bin
|
||||
|
||||
# Include udevadm (udev management tool)
|
||||
copy_exec /usr/bin/udevadm /usr/bin
|
||||
EOF
|
||||
|
||||
chmod 0755 /etc/initramfs-tools/hooks/ciss_debian_live_builder
|
||||
|
||||
### Regenerate the initramfs for the live system kernel
|
||||
update-initramfs -u -k all
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
144
config/hooks/live/0002_verify_checksums.chroot
Normal file
144
config/hooks/live/0002_verify_checksums.chroot
Normal file
@@ -0,0 +1,144 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.hardened.installer framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
target="/usr/lib/live/boot/0030-verify-checksums"
|
||||
src="$(mktemp)"
|
||||
|
||||
if [[ ! -d /usr/lib/live/boot ]]; then
|
||||
mkdir -p /usr/lib/live/boot
|
||||
fi
|
||||
|
||||
cat << 'EOF' >| "${src}"
|
||||
#!/bin/sh
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.hardened.installer framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
### Changed version of https://salsa.debian.org/live-team/live-boot 'components/0030-verify-checksums'
|
||||
### In case of successful verification of the offered checksums, proceed with booting, else panic.
|
||||
|
||||
### Inside 0002_verify_checksums.chroot ###
|
||||
|
||||
#######################################
|
||||
# Live build ISO with the modified checksum verification script for continuing the boot process.
|
||||
# Globals:
|
||||
# LIVE_BOOT_CMDLINE
|
||||
# LIVE_VERIFY_CHECKSUMS
|
||||
# LIVE_VERIFY_CHECKSUMS_DIGESTS
|
||||
# _CHECKSUM
|
||||
# _CHECKSUMS
|
||||
# _DIGEST
|
||||
# _MOUNTPOINT
|
||||
# _PARAMETER
|
||||
# _RETURN
|
||||
# _TTY
|
||||
# Arguments:
|
||||
# $1: ${_PARAMETER}
|
||||
# Returns:
|
||||
# 0 : Successful Verification
|
||||
#######################################
|
||||
Verify_checksums() {
|
||||
for _PARAMETER in ${LIVE_BOOT_CMDLINE}; do
|
||||
case "${_PARAMETER}" in
|
||||
live-boot.verify-checksums=* | verify-checksums=*)
|
||||
LIVE_VERIFY_CHECKSUMS="true"
|
||||
LIVE_VERIFY_CHECKSUMS_DIGESTS="${_PARAMETER#*verify-checksums=}"
|
||||
;;
|
||||
|
||||
live-boot.verify-checksums | verify-checksums)
|
||||
LIVE_VERIFY_CHECKSUMS="true"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
case "${LIVE_VERIFY_CHECKSUMS}" in
|
||||
true) ;;
|
||||
|
||||
*)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
_MOUNTPOINT="${1}"
|
||||
|
||||
LIVE_VERIFY_CHECKSUMS_DIGESTS="${LIVE_VERIFY_CHECKSUMS_DIGESTS:-sha512 sha384 sha256}"
|
||||
_TTY="/dev/tty8"
|
||||
|
||||
log_begin_msg "Verifying checksums"
|
||||
|
||||
# shellcheck disable=SC2164
|
||||
cd "${_MOUNTPOINT}"
|
||||
|
||||
for _DIGEST in $(echo "${LIVE_VERIFY_CHECKSUMS_DIGESTS}" | sed -e 's|,| |g'); do
|
||||
# shellcheck disable=SC2060
|
||||
_CHECKSUMS="$(echo "${_DIGEST}" | tr [a-z] [A-Z])SUMS ${_DIGEST}sum.txt"
|
||||
|
||||
for _CHECKSUM in ${_CHECKSUMS}; do
|
||||
if [ -e "${_CHECKSUM}" ]; then
|
||||
echo "Found ${_CHECKSUM}..." > "${_TTY}"
|
||||
|
||||
if [ -e "/bin/${_DIGEST}sum" ]; then
|
||||
echo "Checking ${_CHECKSUM}..." > "${_TTY}"
|
||||
|
||||
# Verify checksums
|
||||
grep -v '^#' "${_CHECKSUM}" | /bin/"${_DIGEST}"sum -c > "${_TTY}"
|
||||
_RETURN="${?}"
|
||||
|
||||
# Stop after the first verification
|
||||
# break 2
|
||||
else
|
||||
echo "Not found /bin/${_DIGEST}sum..." > "${_TTY}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
log_end_msg
|
||||
|
||||
case "${_RETURN}" in
|
||||
0)
|
||||
log_success_msg "Verification sha512 sha384 sha256 successful, continuing booting in 10 seconds."
|
||||
sleep 10
|
||||
return 0
|
||||
;;
|
||||
|
||||
*)
|
||||
panic "Verification failed, $(basename ${_TTY}) for more information."
|
||||
;;
|
||||
esac
|
||||
}
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
EOF
|
||||
|
||||
# Copy and make executable
|
||||
install -Dm755 "${src}" "${target}"
|
||||
|
||||
rm -f "${src}"
|
||||
|
||||
unset target src
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
53
config/hooks/live/0050_activate_root.chroot
Normal file
53
config/hooks/live/0050_activate_root.chroot
Normal file
@@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.hardened.installer framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
if [[ ! -f /root/.pwd ]]; then
|
||||
printf "\e[93m++++ ++++ ++++ ++++ ++++ ++++ ++ ❌ /root/.pwd NOT found. \e[0m\n"
|
||||
# sleep 1
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ❌ Exiting Hook ... \e[0m\n"
|
||||
# sleep 1
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' done. Nothing changed. \e[0m\n" "${0}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
cd /root
|
||||
|
||||
cp /etc/shadow /root/.ciss/dlb/backup/shadow.bak."$(date +%F_%T)"
|
||||
chmod 600 /root/.ciss/dlb/backup/shadow.bak.*
|
||||
|
||||
declare hashed_pwd
|
||||
declare safe_hashed_pwd
|
||||
IFS= read -r hashed_pwd < /root/.pwd
|
||||
|
||||
safe_hashed_pwd=$(printf '%s' "${hashed_pwd}" | sed 's/[\/&]/\\&/g')
|
||||
sed -i "s|^root:[^:]*:\(.*\)|root:${safe_hashed_pwd}:\1|" /etc/shadow
|
||||
sed -i "s|^user:[^:]*:\(.*\)|user:${safe_hashed_pwd}:\1|" /etc/shadow
|
||||
unset hashed_pwd safe_hashed_pwd
|
||||
|
||||
cat /etc/shadow
|
||||
# sleep 1
|
||||
|
||||
if shred -vfzu -n 5 /root/.pwd; then
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ Password file /root/.pwd: -vfzu -n 5 >> done. \e[0m\n"
|
||||
else
|
||||
printf "\e[91m++++ ++++ ++++ ++++ ++++ ++++ ++ ❌ Password file /root/.pwd: -vfzu -n 5 >> NOT successful. \e[0m\n" >&2
|
||||
fi
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
31
config/hooks/live/0080_keyboard_layout.chroot
Normal file
31
config/hooks/live/0080_keyboard_layout.chroot
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
cat << 'EOF' >| /etc/default/keyboard
|
||||
XKBMODEL="pc105"
|
||||
XKBLAYOUT="de"
|
||||
XKBVARIANT=""
|
||||
XKBOPTIONS=""
|
||||
BACKSPACE="guess"
|
||||
EOF
|
||||
|
||||
dpkg-reconfigure -f noninteractive keyboard-configuration
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
42
config/hooks/live/0090_haveged.chroot
Normal file
42
config/hooks/live/0090_haveged.chroot
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
apt-get update -y
|
||||
apt-get install --no-install-recommends haveged -y
|
||||
|
||||
cd /root
|
||||
cat << 'EOF' >| /etc/default/haveged
|
||||
# Configuration file for haveged
|
||||
|
||||
# Options to pass to haveged:
|
||||
DAEMON_ARGS="-w 2048 -v 1"
|
||||
EOF
|
||||
|
||||
#mkdir -p /etc/systemd/system/haveged.service.d
|
||||
#cat << 'EOF' >| /etc/systemd/system/haveged.service.d/override.conf
|
||||
#[Service]
|
||||
#NoNewPrivileges=yes
|
||||
#ReadWritePaths=/dev/random /dev/urandom
|
||||
#AmbientCapabilities=
|
||||
#User=haveged
|
||||
#Group=nogroup
|
||||
#EOF
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
34
config/hooks/live/0120_set_hostname.chroot
Normal file
34
config/hooks/live/0120_set_hostname.chroot
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
mv /etc/hostname /root/.ciss/dlb/backup/hostname.bak
|
||||
mv /etc/mailname /root/.ciss/dlb/backup/mailname.bak
|
||||
|
||||
cat << 'EOF' >| /etc/hostname
|
||||
live.local
|
||||
|
||||
EOF
|
||||
|
||||
cat << 'EOF' >| /etc/mailname
|
||||
localhost.local
|
||||
|
||||
EOF
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
40
config/hooks/live/0130_machineid.chroot
Normal file
40
config/hooks/live/0130_machineid.chroot
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
cd /root
|
||||
if [[ -f /var/lib/dbus/machine-id ]]; then
|
||||
rm /var/lib/dbus/machine-id
|
||||
fi
|
||||
|
||||
cat << 'EOF' >| /var/lib/dbus/machine-id
|
||||
b08dfa6083e7567a1921a715000001fb
|
||||
EOF
|
||||
chmod 644 /var/lib/dbus/machine-id
|
||||
|
||||
if [[ -f /etc/machine-id ]]; then
|
||||
rm /etc/machine-id
|
||||
fi
|
||||
|
||||
cat << 'EOF' >| /etc/machine-id
|
||||
b08dfa6083e7567a1921a715000001fb
|
||||
EOF
|
||||
chmod 644 /etc/machine-id
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
162
config/hooks/live/0400_eza_install.chroot
Normal file
162
config/hooks/live/0400_eza_install.chroot
Normal file
@@ -0,0 +1,162 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
cd /root
|
||||
|
||||
repo="ryanoasis/nerd-fonts"
|
||||
latest_release=$(curl -s "https://api.github.com/repos/${repo}/releases/latest" | jq -r .tag_name)
|
||||
download_url="https://github.com/${repo}/releases/download/${latest_release}/Hack.zip"
|
||||
|
||||
wget -qO- https://raw.githubusercontent.com/eza-community/eza/main/deb.asc | gpg --dearmor -o /etc/apt/keyrings/gierens.gpg
|
||||
echo "deb [signed-by=/etc/apt/keyrings/gierens.gpg] http://deb.gierens.de stable main" | tee /etc/apt/sources.list.d/gierens.list
|
||||
chmod 644 /etc/apt/keyrings/gierens.gpg /etc/apt/sources.list.d/gierens.list
|
||||
|
||||
apt-get update -y
|
||||
apt-get install -y eza
|
||||
|
||||
git clone https://github.com/eza-community/eza-themes.git
|
||||
mkdir -p /root/.config/eza
|
||||
|
||||
cat << 'EOF' >| "/root/eza-themes/themes/centurion.yml"
|
||||
colourful: true
|
||||
|
||||
filekinds:
|
||||
normal: {foreground: Default}
|
||||
directory: {foreground: Purple, is_bold: true}
|
||||
symlink: {foreground: Cyan}
|
||||
pipe: {foreground: Yellow}
|
||||
block_device: {foreground: Yellow, is_bold: true}
|
||||
char_device: {foreground: Yellow, is_bold: true}
|
||||
socket: {foreground: Red, is_bold: true}
|
||||
special: {foreground: Yellow}
|
||||
executable: {foreground: Green, is_bold: true}
|
||||
mount_point: {foreground: Purple, is_bold: true, is_underlined: true}
|
||||
|
||||
perms:
|
||||
user_read: {foreground: Yellow, is_bold: true}
|
||||
user_write: {foreground: Red, is_bold: true}
|
||||
user_execute_file: {foreground: Green, is_bold: true, is_underlined: true}
|
||||
user_execute_other: {foreground: Green, is_bold: true}
|
||||
group_read: {foreground: Yellow}
|
||||
group_write: {foreground: Red}
|
||||
group_execute: {foreground: Green}
|
||||
other_read: {foreground: Yellow}
|
||||
other_write: {foreground: Red}
|
||||
other_execute: {foreground: Green}
|
||||
special_user_file: {foreground: Purple}
|
||||
special_other: {foreground: Purple}
|
||||
attribute: {foreground: Default}
|
||||
|
||||
size:
|
||||
major: {foreground: Green, is_bold: true}
|
||||
minor: {foreground: Green}
|
||||
number_byte: {foreground: Green, is_bold: true}
|
||||
number_kilo: {foreground: Green, is_bold: true}
|
||||
number_mega: {foreground: Green, is_bold: true}
|
||||
number_giga: {foreground: Green, is_bold: true}
|
||||
number_huge: {foreground: Green, is_bold: true}
|
||||
unit_byte: {foreground: Green}
|
||||
unit_kilo: {foreground: Green}
|
||||
unit_mega: {foreground: Green}
|
||||
unit_giga: {foreground: Green}
|
||||
unit_huge: {foreground: Green}
|
||||
|
||||
users:
|
||||
user_you: {foreground: Yellow, is_bold: true}
|
||||
user_root: {foreground: Default}
|
||||
user_other: {foreground: Default}
|
||||
group_yours: {foreground: Yellow, is_bold: true}
|
||||
group_other: {foreground: Default}
|
||||
group_root: {foreground: Default}
|
||||
|
||||
links:
|
||||
normal: {foreground: Red, is_bold: true}
|
||||
multi_link_file: {foreground: Red, background: Yellow}
|
||||
|
||||
git:
|
||||
new: {foreground: Green}
|
||||
modified: {foreground: Blue}
|
||||
deleted: {foreground: Red}
|
||||
renamed: {foreground: Yellow}
|
||||
typechange: {foreground: Purple}
|
||||
ignored: {foreground: Default, is_dimmed: true}
|
||||
conflicted: {foreground: Red}
|
||||
|
||||
git_repo:
|
||||
branch_main: {foreground: Green}
|
||||
branch_other: {foreground: Yellow}
|
||||
git_clean: {foreground: Green}
|
||||
git_dirty: {foreground: Yellow}
|
||||
|
||||
security_context:
|
||||
colon: {foreground: Default, is_dimmed: true}
|
||||
user: {foreground: Blue}
|
||||
role: {foreground: Green}
|
||||
typ: {foreground: Yellow}
|
||||
range: {foreground: Cyan}
|
||||
|
||||
file_type:
|
||||
image: {foreground: Purple}
|
||||
video: {foreground: Purple, is_bold: true}
|
||||
music: {foreground: Cyan}
|
||||
lossless: {foreground: Cyan, is_bold: true}
|
||||
crypto: {foreground: Green, is_bold: true}
|
||||
document: {foreground: Green}
|
||||
compressed: {foreground: Red}
|
||||
temp: {foreground: White}
|
||||
compiled: {foreground: Yellow}
|
||||
build: {foreground: Yellow, is_bold: true, is_underlined: true}
|
||||
source: {foreground: Yellow, is_bold: true}
|
||||
|
||||
punctuation: {foreground: DarkGray, is_bold: true}
|
||||
date: {foreground: Cyan}
|
||||
inode: {foreground: Purple}
|
||||
blocks: {foreground: Cyan}
|
||||
header: {foreground: White, is_bold: true, is_underlined: true}
|
||||
octal: {foreground: Purple}
|
||||
flags: {foreground: Default}
|
||||
|
||||
symlink_path: {foreground: Cyan}
|
||||
control_char: {foreground: Red}
|
||||
broken_symlink: {foreground: Red}
|
||||
broken_path_overlay: {foreground: Default, is_underlined: true}
|
||||
|
||||
filenames:
|
||||
# Custom filename-based overrides
|
||||
# Cargo.toml: {icon: {glyph: 🦀}}
|
||||
|
||||
extensions:
|
||||
# Custom extension-based overrides
|
||||
# rs: {filename: {foreground: Red}, icon: {glyph: 🦀}}
|
||||
EOF
|
||||
|
||||
chmod 0644 "/root/eza-themes/themes/centurion.yml"
|
||||
ln -sf "/root/eza-themes/themes/centurion.yml" /root/.config/eza/theme.yml
|
||||
|
||||
mkdir -p /tmp/nerd
|
||||
mkdir -p /root/.local/share/fonts
|
||||
wget --no-clobber --https-only --secure-protocol=TLSv1_3 -P /tmp/nerd "${download_url}"
|
||||
unzip /tmp/nerd/Hack.zip -d /root/.local/share/fonts
|
||||
fc-cache -fv
|
||||
rm -rf /tmp/nerd
|
||||
|
||||
unset repo latest_release download_url
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
28
config/hooks/live/0800_lynis_setup.chroot
Normal file
28
config/hooks/live/0800_lynis_setup.chroot
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
curl -fsSL https://packages.cisofy.com/keys/cisofy-software-public.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/cisofy-software-public.gpg
|
||||
echo "deb [arch=amd64,arm64 signed-by=/etc/apt/trusted.gpg.d/cisofy-software-public.gpg] https://packages.cisofy.com/community/lynis/deb/ stable main" | tee /etc/apt/sources.list.d/cisofy-lynis.list
|
||||
|
||||
apt-get update -y
|
||||
apt-get install -y lynis
|
||||
lynis show version
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
68
config/hooks/live/0810_chrony_setup.chroot
Normal file
68
config/hooks/live/0810_chrony_setup.chroot
Normal file
@@ -0,0 +1,68 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
mkdir -p /var/log/chrony
|
||||
# See https://coresecret.eu/tutorials/debian-package-glossary/ for a brief description of the installed packages.
|
||||
apt-get install chrony -y
|
||||
systemctl enable chrony.service
|
||||
|
||||
mv /etc/chrony/chrony.conf /root/.ciss/dlb/backup/chrony.conf.bak
|
||||
chmod 644 /root/.ciss/dlb/backup/chrony.conf.bak
|
||||
|
||||
cat << 'EOF' >| /etc/chrony/chrony.conf
|
||||
# Include configuration files found in /etc/chrony/conf.d.
|
||||
confdir /etc/chrony/conf.d
|
||||
driftfile /var/lib/chrony/chrony.drift
|
||||
keyfile /etc/chrony/chrony.keys
|
||||
logdir /var/log/chrony
|
||||
ntsdumpdir /var/lib/chrony
|
||||
sourcedir /run/chrony-dhcp
|
||||
sourcedir /etc/chrony/sources.d
|
||||
|
||||
log tracking measurements statistics
|
||||
|
||||
authselectmode require
|
||||
|
||||
server ptbtime1.ptb.de iburst nts minpoll 5 maxpoll 9
|
||||
server ptbtime2.ptb.de iburst nts minpoll 5 maxpoll 9
|
||||
server ptbtime3.ptb.de iburst nts minpoll 5 maxpoll 9
|
||||
server ptbtime4.ptb.de iburst nts noselect minpoll 5 maxpoll 9
|
||||
# server nts.netnod.se iburst nts minpoll 5 maxpoll 9
|
||||
|
||||
# server ntp.ripe.net iburst nts minpoll 5 maxpoll 9
|
||||
# server ntp12.metas.ch iburst nts minpoll 5 maxpoll 9
|
||||
# server ntp2.tecnico.ulisboa.pt iburst nts minpoll 5 maxpoll 9
|
||||
# server time-c-b.nist.gov iburst nts minpoll 5 maxpoll 9
|
||||
server ntp0.fau.de iburst nts minpoll 5 maxpoll 9
|
||||
|
||||
leapsectz right/UTC
|
||||
|
||||
leapsecmode system
|
||||
|
||||
maxupdateskew 100.0
|
||||
|
||||
rtcsync
|
||||
|
||||
makestep 1 3
|
||||
EOF
|
||||
|
||||
chmod 644 /etc/chrony/chrony.conf
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
24
config/hooks/live/0820_kernel_hardening_checker.chroot
Normal file
24
config/hooks/live/0820_kernel_hardening_checker.chroot
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
cd /root/git
|
||||
git clone https://github.com/a13xp0p0v/kernel-hardening-checker.git
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
52
config/hooks/live/0822_ssh_restart_hook.chroot
Normal file
52
config/hooks/live/0822_ssh_restart_hook.chroot
Normal file
@@ -0,0 +1,52 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
cd /root
|
||||
declare target_script="/etc/cron.d/restart-ssh"
|
||||
|
||||
cat << 'EOF' >| "${target_script}"
|
||||
@reboot root /usr/local/bin/restart-ssh.sh
|
||||
EOF
|
||||
|
||||
chmod 644 "${target_script}"
|
||||
|
||||
cat << 'EOF' >| /usr/local/bin/restart-ssh.sh
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
# Script to restart SSH at boot
|
||||
systemctl stop ssh
|
||||
sleep 5
|
||||
systemctl start ssh
|
||||
EOF
|
||||
|
||||
chmod +x /usr/local/bin/restart-ssh.sh
|
||||
unset target_script
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
24
config/hooks/live/0825_my_sqltuner_perl.chroot
Normal file
24
config/hooks/live/0825_my_sqltuner_perl.chroot
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
cd /root/git
|
||||
git clone --depth 1 -b master https://github.com/major/MySQLTuner-perl.git
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
24
config/hooks/live/0830_download_yq.chroot
Normal file
24
config/hooks/live/0830_download_yq.chroot
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
|
||||
chmod +x /usr/bin/yq
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
24
config/hooks/live/0835_testssl.sh.chroot
Normal file
24
config/hooks/live/0835_testssl.sh.chroot
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
cd /root/git
|
||||
git clone https://github.com/testssl/testssl.sh.git
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
28
config/hooks/live/0840_ufw_abuse_ipdb_reporter.chroot
Normal file
28
config/hooks/live/0840_ufw_abuse_ipdb_reporter.chroot
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
apt-get install -y curl
|
||||
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - && \
|
||||
apt-get install -y nodejs
|
||||
|
||||
cd /root/git
|
||||
git clone https://github.com/sefinek/UFW-AbuseIPDB-Reporter.git
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
24
config/hooks/live/0845_harbian_audit.chroot
Normal file
24
config/hooks/live/0845_harbian_audit.chroot
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
cd /root/git
|
||||
git clone https://github.com/hardenedlinux/harbian-audit.git
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
24
config/hooks/live/0850_ssh_audit.chroot
Normal file
24
config/hooks/live/0850_ssh_audit.chroot
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.hardened.installer framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
cd /root/git
|
||||
git clone https://github.com/jtesta/ssh-audit.git
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
67
config/hooks/live/0900_ufw_setup.chroot
Normal file
67
config/hooks/live/0900_ufw_setup.chroot
Normal file
@@ -0,0 +1,67 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
declare -r UFW_OUT_POLICY="deny"
|
||||
declare -r SSHPORT="MUST_BE_SET"
|
||||
|
||||
ufw --force reset
|
||||
|
||||
ufw logging medium
|
||||
|
||||
ufw default deny incoming
|
||||
|
||||
ufw default "${UFW_OUT_POLICY}" outgoing
|
||||
|
||||
ufw default deny forward
|
||||
|
||||
ufw allow in "${SSHPORT}"/tcp comment 'Incoming SSH (Custom-Port)'
|
||||
|
||||
ufw limit "${SSHPORT}"/tcp comment 'Rate-Limit for SSH (Custom-Port)'
|
||||
|
||||
if [[ ${UFW_OUT_POLICY,,} == "deny" ]]; then
|
||||
ufw allow out 21/tcp comment 'Outgoing FTP'
|
||||
ufw allow out 22/tcp comment 'Outgoing SSH'
|
||||
ufw allow out 25/tcp comment 'Outgoing SMTP'
|
||||
ufw allow out 53/tcp comment 'Outgoing DNS'
|
||||
ufw allow out 80/tcp comment 'Outgoing HTTP'
|
||||
ufw allow out 123/tcp comment 'Outgoing NTP'
|
||||
ufw allow out 143/tcp comment 'Outgoing IMAP'
|
||||
ufw allow out 443/tcp comment 'Outgoing HTTPS'
|
||||
ufw allow out 465/tcp comment 'Outgoing SMTPS'
|
||||
ufw allow out 587/tcp comment 'Outgoing SMTPS'
|
||||
ufw allow out 993/tcp comment 'Outgoing IMAPS'
|
||||
ufw allow out 4460/tcp comment 'Outgoing NTS'
|
||||
ufw allow out "${SSHPORT}"/tcp comment 'Outgoing SSH (Custom-Port)'
|
||||
ufw allow out 53/udp comment 'Outgoing DNS'
|
||||
ufw allow out 123/udp comment 'Outgoing NTP'
|
||||
ufw allow out 443/udp comment 'Outgoing QUIC'
|
||||
ufw allow out 853/udp comment 'Outgoing DoQ'
|
||||
fi
|
||||
|
||||
sed -i "/# ok icmp code for FORWARD/i \# ok icmp codes for OUTPUT" /etc/ufw/before.rules
|
||||
sed -i "/# ok icmp code for FORWARD/i \-A ufw-before-output -p icmp --icmp-type destination-unreachable -j ACCEPT" /etc/ufw/before.rules
|
||||
sed -i "/# ok icmp code for FORWARD/i \-A ufw-before-output -p icmp --icmp-type time-exceeded -j ACCEPT" /etc/ufw/before.rules
|
||||
sed -i "/# ok icmp code for FORWARD/i \-A ufw-before-output -p icmp --icmp-type parameter-problem -j ACCEPT" /etc/ufw/before.rules
|
||||
sed -i "/# ok icmp code for FORWARD/i \-A ufw-before-output -p icmp --icmp-type echo-request -j ACCEPT" /etc/ufw/before.rules
|
||||
|
||||
sed -i 's/^ENABLED=no/ENABLED=yes/' /etc/ufw/ufw.conf
|
||||
ln -sf /lib/systemd/system/ufw.service /etc/systemd/system/multi-user.target.wants/ufw.service
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
# TODO: MUST be uncommented
|
||||
cd /root/git
|
||||
# git clone https://git.coresecret.dev/msw/CISS.debian.installer.git
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
33
config/hooks/live/9900_process_accounting.chroot
Normal file
33
config/hooks/live/9900_process_accounting.chroot
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.hardened.installer framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
apt-get install -y acct
|
||||
|
||||
if [[ ! -d /etc/systemd/system/multi-user.target.wants ]]; then
|
||||
mkdir -p /etc/systemd/system/multi-user.target.wants
|
||||
fi
|
||||
|
||||
if ln -s /lib/systemd/system/acct.service /etc/systemd/system/multi-user.target.wants/acct.service; then
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ 'Process Accounting' enabled successful. \e[0m\n"
|
||||
else
|
||||
printf "\e[91m++++ ++++ ++++ ++++ ++++ ++++ ++ ❌ 'Process Accounting' already enabled. \e[0m\n" >&2
|
||||
fi
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
31
config/hooks/live/9910_motd.chroot
Normal file
31
config/hooks/live/9910_motd.chroot
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.hardened.installer framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
mkdir -p /root/.ciss/dlb/backup/update-motd.d
|
||||
cp -af /etc/update-motd.d/* /root/.ciss/dlb/backup/update-motd.d
|
||||
|
||||
cat << 'EOF' >| /etc/update-motd.d/10-uname
|
||||
#!/bin/sh
|
||||
uname -snrm
|
||||
EOF
|
||||
|
||||
chmod 0755 /etc/update-motd.d/10-uname
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' successful applied. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
170
config/hooks/live/9920_deleting_invalid_x509.chroot
Normal file
170
config/hooks/live/9920_deleting_invalid_x509.chroot
Normal file
@@ -0,0 +1,170 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
declare -a search_dirs=("/etc/ssl/certs" "/usr/local/share/ca-certificates" "/usr/share/ca-certificates" "/etc/letsencrypt")
|
||||
declare backup_dir="/root/.ciss/dlb/backup/certificates"
|
||||
declare current_date
|
||||
current_date=$(date +%s)
|
||||
declare -ax expired_certificates=()
|
||||
|
||||
#######################################
|
||||
# Backup Wrapper for all x509 Root CA Certs
|
||||
# Globals:
|
||||
# backup_dir
|
||||
# search_dirs
|
||||
# dir
|
||||
# Arguments:
|
||||
# None
|
||||
#######################################
|
||||
create_backup() {
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 Backup Certificate: '%s' ... \e[0m\n" "${backup_dir}"
|
||||
mkdir -p "${backup_dir}"
|
||||
declare dir=""
|
||||
for dir in "${search_dirs[@]}"; do
|
||||
if [ -d "${dir}" ] && compgen -G "${dir}"/* > /dev/null; then
|
||||
cp -r "${dir}"/* "${backup_dir}"
|
||||
fi
|
||||
done
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ Backup Certificate: '%s' done.\e[0m\n" "${backup_dir}"
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Check the validity of each certificate.
|
||||
# Globals:
|
||||
# CERT
|
||||
# CERT_DATE
|
||||
# CERT_DATE_SECONDS
|
||||
# CURRENT_DATE
|
||||
# DIR
|
||||
# EXPIRED_CERTIFICATES
|
||||
# SEARCH_DIRS
|
||||
# Arguments:
|
||||
# None
|
||||
#######################################
|
||||
check_certificates() {
|
||||
declare dir=""
|
||||
declare cert=""
|
||||
declare cert_date=""
|
||||
declare cert_date_seconds=""
|
||||
for dir in "${search_dirs[@]}"; do
|
||||
while IFS= read -r -d '' cert; do
|
||||
cert_date=$(openssl x509 -in "${cert}" -noout -enddate | sed 's/notAfter=//')
|
||||
cert_date_seconds=$(date -d "${cert_date}" +%s)
|
||||
if [[ ${cert_date_seconds} -lt ${current_date} ]]; then
|
||||
declare -g expired_certificates+=("${cert}")
|
||||
fi
|
||||
done < <(find "${dir}" -type f \( -name "*.crt" -o -name "*.pem" \) -print0)
|
||||
done
|
||||
}
|
||||
# done < <(find "${dir}" -type f -name "*.crt" -o -name "*.pem" -print0)
|
||||
# done < <(find "${DIR}" -type f \( -name "*.crt" -o -name "*.pem" \) -print0)
|
||||
|
||||
#######################################
|
||||
# Find and clean all ca-certificates.crt files in SEARCH_DIRS.
|
||||
# Globals:
|
||||
# CURRENT_DATE
|
||||
# SEARCH_DIRS
|
||||
# cert
|
||||
# line
|
||||
# Arguments:
|
||||
# None
|
||||
#######################################
|
||||
delete_expired_from_all_bundles() {
|
||||
declare dir bundle
|
||||
for dir in "${search_dirs[@]}"; do
|
||||
bundle="${dir}/ca-certificates.crt"
|
||||
if [[ -f ${bundle} ]]; then
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 Checking Root-CA Bundle: '%s' ...\e[0m\n" "${bundle}"
|
||||
declare tmp_bundle="${bundle}.tmp"
|
||||
declare -a block=()
|
||||
declare expired=0
|
||||
declare enddate cert_date_seconds
|
||||
|
||||
: > "${tmp_bundle}"
|
||||
|
||||
declare line=""
|
||||
while IFS= read -r line; do
|
||||
block+=("${line}")
|
||||
if [[ ${line} == "-----END CERTIFICATE-----" ]]; then
|
||||
cert=$(printf "%s\n" "${block[@]}")
|
||||
enddate=$(echo "${cert}" | openssl x509 -noout -enddate 2> /dev/null | sed 's/notAfter=//')
|
||||
if [[ -n ${enddate} ]]; then
|
||||
declare cert_date_seconds=""
|
||||
cert_date_seconds=$(date -d "${enddate}" +%s)
|
||||
if [[ ${cert_date_seconds} -lt ${current_date} ]]; then
|
||||
expired=1
|
||||
else
|
||||
expired=0
|
||||
fi
|
||||
else
|
||||
expired=0
|
||||
fi
|
||||
if [[ ${expired} -eq 0 ]]; then
|
||||
printf "%s\n" "${block[@]}" >> "${tmp_bundle}"
|
||||
else
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ Certificate deleted: '%s' (Expired: %s)\e[0m\n" "${bundle}" "${enddate}"
|
||||
fi
|
||||
block=()
|
||||
fi
|
||||
done < "${bundle}"
|
||||
|
||||
mv -f "${tmp_bundle}" "${bundle}"
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ Checking Root-CA Bundle: '%s' done. \e[0m\n" "${bundle}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 Check certificates in: '%s'.\e[0m\n" "${search_dirs[*]}"
|
||||
create_backup
|
||||
delete_expired_from_all_bundles
|
||||
check_certificates
|
||||
|
||||
if [[ ${#expired_certificates[@]} -eq 0 ]]; then
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ No expired certificates found.\e[0m\n"
|
||||
|
||||
else
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 Expired certificates found:\e[0m\n"
|
||||
|
||||
for exp_cert in "${expired_certificates[@]}"; do
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ '%s'. \e[0m\n" "${exp_cert}"
|
||||
done
|
||||
|
||||
for exp_cert in "${expired_certificates[@]}"; do
|
||||
rm -f "${exp_cert}"
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ Certificate deleted: '%s'.\e[0m\n" "${exp_cert}"
|
||||
basename=$(basename "${exp_cert}")
|
||||
mozilla_entry="mozilla/${basename%.pem}.crt"
|
||||
mozilla_entry="${mozilla_entry%.crt}.crt"
|
||||
declare ca_conf="/etc/ca-certificates.conf"
|
||||
if grep -Fxq "${mozilla_entry}" "${ca_conf}"; then
|
||||
sed -i "s|^${mozilla_entry}$|#${mozilla_entry}|" "${ca_conf}"
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ Entry in ca-certificates.conf deselected: '#%s'.\e[0m\n" "${mozilla_entry}"
|
||||
fi
|
||||
done
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ Updating the certificate cache ... \e[0m\n"
|
||||
update-ca-certificates --fresh
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ Updating the certificate cache done.\e[0m\n"
|
||||
# sleep 1
|
||||
fi
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
64
config/hooks/live/9930_hardening_ssh.chroot
Normal file
64
config/hooks/live/9930_hardening_ssh.chroot
Normal file
@@ -0,0 +1,64 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
cd /etc/ssh || {
|
||||
printf "\e[91mm++++ ++++ ++++ ++++ ++++ ++++ ++ Could not find /etc/ssh \e[0m\n"
|
||||
}
|
||||
rm -rf ssh_host_*key*
|
||||
|
||||
ssh-keygen -o -N "" -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -C "root@live-$(date -I)"
|
||||
ssh-keygen -o -N "" -t rsa -b 8192 -f /etc/ssh/ssh_host_rsa_key -C "root@live-$(date -I)"
|
||||
|
||||
awk '$5 >= 4000' /etc/ssh/moduli >| /etc/ssh/moduli.safe
|
||||
rm -rf /etc/ssh/moduli
|
||||
mv /etc/ssh/moduli.safe /etc/ssh/moduli
|
||||
|
||||
chmod 0600 /etc/ssh/ssh_host_*_key
|
||||
chown root:root /etc/ssh/ssh_host_*_key
|
||||
chmod 0644 /etc/ssh/ssh_host_*_key.pub
|
||||
chown root:root /etc/ssh/ssh_host_*_key.pub
|
||||
|
||||
chmod 600 /etc/ssh/sshd_config /etc/ssh/ssh_config
|
||||
|
||||
touch /root/sshfp
|
||||
ssh-keygen -r @ >| /root/sshfp
|
||||
|
||||
###########################################################################################
|
||||
# Remarks: The file /etc/profile.d/idle-users.sh is created to set two read-only #
|
||||
# environment variables: TMOUT and HISTFILE. #
|
||||
# TMOUT=14400 ensures that users are automatically logged out after 4 hours of inactivity.#
|
||||
# readonly HISTFILE ensures that the command history cannot be changed. #
|
||||
# The chmod +x command ensures that the file is executed in every shell session. #
|
||||
###########################################################################################
|
||||
cat << 'EOF' >| /etc/profile.d/idle-users.sh
|
||||
declare -girx TMOUT=14400
|
||||
EOF
|
||||
|
||||
chmod +x /etc/profile.d/idle-users.sh
|
||||
|
||||
mkdir -p /etc/systemd/system/ssh.service.d
|
||||
cat << 'EOF' >| /etc/systemd/system/ssh.service.d/override.conf
|
||||
[Unit]
|
||||
After=ufw.service
|
||||
Requires=ufw.service
|
||||
EOF
|
||||
chmod 0644 /etc/systemd/system/ssh.service.d/override.conf
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
37
config/hooks/live/9940_hardening_memory.dump.chroot
Normal file
37
config/hooks/live/9940_hardening_memory.dump.chroot
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
cp -u /etc/security/limits.conf /root/.ciss/dlb/backup/limits.conf.bak
|
||||
chmod 0644 /root/.ciss/dlb/backup/limits.conf.bak
|
||||
sed -i "/#* soft core 0/ i\* soft core 0" /etc/security/limits.conf
|
||||
sed -i "/#root hard core 100000/ i\* hard core 0" /etc/security/limits.conf
|
||||
|
||||
if [[ ! -d /etc/systemd/coredump.conf.d ]]; then
|
||||
mkdir -p /etc/systemd/coredump.conf.d
|
||||
fi
|
||||
|
||||
touch /etc/systemd/coredump.conf.d/disable.conf
|
||||
chmod 0644 /etc/systemd/coredump.conf.d/disable.conf
|
||||
cat << EOF >| /etc/systemd/coredump.conf.d/disable.conf
|
||||
[Coredump]
|
||||
Storage=none
|
||||
EOF
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
148
config/hooks/live/9950_fail2ban_hardening.chroot
Normal file
148
config/hooks/live/9950_fail2ban_hardening.chroot
Normal file
@@ -0,0 +1,148 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
cd /root
|
||||
|
||||
cp -u /etc/fail2ban/fail2ban.conf /root/.ciss/dlb/backup/fail2ban.conf.bak
|
||||
chmod 0644 /root/.ciss/dlb/backup/fail2ban.conf.bak
|
||||
|
||||
### https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1024305
|
||||
sed -i 's/#allowipv6 = auto/allowipv6 = auto/1' /etc/fail2ban/fail2ban.conf
|
||||
|
||||
mv /etc/fail2ban/jail.d/defaults-debian.conf /root/.ciss/dlb/backup/defaults-debian.conf.bak
|
||||
chmod 0644 /root/.ciss/dlb/backup/defaults-debian.conf.bak
|
||||
|
||||
cat << 'EOF' >| /etc/fail2ban/jail.d/centurion-default.conf
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <cendev@coresecret.eu>
|
||||
# SPDX-ExternalRef: GIT https://cendev.eu/marc.weidner/CISS.2025.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <cendev@coresecret.eu>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.2025.hardened.installer framework.
|
||||
# SPDX-PackageName: CISS.2025.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
[DEFAULT]
|
||||
usedns = yes
|
||||
# local | vpn
|
||||
ignoreip = 127.0.0.0/8 ::1 MUST_BE_SET
|
||||
maxretry = 8
|
||||
findtime = 24h
|
||||
bantime = 24h
|
||||
|
||||
### SSH Handling: Foreign IP (not in /etc/hosts.allow): refused to connect: immediate ban [sshd-refused]
|
||||
### Jump host mistyped 1–3 times: no ban, only after four attempts [sshd]
|
||||
|
||||
[sshd]
|
||||
enabled = true
|
||||
backend = systemd
|
||||
filter = sshd
|
||||
mode = normal
|
||||
port = MUST_BE_SET
|
||||
protocol = tcp
|
||||
logpath = /var/log/auth.log
|
||||
maxretry = 4
|
||||
findtime = 24h
|
||||
bantime = 24h
|
||||
|
||||
[sshd-refused]
|
||||
enabled = true
|
||||
filter = sshd-refused
|
||||
port = MUST_BE_SET
|
||||
protocol = tcp
|
||||
logpath = /var/log/auth.log
|
||||
maxretry = 1
|
||||
findtime = 24h
|
||||
bantime = 24h
|
||||
|
||||
# ufw aggressive approach:
|
||||
# Any valid client communicating with our server should be going directly to the service ports opened in ufw (ssh, 80, 443, ...).
|
||||
# Any client touching other ports is treated as malicious and therefore should be blocked access to ALL ports after one attempt.
|
||||
|
||||
[ufw]
|
||||
enabled = true
|
||||
filter = ufw.aggressive
|
||||
action = iptables-allports
|
||||
logpath = /var/log/ufw.log
|
||||
maxretry = 1
|
||||
findtime = 24h
|
||||
bantime = 24h
|
||||
protocol = tcp,udp
|
||||
|
||||
EOF
|
||||
|
||||
cat << EOF >| /etc/fail2ban/filter.d/ufw.aggressive.conf
|
||||
[Definition]
|
||||
failregex = ^.*UFW BLOCK.* SRC=<HOST> .*DPT=\d+ .*
|
||||
EOF
|
||||
|
||||
cat << EOF >| /etc/fail2ban/filter.d/sshd-refused.conf
|
||||
[Definition]
|
||||
failregex = ^refused connect from \S+ \(<HOST>\)
|
||||
EOF
|
||||
|
||||
###########################################################################################
|
||||
# Remarks: hardening of fail2ban systemd #
|
||||
###########################################################################################
|
||||
# https://wiki.archlinux.org/title/fail2ban#Service_hardening #
|
||||
# The CapabilityBoundingSet parameters CAP_DAC_READ_SEARCH will allow Fail2ban full read #
|
||||
# access to every directory and file. CAP_NET_ADMIN and CAP_NET_RAW allow Fail2ban to #
|
||||
# operate # on any firewall that has a command-line shell interface. By using #
|
||||
# ProtectSystem=strict the filesystem hierarchy will only be read-only; ReadWritePaths #
|
||||
# allows Fail2ban to have write access on required paths. #
|
||||
###########################################################################################
|
||||
mkdir -p /etc/systemd/system/fail2ban.service.d
|
||||
mkdir /var/log/fail2ban
|
||||
|
||||
cat << 'EOF' >| /etc/systemd/system/fail2ban.service.d/override.conf
|
||||
[Service]
|
||||
PrivateDevices=yes
|
||||
PrivateTmp=yes
|
||||
ProtectHome=read-only
|
||||
ProtectSystem=strict
|
||||
ReadWritePaths=-/var/run/fail2ban
|
||||
ReadWritePaths=-/var/lib/fail2ban
|
||||
ReadWritePaths=-/var/log/fail2ban
|
||||
ReadWritePaths=-/var/spool/postfix/maildrop
|
||||
ReadWritePaths=-/run/xtables.lock
|
||||
CapabilityBoundingSet=CAP_AUDIT_READ CAP_DAC_READ_SEARCH CAP_NET_ADMIN CAP_NET_RAW
|
||||
|
||||
### Added by CISS.debian.live.builder
|
||||
ProtectClock=true
|
||||
ProtectHostname=true
|
||||
|
||||
EOF
|
||||
|
||||
cat << 'EOF' >> /etc/fail2ban/fail2ban.local
|
||||
[Definition]
|
||||
logtarget = /var/log/fail2ban/fail2ban.log
|
||||
EOF
|
||||
|
||||
###########################################################################################
|
||||
# Remarks: Logrotate must be updated either #
|
||||
###########################################################################################
|
||||
cp -a /etc/logrotate.d/fail2ban /root/.ciss/dlb/backup/fail2ban_logrotate.bak
|
||||
sed -i 's/\/var\/log\/fail2ban.log/\/var\/log\/fail2ban\/fail2ban.log/1' /etc/logrotate.d/fail2ban
|
||||
touch /var/log/fail2ban/fail2ban.log
|
||||
chmod 640 /var/log/fail2ban/fail2ban.log
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
31
config/hooks/live/9960_disable_services.chroot
Normal file
31
config/hooks/live/9960_disable_services.chroot
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
###########################################################################################
|
||||
# Remarks: Turn off Energy saving mode and ctrl-alt-del #
|
||||
###########################################################################################
|
||||
declare target=""
|
||||
for target in sleep.target suspend.target hibernate.target hybrid-sleep.target ctrl-alt-del.target; do
|
||||
ln -sf /dev/null "/etc/systemd/system/${target}"
|
||||
done
|
||||
|
||||
unset target
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
40
config/hooks/live/9970_remove_exim.chroot
Normal file
40
config/hooks/live/9970_remove_exim.chroot
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
cd /etc
|
||||
|
||||
apt-get purge exim4 -y
|
||||
apt-get purge exim4-base -y
|
||||
apt-get purge exim4-config -y
|
||||
|
||||
apt-get autoremove -y
|
||||
apt-get autoclean -y
|
||||
apt-get autopurge -y
|
||||
|
||||
apt-mark hold exim4 exim4-daemon-light exim4-base exim4-config
|
||||
|
||||
apt-get update -y
|
||||
apt-get upgrade -y
|
||||
|
||||
if [[ -d /etc/exim4 ]]; then
|
||||
rm -rf /etc/exim4
|
||||
fi
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
45
config/hooks/live/9980_usb_guard.chroot
Normal file
45
config/hooks/live/9980_usb_guard.chroot
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
apt-get install -y usbguard
|
||||
|
||||
# sleep 1
|
||||
|
||||
# Preparing USBGuard: see https://www.privacy-handbuch.de/handbuch_91a.htm
|
||||
touch /tmp/rules.conf
|
||||
usbguard generate-policy >> /tmp/rules.conf
|
||||
|
||||
if [[ -f /etc/usbguard/rules.conf && -s /etc/usbguard/rules.conf ]]; then
|
||||
mv /etc/usbguard/rules.conf /root/.ciss/dlb/backup/usbguard_rules.conf.bak
|
||||
cp -a /tmp/rules.conf /etc/usbguard/rules.conf
|
||||
chmod 0600 /etc/usbguard/rules.conf
|
||||
else
|
||||
rm -f /etc/usbguard/rules.conf
|
||||
cp -a /tmp/rules.conf /etc/usbguard/rules.conf
|
||||
chmod 0600 /etc/usbguard/rules.conf
|
||||
fi
|
||||
|
||||
cp -a /etc/usbguard/usbguard-daemon.conf /root/.ciss/dlb/backup/usbguard-daemon.conf.bak
|
||||
sed -i "s/PresentDevicePolicy=apply-policy/PresentDevicePolicy=allow/" /etc/usbguard/usbguard-daemon.conf
|
||||
# sleep 1
|
||||
|
||||
rm -f /tmp/rules.conf
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
77
config/hooks/live/9985_clamav.chroot
Normal file
77
config/hooks/live/9985_clamav.chroot
Normal file
@@ -0,0 +1,77 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
mkdir -p /etc/systemd/system/clamav-daemon.service.d
|
||||
cat << 'EOF' >| /etc/systemd/system/clamav-daemon.service.d/override.conf
|
||||
[Service]
|
||||
User=clamav
|
||||
Group=clamav
|
||||
ProtectSystem=full
|
||||
ProtectHome=read-only
|
||||
PrivateTmp=yes
|
||||
NoNewPrivileges=yes
|
||||
PermissionsStartOnly=true
|
||||
ExecStartPre=/bin/mkdir -p /run/clamav
|
||||
ExecStartPre=/bin/chown clamav:clamav /run/clamav
|
||||
ExecStartPre=/bin/chmod 750 /run/clamav
|
||||
|
||||
ReadOnlyPaths=/
|
||||
ReadWritePaths=/var/lib/clamav /var/log/clamav /var/run/clamav /run/clamav
|
||||
|
||||
MemoryDenyWriteExecute=yes
|
||||
MemoryLimit=512M
|
||||
CPUShares=512
|
||||
|
||||
RestrictAddressFamilies=AF_INET AF_INET6
|
||||
RestrictNamespaces=yes
|
||||
RestrictRealtime=yes
|
||||
SystemCallFilter=@system-service
|
||||
CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_SYS_NICE
|
||||
|
||||
EOF
|
||||
chmod 0644 /etc/systemd/system/clamav-daemon.service.d/override.conf
|
||||
|
||||
mkdir -p /etc/systemd/system/clamav-freshclam.service.d
|
||||
cat << 'EOF' >| /etc/systemd/system/clamav-freshclam.service.d/override.conf
|
||||
[Service]
|
||||
User=clamav
|
||||
Group=clamav
|
||||
ProtectSystem=full
|
||||
ProtectHome=read-only
|
||||
PrivateTmp=yes
|
||||
NoNewPrivileges=yes
|
||||
|
||||
ReadOnlyPaths=/
|
||||
ReadWritePaths=/var/lib/clamav /var/log/clamav /var/run/clamav
|
||||
|
||||
MemoryDenyWriteExecute=yes
|
||||
MemoryLimit=512M
|
||||
CPUShares=512
|
||||
|
||||
RestrictAddressFamilies=AF_INET AF_INET6
|
||||
RestrictNamespaces=yes
|
||||
RestrictRealtime=yes
|
||||
SystemCallFilter=@system-service
|
||||
CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_SYS_NICE
|
||||
|
||||
EOF
|
||||
chmod 0644 /etc/systemd/system/clamav-freshclam.service.d/override.conf
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
59
config/hooks/live/9990_final_purge.chroot
Normal file
59
config/hooks/live/9990_final_purge.chroot
Normal file
@@ -0,0 +1,59 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
apt-get update -y
|
||||
|
||||
apt-get purge -y exim4 exim4-daemon-light exim4-base exim4-config \
|
||||
qemu-guest-agent rmail sendmail-base sendmail-bin sendmail-cf sensible-mda sendmail-doc
|
||||
|
||||
apt-mark hold exim4 exim4-daemon-light exim4-base exim4-config \
|
||||
qemu-guest-agent rmail sendmail-base sendmail-bin sendmail-cf sensible-mda sendmail-doc
|
||||
|
||||
dpkg --get-selections | grep deinstall >> /tmp/deinstall.log || true
|
||||
|
||||
if [[ -s /tmp/deinstall.log ]]; then
|
||||
printf "\n"
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 Packages to purge ... \e[0m\n"
|
||||
sed -i 's!deinstall!!' /tmp/deinstall.log
|
||||
while IFS= read -r line; do
|
||||
declare trimmed_string
|
||||
trimmed_string=$(echo "$line" | awk '{$1=$1};1')
|
||||
echo "y" | apt-get purge "${trimmed_string}"
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ Package '%s' purged. \e[0m\n" "${trimmed_string}"
|
||||
# sleep 1
|
||||
done < /tmp/deinstall.log
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ Packages to purge done. \e[0m\n"
|
||||
else
|
||||
printf "\n"
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ No Packages to purge, proceeding with clean up. \e[0m\n"
|
||||
fi
|
||||
|
||||
apt-get update -y
|
||||
apt-get upgrade -y
|
||||
|
||||
rm -f /tmp/deinstall.log
|
||||
rm -fr /opt/udebs
|
||||
apt-get autoclean -y
|
||||
apt-get autoremove -y
|
||||
apt-get autopurge -y
|
||||
|
||||
updatedb
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' successful applied. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
105
config/hooks/live/9991_file_permissions.chroot
Normal file
105
config/hooks/live/9991_file_permissions.chroot
Normal file
@@ -0,0 +1,105 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
chmod 0644 /etc/banner
|
||||
chmod 0644 /etc/issue
|
||||
chmod 0644 /etc/issue.net
|
||||
|
||||
if [[ -f /etc/motd ]]; then
|
||||
cp -a /etc/motd /root/.ciss/dlb/backup/motd.bak
|
||||
chmod 0644 /root/.ciss/dlb/backup/motd.bak
|
||||
rm /etc/motd
|
||||
fi
|
||||
|
||||
touch /etc/motd
|
||||
cat << EOF >| /etc/motd
|
||||
|
||||
(c) Marc S. Weidner, 2018 - 2025
|
||||
(p) Centurion Press, 2018 - 2025
|
||||
Centurion Intelligence Consulting Agency (tm)
|
||||
https://coresecret.eu/
|
||||
Please consider making a donation:
|
||||
https://coresecret.eu/spenden/
|
||||
|
||||
|
||||
EOF
|
||||
|
||||
cp -a /etc/login.defs /root/.ciss/dlb/backup/login.defs.bak
|
||||
|
||||
sed -i 's/UMASK 022/UMASK 077/' /etc/login.defs
|
||||
sed -i 's/PASS_MAX_DAYS 99999/PASS_MAX_DAYS 16384/' /etc/login.defs
|
||||
sed -i 's/PASS_MIN_DAYS 0/PASS_MIN_DAYS 1/' /etc/login.defs
|
||||
sed -i 's/PASS_WARN_AGE 7/PASS_WARN_AGE 128/' /etc/login.defs
|
||||
sed -i 's/ENCRYPT_METHOD SHA512/ENCRYPT_METHOD YESCRYPT/' /etc/login.defs
|
||||
sed -i 's/#SHA_CRYPT_MIN_ROUNDS 5000/SHA_CRYPT_MIN_ROUNDS 8388608/' /etc/login.defs
|
||||
sed -i 's/#SHA_CRYPT_MAX_ROUNDS 5000/SHA_CRYPT_MAX_ROUNDS 8388608/' /etc/login.defs
|
||||
sed -i 's/#YESCRYPT_COST_FACTOR 5/YESCRYPT_COST_FACTOR 8/' /etc/login.defs
|
||||
|
||||
if [[ -f /etc/cron.deny ]]; then
|
||||
rm /etc/cron.deny
|
||||
fi
|
||||
|
||||
if [[ -f /etc/cron.allow ]]; then
|
||||
cp -u /etc/cron.allow /root/.backup/cron.allow.bak
|
||||
chmod 644 /root/.backup/cron.allow.bak
|
||||
chmod 600 /etc/cron.allow
|
||||
cat << EOF >| /etc/cron.allow
|
||||
root
|
||||
EOF
|
||||
|
||||
else
|
||||
touch /etc/cron.allow
|
||||
chmod 0600 /etc/cron.allow
|
||||
cat << EOF >| /etc/cron.allow
|
||||
root
|
||||
EOF
|
||||
fi
|
||||
|
||||
chmod g-wx,o-rwx /etc/cron.allow
|
||||
chown root:root /etc/cron.allow
|
||||
chmod 0640 /etc/shadow
|
||||
chown root:shadow /etc/shadow
|
||||
|
||||
chmod 0700 /etc/cron.d /etc/cron.daily /etc/cron.hourly /etc/cron.monthly /etc/cron.weekly
|
||||
chmod 0700 /etc/sudoers.d
|
||||
chmod 0600 /etc/crontab
|
||||
|
||||
chmod 0600 /etc/ssh/sshd_config /etc/ssh/ssh_config
|
||||
|
||||
chmod 0750 /home
|
||||
|
||||
if chmod 0750 /var/spool/apt-mirror; then :; fi
|
||||
|
||||
mkdir /root/.ansible
|
||||
|
||||
declare bin
|
||||
declare target
|
||||
for bin in as gcc g++ cc clang; do
|
||||
target=$(readlink -f "/usr/bin/${bin}") || {
|
||||
printf "\e[92m✅ Info: '%s' not found, skipping. \e[0m\n" "${bin}"
|
||||
continue
|
||||
}
|
||||
chmod 700 "${target}" || {
|
||||
printf "\e[92m❌ Error: chmod failed for '%s', skipping. \e[0m\n" "${bin}"
|
||||
}
|
||||
done
|
||||
unset bin target
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' successful applied. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
52
config/hooks/live/9992_password_expiration.chroot
Normal file
52
config/hooks/live/9992_password_expiration.chroot
Normal file
@@ -0,0 +1,52 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.hardened.installer framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
if ! command -v chage &>/dev/null; then
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ Info: 'chage' NOT found. Exiting hook ... \e[0m\n"
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
declare -i max_days=16384
|
||||
mapfile -t users_to_update < <(
|
||||
awk -F: '$2 !~ /^[!*]/ { print $1 }' /etc/shadow
|
||||
)
|
||||
|
||||
if [[ ${#users_to_update[@]} -eq 0 ]]; then
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ No enabled-login accounts found in /etc/shadow. Exiting hook ... \e[0m\n"
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
declare user
|
||||
for user in "${users_to_update[@]}"; do
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ Setting max password age for user '%s' to '%s' days. \e[0m\n" "${user}" "${max_days}"
|
||||
chage --maxdays "$max_days" "$user"
|
||||
done
|
||||
|
||||
unset max_days user users_to_update
|
||||
|
||||
awk -F: '$2 !~ /^\$[0-9]/ && length($2)==13 { print $1,$2 }' /etc/shadow
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ All applicable accounts have been updated. \e[0m\n"
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
32
config/hooks/live/9993_aide.chroot
Normal file
32
config/hooks/live/9993_aide.chroot
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.hardened.installer framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
apt-get install -y aide
|
||||
|
||||
cp -u /etc/aide/aide.conf /root/.ciss/dlb/backup/aide.conf.bak
|
||||
sed -i "s/Checksums = H/Checksums = sha512/" /etc/aide/aide.conf
|
||||
|
||||
if aideinit; then
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ 'aideinit' successful. \e[0m\n"
|
||||
else
|
||||
printf "\e[91m++++ ++++ ++++ ++++ ++++ ++++ ++ ❌ 'aideinit' NOT successful. \e[0m\n" >&2
|
||||
fi
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
135
config/hooks/live/9994_password_policy.chroot
Normal file
135
config/hooks/live/9994_password_policy.chroot
Normal file
@@ -0,0 +1,135 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.hardened.installer framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
### NIST recommends at least eight characters but advises longer passphrases (e.g., 12–64) for increased security.
|
||||
### NIST SP 800–63B, https://pages.nist.gov/800-63-3/sp800-63b.html
|
||||
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
cp -a /etc/security/pwquality.conf /root/.ciss/dlb/backup/pwquality.conf.bak
|
||||
chmod 0644 /root/.ciss/dlb/backup/pwquality.conf.bak
|
||||
|
||||
cat << 'EOF' >| /etc/security/pwquality.conf
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.hardened.installer framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
### Current recommendations for '/etc/security/pwquality.conf' based on common best practices,
|
||||
### including NIST SP 800–63B, https://pages.nist.gov/800-63-3/sp800-63b.html
|
||||
### and weighing usability against security.
|
||||
|
||||
### Configuration for systemwide password quality limits
|
||||
### Defaults:
|
||||
|
||||
### Number of characters in the new password that must not be present in the
|
||||
### old password.
|
||||
difok = 4
|
||||
|
||||
### Length over complexity: Studies show that longer passphrases are significantly more
|
||||
### resistant to brute-force and dictionary attacks. NIST recommends at least eight characters
|
||||
### but advises longer passphrases (e.g., 12–64) for increased security. Twenty characters strike a
|
||||
### good balance between security and user convenience.
|
||||
### Minimum acceptable size for the new password (plus one if
|
||||
### credits are not disabled, which is the default). (See pam_cracklib manual.)
|
||||
### Cannot be set to a lower value than 6.
|
||||
minlen = 20
|
||||
|
||||
### dcredit = 0, ucredit = 0, lcredit = 0, ocredit = 0, minclass = 0
|
||||
### NIST SP 800–63B advises against rigid complexity rules (numbers, symbols, uppercase)
|
||||
### because they can lead users to adopt predictable patterns (e.g., “Pa$$word!”).
|
||||
### Length and dictionary checks are more effective.
|
||||
|
||||
### The maximum credit for having digits in the new password. If less than 0
|
||||
### it is the minimum number of digits in the new password.
|
||||
dcredit = 0
|
||||
|
||||
### The maximum credit for having uppercase characters in the new password.
|
||||
### If less than 0, it is the minimum number of uppercase characters in the new
|
||||
### password.
|
||||
ucredit = 0
|
||||
|
||||
### The maximum credit for having lowercase characters in the new password.
|
||||
### If less than 0, it is the minimum number of lowercase characters in the new
|
||||
### password.
|
||||
lcredit = 0
|
||||
|
||||
### The maximum credit for having other characters in the new password.
|
||||
### If less than 0, it is the minimum number of other characters in the new
|
||||
### password.
|
||||
ocredit = 0
|
||||
|
||||
### The minimum number of required classes of characters for the new
|
||||
### password (digits, uppercase, lowercase, others).
|
||||
minclass = 0
|
||||
|
||||
### The maximum number of allowed consecutive same characters in the new password.
|
||||
### The check is disabled if the value is 0.
|
||||
maxrepeat = 2
|
||||
|
||||
### The maximum number of allowed consecutive characters of the same class in the
|
||||
### new password.
|
||||
### The check is disabled if the value is 0.
|
||||
maxclassrepeat = 4
|
||||
|
||||
### Whether to check for the words from the passwd entry GECOS string of the user.
|
||||
### The check is enabled if the value is not 0.
|
||||
### gecoscheck = 0
|
||||
|
||||
### Whether to check for the words from the cracklib dictionary.
|
||||
### The check is enabled if the value is not 0.
|
||||
dictcheck = 1
|
||||
|
||||
### Whether to check if it contains the username in some form.
|
||||
### The check is enabled if the value is not 0.
|
||||
usercheck = 1
|
||||
|
||||
### Length of substrings from the username to check for in the password
|
||||
### The check is enabled if the value is greater than 0, and the usercheck is enabled.
|
||||
usersubstr = 3
|
||||
|
||||
### Whether the check is enforced by the PAM module and possibly other
|
||||
### applications.
|
||||
### The new password is rejected if it fails the check, and the value is not 0.
|
||||
enforcing = 1
|
||||
|
||||
### Path to the cracklib dictionaries. The default is to use the cracklib default.
|
||||
dictpath =
|
||||
|
||||
# Prompt user at most N times before returning with error. The default is 1.
|
||||
retry = 3
|
||||
|
||||
# Enforces pwquality checks on the root user password.
|
||||
# Enabled if the option is present.
|
||||
enforce_for_root
|
||||
|
||||
# Skip testing the password quality for users that are not present in the
|
||||
# /etc/passwd file.
|
||||
# Enabled if the option is present.
|
||||
local_users_only
|
||||
|
||||
EOF
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
23
config/hooks/live/9995_sysstat.chroot
Normal file
23
config/hooks/live/9995_sysstat.chroot
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.hardened.installer framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
sed -i 's#^\(ENABLED=\).*#\1"true"#' /etc/default/sysstat
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
332
config/hooks/live/9996_auditd.chroot
Normal file
332
config/hooks/live/9996_auditd.chroot
Normal file
@@ -0,0 +1,332 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.hardened.installer framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
### https://github.com/linux-audit/audit-userspace/tree/master/rules
|
||||
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
cd /root
|
||||
|
||||
apt-get install auditd -y
|
||||
|
||||
cp -u /etc/audit/audit.rules /root/.ciss/dlb/backup/audit.rules.bak
|
||||
cp -u /etc/audit/auditd.conf /root/.ciss/dlb/backup/auditd.conf.bak
|
||||
cp -u /etc/audit/rules.d/audit.rules /root/.ciss/dlb/backup/rules_d_audit.rules.bak
|
||||
rm -rf /etc/audit/rules.d/audit.rules
|
||||
|
||||
############################################################### /etc/audit/rules.d/10-base-config.rules
|
||||
cat << EOF >| /etc/audit/rules.d/10-base-config.rules
|
||||
## First rule - delete all
|
||||
-D
|
||||
|
||||
## Increase the buffers to survive stress events.
|
||||
## Make this bigger for busy systems
|
||||
-b 8192
|
||||
|
||||
## This determine how long to wait in burst of events
|
||||
--backlog_wait_time 60000
|
||||
|
||||
## Set failure mode to syslog
|
||||
-f 1
|
||||
EOF
|
||||
|
||||
############################################################### /etc/audit/rules.d/11-loginuid.rules
|
||||
cat << EOF >| /etc/audit/rules.d/11-loginuid.rules
|
||||
--loginuid-immutable
|
||||
EOF
|
||||
|
||||
############################################################### /etc/audit/rules.d/20-dont-audit.rules
|
||||
cat << EOF >| /etc/audit/rules.d/20-dont-audit.rules
|
||||
## This is for don't audit rules. We put these early because audit
|
||||
### is a first match wins system. Uncomment the rules you want.
|
||||
|
||||
## Cron jobs fill the logs with stuff we normally don't want
|
||||
-a never,user -F subj_type=crond_t
|
||||
|
||||
## This prevents chrony from overwhelming the logs
|
||||
-a never,exit -F arch=x86_64 -S adjtimex -F auid=unset -F uid=chrony -F subj_type=chronyd_t
|
||||
|
||||
### This is not very interesting and wastes a lot of space if
|
||||
### the server is public facing
|
||||
-a always,exclude -F msgtype=CRYPTO_KEY_USER
|
||||
EOF
|
||||
|
||||
############################################################### /etc/audit/rules.d/21-no32bit.rules
|
||||
cat << EOF >| /etc/audit/rules.d/21-no32bit.rules
|
||||
## If you are on a 64 bit platform, everything _should_ be running
|
||||
## in 64 bit mode. This rule will detect any use of the 32 bit syscalls
|
||||
## because this might be a sign of someone exploiting a hole in the 32
|
||||
## bit ABI.
|
||||
-a always,exit -F arch=b32 -S all -F key=32bit-abi
|
||||
EOF
|
||||
|
||||
############################################################### /etc/audit/rules.d/22-ignore-chrony.rules
|
||||
cat << EOF >| /etc/audit/rules.d/22-ignore-chrony.rules
|
||||
## This rule suppresses the time-change event when chrony does time updates
|
||||
-a never,exit -F arch=b64 -S adjtimex -F auid=unset -F uid=chrony -F subj_type=chronyd_t
|
||||
-a never,exit -F arch=b32 -S adjtimex -F auid=unset -F uid=chrony -F subj_type=chronyd_t
|
||||
EOF
|
||||
|
||||
############################################################### /etc/audit/rules.d/30-ospp-v42-1-create-failed.rules
|
||||
cat << EOF >| /etc/audit/rules.d/30-ospp-v42-1-create-failed.rules
|
||||
## Unsuccessful file creation (open with O_CREAT)
|
||||
-a always,exit -F arch=b32 -S openat,open_by_handle_at -F a2&0100 -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-create
|
||||
-a always,exit -F arch=b64 -S openat,open_by_handle_at -F a2&0100 -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-create
|
||||
-a always,exit -F arch=b32 -S open -F a1&0100 -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-create
|
||||
-a always,exit -F arch=b64 -S open -F a1&0100 -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-create
|
||||
-a always,exit -F arch=b32 -S creat -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-create
|
||||
-a always,exit -F arch=b64 -S creat -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-create
|
||||
-a always,exit -F arch=b32 -S openat,open_by_handle_at -F a2&0100 -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-create
|
||||
-a always,exit -F arch=b64 -S openat,open_by_handle_at -F a2&0100 -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-create
|
||||
-a always,exit -F arch=b32 -S open -F a1&0100 -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-create
|
||||
-a always,exit -F arch=b64 -S open -F a1&0100 -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-create
|
||||
-a always,exit -F arch=b32 -S creat -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-create
|
||||
-a always,exit -F arch=b64 -S creat -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-create
|
||||
EOF
|
||||
|
||||
############################################################### /etc/audit/rules.d/30-ospp-v42-1-create-success.rules
|
||||
cat << EOF >| /etc/audit/rules.d/30-ospp-v42-1-create-success.rules
|
||||
## Successful file creation (open with O_CREAT)
|
||||
-a always,exit -F arch=b32 -S openat,open_by_handle_at -F a2&0100 -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-create
|
||||
-a always,exit -F arch=b64 -S openat,open_by_handle_at -F a2&0100 -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-create
|
||||
-a always,exit -F arch=b32 -S open -F a1&0100 -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-create
|
||||
-a always,exit -F arch=b64 -S open -F a1&0100 -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-create
|
||||
-a always,exit -F arch=b32 -S creat -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-create
|
||||
-a always,exit -F arch=b64 -S creat -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-create
|
||||
EOF
|
||||
|
||||
############################################################### /etc/audit/rules.d/30-ospp-v42-2-modify-failed.rules
|
||||
cat << EOF >| /etc/audit/rules.d/30-ospp-v42-2-modify-failed.rules
|
||||
## Unsuccessful file modifications (open for write or truncate)
|
||||
-a always,exit -F arch=b32 -S openat,open_by_handle_at -F a2&01003 -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-modification
|
||||
-a always,exit -F arch=b64 -S openat,open_by_handle_at -F a2&01003 -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-modification
|
||||
-a always,exit -F arch=b32 -S open -F a1&01003 -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-modification
|
||||
-a always,exit -F arch=b64 -S open -F a1&01003 -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-modification
|
||||
-a always,exit -F arch=b32 -S truncate,ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-modification
|
||||
-a always,exit -F arch=b64 -S truncate,ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-modification
|
||||
-a always,exit -F arch=b32 -S openat,open_by_handle_at -F a2&01003 -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-modification
|
||||
-a always,exit -F arch=b64 -S openat,open_by_handle_at -F a2&01003 -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-modification
|
||||
-a always,exit -F arch=b32 -S open -F a1&01003 -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-modification
|
||||
-a always,exit -F arch=b64 -S open -F a1&01003 -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-modification
|
||||
-a always,exit -F arch=b32 -S truncate,ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-modification
|
||||
-a always,exit -F arch=b64 -S truncate,ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-modification
|
||||
EOF
|
||||
|
||||
############################################################### /etc/audit/rules.d/30-ospp-v42-2-modify-success.rules
|
||||
cat << EOF >| /etc/audit/rules.d/30-ospp-v42-2-modify-success.rules
|
||||
## Successful file modifications (open for write or truncate)
|
||||
-a always,exit -F arch=b32 -S openat,open_by_handle_at -F a2&01003 -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-modification
|
||||
-a always,exit -F arch=b64 -S openat,open_by_handle_at -F a2&01003 -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-modification
|
||||
-a always,exit -F arch=b32 -S open -F a1&01003 -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-modification
|
||||
-a always,exit -F arch=b64 -S open -F a1&01003 -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-modification
|
||||
-a always,exit -F arch=b32 -S truncate,ftruncate -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-modification
|
||||
-a always,exit -F arch=b64 -S truncate,ftruncate -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-modification
|
||||
EOF
|
||||
|
||||
############################################################### /etc/audit/rules.d/30-ospp-v42-3-access-failed.rules
|
||||
cat << EOF >| /etc/audit/rules.d/30-ospp-v42-3-access-failed.rules
|
||||
## Unsuccessful file access (any other opens) This has to go last.
|
||||
-a always,exit -F arch=b32 -S open,openat,openat2,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
|
||||
-a always,exit -F arch=b64 -S open,openat,openat2,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
|
||||
-a always,exit -F arch=b32 -S open,openat,openat2,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
|
||||
-a always,exit -F arch=b64 -S open,openat,openat2,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
|
||||
EOF
|
||||
|
||||
############################################################### /etc/audit/rules.d/30-ospp-v42-3-access-success.rules
|
||||
cat << EOF >| /etc/audit/rules.d/30-ospp-v42-3-access-success.rules
|
||||
## Successful file access (any other opens) This has to go last.
|
||||
## These next two are likely to result in a whole lot of events
|
||||
-a always,exit -F arch=b32 -S open,openat,openat2,open_by_handle_at -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-access
|
||||
-a always,exit -F arch=b64 -S open,openat,openat2,open_by_handle_at -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-access
|
||||
EOF
|
||||
|
||||
############################################################### /etc/audit/rules.d/30-ospp-v42-4-delete-failed.rules
|
||||
cat << EOF >| /etc/audit/rules.d/30-ospp-v42-4-delete-failed.rules
|
||||
## Unsuccessful file delete
|
||||
-a always,exit -F arch=b32 -S unlink,unlinkat,rename,renameat -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-delete
|
||||
-a always,exit -F arch=b64 -S unlink,unlinkat,rename,renameat -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-delete
|
||||
-a always,exit -F arch=b32 -S unlink,unlinkat,rename,renameat -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-delete
|
||||
-a always,exit -F arch=b64 -S unlink,unlinkat,rename,renameat -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-delete
|
||||
EOF
|
||||
|
||||
############################################################### /etc/audit/rules.d/30-ospp-v42-4-delete-success.rules
|
||||
cat << EOF >| /etc/audit/rules.d/30-ospp-v42-4-delete-success.rules
|
||||
## Successful file delete
|
||||
-a always,exit -F arch=b32 -S unlink,unlinkat,rename,renameat -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-delete
|
||||
-a always,exit -F arch=b64 -S unlink,unlinkat,rename,renameat -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-delete
|
||||
EOF
|
||||
|
||||
############################################################### /etc/audit/rules.d/30-ospp-v42-5-perm-change-failed.rules
|
||||
cat << EOF >| /etc/audit/rules.d/30-ospp-v42-5-perm-change-failed.rules
|
||||
## Unsuccessful permission change
|
||||
-a always,exit -F arch=b32 -S chmod,fchmod,fchmodat,setxattr,lsetxattr,fsetxattr,removexattr,lremovexattr,fremovexattr -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-perm-change
|
||||
-a always,exit -F arch=b64 -S chmod,fchmod,fchmodat,setxattr,lsetxattr,fsetxattr,removexattr,lremovexattr,fremovexattr -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-perm-change
|
||||
-a always,exit -F arch=b32 -S chmod,fchmod,fchmodat,setxattr,lsetxattr,fsetxattr,removexattr,lremovexattr,fremovexattr -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-perm-change
|
||||
-a always,exit -F arch=b64 -S chmod,fchmod,fchmodat,setxattr,lsetxattr,fsetxattr,removexattr,lremovexattr,fremovexattr -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-perm-change
|
||||
EOF
|
||||
|
||||
############################################################### /etc/audit/rules.d/30-ospp-v42-5-perm-change-success.rules
|
||||
cat << EOF >| /etc/audit/rules.d/30-ospp-v42-5-perm-change-success.rules
|
||||
## Successful permission change
|
||||
-a always,exit -F arch=b32 -S chmod,fchmod,fchmodat,setxattr,lsetxattr,fsetxattr,removexattr,lremovexattr,fremovexattr -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-perm-change
|
||||
-a always,exit -F arch=b64 -S chmod,fchmod,fchmodat,setxattr,lsetxattr,fsetxattr,removexattr,lremovexattr,fremovexattr -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-perm-change
|
||||
EOF
|
||||
|
||||
############################################################### /etc/audit/rules.d/30-ospp-v42-6-owner-change-failed.rules
|
||||
cat << EOF >| /etc/audit/rules.d/30-ospp-v42-6-owner-change-failed.rules
|
||||
## Unsuccessful ownership change
|
||||
-a always,exit -F arch=b32 -S lchown,fchown,chown,fchownat -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-owner-change
|
||||
-a always,exit -F arch=b64 -S lchown,fchown,chown,fchownat -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-owner-change
|
||||
-a always,exit -F arch=b32 -S lchown,fchown,chown,fchownat -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-owner-change
|
||||
-a always,exit -F arch=b64 -S lchown,fchown,chown,fchownat -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-owner-change
|
||||
EOF
|
||||
|
||||
############################################################### /etc/audit/rules.d/30-ospp-v42-6-owner-change-success.rules
|
||||
cat << EOF >| /etc/audit/rules.d/30-ospp-v42-6-owner-change-success.rules
|
||||
## Successful ownership change
|
||||
-a always,exit -F arch=b32 -S lchown,fchown,chown,fchownat -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-owner-change
|
||||
-a always,exit -F arch=b64 -S lchown,fchown,chown,fchownat -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-owner-change
|
||||
EOF
|
||||
|
||||
############################################################### /etc/audit/rules.d/30-ospp-v42.rules
|
||||
cat << EOF >| /etc/audit/rules.d/30-ospp-v42.rules
|
||||
## The purpose of these rules is to meet the requirements for Operating
|
||||
## System Protection Profile (OSPP)v4.2. These rules depends on having
|
||||
## the following rule files copied to /etc/audit/rules.d:
|
||||
##
|
||||
## 10-base-config.rules, 11-loginuid.rules,
|
||||
## 30-ospp-v42-1-create-failed.rules, 30-ospp-v42-1-create-success.rules,
|
||||
## 30-ospp-v42-2-modify-failed.rules, 30-ospp-v42-2-modify-success.rules,
|
||||
## 30-ospp-v42-3-access-failed.rules, 30-ospp-v42-3-access-success.rules,
|
||||
## 30-ospp-v42-4-delete-failed.rules, 30-ospp-v42-4-delete-success.rules,
|
||||
## 30-ospp-v42-5-perm-change-failed.rules,
|
||||
## 30-ospp-v42-5-perm-change-success.rules,
|
||||
## 30-ospp-v42-6-owner-change-failed.rules,
|
||||
## 30-ospp-v42-6-owner-change-success.rules
|
||||
##
|
||||
## original copies may be found in /usr/share/audit-rules
|
||||
|
||||
|
||||
## User add delete modify. This is covered by pam. However, someone could
|
||||
## open a file and directly create or modify a user, so we'll watch passwd and
|
||||
## shadow for writes
|
||||
-a always,exit -F arch=b32 -S openat,open_by_handle_at -F a2&03 -F path=/etc/passwd -F auid>=1000 -F auid!=unset -F key=user-modify
|
||||
-a always,exit -F arch=b64 -S openat,open_by_handle_at -F a2&03 -F path=/etc/passwd -F auid>=1000 -F auid!=unset -F key=user-modify
|
||||
-a always,exit -F arch=b32 -S open -F a1&03 -F path=/etc/passwd -F auid>=1000 -F auid!=unset -F key=user-modify
|
||||
-a always,exit -F arch=b64 -S open -F a1&03 -F path=/etc/passwd -F auid>=1000 -F auid!=unset -F key=user-modify
|
||||
-a always,exit -F arch=b32 -S openat,open_by_handle_at -F a2&03 -F path=/etc/shadow -F auid>=1000 -F auid!=unset -F key=user-modify
|
||||
-a always,exit -F arch=b64 -S openat,open_by_handle_at -F a2&03 -F path=/etc/shadow -F auid>=1000 -F auid!=unset -F key=user-modify
|
||||
-a always,exit -F arch=b32 -S open -F a1&03 -F path=/etc/shadow -F auid>=1000 -F auid!=unset -F key=user-modify
|
||||
-a always,exit -F arch=b64 -S open -F a1&03 -F path=/etc/shadow -F auid>=1000 -F auid!=unset -F key=user-modify
|
||||
|
||||
## User enable and disable. This is entirely handled by pam.
|
||||
|
||||
## Group add delete modify. This is covered by pam. However, someone could
|
||||
## open a file and directly create or modify a user, so we'll watch group and
|
||||
## gshadow for writes
|
||||
-a always,exit -F arch=b32 -F path=/etc/passwd -F perm=wa -F auid>=1000 -F auid!=unset -F key=user-modify
|
||||
-a always,exit -F arch=b64 -F path=/etc/passwd -F perm=wa -F auid>=1000 -F auid!=unset -F key=user-modify
|
||||
-a always,exit -F arch=b32 -F path=/etc/shadow -F perm=wa -F auid>=1000 -F auid!=unset -F key=user-modify
|
||||
-a always,exit -F arch=b64 -F path=/etc/shadow -F perm=wa -F auid>=1000 -F auid!=unset -F key=user-modify
|
||||
-a always,exit -F arch=b32 -F path=/etc/group -F perm=wa -F auid>=1000 -F auid!=unset -F key=group-modify
|
||||
-a always,exit -F arch=b64 -F path=/etc/group -F perm=wa -F auid>=1000 -F auid!=unset -F key=group-modify
|
||||
-a always,exit -F arch=b32 -F path=/etc/gshadow -F perm=wa -F auid>=1000 -F auid!=unset -F key=group-modify
|
||||
-a always,exit -F arch=b64 -F path=/etc/gshadow -F perm=wa -F auid>=1000 -F auid!=unset -F key=group-modify
|
||||
|
||||
|
||||
## Use of special rights for config changes. This would be use of setuid
|
||||
## programs that relate to user accts. This is not all setuid apps because
|
||||
## requirements are only for ones that affect system configuration.
|
||||
-a always,exit -F arch=b32 -F path=/usr/sbin/unix_chkpwd -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b64 -F path=/usr/sbin/unix_chkpwd -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b32 -F path=/usr/sbin/usernetctl -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b64 -F path=/usr/sbin/usernetctl -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b32 -F path=/usr/sbin/userhelper -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b64 -F path=/usr/sbin/userhelper -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b32 -F path=/usr/sbin/seunshare -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b64 -F path=/usr/sbin/seunshare -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b32 -F path=/usr/bin/mount -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b64 -F path=/usr/bin/mount -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b32 -F path=/usr/bin/newgrp -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b64 -F path=/usr/bin/newgrp -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b32 -F path=/usr/bin/newuidmap -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b64 -F path=/usr/bin/newuidmap -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b32 -F path=/usr/bin/gpasswd -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b64 -F path=/usr/bin/gpasswd -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b32 -F path=/usr/bin/newgidmap -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b64 -F path=/usr/bin/newgidmap -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b32 -F path=/usr/bin/umount -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b64 -F path=/usr/bin/umount -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b32 -F path=/usr/bin/passwd -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b64 -F path=/usr/bin/passwd -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b32 -F path=/usr/bin/crontab -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b64 -F path=/usr/bin/crontab -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b32 -F path=/usr/bin/at -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b64 -F path=/usr/bin/at -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b32 -F path=/usr/sbin/grub2-set-bootflag -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
-a always,exit -F arch=b64 -F path=/usr/sbin/grub2-set-bootflag -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
|
||||
|
||||
## Privilege escalation via su or sudo. This is entirely handled by pam.
|
||||
## Special case for systemd-run. It is not audit aware, specifically watch it
|
||||
-a always,exit -F arch=b32 -F path=/usr/bin/systemd-run -F perm=x -F auid!=unset -F key=maybe-escalation
|
||||
-a always,exit -F arch=b64 -F path=/usr/bin/systemd-run -F perm=x -F auid!=unset -F key=maybe-escalation
|
||||
## Special case for pkexec. It is not audit aware, specifically watch it
|
||||
-a always,exit -F arch=b32 -F path=/usr/bin/pkexec -F perm=x -F key=maybe-escalation
|
||||
-a always,exit -F arch=b64 -F path=/usr/bin/pkexec -F perm=x -F key=maybe-escalation
|
||||
|
||||
|
||||
## Watch for configuration changes to privilege escalation.
|
||||
-a always,exit -F arch=b32 -F path=/etc/sudoers -F perm=wa -F key=special-config-changes
|
||||
-a always,exit -F arch=b64 -F path=/etc/sudoers -F perm=wa -F key=special-config-changes
|
||||
-a always,exit -F arch=b32 -F dir=/etc/sudoers.d/ -F perm=wa -F key=special-config-changes
|
||||
-a always,exit -F arch=b64 -F dir=/etc/sudoers.d/ -F perm=wa -F key=special-config-changes
|
||||
|
||||
## Audit log access
|
||||
-a always,exit -F arch=b32 -F dir=/var/log/audit/ -F perm=r -F auid>=1000 -F auid!=unset -F key=access-audit-trail
|
||||
-a always,exit -F arch=b64 -F dir=/var/log/audit/ -F perm=r -F auid>=1000 -F auid!=unset -F key=access-audit-trail
|
||||
## Attempts to Alter Process and Session Initiation Information
|
||||
-a always,exit -F arch=b32 -F path=/var/run/utmp -F perm=wa -F auid>=1000 -F auid!=unset -F key=session
|
||||
-a always,exit -F arch=b64 -F path=/var/run/utmp -F perm=wa -F auid>=1000 -F auid!=unset -F key=session
|
||||
-a always,exit -F arch=b32 -F path=/var/log/btmp -F perm=wa -F auid>=1000 -F auid!=unset -F key=session
|
||||
-a always,exit -F arch=b64 -F path=/var/log/btmp -F perm=wa -F auid>=1000 -F auid!=unset -F key=session
|
||||
-a always,exit -F arch=b32 -F path=/var/log/wtmp -F perm=wa -F auid>=1000 -F auid!=unset -F key=session
|
||||
-a always,exit -F arch=b64 -F path=/var/log/wtmp -F perm=wa -F auid>=1000 -F auid!=unset -F key=session
|
||||
|
||||
## Attempts to modify MAC controls
|
||||
-a always,exit -F arch=b32 -F dir=/etc/selinux/ -F perm=wa -F auid>=1000 -F auid!=unset -F key=MAC-policy
|
||||
-a always,exit -F arch=b64 -F dir=/etc/selinux/ -F perm=wa -F auid>=1000 -F auid!=unset -F key=MAC-policy
|
||||
|
||||
## Software updates. This is entirely handled by rpm.
|
||||
|
||||
## System start and shutdown. This is entirely handled by systemd
|
||||
|
||||
## Kernel Module loading. This is handled in 43-module-load.rules
|
||||
|
||||
## Application invocation. The requirements list an optional requirement
|
||||
## FPT_SRP_EXT.1 Software Restriction Policies. This event is intended to
|
||||
## state results from that policy. This would be handled entirely by
|
||||
## that daemon.
|
||||
EOF
|
||||
|
||||
############################################################### /etc/audit/rules.d/99-finalize.rules
|
||||
cat << EOF >| /etc/audit/rules.d/99-finalize.rules
|
||||
-e 2
|
||||
EOF
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
36
config/hooks/live/9997_debsums.chroot
Normal file
36
config/hooks/live/9997_debsums.chroot
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
cd /root
|
||||
|
||||
apt-get install --no-install-recommends debsums -y
|
||||
|
||||
cp -a /etc/default/debsums /root/.ciss/dlb/backup/debsums.bak
|
||||
chmod 0644 /root/.ciss/dlb/backup/debsums.bak
|
||||
sed -i "s/CRON_CHECK=never/CRON_CHECK=monthly/" /etc/default/debsums
|
||||
|
||||
if debsums -g; then
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ 'debsums -g' successful. \e[0m\n"
|
||||
else
|
||||
# Omit false negative error output to stdout and stderr, as no problematic errors occur on startup.
|
||||
printf "\e[91m++++ ++++ ++++ ++++ ++++ ++++ ++ ❌ 'debsums -g' NOT successful. \e[0m\n" > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
59
config/hooks/live/9998_sources_list.chroot
Normal file
59
config/hooks/live/9998_sources_list.chroot
Normal file
@@ -0,0 +1,59 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.hardened.installer framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
cd /root
|
||||
|
||||
if [[ -f /etc/apt/sources.list ]]; then
|
||||
mv /etc/apt/sources.list /root/.ciss/dlb/backup/sources.list.bak
|
||||
fi
|
||||
|
||||
cat << 'EOF' >| /etc/apt/sources.list
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <cendev@coresecret.eu>
|
||||
# SPDX-ExternalRef: GIT https://cendev.eu/marc.weidner/CISS.2025.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <cendev@coresecret.eu>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.2025.hardened.installer framework.
|
||||
# SPDX-PackageName: CISS.2025.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
#-----------------------------------------------------------------------------------------#
|
||||
# OFFICIAL DEBIAN REPOS
|
||||
#-----------------------------------------------------------------------------------------#
|
||||
|
||||
### Debian Main Repos Bookworm
|
||||
|
||||
deb https://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware
|
||||
deb-src https://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware
|
||||
|
||||
deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
|
||||
deb-src http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
|
||||
|
||||
deb https://deb.debian.org/debian/ bookworm-updates main contrib non-free non-free-firmware
|
||||
deb-src https://deb.debian.org/debian/ bookworm-updates main contrib non-free non-free-firmware
|
||||
|
||||
deb https://deb.debian.org/debian/ bookworm-backports main contrib non-free non-free-firmware
|
||||
deb-src https://deb.debian.org/debian/ bookworm-backports main contrib non-free non-free-firmware
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
EOF
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
65
config/hooks/live/9999_interfaces_update.chroot
Normal file
65
config/hooks/live/9999_interfaces_update.chroot
Normal file
@@ -0,0 +1,65 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
set -C -e -u -o pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
mv /etc/network/interfaces /root/.ciss/dlb/backup/interfaces.chroot
|
||||
rm -f /etc/network/interfaces
|
||||
|
||||
cat << 'EOF' >| /etc/network/interfaces
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024–2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
# This file describes the network interfaces available on your system
|
||||
# and how to activate them. For more information, see interfaces(5).
|
||||
|
||||
### The loopback network interface
|
||||
auto lo
|
||||
iface lo inet loopback
|
||||
|
||||
### Fully dynamic interface
|
||||
auto dynamic
|
||||
iface dynamic inet dhcp
|
||||
pre-up \
|
||||
IFACE=$(ip -o link show \
|
||||
| awk -F': ' '{print $2}' \
|
||||
| grep -m1 -v lo) && \
|
||||
echo "Using interface $IFACE as dynamic" && \
|
||||
ip link set dev "$IFACE" up && \
|
||||
ip link set dev "$IFACE" name dynamic
|
||||
|
||||
post-down \
|
||||
ip link set dev dynamic name "$IFACE" && \
|
||||
echo "Restored interface name $IFACE"
|
||||
|
||||
source /etc/network/interfaces.d/*
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
EOF
|
||||
|
||||
chmod 0644 /etc/network/interfaces
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
Reference in New Issue
Block a user