Centurion Intelligence Consulting Agency Information Security Standard
Debian Live Build Generator for hardened live environment and CISS Debian Installer
Master Version: 8.02
Build: V8.03.256.2025.06.02
This shell wrapper automates the creation of a Debian Bookworm live ISO hardened according to the latest best practices in server and service security. It integrates into your build pipeline to deliver an isolated, robust environment suitable for cloud deployment or unattended installations via the forthcoming CISS.debian.installer.
Check out more:
Please note that all my signing keys are stored in an HSM and that the signing environment is air-gapped. The next step is to move to a room-gapped environment. ^^
Please note that coresecret.dev is included in the (HSTS Preload List) and always serves the headers:
add_header Expect-CT "max-age=86400, enforce" always;
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
Additionally, the entire zone is dual-signed with DNSSEC. See the current DNSSEC status at DNSSEC Audit Report
This live ISO establishes a secure, fully deterministic, integrity self-verifying boot environment based entirely on static source-code definitions. All configurations, system components, and installation routines are embedded during build time and locked for runtime immutability. This ensures that the live environment functions as a trusted Source of Truth — not only for boot-time operations, but for deploying entire systems in a secure and reproducible way.
Once booted, the environment optionally launches a fully scripted installer, via the forthcoming CISS.debian.installer, yet to deploy, that provisions the target system (the hardware the DVD is running on). The installer pulls no external dependencies besides of the necessary Debian debootstrap and Debian Packages and never exposes the target system in a not secure manner to the internet during installation. It operates strictly from within the verified image content, providing fully secured provisioning. Combined with checksum verification, activated by default, at boot and strict firewall defaults, this architecture guarantees that what is executed has not been tampered with and corresponds exactly to the intended source definition.
An even more secure deployment variant — an unattended and headless version — can be built without any active network interface or shell-access, also via the forthcoming CISS.debian.installer. Such a version performs all verification steps autonomously, provisions the target device from embedded source artifacts, and reboots into a fully encrypted system image. The system then awaits the decryption passphrase input via an embedded Dropbear SSH server (SSH PubKey only) in the initramfs, exposing no ports without cryptographic hardened access, while also the /boot partition could be encrypted via the built-in support of grub2 (2.12-1~bpo12+1).
This approach provides a fully reproducible, audit-friendly, and tamper-resistant provisioning workflow rooted entirely in source-defined infrastructure logic.
After build and configuration, the following audit reports can be generated:
chkhvg at the prompt. See example report: Haveged Audit Reportlsadt at the prompt. See example report: Lynis Audit Reportssh-audit <IP>:<PORT>. See example report: SSH Audit Report
The Debian Installer (d-i) will ALWAYS boot a new system.
Regardless of whether you start it:
The following happens in all cases:
The Debian Installer loads:
This means function status of the CISS.2025.debian.live.builder ISO after d-i start:
Below is a breakdown of each hardening component, with a summary of why each is critical to your security posture.
audit_backlog_limit=8192: Ensures the audit subsystem can queue up to 8192 events to avoid dropped logs under heavy loads.audit=1: Enables kernel auditing from boot to record system calls and security events.cfi=kcfi: Activates kernel control-flow integrity using kCFI to protect against control-flow hijacking.debugfs=off: Disables debugfs to prevent non-privileged access to kernel internals.efi=disable_early_pci_dma: Stops early PCI DMA under EFI to mitigate DMA-based attacks during boot.efi_no_storage_paranoia: Disables extra EFI storage checks to streamline boot without compromising expected storage integrity.hardened_usercopy=1: Enables stringent checks on copy operations between user and kernel space to prevent buffer overflows.ia32_emulation=0: Turns off 32-bit compatibility modes to reduce attack surface on 64-bit hosts.init_on_alloc=1: Zeroes memory on allocation to prevent leakage of previous data.init_on_free=1: Initializes memory on free to catch use-after-free bugs.iommu=force: Enforces IOMMU for all devices to isolate DMA-capable hardware.kfence.sample_interval=100: Configures the kernel fence memory safety tool to sample every 100 allocations.kvm.nx_huge_pages=force: Enforces non-executable huge pages in KVM to mitigate code injection.l1d_flush=on: Flushes L1 data cache on context switch to mitigate L1D vulnerabilities.lockdown=confidentiality: Puts the kernel in confidentiality lockdown to restrict direct hardware access.loglevel=0: Suppresses non-critical kernel messages to reduce information leakage.mce=0: Disables machine check exceptions to prevent side-channel data leaks from hardware error reporting.mitigations=auto,nosmt: Enables all automatic CPU mitigations and disables SMT to reduce side-channel risks.mmio_stale_data=full,nosmt: Ensures stale MMIO data is fully flushed and disables SMT for added protection.oops=panic: Forces a kernel oops to trigger a panic, preventing the system from running in an inconsistent state.page_alloc.shuffle=1: Randomizes physical page allocation to hinder memory layout prediction attacks.page_poison=1: Fills freed pages with a poison pattern to detect use-after-free.panic=-1: Disables automatic reboot on panic to preserve the system state for forensic analysis.pti=on: Enables page table isolation to mitigate Meltdown attacks.random.trust_bootloader=off: Prevents trusting entropy provided by the bootloader.random.trust_cpu=off: Disables trusting CPU-provided randomness, enforcing external entropy sources.randomize_kstack_offset=on: Randomizes the kernel stack offset on each syscall entry to harden against stack probing.randomize_va_space=2: Enables full address space layout randomization (ASLR) for user space.retbleed=auto,nosmt: Enables automatic RETBLEED mitigations and disables SMT for better side-channel resistance.rodata=on: Marks kernel read-only data sections to prevent runtime modification.tsx=off: Disables Intel TSX extensions to eliminate related speculative execution vulnerabilities.vdso32=0: Disables 32-bit vDSO to prevent unintended cross-mode calls.vsyscall=none: Disables legacy vsyscall support to close a potential attack vector.CONFIG_DEBUG_RODATA, CONFIG_STRICT_MODULE_RWX, and other self-protections.sysp()provides a function to apply and audit local kernel hardening rules from /etc/sysctl.d/99_local.hardened:###########################################################################################
# Globals: Wrapper for loading CISS.2025 hardened Kernel Parameters
# Arguments:
# none
###########################################################################################
# shellcheck disable=SC2317
sysp() {
sysctl -p /etc/sysctl.d/99_local.hardened
# sleep 1
sysctl -a | grep -E 'kernel|vm|net' > /var/log/sysctl_check"$(date +"%Y-%m-%d_%H:%M:%S")".log
}
kernel.modules_disabled=1kernel.kptr_restrict=2, kernel.dmesg_restrict=1, kernel.printk=3 3 3 3kernel.yama.ptrace_scope=2fs.protected_*Warning Once applied, some hardening settings cannot be undone via sysctl without a reboot, and dynamic module loading remains disabled until the next boot. Automatic enforcement at startup is therefore omitted by design—run sysp() manually and plan a reboot to apply or revert these controls.
sysctl settings (e.g., net.ipv4.conf.all.rp_filter=1, arp_ignore, arp_announce) to restrict inbound/outbound traffic behaviors.Yama restrictions, and configures kernel.kptr_restrict.haveged, seeds /dev/random early.pam_faillock)./etc/hosts.allow and /etc/hosts.deny enforce an ALL: ALL deny policy, permitting only specified hosts./etc/fail2ban/jail.d/centurion-default.conf immediately bans any host that touches closed ports.
fail2ban service is hardened as well according to: Arch Linux Wiki Fail2ban Hardening/etc/sshd_config enforces strict cryptographic and connection controls with respect to SSH Audit Guide Debian 12:
RekeyLimit 1G 1hHostKey /etc/ssh/ssh_host_ed25519_keyHostKey /etc/ssh/ssh_host_rsa_key (8192-bit RSA)PubkeyAuthentication yesPermitRootLogin prohibit-passwordPasswordAuthentication noPermitEmptyPasswords noLoginGraceTime 2mMaxAuthTries 3MaxSessions 2MaxStartups 08:64:16PerSourceMaxStartups 4RequiredRSASize 4096Ciphers aes256-gcm@openssh.comKexAlgorithms sntrup761x25519-sha512@openssh.com,sntrup761x25519-sha512,gss-curve25519-sha256-MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.comdeny incoming and (optionally) deny outgoing; automatically opens only whitelisted ports.systemd policy override to limit privileges of the Fail2Ban service itselfchrony, selects PTB NTPsec servers by default.Description: A built-in debug mode outputs clear, timestamped logs including:
Rationale: Simplifies troubleshooting and provides precise error tracing.
Description: The implemented xtrace wrapper set -x enforces comprehensive Bash error handling to ensure
and delivers full information, which command failed to execute:
The following set options are applied at the beginning of the script (see Bash Manual, The Set Builtin):
set -o errexit # Exit script when a command exits with non-zero status (same as "set -e").
set -o errtrace # Inherit ERR traps in subshells (same as "set -E").
set -o functrace # Inherit DEBUG and RETURN traps in subshells (same as "set -T").
set -o nounset # Exit script on use of an undefined variable (same as "set -u").
set -o pipefail # Return the exit status of the last failed command in a pipeline.
set -o noclobber # Prevent overwriting files via redirection (same as "set -C").
live-build package installed.ciss_live_builder.sh and related scripts.Clone the repository:
git clone https://git.coresecret.dev/msw/CISS.debian.live.builder.git
cd CISS.debian.live.builderPreparation:
mkdir /opt/livebuild.authorized_keys file, for example, in the /opt/gitea/CISS.debian.live.builder directory.password.txt file, for example, in the /opt/gitea/CISS.debian.live.builder directory.Run the config builder script ./ciss_live_builder.sh and the integrated lb build command (example):
chmod 0700 ./ciss_live_builder.sh
./ciss_live_builder.sh --architecture amd64 \
--build-directory /opt/livebuild \
--change-splash hexagon \
--control 384 \
--debug \
--dhcp-centurion \
--jump-host 10.0.0.128 [c0de:4711:0815:4242::1] [2abc:4711:0815:4242::1]/64 \
--provider-netcup-ipv6 [c0de:4711:0815:4242::ffff] \
--renice-priority "-19" \
--reionice-priority 1 2 \
--root-password-file /opt/gitea/CISS.debian.live.builder/password.txt \
--ssh-port 4242 \
--ssh-pubkey /opt/gitea/CISS.debian.live.builderLocate your ISO in the --build-directory.
Boot from the ISO and login to the live image via the console, or the multi-layer secured coresecret SSH tunnel.
Type sysp for the final kernel hardening features.
Check the boot log with jboot and via ssf that all services are up.
Finally, audit your environment with lsadt for a comprehensive Lynis audit.
Type celp for some shortcuts.
Clone the repository:
git clone https://git.coresecret.dev/msw/CISS.debian.live.builder.git
cd CISS.debian.live.builderEdit the .gitea/workflows/generate-iso.yaml file according to your requirements. Ensure that the trigger file .gitea/trigger/t_generate.iso.yaml and the counter are updated. Change all the necessary {{ secrets.VAR }}. Push your commits to trigger the workflow. Then download your final ISO from the specified Location.
#...
steps:
- name: Preparing SSH Setup, SSH Deploy Key, Known Hosts, .config.
run: |
rm -rf ~/.ssh && mkdir -m700 ~/.ssh
### Private Key
echo "${{ secrets.CHANGE_ME }}" >| ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
#...
### https://github.com/actions/checkout/issues/1843
- name: Using manual clone via SSH to circumvent Gitea SHA-256 object issues.
run: |
git clone --branch "${GITHUB_REF_NAME}" ssh://git@CHANGE_ME .
#...
- name: Importing the 'CI PGP DEPLOY ONLY' key.
run: |
### GPG-Home relative to the Runner Workspace to avoid changing global files.
export GNUPGHOME="$(pwd)/.gnupg"
mkdir -m700 "${GNUPGHOME}"
echo "${{ secrets.CHANGE_ME }}" >| ci-bot.sec.asc
#...
- name: Configuring Git for signed CI/DEPLOY commits.
run: |
export GNUPGHOME="$(pwd)/.gnupg"
git config user.name "CHANGE_ME"
git config user.email "CHANGE_ME"
#...
- name: Preparing the build environment.
run: |
mkdir -p /opt/config
mkdir -p /opt/livebuild
echo "${{ secrets.CHANGE_ME }}" >| /opt/config/password.txt
echo "${{ secrets.CHANGE_ME }}" >| /opt/config/authorized_keys
#...
- name: Starting CISS.debian.live.builder. This may take a while ...
run: |
chmod 0700 ciss_live_builder.sh && chown root:root ciss_live_builder.sh
timestamp=$(date -u +"%Y_%m_%d_%H_%M_Z")
### Change "--autobuild=" to the specific kernel version you need: '6.12.22+bpo-amd64'.
./ciss_live_builder.sh \
--autobuild=CHANGE_ME \
--architecture CHANGE_ME \
--build-directory /opt/livebuild \
--control "${timestamp}" \
--jump-host "${{ secrets.CHANGE_ME }}" \
--root-password-file /opt/config/password.txt \
--ssh-port CHANGE_ME \
--ssh-pubkey /opt/config
#...
### SKIP OR CHANGE ALL REMAINING STEPS
This repository is fully SPDX-compliant. All source files include appropriate SPDX license identifiers and headers to ensure clear and unambiguous licensing. You can verify compliance by reviewing the top of each file, which follows the SPDX standard for license expressions and metadata.
This README is provided "as-is" without any warranty. Review your organization's policies before deploying to production.
no tracking | no logging | no advertising | no profiling | no bullshit