Compare commits
331 Commits
v8.13.008-
...
4c5d917eb6
| Author | SHA256 | Date | |
|---|---|---|---|
|
4c5d917eb6
|
|||
|
69835345e7
|
|||
|
b210d784a7
|
|||
|
3fe0913dc9
|
|||
|
311074c1d3
|
|||
|
5cdf9f93a1
|
|||
|
db5e1836f8
|
|||
|
65ee8985b8
|
|||
|
7d142cb058
|
|||
|
a7bc6ca2cb
|
|||
|
4614d65d7c
|
|||
|
ae8edb028b
|
|||
|
270be404be
|
|||
|
3b8a8bd9e2
|
|||
|
99cda6c141
|
|||
|
9481ac092a
|
|||
|
7c231100ff
|
|||
|
e44bef253f
|
|||
|
9253722a47
|
|||
|
5150604a54
|
|||
|
b2e19ae41b
|
|||
|
33a013c158
|
|||
|
47eaa39e3d
|
|||
|
8b2809f4de
|
|||
|
12f366e842
|
|||
|
075f0ad6e3
|
|||
|
1540036410
|
|||
|
f00c8fd690
|
|||
|
fd94e0aea0
|
|||
|
c2e5f83fbf
|
|||
|
dd79251eb7
|
|||
|
2d9bb3840a
|
|||
|
83ce94b842
|
|||
|
b0f7ee8c07
|
|||
|
2b5fbde43f
|
|||
|
7c3c3654dc
|
|||
|
cbbd855ca7
|
|||
|
d7c94122d0
|
|||
|
0bf6aec92f
|
|||
|
b88084e699
|
|||
|
0f41a67b01
|
|||
|
1e2e124352
|
|||
|
94a3bc40c3
|
|||
|
2f9ecd4dee
|
|||
|
7a0fc6127d
|
|||
|
354e78c5a2
|
|||
|
2f94fc9e7e
|
|||
|
072372f69b
|
|||
|
b6748c4c50
|
|||
|
33ab1affa3
|
|||
|
18f7afa640
|
|||
|
307b2a74aa
|
|||
|
87d954f0e6
|
|||
|
6894fda632
|
|||
|
a46507ec0b
|
|||
|
e81f85f4bf
|
|||
|
c4ac2fc6b6
|
|||
|
f7b58dd58b
|
|||
|
6ca1dc23a0
|
|||
|
884fa4a7c1
|
|||
|
70b76b63b2
|
|||
|
831b097308
|
|||
|
011fa4b611
|
|||
|
597bf1eaa3
|
|||
|
2a2a498345
|
|||
|
ea8845c95b
|
|||
|
660ff2842d
|
|||
|
87c563c8d7
|
|||
|
93fbf258f2
|
|||
|
b52ae63248
|
|||
|
935fc97215
|
|||
|
0f85ba60b2
|
|||
|
fcd1756cce
|
|||
|
a2451de100
|
|||
|
c6eebb4eb5
|
|||
|
8b4b13dd4d
|
|||
|
ec8538a6ed
|
|||
|
c19f66319d
|
|||
|
7a71c4e27a
|
|||
|
3e440a1f0f
|
|||
|
2c35919528
|
|||
|
64499c02f5
|
|||
|
e9dee013ee
|
|||
|
9b68f61a43
|
|||
|
74e504164a
|
|||
|
900e7a0902
|
|||
|
73578d777e
|
|||
|
02425e4b31
|
|||
|
4a679a222f
|
|||
|
026c6af8df
|
|||
|
48ce7c2328
|
|||
|
615204c0b9
|
|||
|
571a94d7e8
|
|||
|
cca580000c
|
|||
|
5248d0c60c
|
|||
|
a2898a9be0
|
|||
|
776432110a
|
|||
|
923ce8afa8
|
|||
|
d33b0bff4d
|
|||
|
e01edb4bee
|
|||
|
929415d37f
|
|||
|
1d63afbe2e
|
|||
|
e13765da6b
|
|||
|
ca212c9a27
|
|||
|
ce19ab9311
|
|||
|
62b295ba79
|
|||
|
bad373d0ea
|
|||
|
fe25a4ebd6
|
|||
|
ab291828e8
|
|||
|
7ef1d52bf8
|
|||
|
298dc531db
|
|||
|
91e2e53335
|
|||
|
e5b336da1b
|
|||
|
117054ed5b
|
|||
|
07489889ab
|
|||
|
640a4ee1cc
|
|||
|
cc6a47ebc0
|
|||
|
403ff69cd6
|
|||
|
f627bac5e7
|
|||
|
5b0484daeb
|
|||
|
e917ac59fb
|
|||
|
61599102dd
|
|||
|
b390b484ac
|
|||
|
f18d76eb2a
|
|||
|
347b8a774c
|
|||
|
1a9c0041dc
|
|||
|
9753e4f73c
|
|||
|
6b351d0675
|
|||
|
3e4a00dc55
|
|||
|
36bd43bde9
|
|||
|
a959c7070a
|
|||
|
b59a5a6d0c
|
|||
|
4a025f0151
|
|||
|
0252979034
|
|||
|
314ba8493e
|
|||
|
f8d9fa9c99
|
|||
|
2a866d7520
|
|||
|
343ae97968
|
|||
|
f343e06ce5
|
|||
|
26983d4f01
|
|||
|
7abe899a9a
|
|||
|
debdfa0b14
|
|||
|
5888af923b
|
|||
|
c6bdf8edda
|
|||
|
f58c14c406
|
|||
|
44056d4e76
|
|||
|
52670eff77
|
|||
|
3c663234e6
|
|||
|
d652d0dece
|
|||
|
be06208118
|
|||
|
887f7a0b14
|
|||
|
b69b15a786
|
|||
|
1a903aeb8d
|
|||
|
b37a98a7aa
|
|||
|
daed41deee
|
|||
|
ba12db9b14
|
|||
|
f7a82f9c1c
|
|||
|
dd4756f631
|
|||
|
2351f5e93b
|
|||
|
121e623694
|
|||
|
1a8047c60d
|
|||
|
2db18b0a1a
|
|||
|
cecf412388
|
|||
|
d79429f1ed
|
|||
|
cfb73eade8
|
|||
|
299206355c
|
|||
|
d97d4206d7
|
|||
|
80ca95ade9
|
|||
|
3cb59698cf
|
|||
|
9ea13fade8
|
|||
|
cbcab8cbf9
|
|||
|
d909b17de7
|
|||
|
6bda13c9dc
|
|||
|
258f350255
|
|||
|
e3ef7631ef
|
|||
|
ea1dfd791b
|
|||
|
d568ab64ac
|
|||
|
29902eeb7b
|
|||
|
30f79c7245
|
|||
|
c8ed90bf60
|
|||
|
36c89e2383
|
|||
|
baea8a673a
|
|||
|
d98ad001a2
|
|||
|
c42a39b757
|
|||
|
131b29e8b6
|
|||
|
faaa4db9f3
|
|||
|
582a110f04
|
|||
|
f61b149ab5
|
|||
|
51556707e2
|
|||
|
d8458b7220
|
|||
|
d31654a9ac
|
|||
|
b7760d5868
|
|||
|
c68a163982
|
|||
|
c7dd4c40cd
|
|||
|
e319a049de
|
|||
|
d1616934af
|
|||
|
14f1b99268
|
|||
|
147b54450f
|
|||
|
a8a27980eb
|
|||
|
d52df34b7b
|
|||
|
70f42be6ec
|
|||
|
8ce7830013
|
|||
|
746792cba2
|
|||
|
675649c646
|
|||
|
64275013c0
|
|||
|
54b153ba76
|
|||
|
bf7d616ea6
|
|||
|
9d235a427e
|
|||
|
2ffb74a408
|
|||
|
a4da5a6991
|
|||
|
aeea58ff84
|
|||
|
9a06c569f1
|
|||
|
40ab6fb578
|
|||
|
5b843d6e59
|
|||
|
18c60ce260
|
|||
|
11952e0621
|
|||
|
cb490632c4
|
|||
|
83fa76d4aa
|
|||
|
1813ae3774
|
|||
|
c4fc603d5b
|
|||
|
a9182d59f6
|
|||
|
db9dca9fa2
|
|||
|
cae8d68ecc
|
|||
|
9688142245
|
|||
|
f36de4a5b4
|
|||
|
5d00daf2ae
|
|||
|
175af760bc
|
|||
|
c60e138b27
|
|||
|
2d76fca675
|
|||
|
a44bd771d3
|
|||
|
1857d730e2
|
|||
|
b1243bdf97
|
|||
|
c8053082fd
|
|||
|
779c830111
|
|||
|
d6fdcacc9c
|
|||
|
3b89515b70
|
|||
|
97af826d5e
|
|||
|
584077e1c0
|
|||
|
c8791a9221
|
|||
|
b577201cc3
|
|||
|
eca769a7df
|
|||
|
b51049eb8e
|
|||
|
474b34afd3
|
|||
|
ca5cbbf323
|
|||
|
38a6fe4a2c
|
|||
|
b140f0e03e
|
|||
|
7060f945c1
|
|||
|
3e07d26cc6
|
|||
|
78f835f96e
|
|||
|
d3f9bec31c
|
|||
|
e682b6ac17
|
|||
|
3b1ab56d2c
|
|||
|
195b9a9c91
|
|||
|
fc4aa8d23f
|
|||
|
1b883619e7
|
|||
|
fc719ebfa9
|
|||
|
353d4cf7df
|
|||
|
66a2dd465e
|
|||
|
ef486ce7e5
|
|||
|
1cefc27d54
|
|||
|
7c0a3238a7
|
|||
|
242f0a0159
|
|||
|
11d1e529a9
|
|||
|
fd2357998b
|
|||
|
a5bcb4bb17
|
|||
|
4a985e1c81
|
|||
|
c60d4e1742
|
|||
|
0c4060fe5d
|
|||
|
f8d84b3585
|
|||
|
306d08ff87
|
|||
|
cd36d382bb
|
|||
|
0aca2331de
|
|||
|
77c1753d02
|
|||
|
ad30f41516
|
|||
|
7cba3e3531
|
|||
|
44aa77969f
|
|||
|
117959234e
|
|||
|
4bc332249c
|
|||
|
a536c4da96
|
|||
|
95835f1e15
|
|||
|
68c803550b
|
|||
|
9466395273
|
|||
|
181b73b04c
|
|||
|
7f678baa64
|
|||
|
1d711ea816
|
|||
|
9e66e27eae
|
|||
|
9a72da4e97
|
|||
|
fda63adb9c
|
|||
|
368d523f95
|
|||
|
e00c6e8900
|
|||
|
02f56b725f
|
|||
|
a475cc45a3
|
|||
|
5d64de95bc
|
|||
|
d313ae0b51
|
|||
|
edc59d362f
|
|||
|
eb90a815e8
|
|||
|
6f1793f2ac
|
|||
|
2a4d5e5b2e
|
|||
|
f7a7d1cff0
|
|||
|
40b3fb8ff7
|
|||
|
636c34cee5
|
|||
|
47ebdf7ed0
|
|||
|
61d9bf1510
|
|||
|
bd77170cf9
|
|||
|
49c6277efa
|
|||
|
d55f420c35
|
|||
|
af84d5292b
|
|||
|
53642d6115
|
|||
|
7fab4a183c
|
|||
|
c514634dd4
|
|||
|
32f1b05181
|
|||
|
1a2d1a3ae1
|
|||
|
5fcd2ebf42
|
|||
|
7168374797
|
|||
|
720eede478
|
|||
|
036fefdd3e
|
|||
|
2bcbdf8716
|
|||
|
ffecfcdc50
|
|||
|
a51e37b648
|
|||
|
0f8b894e40
|
|||
|
ec171888f7
|
|||
|
d046770aeb
|
|||
|
63502787c0
|
|||
|
a96af3ff06
|
|||
|
3c2c899403
|
|||
|
e966a899c7
|
|||
|
9b28418860
|
|||
|
40d81b51f9
|
|||
|
ac0560714b
|
|||
|
7f35d1ab38
|
|||
|
ec6e791b9d
|
@@ -21,7 +21,7 @@ usage() {
|
||||
clear
|
||||
cat << EOF
|
||||
$(echo -e "\e[92mCISS.debian.live.builder\e[0m")
|
||||
$(echo -e "\e[92mMaster V8.13.008.2025.08.22\e[0m")
|
||||
$(echo -e "\e[92mMaster V8.13.294.2025.10.28\e[0m")
|
||||
$(echo -e "\e[92mA lightweight Shell Wrapper for building a hardened Debian Live ISO Image.\e[0m")
|
||||
|
||||
$(echo -e "\e[97m(c) Marc S. Weidner, 2018 - 2025\e[0m")
|
||||
|
||||
@@ -9,10 +9,9 @@
|
||||
# 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
DEBIAN_FRONTEND=noninteractive \
|
||||
apt-get update && \
|
||||
@@ -33,7 +32,6 @@ DEBIAN_FRONTEND=noninteractive \
|
||||
whois
|
||||
|
||||
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
|
||||
|
||||
72
.archive/0005_tmpfile_dublette.chroot
Normal file
72
.archive/0005_tmpfile_dublette.chroot
Normal file
@@ -0,0 +1,72 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-10-11; 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 -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
|
||||
# Purpose: Copy vendor 'legacy.conf' to '/etc/tmpfiles.d' and drop duplicate '/run/lock' lines.
|
||||
|
||||
#######################################
|
||||
# Simple error terminal logger.
|
||||
# Arguments:
|
||||
# None
|
||||
#######################################
|
||||
log() { printf '[tmpfiles-fix] %s\n' "$*" >&2; }
|
||||
|
||||
### Locate vendor 'legacy.conf' (The path can vary).
|
||||
declare vendor=""
|
||||
|
||||
for p in /usr/lib/tmpfiles.d/legacy.conf /lib/tmpfiles.d/legacy.conf; do
|
||||
|
||||
if [[ -f "${p}" ]]; then vendor="${p}"; break; fi
|
||||
|
||||
done
|
||||
|
||||
if [[ -z "${vendor}" ]]; then
|
||||
log "WARN: vendor legacy.conf not found; creating a minimal override"
|
||||
install -D -m 0644 /dev/null /etc/tmpfiles.d/legacy.conf
|
||||
|
||||
else
|
||||
|
||||
install -D -m 0644 "${vendor}" /etc/tmpfiles.d/legacy.conf
|
||||
|
||||
fi
|
||||
|
||||
### Deduplicate: keep only the FIRST 'd /run/lock ' definition, drop subsequent ones.
|
||||
# shellcheck disable=SC2155
|
||||
declare tmpdir="$(mktemp -d)"
|
||||
declare out="${tmpdir}/legacy.conf"
|
||||
|
||||
awk '
|
||||
BEGIN{seen=0}
|
||||
{
|
||||
# Preserve everything by default
|
||||
keep=1
|
||||
# Match tmpfiles "d /run/lock ..." (allowing variable spacing and case of directive)
|
||||
if ($1 ~ /^[dD]$/ && $2 == "/run/lock") {
|
||||
if (seen==1) { keep=0 } else { seen=1 }
|
||||
}
|
||||
if (keep) print
|
||||
}' /etc/tmpfiles.d/legacy.conf >| "${out}"
|
||||
|
||||
### Install the sanitized file atomically.
|
||||
install -m 0644 -o root -g root "${out}" /etc/tmpfiles.d/legacy.conf
|
||||
rm -rf -- "${tmpdir}"
|
||||
|
||||
log "Deduplicated /etc/tmpfiles.d/legacy.conf (kept only first /run/lock entry)."
|
||||
|
||||
command -v systemd-tmpfiles >/dev/null 2>&1 && systemd-tmpfiles --create --prefix /run/lock || true
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
455
.archive/generate_PRIVATE_trixie_1.yaml
Normal file
455
.archive/generate_PRIVATE_trixie_1.yaml
Normal file
@@ -0,0 +1,455 @@
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-08-22; 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
|
||||
|
||||
# Version Master V8.13.294.2025.10.28
|
||||
|
||||
name: 🔐 Generating a Private Live ISO TRIXIE.
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '.gitea/trigger/t_generate_PRIVATE_trixie_1.yaml'
|
||||
|
||||
jobs:
|
||||
generate-private-cdlb-trixie:
|
||||
name: 🔐 Generating a Private Live ISO TRIXIE.
|
||||
runs-on: cdlb.trixie
|
||||
|
||||
container:
|
||||
image: debian:trixie
|
||||
|
||||
steps:
|
||||
- name: 🛠️ Basic Image Setup.
|
||||
shell: bash
|
||||
run: |
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get update -qq
|
||||
apt-get upgrade -y
|
||||
apt-get install -y --no-install-recommends \
|
||||
apt-utils \
|
||||
bash \
|
||||
ca-certificates \
|
||||
curl \
|
||||
git \
|
||||
gnupg \
|
||||
openssh-client \
|
||||
openssl \
|
||||
perl \
|
||||
sudo \
|
||||
util-linux
|
||||
|
||||
- name: ⚙️ Check GnuPG Version.
|
||||
shell: bash
|
||||
run: |
|
||||
gpg --version
|
||||
|
||||
- name: ⚙️ Preparing SSH Setup, SSH Deploy Key, Known Hosts, .config.
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
var_wait=$(( RANDOM % 33 ))
|
||||
printf "⏳ Waiting %s seconds to desynchronize parallel workflows...\n" "${var_wait}"
|
||||
sleep "${var_wait}"
|
||||
|
||||
rm -rf ~/.ssh && mkdir -m700 ~/.ssh
|
||||
|
||||
### Private Key
|
||||
echo "${{ secrets.SSH_MSW_DEPLOY_CORESECRET_DEV }}" >| ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
|
||||
### Scan git.coresecret.dev to fill ~/.ssh/known_hosts
|
||||
ssh-keyscan -p 42842 git.coresecret.dev >| ~/.ssh/known_hosts
|
||||
chmod 600 ~/.ssh/known_hosts
|
||||
|
||||
### Generate SSH Config for git.coresecret.dev Custom-Port
|
||||
cat <<EOF >| ~/.ssh/config
|
||||
Host git.coresecret.dev
|
||||
HostName git.coresecret.dev
|
||||
Port 42842
|
||||
IdentityFile ~/.ssh/id_ed25519
|
||||
StrictHostKeyChecking yes
|
||||
UserKnownHostsFile ~/.ssh/known_hosts
|
||||
EOF
|
||||
chmod 600 ~/.ssh/config
|
||||
|
||||
### https://github.com/actions/checkout/issues/1843
|
||||
- name: 🛠️ Using manual clone via SSH to circumvent Gitea SHA-256 object issues.
|
||||
shell: bash
|
||||
env:
|
||||
### GITHUB_REF_NAME contains the branch name from the push event.
|
||||
GITHUB_REF_NAME: ${{ github.ref_name }}
|
||||
run: |
|
||||
git clone --branch "${GITHUB_REF_NAME}" ssh://git@git.coresecret.dev:42842/msw/CISS.debian.live.builder.git .
|
||||
git fetch --unshallow || echo "Nothing to fetch - already full clone."
|
||||
|
||||
- name: 🛠️ Cleaning the workspace.
|
||||
shell: bash
|
||||
run: |
|
||||
git reset --hard
|
||||
git clean -fd
|
||||
|
||||
- name: ⚙️ Importing the 'CI PGP DEPLOY ONLY' key.
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
### GPG-Home relative to the Runner Workspace to avoid changing global files.
|
||||
export GNUPGHOME="$(pwd)/.gnupg"
|
||||
mkdir -m 700 "${GNUPGHOME}"
|
||||
echo "${{ secrets.PGP_PUBKEY_CENTURION_ROOT_2025_X448 }}" >| centurion-root.PUB.asc
|
||||
gpg --batch --import centurion-root.PUB.asc
|
||||
echo "${{ secrets.PGP_MSW_DEPLOY_CORESECRET_DEV }}" >| ci-bot.sec.asc
|
||||
gpg --batch --import ci-bot.sec.asc
|
||||
### Trust the key automatically
|
||||
KEY_ID=$(gpg --list-keys --with-colons | awk -F: '/^pub:/ {print $5}')
|
||||
echo "trust-model always" >| "${GNUPGHOME}/gpg.conf"
|
||||
|
||||
- name: ⚙️ Configuring Git for signed CI/DEPLOY commits.
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
export GNUPGHOME="$(pwd)/.gnupg"
|
||||
git config user.name "Marc S. Weidner BOT"
|
||||
git config user.email "msw+bot@coresecret.dev"
|
||||
git config commit.gpgsign true
|
||||
git config gpg.program gpg
|
||||
git config gpg.format openpgp
|
||||
|
||||
- name: ⚙️ Preparing the build environment.
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir -p /opt/config
|
||||
mkdir -p /opt/livebuild
|
||||
touch /opt/config/password.txt && chmod 0600 /opt/config/password.txt
|
||||
touch /opt/config/authorized_keys && chmod 0600 /opt/config/authorized_keys
|
||||
echo "${{ secrets.CISS_DLB_ROOT_PWD_1 }}" >| /opt/config/password.txt
|
||||
echo "${{ secrets.CISS_DLB_ROOT_SSH_PUBKEY_1 }}" >| /opt/config/authorized_keys
|
||||
|
||||
- name: 🔧 Render live hook with secrets.
|
||||
shell: bash
|
||||
working-directory: ${{ github.workspace }}
|
||||
env:
|
||||
ED25519_PRIV: ${{ secrets.CISS_DLB_SSH_HOST_ED25519_KEY }}
|
||||
ED25519_PUB: ${{ secrets.CISS_DLB_SSH_HOST_ED25519_KEY_PUB }}
|
||||
RSA_PRIV: ${{ secrets.CISS_DLB_SSH_HOST_RSA_KEY }}
|
||||
RSA_PUB: ${{ secrets.CISS_DLB_SSH_HOST_RSA_KEY_PUB }}
|
||||
CISS_PRIMORDIAL: ${{ secrets.CISS_PRIMORDIAL_PRIVATE }}
|
||||
CISS_PRIMORDIAL_PUB: ${{ secrets.CISS_PRIMORDIAL_PUBLIC }}
|
||||
CISS_PHYS_AGE: ${{ secrets.CISS_PHYS_AGE }}
|
||||
run: |
|
||||
set -Ceuo pipefail
|
||||
umask 077
|
||||
|
||||
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)"
|
||||
|
||||
TPL="${REPO_ROOT}/config/hooks/live/9935_hardening_ssh.chroot.tmpl"
|
||||
OUT="${REPO_ROOT}/config/hooks/live/9935_hardening_ssh.chroot"
|
||||
ID_OUT="${REPO_ROOT}/config/includes.chroot/root/.ssh/id_2025_ed25519_ciss_primordial"
|
||||
ID_OUT_PUB="${REPO_ROOT}/config/includes.chroot/root/.ssh/id_2025_ed25519_ciss_primordial.pub"
|
||||
SOPS="${REPO_ROOT}/config/hooks/live/0860_sops.chroot"
|
||||
|
||||
if [[ ! -f "${TPL}" ]]; then
|
||||
echo "Template not found: ${TPL}"
|
||||
echo "::group::Tree of config/hooks/live"
|
||||
ls -la "${REPO_ROOT}/config/hooks/live" || true
|
||||
echo "::endgroup::"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
export ED25519_PRIV="${ED25519_PRIV//$'\r'/}"
|
||||
export ED25519_PUB="${ED25519_PUB//$'\r'/}"
|
||||
export RSA_PRIV="${RSA_PRIV//$'\r'/}"
|
||||
export RSA_PUB="${RSA_PUB//$'\r'/}"
|
||||
export CISS_PRIMORDIAL="${CISS_PRIMORDIAL//$'\r'/}"
|
||||
export CISS_PRIMORDIAL_PUB="${CISS_PRIMORDIAL_PUB//$'\r'/}"
|
||||
export CISS_PHYS_AGE="${CISS_PHYS_AGE//$'\r'/}"
|
||||
|
||||
(
|
||||
cat << EOF >| "${ID_OUT}"
|
||||
${CISS_PRIMORDIAL}
|
||||
EOF
|
||||
) && chmod 0600 "${ID_OUT}"
|
||||
if [[ -f "${ID_OUT}" ]]; then
|
||||
echo "Written: ${ID_OUT}"
|
||||
else
|
||||
echo "Error: ${ID_OUT} not written."
|
||||
fi
|
||||
|
||||
(
|
||||
cat << EOF >| "${ID_OUT_PUB}"
|
||||
${CISS_PRIMORDIAL_PUB}
|
||||
EOF
|
||||
) && chmod 0600 "${ID_OUT_PUB}"
|
||||
if [[ -f "${ID_OUT_PUB}" ]]; then
|
||||
echo "Written: ${ID_OUT_PUB}"
|
||||
else
|
||||
echo "Error: ${ID_OUT_PUB} not written."
|
||||
fi
|
||||
|
||||
perl -0777 -pe '
|
||||
BEGIN{
|
||||
$ed=$ENV{ED25519_PRIV}; $edpub=$ENV{ED25519_PUB};
|
||||
$rsa=$ENV{RSA_PRIV}; $rsapub=$ENV{RSA_PUB};
|
||||
}
|
||||
s/\{\{\s*secrets\.CISS_DLB_SSH_HOST_ED25519_KEY\s*\}\}/$ed/g;
|
||||
s/\{\{\s*secrets\.CISS_DLB_SSH_HOST_ED25519_KEY_PUB\s*\}\}/$edpub/g;
|
||||
s/\{\{\s*secrets\.CISS_DLB_SSH_HOST_RSA_KEY\s*\}\}/$rsa/g;
|
||||
s/\{\{\s*secrets\.CISS_DLB_SSH_HOST_RSA_KEY_PUB\s*\}\}/$rsapub/g;
|
||||
' "${TPL}" > "${OUT}"
|
||||
|
||||
chmod 0755 "${OUT}"
|
||||
|
||||
#perl -0777 -i -pe '
|
||||
# BEGIN {
|
||||
# our $age = $ENV{CISS_PHYS_AGE} // q{};
|
||||
# }
|
||||
# s/\{\{\s*secrets\.CISS_PHYS_AGE\s*\}\}/$age/g;
|
||||
#' -- "${SOPS}"
|
||||
#chmod 0755 "${SOPS}"
|
||||
|
||||
echo "Hook rendered: ${OUT}"
|
||||
|
||||
- name: 🛠️ Starting CISS.debian.live.builder. This may take a while ...
|
||||
shell: bash
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
chmod 0755 ciss_live_builder.sh
|
||||
timestamp=$(date -u +"%Y_%m_%dT%H_%M_%SZ")
|
||||
### Change "--autobuild=" to the specific kernel version you need: '6.16.3+deb13-amd64'.
|
||||
./ciss_live_builder.sh \
|
||||
--autobuild=6.16.3+deb13-amd64 \
|
||||
--architecture amd64 \
|
||||
--build-directory /opt/livebuild \
|
||||
--cdi \
|
||||
--control "${timestamp}" \
|
||||
--jump-host ${{ secrets.CISS_DLB_JUMP_HOSTS_1 }} \
|
||||
--root-password-file /opt/config/password.txt \
|
||||
--ssh-port ${{ secrets.CISS_DLB_SSH_PORT_1 }} \
|
||||
--ssh-pubkey /opt/config \
|
||||
--trixie
|
||||
|
||||
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)"
|
||||
OUT="$REPO_ROOT/config/hooks/live/9935_hardening_ssh.chroot"
|
||||
rm -f "$OUT"
|
||||
echo "Hook removed: $OUT"
|
||||
|
||||
- name: 📥 Checking Centurion Cloud for existing LIVE ISOs.
|
||||
shell: bash
|
||||
env:
|
||||
NC_BASE: "https://cloud.e2ee.li"
|
||||
SHARE_TOKEN: "${{ secrets.CENTURION_CLOUD_UL_USER_1 }}"
|
||||
SHARE_PASS: "${{ secrets.CENTURION_CLOUD_UL_PASSWD_1 }}"
|
||||
run: |
|
||||
set -euo pipefail
|
||||
SHARE_SUBDIR=""
|
||||
|
||||
echo "📥 Get directory listing via PROPFIND ..."
|
||||
curl -s \
|
||||
--user "${SHARE_TOKEN}:${SHARE_PASS}" \
|
||||
-X PROPFIND \
|
||||
-H "Depth: 1" \
|
||||
"${NC_BASE}/public.php/webdav/${SHARE_SUBDIR}" \
|
||||
-o propfind_public.xml
|
||||
|
||||
echo "📥 Filter .iso files from the PROPFIND response ..."
|
||||
grep -oP '(?<=<d:href>)[^<]+\.iso(?=</d:href>)' propfind_public.xml >| public_iso_list.txt || true
|
||||
|
||||
if [[ -f public_iso_list.txt && -s public_iso_list.txt ]]; then
|
||||
echo "💡 Old ISO files found and deleted :"
|
||||
while IFS= read -r href; do
|
||||
FILE_URL="${NC_BASE}${href}"
|
||||
echo " Delete: ${FILE_URL}"
|
||||
if curl -s \
|
||||
--user "${SHARE_TOKEN}:${SHARE_PASS}" \
|
||||
-X DELETE "${FILE_URL}"; then
|
||||
echo " ✅ Successfully deleted: $(basename "${href}")"
|
||||
else
|
||||
echo " ❌ Error: $(basename "${href}") could not be deleted"
|
||||
fi
|
||||
done < public_iso_list.txt
|
||||
else
|
||||
echo "💡 No old ISO files found to delete."
|
||||
fi
|
||||
|
||||
- name: 🛠️ Upload the ISO file to the Centurion Cloud (cloud.e2ee.li) via WebDAV.
|
||||
shell: bash
|
||||
env:
|
||||
NC_BASE: "https://cloud.e2ee.li"
|
||||
SHARE_TOKEN: "${{ secrets.CENTURION_CLOUD_UL_USER_1 }}"
|
||||
SHARE_PASS: "${{ secrets.CENTURION_CLOUD_UL_PASSWD_1 }}"
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [[ $(ls /opt/livebuild/*.iso 2>/dev/null | wc -l) -ne 1 ]]; then
|
||||
echo "❌ There must be exactly one .iso file in the directory!"
|
||||
exit 1
|
||||
else
|
||||
VAR_ISO_FILE_PATH=$(ls /opt/livebuild/*.iso)
|
||||
VAR_ISO_FILE_NAME=$(basename "${VAR_ISO_FILE_PATH}")
|
||||
echo "✅ ISO file found: ${VAR_ISO_FILE_NAME}"
|
||||
fi
|
||||
|
||||
AUTH="${SHARE_TOKEN}:${SHARE_PASS}"
|
||||
if curl --retry 2 "${NC_BASE}"/public.php/webdav/"${VAR_ISO_FILE_NAME}" \
|
||||
--upload-file "${VAR_ISO_FILE_PATH}" --user "${AUTH}" > /dev/null 2>&1; then
|
||||
echo "✅ New ISO successfully uploaded."
|
||||
else
|
||||
echo "❌ Uploading the new ISO failed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: 🔑 Generating a sha512 Hash of ISO, signing with the 'CI PGP DEPLOY ONLY' key, generate a success message file.
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ $(ls /opt/livebuild/*.iso 2>/dev/null | wc -l) -ne 1 ]]; then
|
||||
echo "❌ There must be exactly one .iso file in the directory!"
|
||||
exit 1
|
||||
else
|
||||
VAR_ISO_FILE_PATH=$(ls /opt/livebuild/*.iso)
|
||||
VAR_ISO_FILE_NAME=$(basename "${VAR_ISO_FILE_PATH}")
|
||||
echo "✅ ISO file found: ${VAR_ISO_FILE_NAME}"
|
||||
fi
|
||||
|
||||
VAR_ISO_FILE_SHA512="${VAR_ISO_FILE_NAME}.sha512"
|
||||
touch "${VAR_ISO_FILE_SHA512}"
|
||||
sha512sum "${VAR_ISO_FILE_PATH}" | awk '{print $1}' >| "${VAR_ISO_FILE_SHA512}"
|
||||
SIGNATURE_FILE="${VAR_ISO_FILE_SHA512}.sign"
|
||||
touch "${SIGNATURE_FILE}"
|
||||
export GNUPGHOME="$(pwd)/.gnupg"
|
||||
gpg --batch --yes --armor --detach-sign --output "${SIGNATURE_FILE}" "${VAR_ISO_FILE_SHA512}"
|
||||
|
||||
timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
||||
VAR_DATE="$(date +%F)"
|
||||
PRIVATE_FILE="LIVE_ISO_TRIXIE_1.private"
|
||||
touch "${PRIVATE_FILE}"
|
||||
cat << EOF >| "${PRIVATE_FILE}"
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: ${VAR_DATE}; 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 was automatically generated by the DEPLOY BOT on: "${timestamp}"
|
||||
|
||||
CISS.debian.live.builder ISO :
|
||||
"${VAR_ISO_FILE_NAME}"
|
||||
CISS.debian.live.builder ISO sha512 :
|
||||
$(< "${VAR_ISO_FILE_SHA512}")
|
||||
CISS.debian.live.builder ISO sha512 sign :
|
||||
$(< "${SIGNATURE_FILE}")
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=text
|
||||
EOF
|
||||
|
||||
- name: 🚧 Stash local changes (including untracked).
|
||||
shell: bash
|
||||
env:
|
||||
GIT_SSH_COMMAND: "ssh -p 42842"
|
||||
run: |
|
||||
set -euo pipefail
|
||||
### Temporarily store any local modifications or untracked files.
|
||||
git stash push --include-untracked -m "ci-temp" || echo "✔️ Nothing to stash."
|
||||
|
||||
- name: 🔄 Sync with remote before commit using merge strategy.
|
||||
shell: bash
|
||||
env:
|
||||
GIT_SSH_COMMAND: "ssh -p 42842"
|
||||
run: |
|
||||
set -euo pipefail
|
||||
export GNUPGHOME="$(pwd)/.gnupg"
|
||||
|
||||
echo "🔄 Fetching origin/master ..."
|
||||
git fetch origin master
|
||||
|
||||
echo "🔁 Merging origin/master into current branch ..."
|
||||
git merge --no-edit origin/master || echo "✔️ Already up to date or fast-forward."
|
||||
|
||||
echo "📋 Post-merge status :"
|
||||
git status
|
||||
git log --oneline -n 5
|
||||
|
||||
- name: 🛠️ Restore stashed changes.
|
||||
shell: bash
|
||||
env:
|
||||
GIT_SSH_COMMAND: "ssh -p 42842"
|
||||
run: |
|
||||
set -euo pipefail
|
||||
### Apply previously stashed changes.
|
||||
git stash pop || echo "✔️ Nothing to pop."
|
||||
|
||||
- name: 📦 Stage generated files.
|
||||
shell: bash
|
||||
env:
|
||||
GIT_SSH_COMMAND: "ssh -p 42842"
|
||||
run: |
|
||||
set -euo pipefail
|
||||
PRIVATE_FILE="LIVE_ISO_TRIXIE_1.private"
|
||||
git add "${PRIVATE_FILE}" || echo "✔️ Nothing to add."
|
||||
|
||||
- name: 🔑 Commit and sign changes with CI metadata.
|
||||
shell: bash
|
||||
env:
|
||||
GIT_SSH_COMMAND: "ssh -p 42842"
|
||||
run: |
|
||||
set -euo pipefail
|
||||
export GNUPGHOME="$(pwd)/.gnupg"
|
||||
|
||||
if git diff --cached --quiet; then
|
||||
echo "✔️ No staged changes to commit."
|
||||
else
|
||||
echo "📝 Committing changes with GPG signature ..."
|
||||
|
||||
### CI Metadata
|
||||
TIMESTAMP_UTC="$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
|
||||
HOSTNAME="$(hostname -f || hostname)"
|
||||
GIT_SHA="$(git rev-parse --short HEAD)"
|
||||
GIT_REF="$(git symbolic-ref --short HEAD || echo detached)"
|
||||
WORKFLOW_ID="${GITHUB_WORKFLOW:-render-md-to-html.yaml}"
|
||||
CI_HEADER="X-CI-Metadata: ${GIT_REF}@${GIT_SHA} at ${TIMESTAMP_UTC} on ${HOSTNAME}"
|
||||
|
||||
COMMIT_MSG="DEPLOY BOT : 🔐 Auto-Generate PRIVATE LIVE ISO TRIXIE 1 [skip ci]
|
||||
|
||||
${CI_HEADER}
|
||||
|
||||
Generated at : ${TIMESTAMP_UTC}
|
||||
Runner Host : ${HOSTNAME}
|
||||
Workflow ID : ${WORKFLOW_ID}
|
||||
Git Commit : ${GIT_SHA} HEAD -> ${GIT_REF}
|
||||
"
|
||||
|
||||
echo "🔏 Commit message :"
|
||||
echo "${COMMIT_MSG}"
|
||||
git commit -S -m "${COMMIT_MSG}"
|
||||
fi
|
||||
|
||||
- name: 🔁 Push back to repository.
|
||||
shell: bash
|
||||
env:
|
||||
GIT_SSH_COMMAND: "ssh -p 42842"
|
||||
run: |
|
||||
set -euo pipefail
|
||||
echo "📤 Pushing changes to ${GITHUB_REF_NAME} ..."
|
||||
git push origin HEAD:${GITHUB_REF_NAME}
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=yaml
|
||||
@@ -25,7 +25,7 @@ body:
|
||||
attributes:
|
||||
label: "Version"
|
||||
description: "Which version are you running? Use `./ciss_live_builder.sh -v`."
|
||||
placeholder: "e.g., Master V8.13.008.2025.08.22"
|
||||
placeholder: "e.g., Master V8.13.294.2025.10.28"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
### Version Master V8.13.008.2025.08.22
|
||||
# Version Master V8.13.294.2025.10.28
|
||||
|
||||
FROM debian:bookworm
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
### Version Master V8.13.008.2025.08.22
|
||||
# Version Master V8.13.294.2025.10.28
|
||||
|
||||
name: 🔁 Render README.md to README.html.
|
||||
|
||||
|
||||
@@ -11,5 +11,5 @@
|
||||
|
||||
build:
|
||||
counter: 1023
|
||||
version: V8.13.008.2025.08.22
|
||||
version: V8.13.294.2025.10.28
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=yaml
|
||||
|
||||
@@ -10,6 +10,6 @@
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
build:
|
||||
counter: 1023
|
||||
version: V8.13.008.2025.08.22
|
||||
counter: 1024
|
||||
version: V8.13.294.2025.10.28
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=yaml
|
||||
|
||||
@@ -11,5 +11,5 @@
|
||||
|
||||
build:
|
||||
counter: 1023
|
||||
version: V8.13.008.2025.08.22
|
||||
version: V8.13.294.2025.10.28
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=yaml
|
||||
|
||||
@@ -11,5 +11,5 @@
|
||||
|
||||
build:
|
||||
counter: 1023
|
||||
version: V8.13.008.2025.08.22
|
||||
version: V8.13.294.2025.10.28
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=yaml
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
### Version Master V8.13.008.2025.08.22
|
||||
# Version Master V8.13.294.2025.10.28
|
||||
|
||||
name: 🔐 Generating a Private Live ISO TRIXIE.
|
||||
|
||||
@@ -40,7 +40,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get update
|
||||
apt-get update -qq
|
||||
apt-get upgrade -y
|
||||
apt-get install -y --no-install-recommends \
|
||||
apt-utils \
|
||||
@@ -51,6 +51,7 @@ jobs:
|
||||
gnupg \
|
||||
openssh-client \
|
||||
openssl \
|
||||
perl \
|
||||
sudo \
|
||||
util-linux
|
||||
|
||||
@@ -62,6 +63,11 @@ jobs:
|
||||
- name: ⚙️ Preparing SSH Setup, SSH Deploy Key, Known Hosts, .config.
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
var_wait=$(( RANDOM % 33 ))
|
||||
printf "⏳ Waiting %s seconds to desynchronize parallel workflows...\n" "${var_wait}"
|
||||
sleep "${var_wait}"
|
||||
|
||||
rm -rf ~/.ssh && mkdir -m700 ~/.ssh
|
||||
|
||||
### Private Key
|
||||
@@ -136,17 +142,91 @@ jobs:
|
||||
echo "${{ secrets.CISS_DLB_ROOT_PWD }}" >| /opt/config/password.txt
|
||||
echo "${{ secrets.CISS_DLB_ROOT_SSH_PUBKEY }}" >| /opt/config/authorized_keys
|
||||
|
||||
- name: 🔧 Render live hook with secrets.
|
||||
shell: bash
|
||||
working-directory: ${{ github.workspace }}
|
||||
env:
|
||||
ED25519_PRIV: ${{ secrets.CISS_DLB_SSH_HOST_ED25519_KEY }}
|
||||
ED25519_PUB: ${{ secrets.CISS_DLB_SSH_HOST_ED25519_KEY_PUB }}
|
||||
RSA_PRIV: ${{ secrets.CISS_DLB_SSH_HOST_RSA_KEY }}
|
||||
RSA_PUB: ${{ secrets.CISS_DLB_SSH_HOST_RSA_KEY_PUB }}
|
||||
CISS_PRIMORDIAL: ${{ secrets.CISS_PRIMORDIAL_PRIVATE }}
|
||||
CISS_PRIMORDIAL_PUB: ${{ secrets.CISS_PRIMORDIAL_PUBLIC }}
|
||||
run: |
|
||||
set -Ceuo pipefail
|
||||
umask 077
|
||||
|
||||
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)"
|
||||
|
||||
TPL="${REPO_ROOT}/config/hooks/live/9935_hardening_ssh.chroot.tmpl"
|
||||
OUT="${REPO_ROOT}/config/hooks/live/9935_hardening_ssh.chroot"
|
||||
ID_OUT="${REPO_ROOT}/config/includes.chroot/root/.ssh/id_2025_ed25519_ciss_primordial"
|
||||
ID_OUT_PUB="${REPO_ROOT}/config/includes.chroot/root/.ssh/id_2025_ed25519_ciss_primordial.pub"
|
||||
|
||||
if [[ ! -f "${TPL}" ]]; then
|
||||
echo "Template not found: ${TPL}"
|
||||
echo "::group::Tree of config/hooks/live"
|
||||
ls -la "${REPO_ROOT}/config/hooks/live" || true
|
||||
echo "::endgroup::"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
export ED25519_PRIV="${ED25519_PRIV//$'\r'/}"
|
||||
export ED25519_PUB="${ED25519_PUB//$'\r'/}"
|
||||
export RSA_PRIV="${RSA_PRIV//$'\r'/}"
|
||||
export RSA_PUB="${RSA_PUB//$'\r'/}"
|
||||
export CISS_PRIMORDIAL="${CISS_PRIMORDIAL//$'\r'/}"
|
||||
export CISS_PRIMORDIAL_PUB="${CISS_PRIMORDIAL_PUB//$'\r'/}"
|
||||
|
||||
(
|
||||
cat << EOF >| "${ID_OUT}"
|
||||
${CISS_PRIMORDIAL}
|
||||
EOF
|
||||
) && chmod 0600 "${ID_OUT}"
|
||||
if [[ -f "${ID_OUT}" ]]; then
|
||||
echo "Written: ${ID_OUT}"
|
||||
else
|
||||
echo "Error: ${ID_OUT} not written."
|
||||
fi
|
||||
|
||||
(
|
||||
cat << EOF >| "${ID_OUT_PUB}"
|
||||
${CISS_PRIMORDIAL_PUB}
|
||||
EOF
|
||||
) && chmod 0600 "${ID_OUT_PUB}"
|
||||
if [[ -f "${ID_OUT_PUB}" ]]; then
|
||||
echo "Written: ${ID_OUT_PUB}"
|
||||
else
|
||||
echo "Error: ${ID_OUT_PUB} not written."
|
||||
fi
|
||||
|
||||
perl -0777 -pe '
|
||||
BEGIN{
|
||||
$ed=$ENV{ED25519_PRIV}; $edpub=$ENV{ED25519_PUB};
|
||||
$rsa=$ENV{RSA_PRIV}; $rsapub=$ENV{RSA_PUB};
|
||||
}
|
||||
s/\{\{\s*secrets\.CISS_DLB_SSH_HOST_ED25519_KEY\s*\}\}/$ed/g;
|
||||
s/\{\{\s*secrets\.CISS_DLB_SSH_HOST_ED25519_KEY_PUB\s*\}\}/$edpub/g;
|
||||
s/\{\{\s*secrets\.CISS_DLB_SSH_HOST_RSA_KEY\s*\}\}/$rsa/g;
|
||||
s/\{\{\s*secrets\.CISS_DLB_SSH_HOST_RSA_KEY_PUB\s*\}\}/$rsapub/g;
|
||||
' "${TPL}" > "${OUT}"
|
||||
|
||||
chmod 0755 "${OUT}"
|
||||
echo "Hook rendered: ${OUT}"
|
||||
|
||||
- name: 🛠️ Starting CISS.debian.live.builder. This may take a while ...
|
||||
shell: bash
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
chmod 0755 ciss_live_builder.sh
|
||||
timestamp=$(date -u +"%Y_%m_%dT%H_%M_%SZ")
|
||||
### Change "--autobuild=" to the specific kernel version you need: '6.12.41+deb13-amd64'.
|
||||
### Change "--autobuild=" to the specific kernel version you need: '6.16.3+deb13-amd64'.
|
||||
./ciss_live_builder.sh \
|
||||
--autobuild=6.12.41+deb13-amd64 \
|
||||
--autobuild=6.16.3+deb13-amd64 \
|
||||
--architecture amd64 \
|
||||
--build-directory /opt/livebuild \
|
||||
--cdi \
|
||||
--control "${timestamp}" \
|
||||
--debug \
|
||||
--dhcp-centurion \
|
||||
@@ -155,8 +235,14 @@ jobs:
|
||||
--root-password-file /opt/config/password.txt \
|
||||
--ssh-port ${{ secrets.CISS_DLB_SSH_PORT }} \
|
||||
--ssh-pubkey /opt/config \
|
||||
--sshfp \
|
||||
--trixie
|
||||
|
||||
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)"
|
||||
OUT="$REPO_ROOT/config/hooks/live/9935_hardening_ssh.chroot"
|
||||
rm -f "$OUT"
|
||||
echo "Hook removed: $OUT"
|
||||
|
||||
- name: 📥 Checking Centurion Cloud for existing LIVE ISOs.
|
||||
shell: bash
|
||||
env:
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
### Version Master V8.13.008.2025.08.22
|
||||
# Version Master V8.13.294.2025.10.28
|
||||
|
||||
name: 🔐 Generating a Private Live ISO TRIXIE.
|
||||
|
||||
@@ -40,7 +40,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get update
|
||||
apt-get update -qq
|
||||
apt-get upgrade -y
|
||||
apt-get install -y --no-install-recommends \
|
||||
apt-utils \
|
||||
@@ -51,6 +51,7 @@ jobs:
|
||||
gnupg \
|
||||
openssh-client \
|
||||
openssl \
|
||||
perl \
|
||||
sudo \
|
||||
util-linux
|
||||
|
||||
@@ -62,6 +63,11 @@ jobs:
|
||||
- name: ⚙️ Preparing SSH Setup, SSH Deploy Key, Known Hosts, .config.
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
var_wait=$(( RANDOM % 33 ))
|
||||
printf "⏳ Waiting %s seconds to desynchronize parallel workflows...\n" "${var_wait}"
|
||||
sleep "${var_wait}"
|
||||
|
||||
rm -rf ~/.ssh && mkdir -m700 ~/.ssh
|
||||
|
||||
### Private Key
|
||||
@@ -136,24 +142,116 @@ jobs:
|
||||
echo "${{ secrets.CISS_DLB_ROOT_PWD_1 }}" >| /opt/config/password.txt
|
||||
echo "${{ secrets.CISS_DLB_ROOT_SSH_PUBKEY_1 }}" >| /opt/config/authorized_keys
|
||||
|
||||
- name: 🔧 Render live hook with secrets.
|
||||
shell: bash
|
||||
working-directory: ${{ github.workspace }}
|
||||
env:
|
||||
ED25519_PRIV: ${{ secrets.CISS_DLB_SSH_HOST_ED25519_KEY }}
|
||||
ED25519_PUB: ${{ secrets.CISS_DLB_SSH_HOST_ED25519_KEY_PUB }}
|
||||
RSA_PRIV: ${{ secrets.CISS_DLB_SSH_HOST_RSA_KEY }}
|
||||
RSA_PUB: ${{ secrets.CISS_DLB_SSH_HOST_RSA_KEY_PUB }}
|
||||
CISS_PRIMORDIAL: ${{ secrets.CISS_PRIMORDIAL_PRIVATE }}
|
||||
CISS_PRIMORDIAL_PUB: ${{ secrets.CISS_PRIMORDIAL_PUBLIC }}
|
||||
CISS_PHYS_AGE: ${{ secrets.CISS_PHYS_AGE }}
|
||||
run: |
|
||||
set -Ceuo pipefail
|
||||
umask 077
|
||||
|
||||
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)"
|
||||
|
||||
TPL="${REPO_ROOT}/config/hooks/live/9935_hardening_ssh.chroot.tmpl"
|
||||
OUT="${REPO_ROOT}/config/hooks/live/9935_hardening_ssh.chroot"
|
||||
ID_OUT="${REPO_ROOT}/config/includes.chroot/root/.ssh/id_2025_ed25519_ciss_primordial"
|
||||
ID_OUT_PUB="${REPO_ROOT}/config/includes.chroot/root/.ssh/id_2025_ed25519_ciss_primordial.pub"
|
||||
SOPS="${REPO_ROOT}/config/hooks/live/0860_sops.chroot"
|
||||
|
||||
if [[ ! -f "${TPL}" ]]; then
|
||||
echo "Template not found: ${TPL}"
|
||||
echo "::group::Tree of config/hooks/live"
|
||||
ls -la "${REPO_ROOT}/config/hooks/live" || true
|
||||
echo "::endgroup::"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
export ED25519_PRIV="${ED25519_PRIV//$'\r'/}"
|
||||
export ED25519_PUB="${ED25519_PUB//$'\r'/}"
|
||||
export RSA_PRIV="${RSA_PRIV//$'\r'/}"
|
||||
export RSA_PUB="${RSA_PUB//$'\r'/}"
|
||||
export CISS_PRIMORDIAL="${CISS_PRIMORDIAL//$'\r'/}"
|
||||
export CISS_PRIMORDIAL_PUB="${CISS_PRIMORDIAL_PUB//$'\r'/}"
|
||||
export CISS_PHYS_AGE="${CISS_PHYS_AGE//$'\r'/}"
|
||||
|
||||
(
|
||||
cat << EOF >| "${ID_OUT}"
|
||||
${CISS_PRIMORDIAL}
|
||||
EOF
|
||||
) && chmod 0600 "${ID_OUT}"
|
||||
if [[ -f "${ID_OUT}" ]]; then
|
||||
echo "Written: ${ID_OUT}"
|
||||
else
|
||||
echo "Error: ${ID_OUT} not written."
|
||||
fi
|
||||
|
||||
(
|
||||
cat << EOF >| "${ID_OUT_PUB}"
|
||||
${CISS_PRIMORDIAL_PUB}
|
||||
EOF
|
||||
) && chmod 0600 "${ID_OUT_PUB}"
|
||||
if [[ -f "${ID_OUT_PUB}" ]]; then
|
||||
echo "Written: ${ID_OUT_PUB}"
|
||||
else
|
||||
echo "Error: ${ID_OUT_PUB} not written."
|
||||
fi
|
||||
|
||||
perl -0777 -pe '
|
||||
BEGIN{
|
||||
$ed=$ENV{ED25519_PRIV}; $edpub=$ENV{ED25519_PUB};
|
||||
$rsa=$ENV{RSA_PRIV}; $rsapub=$ENV{RSA_PUB};
|
||||
}
|
||||
s/\{\{\s*secrets\.CISS_DLB_SSH_HOST_ED25519_KEY\s*\}\}/$ed/g;
|
||||
s/\{\{\s*secrets\.CISS_DLB_SSH_HOST_ED25519_KEY_PUB\s*\}\}/$edpub/g;
|
||||
s/\{\{\s*secrets\.CISS_DLB_SSH_HOST_RSA_KEY\s*\}\}/$rsa/g;
|
||||
s/\{\{\s*secrets\.CISS_DLB_SSH_HOST_RSA_KEY_PUB\s*\}\}/$rsapub/g;
|
||||
' "${TPL}" > "${OUT}"
|
||||
|
||||
chmod 0755 "${OUT}"
|
||||
|
||||
perl -0777 -i -pe '
|
||||
BEGIN {
|
||||
our $age = $ENV{CISS_PHYS_AGE} // q{};
|
||||
}
|
||||
s/\{\{\s*secrets\.CISS_PHYS_AGE\s*\}\}/$age/g;
|
||||
' -- "${SOPS}"
|
||||
chmod 0755 "${SOPS}"
|
||||
|
||||
echo "Hook rendered: ${OUT}"
|
||||
|
||||
- name: 🛠️ Starting CISS.debian.live.builder. This may take a while ...
|
||||
shell: bash
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
chmod 0755 ciss_live_builder.sh
|
||||
timestamp=$(date -u +"%Y_%m_%dT%H_%M_%SZ")
|
||||
### Change "--autobuild=" to the specific kernel version you need: '6.12.41+deb13-amd64'.
|
||||
### Change "--autobuild=" to the specific kernel version you need: '6.16.3+deb13-amd64'.
|
||||
./ciss_live_builder.sh \
|
||||
--autobuild=6.12.41+deb13-amd64 \
|
||||
--autobuild=6.16.3+deb13-amd64 \
|
||||
--architecture amd64 \
|
||||
--build-directory /opt/livebuild \
|
||||
--cdi \
|
||||
--control "${timestamp}" \
|
||||
--jump-host ${{ secrets.CISS_DLB_JUMP_HOSTS_1 }} \
|
||||
--root-password-file /opt/config/password.txt \
|
||||
--ssh-port ${{ secrets.CISS_DLB_SSH_PORT_1 }} \
|
||||
--ssh-pubkey /opt/config \
|
||||
--sshfp \
|
||||
--trixie
|
||||
|
||||
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)"
|
||||
OUT="$REPO_ROOT/config/hooks/live/9935_hardening_ssh.chroot"
|
||||
rm -f "$OUT"
|
||||
echo "Hook removed: $OUT"
|
||||
|
||||
- name: 📥 Checking Centurion Cloud for existing LIVE ISOs.
|
||||
shell: bash
|
||||
env:
|
||||
|
||||
@@ -9,10 +9,14 @@
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
### Version Master V8.13.008.2025.08.22
|
||||
# Version Master V8.13.294.2025.10.28
|
||||
|
||||
name: 💙 Generating a PUBLIC Live ISO.
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
@@ -24,161 +28,32 @@ on:
|
||||
- '.gitea/trigger/t_generate_PUBLIC.yaml'
|
||||
|
||||
jobs:
|
||||
generate-private-ciss-debian-live-iso:
|
||||
generate-public-cdlb-trixie:
|
||||
name: 💙 Generating a PUBLIC Live ISO.
|
||||
runs-on: ciss.debian.live.builder.iso.generator
|
||||
runs-on: cdlb.trixie
|
||||
|
||||
### Run all steps inside Debian Bookworm
|
||||
container:
|
||||
image: debian:bookworm
|
||||
image: debian:trixie
|
||||
|
||||
steps:
|
||||
- name: 🛠️ Basic Image Setup and enable Bookworm Backports.
|
||||
run: |
|
||||
apt-get update -y
|
||||
apt-get install -y apt-transport-https apt-utils bash ca-certificates openssl sudo
|
||||
echo 'deb https://deb.debian.org/debian bookworm-backports main' \
|
||||
>| /etc/apt/sources.list.d/bookworm-backports.list
|
||||
apt-get update -y
|
||||
apt-get upgrade -y
|
||||
|
||||
- name: 🛠️ Installing Build Tools.
|
||||
- name: 🛠️ Basic Image Setup.
|
||||
shell: bash
|
||||
run: |
|
||||
apt-get update -y
|
||||
apt-get install -y \
|
||||
autoconf \
|
||||
automake \
|
||||
build-essential \
|
||||
cryptsetup \
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get update -qq
|
||||
apt-get upgrade -y
|
||||
apt-get install -y --no-install-recommends \
|
||||
apt-utils \
|
||||
bash \
|
||||
ca-certificates \
|
||||
curl \
|
||||
debootstrap \
|
||||
dosfstools \
|
||||
efibootmgr \
|
||||
gettext \
|
||||
git \
|
||||
gnupg \
|
||||
haveged \
|
||||
libbz2-dev \
|
||||
zlib1g-dev \
|
||||
liblzma-dev \
|
||||
libtool \
|
||||
live-build \
|
||||
parted \
|
||||
pkg-config \
|
||||
ssh \
|
||||
ssl-cert \
|
||||
openssh-client \
|
||||
openssl \
|
||||
perl \
|
||||
sudo \
|
||||
texinfo \
|
||||
wget \
|
||||
whois \
|
||||
|
||||
- name: 🛠️ Build GnuPG from the sources, as the Bookworm GPG does not understand key format 5.
|
||||
shell: bash
|
||||
run: |
|
||||
urls=(
|
||||
"https://gnupg.org/ftp/gcrypt/npth/npth-1.8.tar.bz2"
|
||||
"https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.55.tar.bz2"
|
||||
"https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.11.1.tar.bz2"
|
||||
"https://gnupg.org/ftp/gcrypt/libksba/libksba-1.6.7.tar.bz2"
|
||||
"https://gnupg.org/ftp/gcrypt/libassuan/libassuan-3.0.2.tar.bz2"
|
||||
"https://gnupg.org/ftp/gcrypt/gnupg/gnupg-2.4.8.tar.bz2"
|
||||
)
|
||||
|
||||
wget --https-only https://gnupg.org/signature_key.asc -O signature_key.asc > /dev/null 2>&1
|
||||
gpg --batch --import signature_key.asc
|
||||
|
||||
for url in "${urls[@]}"; do
|
||||
archive_name="${url##*/}"
|
||||
pkg_name="${archive_name%.tar.bz2}"
|
||||
echo "🔄 Processing ${pkg_name}"
|
||||
if [[ ! -f "${archive_name}" ]]; then
|
||||
echo "📥 Downloading: '${archive_name}'."
|
||||
if wget --https-only "${url}" -O "${archive_name}" > /dev/null 2>&1 && wget --https-only "${url}.sig" -O "${archive_name}.sig" > /dev/null 2>&1; then
|
||||
echo "✅ Download successful: '${archive_name}'."
|
||||
else
|
||||
echo "❌ Download NOT successful: '${archive_name}'."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "💡 Skipping download, package already exists: '${archive_name}'."
|
||||
fi
|
||||
|
||||
if ! gpg --verify "${archive_name}.sig" "${archive_name}"; then echo "❌ Bad Signature: '${archive_name}'.";exit 1; fi
|
||||
|
||||
if [[ ! -d "${pkg_name}" ]]; then
|
||||
echo "📂 Extracting: '${archive_name}'."
|
||||
if tar -xjf "${archive_name}"; then
|
||||
echo "✅ Extraction successful: '${archive_name}'."
|
||||
else
|
||||
echo "❌ Extraction not successful: '${archive_name}'."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "💡 Skipping directory, already exists: '${pkg_name}'."
|
||||
fi
|
||||
|
||||
echo "🏗️ Build and install the package: '${pkg_name}'."
|
||||
cd "${pkg_name}" || { echo "❌ Could not change to '${pkg_name}'."; exit 1; }
|
||||
mkdir -p build
|
||||
cd build || { echo "❌ Could not change to '/build'."; exit 1; }
|
||||
|
||||
sudo ../configure > /dev/null 2>&1 || { echo "❌ '../configure' NOT successful for '${pkg_name}'."; exit 1; }
|
||||
make > /dev/null 2>&1 || { echo "❌ 'make' NOT successful for '${pkg_name}'."; exit 1; }
|
||||
sudo make install > /dev/null 2>&1 || { echo "❌ 'make install' NOT successful for '${pkg_name}'."; exit 1; }
|
||||
|
||||
cd ../.. || { echo "❌ Could not change to '../..'."; exit 1; }
|
||||
|
||||
rm -f "${archive_name}" && rm -f "${archive_name}.sig" && echo "✅ Removed archive: '${pkg_name}'."
|
||||
rm -fr "${pkg_name}" && echo "✅ Removed build artifacts: '${pkg_name}'."
|
||||
echo "✅ Successful build and installation of '${pkg_name}'."
|
||||
echo "-------------------------------------------------------------------------------------"
|
||||
|
||||
done
|
||||
|
||||
rm -f signature_key.asc
|
||||
|
||||
echo "✅ All packages were built and installed successfully."
|
||||
|
||||
mv_bin=(
|
||||
"/usr/bin/gpg"
|
||||
"/usr/bin/gpg-agent"
|
||||
"/usr/bin/gpgconf"
|
||||
"/usr/bin/gpg-connect-agent"
|
||||
"/usr/bin/gpg-wks-client"
|
||||
"/usr/bin/gpg-preset-passphrase"
|
||||
)
|
||||
|
||||
for bin in "${mv_bin[@]}"; do
|
||||
name="${bin##*/}"
|
||||
if [[ -f "${bin}" && -f "/usr/local/bin/${name}" ]]; then
|
||||
if mv "${bin}" "${bin}.debian-backup"; then
|
||||
echo "✅ Moved successfully: '${bin}'."
|
||||
else
|
||||
echo "❌ Moved NOT successfully: '${bin}'."
|
||||
fi
|
||||
else
|
||||
echo "💡 Does not exist as build binary: '${bin}'."
|
||||
fi
|
||||
done
|
||||
|
||||
for bin in "${mv_bin[@]}"; do
|
||||
name="${bin##*/}"
|
||||
if [[ -f "/usr/local/bin/${name}" ]]; then
|
||||
if update-alternatives --install "${bin}" "${name}" "/usr/local/bin/${name}" 100; then
|
||||
echo "✅ 'update-alternatives' successfully: '${bin}'."
|
||||
else
|
||||
echo "❌ 'update-alternatives' NOT successfully: '${bin}'."
|
||||
fi
|
||||
else
|
||||
echo "💡 Does not exist: '/usr/local/bin/${name}'."
|
||||
fi
|
||||
done
|
||||
|
||||
sudo ldconfig
|
||||
|
||||
gpgconf --kill all
|
||||
/usr/local/bin/gpg-agent --daemon
|
||||
util-linux
|
||||
|
||||
- name: ⚙️ Check GnuPG Version.
|
||||
shell: bash
|
||||
@@ -188,6 +63,11 @@ jobs:
|
||||
- name: ⚙️ Preparing SSH Setup, SSH Deploy Key, Known Hosts, .config.
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
var_wait=$(( RANDOM % 33 ))
|
||||
printf "⏳ Waiting %s seconds to desynchronize parallel workflows...\n" "${var_wait}"
|
||||
sleep "${var_wait}"
|
||||
|
||||
rm -rf ~/.ssh && mkdir -m700 ~/.ssh
|
||||
|
||||
### Private Key
|
||||
@@ -269,15 +149,18 @@ jobs:
|
||||
sed -i '/^hardening_ssh.*/d' ciss_live_builder.sh
|
||||
chmod 0755 ciss_live_builder.sh
|
||||
timestamp=$(date -u +"%Y_%m_%dT%H_%M_%SZ")
|
||||
### Change "--autobuild=" to the specific kernel version you need: 6.12.22+bpo-amd64.
|
||||
### Change "--autobuild=" to the specific kernel version you need: '6.16.3+deb13-amd64'.
|
||||
./ciss_live_builder.sh \
|
||||
--autobuild=6.1.0-37-amd64 \
|
||||
--autobuild=6.16.3+deb13-amd64 \
|
||||
--architecture amd64 \
|
||||
--build-directory /opt/livebuild \
|
||||
--cdi \
|
||||
--control "${timestamp}" \
|
||||
--debug \
|
||||
--root-password-file /opt/config/password.txt \
|
||||
--ssh-port 42137 \
|
||||
--ssh-pubkey /opt/config
|
||||
--ssh-pubkey /opt/config \
|
||||
--trixie
|
||||
|
||||
- name: 📥 Checking Centurion Cloud for existing LIVE ISOs.
|
||||
shell: bash
|
||||
@@ -364,11 +247,12 @@ jobs:
|
||||
gpg --batch --yes --armor --detach-sign --output "${SIGNATURE_FILE}" "${VAR_ISO_FILE_SHA512}"
|
||||
|
||||
timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
||||
VAR_DATE="$(date +%F)"
|
||||
PRIVATE_FILE="LIVE_ISO.public"
|
||||
touch "${PRIVATE_FILE}"
|
||||
cat << EOF >| "${PRIVATE_FILE}"
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-06-01; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: ${VAR_DATE}; 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>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
### Version Master V8.13.008.2025.08.22
|
||||
# Version Master V8.13.294.2025.10.28
|
||||
|
||||
# Gitea Workflow: Shell-Script Linting
|
||||
#
|
||||
@@ -41,6 +41,10 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
var_wait=$(( RANDOM % 33 ))
|
||||
printf "⏳ Waiting %s seconds to desynchronize parallel workflows...\n" "${var_wait}"
|
||||
sleep "${var_wait}"
|
||||
|
||||
rm -rf ~/.ssh && mkdir -m700 ~/.ssh
|
||||
|
||||
### Private Key
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
### Version Master V8.13.008.2025.08.22
|
||||
# Version Master V8.13.294.2025.10.28
|
||||
|
||||
name: 🛡️ Retrieve DNSSEC status of coresecret.dev.
|
||||
|
||||
@@ -33,6 +33,10 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
var_wait=$(( RANDOM % 33 ))
|
||||
printf "⏳ Waiting %s seconds to desynchronize parallel workflows...\n" "${var_wait}"
|
||||
sleep "${var_wait}"
|
||||
|
||||
rm -rf ~/.ssh && mkdir -m700 ~/.ssh
|
||||
|
||||
### Private Key
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
### Version Master V8.13.008.2025.08.22
|
||||
# Version Master V8.13.294.2025.10.28
|
||||
|
||||
name: 🔁 Render Graphviz Diagrams.
|
||||
|
||||
@@ -34,6 +34,10 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
var_wait=$(( RANDOM % 33 ))
|
||||
printf "⏳ Waiting %s seconds to desynchronize parallel workflows...\n" "${var_wait}"
|
||||
sleep "${var_wait}"
|
||||
|
||||
rm -rf ~/.ssh && mkdir -m700 ~/.ssh
|
||||
|
||||
### Private Key
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -10,7 +10,6 @@
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
.checklist/
|
||||
.idea/
|
||||
build/
|
||||
out/
|
||||
target/
|
||||
*.DS_Store
|
||||
|
||||
@@ -15,5 +15,5 @@ properties_SPDX-License-Identifier="EUPL-1.2 OR LicenseRef-CCLA-1.0"
|
||||
properties_SPDX-LicenseComment="This file is part of the CISS.debian.installer.secure framework."
|
||||
properties_SPDX-PackageName="CISS.debian.live.builder"
|
||||
properties_SPDX-Security-Contact="security@coresecret.eu"
|
||||
properties_version="V8.13.008.2025.08.22"
|
||||
properties_version="V8.13.294.2025.10.28"
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=conf
|
||||
|
||||
@@ -6,7 +6,7 @@ Creator: Person: Marc S. Weidner (Centurion Intelligence Consulting Agency)
|
||||
Created: 2025-05-07T12:00:00Z
|
||||
Package: CISS.debian.live.builder
|
||||
PackageName: CISS.debian.live.builder
|
||||
PackageVersion: Master V8.13.008.2025.08.22
|
||||
PackageVersion: Master V8.13.294.2025.10.28
|
||||
PackageSupplier: Organization: Centurion Intelligence Consulting Agency
|
||||
PackageDownloadLocation: https://git.coresecret.dev/msw/CISS.debian.live.builder
|
||||
PackageHomePage: https://git.coresecret.dev/msw/CISS.debian.live.builder
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-08-22; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-28; 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>
|
||||
@@ -9,7 +9,7 @@
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
This file was automatically generated by the DEPLOY BOT on: "2025-08-22T17:25:58Z"
|
||||
This file was automatically generated by the DEPLOY BOT on: "2025-10-28T18:49:03Z"
|
||||
|
||||
✅ The last linter check was successful. ✅
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-06-01; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-24; 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>
|
||||
@@ -9,19 +9,19 @@
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
This file was automatically generated by the DEPLOY BOT on: "2025-08-11T22:40:21Z".
|
||||
This file was automatically generated by the DEPLOY BOT on: "2025-10-24T14:50:31Z"
|
||||
|
||||
CISS.debian.live.builder ISO :
|
||||
"ciss-debian-live-2025_08_11T21_49_56Z-amd64.hybrid.iso"
|
||||
"ciss-debian-live-2025_10_24T13_56_21Z-amd64.hybrid.iso"
|
||||
CISS.debian.live.builder ISO sha512 :
|
||||
4aa02673b9a8d5b974014eca4371d1ed69b05eaea9e92203cf7c092880833e18812bf31ab053399eda98b7a3da0b76b8dcdaaba892e9f52f836ea9d2b0e09e38
|
||||
036a1004fee05962610c6e604510bc5293aecf56ddca6cde311179f4b437f6d1d474c6deaca0189de5bea80186068ac82de17b9814fbd6ab2e9ed54e47f3de8f
|
||||
CISS.debian.live.builder ISO sha512 sign :
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iHUEABYKAB0WIQSqYnPMNKGz69afyHA85KY4hzOwIQUCaJpxVQAKCRA85KY4hzOw
|
||||
IZWOAQDJriUoDvDNSQiHbFfW4KVV1E1wqe12eS7GyfVFr9bISwEAoDKhQ85+RiGr
|
||||
pCdWqvU8wcfzEIlKIpAgAZVrhX/xRw8=
|
||||
=wNVV
|
||||
iHQEABYKAB0WIQSqYnPMNKGz69afyHA85KY4hzOwIQUCaPuSNwAKCRA85KY4hzOw
|
||||
IXoDAP9cfoBONoT0ckPEZS7Ny/4l3hLGW4hKcJYz/bTJLy9MkAD468vyMLOwI9yM
|
||||
ipWXHva/2ghh0CqBXzuR+QfSRToABg==
|
||||
=8+N2
|
||||
-----END PGP SIGNATURE-----
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=text
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-08-22; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-28; 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>
|
||||
@@ -9,19 +9,19 @@
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
This file was automatically generated by the DEPLOY BOT on: "2025-08-22T16:55:09Z"
|
||||
This file was automatically generated by the DEPLOY BOT on: "2025-10-28T09:52:35Z"
|
||||
|
||||
CISS.debian.live.builder ISO :
|
||||
"ciss-debian-live-2025_08_22T16_11_02Z-amd64.hybrid.iso"
|
||||
"ciss-debian-live-2025_10_28T08_58_22Z-amd64.hybrid.iso"
|
||||
CISS.debian.live.builder ISO sha512 :
|
||||
35c288d96239804e244cbe99c8ce3895aec39104a7200c2ef7326d38e1ec4eea3bf60b895eaa4d981cb718ae4d27d2d4166f16252b88606a870d14c3db096a37
|
||||
098af6c0d36b41bfe7c03d978eefa721bd39ba4ed4ba26c422fb589a635522369d0f8ef2ca48248cf6f0e11dda55ef748247822f05c6291fd0aca3763ea1abf2
|
||||
CISS.debian.live.builder ISO sha512 sign :
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iHUEABYKAB0WIQSqYnPMNKGz69afyHA85KY4hzOwIQUCaKig7QAKCRA85KY4hzOw
|
||||
IWKWAP0Wlqbi3ArURSGW5m+E+OstdsU7qHjf+e1SVRJ3BGUzaAEAr3ceyHiiA2/7
|
||||
RlXsvZxNgVDaEVSdjmt99dMrZK7DRws=
|
||||
=4Oh3
|
||||
iHUEABYKAB0WIQSqYnPMNKGz69afyHA85KY4hzOwIQUCaQCSYwAKCRA85KY4hzOw
|
||||
Ic8eAP98y67arFZCGX/ooghY/eMGbcxWnhJSgfB5uVCgJcBu5wD+ObnpugIPVv/l
|
||||
OplWsbTlCPA1gMtuJHflKypwlIKQGQU=
|
||||
=Aehw
|
||||
-----END PGP SIGNATURE-----
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=text
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-08-22; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-28; 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>
|
||||
@@ -9,19 +9,19 @@
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
This file was automatically generated by the DEPLOY BOT on: "2025-08-22T17:41:13Z"
|
||||
This file was automatically generated by the DEPLOY BOT on: "2025-10-28T19:43:00Z"
|
||||
|
||||
CISS.debian.live.builder ISO :
|
||||
"ciss-debian-live-2025_08_22T16_56_12Z-amd64.hybrid.iso"
|
||||
"ciss-debian-live-2025_10_28T18_48_33Z-amd64.hybrid.iso"
|
||||
CISS.debian.live.builder ISO sha512 :
|
||||
4925332b61dbd91f0c444624bbe7de586dbd911fbb27b080a99e44ae312c5139afc502d0415d0bef7dfbd1e5461c07e0a0700f7206e746a91cbcb5403ef003e3
|
||||
54765612eabb3cf442f4ecc172aab818d3a39ac6d686741f5c92523e83b297dcd67c290427f0965bced7df466f0b46e59cd81c5123d29044c5b9d07ee13ee82a
|
||||
CISS.debian.live.builder ISO sha512 sign :
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iHUEABYKAB0WIQSqYnPMNKGz69afyHA85KY4hzOwIQUCaKiruQAKCRA85KY4hzOw
|
||||
IdoTAQDqyOBkGA0xDoLsDvjFSaf3tmzz8mD/5qvsDtF6y/rEWwD/dAXzMOdQjxg8
|
||||
IcK+GK6u4k5/HT5bYlCvTy/WxRb5ggQ=
|
||||
=boDM
|
||||
iHUEABYKAB0WIQSqYnPMNKGz69afyHA85KY4hzOwIQUCaQEcxAAKCRA85KY4hzOw
|
||||
ITCiAP9e2/bxJ7t8abtVImKGLnuEUJl82LYGlHi5JLEcdZMXYAEAsI93ja0t7G2m
|
||||
eMb/3bex3UnB6xwpd9tceBZBK8UDbAQ=
|
||||
=/fm8
|
||||
-----END PGP SIGNATURE-----
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=text
|
||||
|
||||
15
README.md
15
README.md
@@ -2,17 +2,17 @@
|
||||
gitea: none
|
||||
include_toc: true
|
||||
---
|
||||
[](https://git.coresecret.dev/msw/CISS.debian.live.builder)
|
||||
[](https://git.coresecret.dev/msw/CISS.debian.live.builder)
|
||||
|
||||
[](https://eupl.eu/1.2/en/)
|
||||
[](https://opensource.org/license/eupl-1-2)
|
||||
[](https://www.gnu.org/software/bash/)
|
||||
[](https://www.gnu.org/software/bash/)
|
||||
[](https://shellcheck.net/)
|
||||
[](https://github.com/mvdan/sh)
|
||||
[](https://google.github.io/styleguide/shellguide.html)
|
||||
|
||||
[](https://docs.gitea.com/)
|
||||
[](https://www.jetbrains.com/store/?section=personal&billing=yearly)
|
||||
[](https://docs.gitea.com/)
|
||||
[](https://www.jetbrains.com/store/?section=personal&billing=yearly)
|
||||
[](https://keepassxc.org/)
|
||||
[](https://www.netcup.com/de)
|
||||
[](https://coresecret.eu/)
|
||||
@@ -26,7 +26,7 @@ include_toc: true
|
||||
**Centurion Intelligence Consulting Agency Information Security Standard**<br>
|
||||
*Debian Live Build Generator for hardened live environment and CISS Debian Installer*<br>
|
||||
**Master Version**: 8.13<br>
|
||||
**Build**: V8.13.008.2025.08.22<br>
|
||||
**Build**: V8.13.294.2025.10.28<br>
|
||||
|
||||
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
|
||||
@@ -151,7 +151,7 @@ This means function status of the **CISS.2025.debian.live.builder** ISO after d-
|
||||
|
||||
This project adheres strictly to a structured versioning scheme following the pattern x.y.z-Date.
|
||||
|
||||
Example: `V8.13.008.2025.08.22`
|
||||
Example: `V8.13.294.2025.10.28`
|
||||
|
||||
`x.y.z` represents major (x), minor (y), and patch (z) version increments.
|
||||
|
||||
@@ -290,7 +290,7 @@ apply or revert these controls.
|
||||
* **Description**: The SSH tunnel and access are secured through multiple layers of defense:
|
||||
* **Firewall Restriction**: ufw allows connections only from defined jump host or VPN exit node IPs.
|
||||
* **TCP Wrappers**: `/etc/hosts.allow` and `/etc/hosts.deny` enforce an `ALL: ALL` deny policy, permitting only specified hosts.
|
||||
* **One-Hit Ban**: A custom Fail2Ban rule `/etc/fail2ban/jail.d/centurion-default.conf` immediately bans any host
|
||||
* **One-Hit Ban**: A custom Fail2Ban rule `/etc/fail2ban/jail.d/ciss-default.conf` immediately bans any host
|
||||
that touches closed ports.
|
||||
* Additionally, the `fail2ban` service is hardened as well according to:
|
||||
[Arch Linux Wiki Fail2ban Hardening](https://wiki.archlinux.org/title/fail2ban#Service_hardening)
|
||||
@@ -453,6 +453,7 @@ predictable script behavior.
|
||||
--build-directory /opt/livebuild \
|
||||
--change-splash hexagon \
|
||||
--control "${timestamp}" \
|
||||
--cdi \
|
||||
--debug \
|
||||
--dhcp-centurion \
|
||||
--jump-host 10.0.0.128 [c0de:4711:0815:4242::1] [2abc:4711:0815:4242::1]/64 \
|
||||
|
||||
119
REPOSITORY.md
Normal file
119
REPOSITORY.md
Normal file
@@ -0,0 +1,119 @@
|
||||
---
|
||||
gitea: none
|
||||
include_toc: true
|
||||
---
|
||||
|
||||
# 1. CISS.debian.live.builder
|
||||
|
||||
**Centurion Intelligence Consulting Agency Information Security Standard**<br>
|
||||
*Debian Live Build Generator for hardened live environment and CISS Debian Installer*<br>
|
||||
**Master Version**: 8.13<br>
|
||||
**Build**: V8.13.294.2025.10.28<br>
|
||||
|
||||
# 2.1. Repository Structure
|
||||
|
||||
**Project:** Centurion Intelligence Consulting Agency Information Security Standard (CISS) — Debian Live Builder
|
||||
**Branch:** `master`
|
||||
**Repository State:** Master Version **8.13**, Build **V8.13.294.2025.10.28** (as of 2025-10-11)
|
||||
|
||||
## 2.2. Top-Level Layout
|
||||
|
||||
````text
|
||||
CISS.debian.live.builder/
|
||||
├─ .archive/ # Archived artefacts or historical assets
|
||||
├─ .gitea/ # Gitea CI/CD metadata (workflows, triggers, templates)
|
||||
│ ├─ ISSUE_TEMPLATE/
|
||||
│ ├─ properties/{json, lua}
|
||||
│ ├─ TO DO/{dockerfile, render-md-to-html.yaml}
|
||||
│ ├─ trigger/{t_generate_.yaml}
|
||||
│ └─ workflows/{generate_.yaml, linter_char_scripts.yaml, render-.yaml}
|
||||
├─ .pubkey/ # Public keys (e.g., for CI or verification)
|
||||
├─ config/ # Live-build configuration (boot, hooks, includes, package lists)
|
||||
│ ├─ bootloaders/{grub-efi, grub-pc, splash.png}
|
||||
│ ├─ hooks/live/.chroot # Ordered chroot hooks (0000_* … 99xx_)
|
||||
│ ├─ includes.binary/boot/grub/config.cfg
|
||||
│ ├─ includes.chroot/{etc, preseed, root}
|
||||
│ └─ package-lists/{live.list.amd64.chroot, live.list.arm64.chroot, live.list.common.chroot}
|
||||
├─ docs/ # Project documentation (audits, change log, policies)
|
||||
│ ├─ AUDIT_.md, BOOTPARAMS.md, CHANGELOG.md, CODING_CONVENTION.md, ...
|
||||
│ ├─ SECURITY/, LICENSES/, graphviz/, screenshots/
|
||||
├─ lib/ # Shell library modules used by the builder
|
||||
├─ scripts/ # Helper/orchestration scripts (e.g., network, live-boot)
|
||||
├─ var/ # Variable sets and early/global defaults (*.var.sh)
|
||||
├─ .editorconfig
|
||||
├─ .gitignore
|
||||
├─ .shellcheckrc
|
||||
├─ .version.properties
|
||||
├─ CISS.debian.live.builder.spdx # SPDX bill of materials / license manifest
|
||||
├─ LICENSE
|
||||
├─ SECURITY.md
|
||||
├─ README.md
|
||||
├─ config.mk.sample
|
||||
├─ ciss_live_builder.sh # Main entrypoint / wrapper
|
||||
├─ makefile
|
||||
├─ meta_sources_debug.sh
|
||||
├─ LIVE_ISO_TRIXIE_0.private # CI artefact markers
|
||||
├─ LIVE_ISO_TRIXIE_1.private # CI artefact markers
|
||||
└─ LIVE_ISO.public # CI artefact markers
|
||||
````
|
||||
|
||||
> **Note:** The ISO marker files (`LIVE_ISO.*`) are produced by CI workflows for convenient retrieval of generated images.
|
||||
|
||||
## 2.3. Directory Semantics
|
||||
|
||||
### 2.3.1. `.gitea/` — CI/CD Orchestration
|
||||
- **`workflows/`**: Declarative Gitea Actions to lint shell scripts, render Graphviz/DNSSEC status, and generate **PUBLIC**/**PRIVATE (TRIXIE)** ISOs reproducibly.
|
||||
- **`trigger/`**: Manual/auxiliary trigger manifests (`t_generate_PUBLIC.yaml`, `t_generate_PRIVATE_trixie_{0,1}.yaml`, `t_generate_dns.yaml`) to drive pipeline variants.
|
||||
- **`ISSUE_TEMPLATE/`**: Issue and pull request templates to standardize change management.
|
||||
- **`properties/`** and **`TODO/`**: Auxiliary config fragments (JSON/Lua) and maintenance utilities (e.g., `render-md-to-html.yaml`).
|
||||
|
||||
### 2.3.2. `config/` — Live-Build Configuration
|
||||
- **`bootloaders/`**: Boot assets for GRUB in EFI and PC modes, incl. a branded splash image.
|
||||
- **`hooks/live/`**: **Ordered** `*.chroot` hooks implementing system configuration and hardening during image creation; the numeric prefixes dictate execution (e.g., `0000_basic_chroot_setup.chroot`, `0810_chrony_setup.chroot`, `0900_ufw_setup.chroot`, `9930_hardening_ssh.chroot`, `9950_hardening_fail2ban.chroot`).
|
||||
- **`includes.binary/boot/grub/`**: Static GRUB configuration embedded in the binary image (`config.cfg`).
|
||||
- **`includes.chroot/`**: Files copied into the live system’s root:
|
||||
- `etc/` (APT configuration, `live/`, `modprobe.d/`, network, SSH, `sysctl.d/`, systemd drop-ins, banners),
|
||||
- `preseed/` (installer preseeding and supporting artifacts),
|
||||
- `root/` (administrator dotfiles and keys).
|
||||
- **`package-lists/`**: Architecture-specific and common package manifests (`amd64`, `arm64`, `common`) used by `live-build`.
|
||||
|
||||
### 2.3.3. `docs/` — Documentation Corpus
|
||||
Audit reports (DNSSEC, Lynis, SSH, TLS, Haveged), **BOOTPARAMS**, **CHANGELOG**, **CODING_CONVENTION**, **CONTRIBUTING**, **REFERENCES**; plus `SECURITY/`, `LICENSES/`, architecture diagrams under `graphviz/`, and illustrative `screenshots/`.
|
||||
|
||||
### 2.3.4. `lib/` — Shell Library Modules
|
||||
Composable, single-purpose modules used by the wrapper and CI steps (argument parsing and validation, kernel/CPU mitigation checks, provider support, `lb config/build` scaffolding, usage/version banners, sanitization and traps, SSH/root-password hardening, ultra-hardening profile, etc.).
|
||||
|
||||
### 2.3.5. `scripts/` — Operational Helpers
|
||||
Ancillary scripts for DHCP supersedes, resolver bootstrapping, and live-boot verification; targeted paths such as `scripts/etc/network/` and `scripts/live-boot/` encapsulate deploy-time adjustments and integrity checks.
|
||||
|
||||
### 2.3.6. `var/` — Variables & Defaults
|
||||
Layered variable sets (`early.var.sh`, `global.var.sh`, `bash.var.sh`, `color.var.sh`) providing early-boot defaults, global tuning, and TTY/UI niceties.
|
||||
|
||||
## 2.4. Key Files
|
||||
|
||||
- **`ciss_live_builder.sh`** — Primary entrypoint; orchestrates argument parsing, environment preparation, `lb config`/`lb build` execution and post-processing.
|
||||
- **`makefile`** & **`config.mk.sample`** — Make-based convenience wrapper and a sample configuration surface.
|
||||
- **`README.md`, `SECURITY.md`, `LICENSE`, `CISS.debian.live.builder.spdx`** — Project overview, security policy, licensing, and SPDX manifest for compliance.
|
||||
- **ISO markers**: `LIVE_ISO.public`, `LIVE_ISO_TRIXIE_{0,1}.private` reflect CI pipeline outputs.
|
||||
|
||||
## 2.5. Conventions & Build Logic
|
||||
|
||||
- **Hook Ordering**: Numeric prefixes (`0000_…` → `99xx_…`) strictly determine execution sequencing within `config/hooks/live/`. Early hooks establish base state (initramfs modules, checksums), mid-range hooks integrate security services (AppArmor, Chrony/NTPsec, Lynis, UFW, Fail2Ban, SSH auditing), late hooks enforce hardening and cleanup (SSH tightening, memory-dump policies, service disablement).
|
||||
- **Binary vs. Chroot Includes**: Assets under `includes.binary/` affect the ISO’s bootloader stage; `includes.chroot/` become part of the runtime filesystem.
|
||||
- **Architecture Scoping**: Package lists are split into `*amd64*`, `*arm64*`, and `*common*` to keep images minimal and deterministic.
|
||||
- **CI/CD**: Reproducible ISO builds are executed via Gitea workflows; dedicated `trigger/` manifests parameterize public vs. private images and auxiliary rendering jobs (e.g., DNSSEC status, Graphviz diagrams).
|
||||
|
||||
## 2.6. Cross-References (Documentation)
|
||||
|
||||
- **Boot Parameters**: see `docs/BOOTPARAMS.md`.
|
||||
- **Audits**: `docs/AUDIT_*.md` (DNSSEC, Lynis, SSH, TLS, Haveged).
|
||||
- **Coding & Contribution**: `docs/CODING_CONVENTION.md`, `docs/CONTRIBUTING.md`.
|
||||
- **Change Log & References**: `docs/CHANGELOG.md`, `docs/REFERENCES.md`.
|
||||
|
||||
## 2.7. Licensing & Compliance
|
||||
|
||||
The repository is **SPDX-compliant**; source files carry SPDX identifiers. See `CISS.debian.live.builder.spdx` and `LICENSE` for details.
|
||||
|
||||
---
|
||||
**[no tracking | no logging | no advertising | no profiling | no bullshit](https://coresecret.eu/)**
|
||||
<!-- vim: set number et ts=2 sw=2 sts=2 ai tw=128 ft=markdown -->
|
||||
@@ -132,6 +132,7 @@ declare -gx VAR_SETUP="true"
|
||||
source_guard "./lib/lib_check_provider.sh"
|
||||
source_guard "./lib/lib_check_stats.sh"
|
||||
source_guard "./lib/lib_check_var.sh"
|
||||
source_guard "./lib/lib_ciss_upgrades.sh"
|
||||
source_guard "./lib/lib_clean_screen.sh"
|
||||
source_guard "./lib/lib_clean_up.sh"
|
||||
source_guard "./lib/lib_copy_integrity.sh"
|
||||
@@ -143,11 +144,13 @@ declare -gx VAR_SETUP="true"
|
||||
source_guard "./lib/lib_lb_config_start.sh"
|
||||
source_guard "./lib/lib_lb_config_write.sh"
|
||||
source_guard "./lib/lib_lb_config_write_trixie.sh"
|
||||
source_guard "./lib/lib_note_target.sh"
|
||||
source_guard "./lib/lib_provider_netcup.sh"
|
||||
source_guard "./lib/lib_run_analysis.sh"
|
||||
source_guard "./lib/lib_sanitizer.sh"
|
||||
source_guard "./lib/lib_trap_on_err.sh"
|
||||
source_guard "./lib/lib_trap_on_exit.sh"
|
||||
source_guard "./lib/lib_update_microcode.sh"
|
||||
source_guard "./lib/lib_usage.sh"
|
||||
}
|
||||
|
||||
@@ -209,8 +212,15 @@ arg_priority_check
|
||||
check_stats
|
||||
if ! ${VAR_HANDLER_AUTOBUILD}; then check_provider; fi
|
||||
if ! ${VAR_HANDLER_AUTOBUILD}; then check_kernel; fi
|
||||
|
||||
if [[ ! "${VAR_SSHFP}" == "true" ]]; then
|
||||
rm -f "${SCRIPT_BASEPATH}/config/includes.chroot/root/.ssh/id_2025_ed25519_ciss_primordial"
|
||||
rm -f "${SCRIPT_BASEPATH}/config/includes.chroot/root/.ssh/id_2025_ed25519_ciss_primordial.pub"
|
||||
fi
|
||||
|
||||
check_hooks
|
||||
hardening_ssh
|
||||
ciss_upgrades
|
||||
lb_config_start
|
||||
|
||||
if [[ "${VAR_SUITE}" == "bookworm" ]]; then
|
||||
@@ -236,6 +246,8 @@ change_splash
|
||||
check_dhcp
|
||||
cdi
|
||||
provider_netcup
|
||||
note_target
|
||||
update_microcode
|
||||
|
||||
### Start the build process
|
||||
set +o errtrace
|
||||
|
||||
10
config/hooks/.keep
Normal file
10
config/hooks/.keep
Normal file
@@ -0,0 +1,10 @@
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-10-26; 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
|
||||
219
config/hooks/live/0000_basic_chroot_setup.chroot
Normal file
219
config/hooks/live/0000_basic_chroot_setup.chroot
Normal file
@@ -0,0 +1,219 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-10-11; 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 -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
|
||||
#######################################
|
||||
# Generates '/etc/default/ciss-xdg-profile'
|
||||
# Globals:
|
||||
# None
|
||||
# Arguments:
|
||||
# None
|
||||
# Returns:
|
||||
# 0: on success
|
||||
#######################################
|
||||
generate_ciss_xdg_profile() {
|
||||
cat << 'EOF' >> /etc/default/ciss-xdg-profile
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-10-11; 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
|
||||
|
||||
# Default toggles for ciss-xdg-profile
|
||||
# 1 = enable, 0 = disable
|
||||
|
||||
ENABLE_XDG_BASH_HISTORY=1
|
||||
ENABLE_XDG_LESS_HISTORY=1
|
||||
ENABLE_XDG_ZSH_HISTORY=1
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=conf
|
||||
EOF
|
||||
|
||||
chmod 0644 /etc/default/ciss-xdg-profile
|
||||
|
||||
return 0
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f generate_ciss_xdg_profile
|
||||
|
||||
#######################################
|
||||
# Generates '/etc/profile.d/ciss-xdg.sh'
|
||||
# Globals:
|
||||
# None
|
||||
# Arguments:
|
||||
# None
|
||||
# Returns:
|
||||
# 0: on success
|
||||
#######################################
|
||||
generate_ciss_xdg_sh() {
|
||||
cat << 'EOF' >> /etc/profile.d/ciss-xdg.sh
|
||||
#!/bin/sh
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-10-11; 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
|
||||
|
||||
# shellcheck shell=sh
|
||||
|
||||
# This file is sourced by login shells via '/etc/profile'. Keep POSIX sh compatible.
|
||||
|
||||
### XDG variables (do not override if already set).
|
||||
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-${HOME}/.config}"
|
||||
export XDG_DATA_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}"
|
||||
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-${HOME}/.cache}"
|
||||
export XDG_STATE_HOME="${XDG_STATE_HOME:-${HOME}/.local/state}"
|
||||
export XDG_CONFIG_DIRS="${XDG_CONFIG_DIRS:-/etc/xdg}"
|
||||
export XDG_DATA_DIRS="${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
|
||||
|
||||
### XDG_RUNTIME_DIR is provided by systemd-logind; do not set a persistent path.
|
||||
# shellcheck disable=SC2312
|
||||
if [ -z "${XDG_RUNTIME_DIR:-}" ] && [ -d "/run/user/$(id -u)" ]; then
|
||||
# shellcheck disable=SC2155
|
||||
export XDG_RUNTIME_DIR="/run/user/$(id -u)"
|
||||
fi
|
||||
|
||||
### Create canonical directories idempotently with 0700.
|
||||
_xdg_umask="$(umask)"
|
||||
umask 077
|
||||
[ -d "${XDG_CONFIG_HOME}" ] || install -d -m 0700 -- "${XDG_CONFIG_HOME}"
|
||||
[ -d "${XDG_DATA_HOME}" ] || install -d -m 0700 -- "${XDG_DATA_HOME}"
|
||||
[ -d "${XDG_CACHE_HOME}" ] || install -d -m 0700 -- "${XDG_CACHE_HOME}"
|
||||
[ -d "${XDG_STATE_HOME}" ] || install -d -m 0700 -- "${XDG_STATE_HOME}"
|
||||
umask "${_xdg_umask}"
|
||||
unset _xdg_umask
|
||||
|
||||
### Optional migrations (controlled via /'etc/default/ciss-xdg-profile').
|
||||
[ -f /etc/default/ciss-xdg-profile ] && . /etc/default/ciss-xdg-profile
|
||||
|
||||
### Bash history -> XDG_STATE_HOME (only if running bash).
|
||||
if [ "${ENABLE_XDG_BASH_HISTORY:-1}" = "1" ] && [ -n "${BASH_VERSION:-}" ]; then
|
||||
[ -d "${XDG_STATE_HOME}/bash" ] || install -d -m 0700 -- "${XDG_STATE_HOME}/bash"
|
||||
export HISTFILE="${XDG_STATE_HOME}/bash/history"
|
||||
fi
|
||||
|
||||
### Less history -> XDG_STATE_HOME
|
||||
if [ "${ENABLE_XDG_LESS_HISTORY:-1}" = "1" ]; then
|
||||
[ -d "${XDG_STATE_HOME}/less" ] || install -d -m 0700 -- "${XDG_STATE_HOME}/less"
|
||||
export LESSHISTFILE="${XDG_STATE_HOME}/less/history"
|
||||
fi
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
EOF
|
||||
|
||||
chmod 0755 /etc/profile.d/ciss-xdg.sh
|
||||
|
||||
return 0
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f generate_ciss_xdg_sh
|
||||
|
||||
#######################################
|
||||
# Generates '/root/ciss_xdg_tmp.sh'
|
||||
# Globals:
|
||||
# None
|
||||
# Arguments:
|
||||
# None
|
||||
# Returns:
|
||||
# 0: on success
|
||||
#######################################
|
||||
generate_ciss_xdg_tmp_sh() {
|
||||
cat << 'EOF' >> /root/ciss_xdg_tmp.sh
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-06-17; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.installer.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.installer
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
### XDG variables (do not override if already set).
|
||||
|
||||
set -a
|
||||
|
||||
# shellcheck disable=SC2034
|
||||
XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-${HOME}/.config}"
|
||||
# shellcheck disable=SC2034
|
||||
XDG_DATA_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}"
|
||||
# shellcheck disable=SC2034
|
||||
XDG_CACHE_HOME="${XDG_CACHE_HOME:-${HOME}/.cache}"
|
||||
# shellcheck disable=SC2034
|
||||
XDG_STATE_HOME="${XDG_STATE_HOME:-${HOME}/.local/state}"
|
||||
# shellcheck disable=SC2034
|
||||
XDG_CONFIG_DIRS="${XDG_CONFIG_DIRS:-/etc/xdg}"
|
||||
# shellcheck disable=SC2034
|
||||
XDG_DATA_DIRS="${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
|
||||
|
||||
### Optional migrations (controlled via /etc/default/ciss-xdg-profile).
|
||||
[[ -f /etc/default/ciss-xdg-profile ]] && . /etc/default/ciss-xdg-profile
|
||||
|
||||
### Bash history -> XDG_STATE_HOME (only if running bash).
|
||||
if [[ "${ENABLE_XDG_BASH_HISTORY:-1}" = "1" ]] && [[ -n "${BASH_VERSION:-}" ]]; then
|
||||
HISTFILE="${XDG_STATE_HOME}/bash/history"
|
||||
fi
|
||||
|
||||
set +a
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
EOF
|
||||
chmod 0700 /root/ciss_xdg_tmp.sh
|
||||
|
||||
return 0
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f generate_ciss_xdg_tmp_sh
|
||||
|
||||
generate_ciss_xdg_profile
|
||||
generate_ciss_xdg_sh
|
||||
generate_ciss_xdg_tmp_sh
|
||||
|
||||
[[ -r /root/ciss_xdg_tmp.sh ]] && . /root/ciss_xdg_tmp.sh
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
apt-get update -qq
|
||||
apt-get install -y --no-install-suggests libpam-systemd
|
||||
|
||||
if [[ -f /root/.architecture ]]; then
|
||||
|
||||
apt-get install -y --no-install-suggests amd64-microcode intel-microcode
|
||||
rm -f /root/.architecture
|
||||
|
||||
fi
|
||||
|
||||
mkdir -p /root/.ciss/dlb/{backup,log}
|
||||
chmod 0700 /root/.ciss/dlb/{backup,log}
|
||||
|
||||
mkdir -p /root/git
|
||||
chmod 0700 /root/git
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,15 +9,18 @@
|
||||
# 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
#######################################
|
||||
# Get all NIC Driver of the current Host-machine
|
||||
# Get all NIC drivers of the current Host machine.
|
||||
# Globals:
|
||||
# None
|
||||
# Arguments:
|
||||
# None
|
||||
# None
|
||||
# Returns:
|
||||
# 0: on success
|
||||
#######################################
|
||||
grep_nic_driver_modules() {
|
||||
declare _mods
|
||||
@@ -34,20 +37,31 @@ grep_nic_driver_modules() {
|
||||
|
||||
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
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
[[ -r /root/ciss_xdg_tmp.sh ]] && . /root/ciss_xdg_tmp.sh
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
apt-get install -y intel-microcode amd64-microcode
|
||||
|
||||
# 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-CreationInfo: 2025-10-11; 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>
|
||||
@@ -69,7 +83,10 @@ cat << EOF >| /etc/initramfs-tools/modules
|
||||
# raid1
|
||||
# sd_mod
|
||||
|
||||
### Main btrfs-Stack
|
||||
### AppArmor -------------------------------------------------------------------------------------------------------------------
|
||||
apparmor
|
||||
|
||||
### btrfs ----------------------------------------------------------------------------------------------------------------------
|
||||
btrfs
|
||||
lzo
|
||||
xor
|
||||
@@ -77,12 +94,27 @@ xxhash
|
||||
zstd
|
||||
zstd_compress
|
||||
|
||||
### Main ext4-Stack
|
||||
ext4
|
||||
jbd2
|
||||
### cryptography ---------------------------------------------------------------------------------------------------------------
|
||||
aes_generic
|
||||
blake2b_generic
|
||||
crc32c_generic
|
||||
cryptd
|
||||
libcrc32c
|
||||
sha256_generic
|
||||
sha512_generic
|
||||
xts
|
||||
|
||||
### Main VFAT/ESP/FAT/UEFI-Stack
|
||||
### cryptsetup -----------------------------------------------------------------------------------------------------------------
|
||||
dm_crypt
|
||||
dm_integrity
|
||||
dm_mod
|
||||
dm_verity
|
||||
|
||||
### Entropy --------------------------------------------------------------------------------------------------------------------
|
||||
jitterentropy_rng
|
||||
rng_core
|
||||
|
||||
### ESP/FAT/UEFI ---------------------------------------------------------------------------------------------------------------
|
||||
exfat
|
||||
fat
|
||||
nls_ascii
|
||||
@@ -92,68 +124,86 @@ nls_iso8859-15
|
||||
nls_utf8
|
||||
vfat
|
||||
|
||||
### Device mapper, encryption & integrity
|
||||
dm_mod
|
||||
dm_crypt
|
||||
dm_integrity
|
||||
dm_verity
|
||||
|
||||
### Main cryptography-Stack
|
||||
aes_generic
|
||||
blake2b_generic
|
||||
crc32c_generic
|
||||
### ext4 -----------------------------------------------------------------------------------------------------------------------
|
||||
ext4
|
||||
jbd2
|
||||
libcrc32c
|
||||
sha256_generic
|
||||
sha512_generic
|
||||
|
||||
### QEMU Bochs-compatible virtual machine support
|
||||
bochs
|
||||
### Live-ISO -------------------------------------------------------------------------------------------------------------------
|
||||
loop
|
||||
squashfs
|
||||
overlay
|
||||
|
||||
### RAID6 parity generation module
|
||||
raid6_pq
|
||||
#### nftables ------------------------------------------------------------------------------------------------------------------
|
||||
#nf_log_common # built-in
|
||||
#nft_counter # built-in
|
||||
#nft_icmp # built-in
|
||||
#nft_icmpv6 # built-in
|
||||
#nft_meta # built-in
|
||||
#nft_set_hash # built-in
|
||||
#nft_set_rbtree # built-in
|
||||
#nft_tcp # built-in
|
||||
#nft_udp # built-in
|
||||
nf_conntrack
|
||||
nf_nat
|
||||
nf_reject_ipv4
|
||||
nf_reject_ipv6
|
||||
nf_tables
|
||||
nfnetlink
|
||||
nfnetlink_log
|
||||
nft_ct
|
||||
nft_limit
|
||||
nft_log
|
||||
nft_masq
|
||||
nft_nat
|
||||
nft_reject_inet
|
||||
|
||||
### Combined RAID4/5/6 support module
|
||||
raid456
|
||||
|
||||
### SCSI/SATA-Stack
|
||||
sd_mod
|
||||
sr_mod
|
||||
sg
|
||||
ahci
|
||||
libahci
|
||||
ata_generic
|
||||
libata
|
||||
scsi_mod
|
||||
scsi_dh_alua
|
||||
|
||||
### NVMe-Stack
|
||||
### NVMe -----------------------------------------------------------------------------------------------------------------------
|
||||
nvme
|
||||
nvme_core
|
||||
|
||||
### USB-Stack
|
||||
xhci_pci
|
||||
xhci_hcd
|
||||
### QEMU -----------------------------------------------------------------------------------------------------------------------
|
||||
bochs
|
||||
|
||||
### RAID -----------------------------------------------------------------------------------------------------------------------
|
||||
raid456
|
||||
raid6_pq
|
||||
|
||||
### SCSI/SATA ------------------------------------------------------------------------------------------------------------------
|
||||
ahci
|
||||
ata_generic
|
||||
libahci
|
||||
libata
|
||||
scsi_dh_alua
|
||||
scsi_mod
|
||||
sd_mod
|
||||
sg
|
||||
sr_mod
|
||||
|
||||
### USB ------------------------------------------------------------------------------------------------------------------------
|
||||
ehci_pci
|
||||
ohci_pci
|
||||
uas
|
||||
uhci_hcd
|
||||
usb_storage
|
||||
uas
|
||||
xhci_hcd
|
||||
xhci_pci
|
||||
|
||||
### Virtual-Machines-Stack
|
||||
virtio_pci
|
||||
### Virtual --------------------------------------------------------------------------------------------------------------------
|
||||
virtio_blk
|
||||
virtio_scsi
|
||||
virtio_rng
|
||||
virtio_console
|
||||
virtio_pci
|
||||
virtio_rng
|
||||
virtio_scsi
|
||||
|
||||
### Network Driver Host-machine
|
||||
### 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-CreationInfo: 2025-10-11; 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>
|
||||
@@ -174,7 +224,7 @@ cat << 'EOF' >| /etc/initramfs-tools/update-initramfs.conf
|
||||
# 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
|
||||
update_initramfs=all
|
||||
|
||||
#
|
||||
# backup_initramfs [ yes | no ]
|
||||
@@ -188,7 +238,7 @@ EOF
|
||||
|
||||
cat << 'EOF' >| /etc/initramfs-tools/initramfs.conf
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -250,10 +300,10 @@ COMPRESS=zstd
|
||||
# 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
|
||||
# 1...9 for gzip|bzip2|lzma|lzop
|
||||
# 0...9 for lz4|xz
|
||||
# 0...19 for zstd
|
||||
COMPRESSLEVEL=16
|
||||
|
||||
#
|
||||
# DEVICE: ...
|
||||
@@ -293,7 +343,7 @@ 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-CreationInfo: 2025-10-11; 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>
|
||||
@@ -305,33 +355,103 @@ cat << 'EOF' >> /etc/initramfs-tools/hooks/ciss_debian_live_builder
|
||||
|
||||
set -e
|
||||
|
||||
printf "\e[95mStarting: [0001_initramfs_modules.chroot] \n\e[0m"
|
||||
|
||||
PREREQ=""
|
||||
prereqs() { echo "$PREREQ"; }
|
||||
case $1 in
|
||||
prereqs() { echo "${PREREQ}"; }
|
||||
# shellcheck disable=SC2249
|
||||
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
|
||||
### Ensure directory structure in initramfs
|
||||
mkdir -p "${DESTDIR}/usr/bin"
|
||||
mkdir -p "${DESTDIR}/etc/keys"
|
||||
mkdir -p "${DESTDIR}/usr/local/bin"
|
||||
mkdir -p "${DESTDIR}/etc/initramfs-tools/conf.d"
|
||||
mkdir -p "${DESTDIR}/etc/initramfs-tools/scripts/init-premount"
|
||||
mkdir -p "${DESTDIR}/usr/sbin"
|
||||
|
||||
# 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
|
||||
### Include bash
|
||||
copy_exec /usr/bin/bash /usr/bin/bash
|
||||
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/bash /usr/bin/bash] \n\e[0m"
|
||||
|
||||
|
||||
### Include blkid
|
||||
copy_exec /usr/sbin/blkid /usr/sbin/blkid
|
||||
printf "\e[92mSuccessfully executed: [copy_exec /usr/sbin/blkid /usr/sbin/blkid] \n\e[0m"
|
||||
|
||||
|
||||
### Include busybox
|
||||
copy_exec /usr/bin/busybox /usr/busybox
|
||||
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/busybox /usr/busybox] \n\e[0m"
|
||||
|
||||
|
||||
### Include GNU coreutils 'sort' (has -V)
|
||||
copy_exec /usr/bin/sort /usr/bin/sort
|
||||
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/sort /usr/bin/sort] \n\e[0m"
|
||||
|
||||
|
||||
### Include gpgv
|
||||
copy_exec /usr/bin/gpgv /usr/bin/gpgv
|
||||
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/gpgv /usr/bin/gpgv] \n\e[0m"
|
||||
|
||||
|
||||
### Include lsblk
|
||||
copy_exec /usr/bin/lsblk /usr/bin/lsblk
|
||||
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/lsblk /usr/bin/lsblk] \n\e[0m"
|
||||
|
||||
|
||||
### Include mkpasswd
|
||||
copy_exec /usr/bin/mkpasswd /usr/mkpasswd
|
||||
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/mkpasswd /usr/mkpasswd] \n\e[0m"
|
||||
copy_exec /usr/bin/mkpasswd /usr/bin/mkpasswd
|
||||
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/mkpasswd /usr/bin/mkpasswd] \n\e[0m"
|
||||
|
||||
|
||||
### Include udevadm (udev management tool)
|
||||
copy_exec /usr/bin/udevadm /usr/bin/udevadm
|
||||
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/udevadm /usr/bin/udevadm] \n\e[0m"
|
||||
|
||||
|
||||
### Include sha384sum, sha512sum
|
||||
copy_exec /usr/bin/sha384sum /usr/bin/sha384sum
|
||||
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/sha384sum /usr/bin/sha384sum ] \n\e[0m"
|
||||
copy_exec /usr/bin/sha512sum /usr/bin/sha512sum
|
||||
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/sha512sum /usr/bin/sha512sum] \n\e[0m"
|
||||
|
||||
|
||||
### Include tree
|
||||
copy_exec /usr/bin/tree /usr/bin/tree
|
||||
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/tree /usr/bin/tree] \n\e[0m"
|
||||
|
||||
|
||||
### Include whois
|
||||
copy_exec /usr/bin/whois /usr/bin/whois
|
||||
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/whois /usr/bin/whois] \n\e[0m"
|
||||
|
||||
|
||||
### Link busybox applets for compatibility
|
||||
for dir in bin usr/bin; do
|
||||
ln -sf busybox "${DESTDIR}/${dir}/cat"
|
||||
ln -sf busybox "${DESTDIR}/${dir}/sleep"
|
||||
done
|
||||
|
||||
printf "\e[92mSuccessfully executed: [0001_initramfs_modules.chroot] \n\e[0m"
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
EOF
|
||||
|
||||
chmod 0755 /etc/initramfs-tools/hooks/ciss_debian_live_builder
|
||||
|
||||
### Regenerate the initramfs for the live system kernel
|
||||
update-initramfs -u -k all
|
||||
update-initramfs -u -k all -v
|
||||
|
||||
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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,10 +9,9 @@
|
||||
# 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
target="/usr/lib/live/boot/0030-verify-checksums"
|
||||
src="$(mktemp)"
|
||||
@@ -23,24 +22,25 @@ fi
|
||||
|
||||
cat << 'EOF' >| "${src}"
|
||||
#!/bin/sh
|
||||
# bashsupport disable=BP5007
|
||||
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-28; 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-License-Identifier: GPL-3.0-or-later
|
||||
# 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
|
||||
|
||||
### 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 ###
|
||||
### Modified Version of the original file:
|
||||
### https://salsa.debian.org/live-team/live-boot 'components/0030-verify-checksums'
|
||||
### In case of successful verification of one of the offered checksums, proceed with booting, else panic.
|
||||
|
||||
#######################################
|
||||
# Live build ISO with the modified checksum verification script for continuing the boot process.
|
||||
# Modified checksum-verification script for continuing the boot process.
|
||||
# Globals:
|
||||
# LIVE_BOOT_CMDLINE
|
||||
# LIVE_VERIFY_CHECKSUMS
|
||||
@@ -53,30 +53,40 @@ cat << 'EOF' >| "${src}"
|
||||
# _RETURN
|
||||
# _TTY
|
||||
# Arguments:
|
||||
# $1: ${_PARAMETER}
|
||||
# 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) ;;
|
||||
|
||||
true)
|
||||
:
|
||||
;;
|
||||
|
||||
*)
|
||||
return 0
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
_MOUNTPOINT="${1}"
|
||||
@@ -85,46 +95,65 @@ Verify_checksums() {
|
||||
_TTY="/dev/tty8"
|
||||
|
||||
log_begin_msg "Verifying checksums"
|
||||
printf "\n"
|
||||
|
||||
# shellcheck disable=SC2164
|
||||
cd "${_MOUNTPOINT}"
|
||||
|
||||
# shellcheck disable=SC2001
|
||||
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
|
||||
|
||||
# shellcheck disable=SC2292
|
||||
if [ -e "${_CHECKSUM}" ]; then
|
||||
echo "Found ${_CHECKSUM}..." > "${_TTY}"
|
||||
|
||||
#echo "Found ${_CHECKSUM}..." > "${_TTY}"
|
||||
printf "Found %s...\n" "${_CHECKSUM}"
|
||||
|
||||
if [ -e "/bin/${_DIGEST}sum" ]; then
|
||||
echo "Checking ${_CHECKSUM}..." > "${_TTY}"
|
||||
|
||||
#echo "Checking ${_CHECKSUM}..." > "${_TTY}"
|
||||
printf "Checking %s...\n" "${_CHECKSUM}"
|
||||
|
||||
# Verify checksums
|
||||
# shellcheck disable=SC2312
|
||||
grep -v '^#' "${_CHECKSUM}" | /bin/"${_DIGEST}"sum -c > "${_TTY}"
|
||||
_RETURN="${?}"
|
||||
|
||||
# Stop after the first verification
|
||||
# break 2
|
||||
|
||||
else
|
||||
echo "Not found /bin/${_DIGEST}sum..." > "${_TTY}"
|
||||
|
||||
#echo "Not found /bin/${_DIGEST}sum..." > "${_TTY}"
|
||||
printf "Not found /bin/%ssum....\n" "${_DIGEST}"
|
||||
|
||||
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
|
||||
log_success_msg "Verification of checksums successful; continuing booting in 8 seconds."
|
||||
sleep 8
|
||||
return 0
|
||||
;;
|
||||
|
||||
*)
|
||||
panic "Verification failed, $(basename ${_TTY}) for more information."
|
||||
panic "Verification failed, $(basename "${_TTY}") for more information."
|
||||
;;
|
||||
|
||||
esac
|
||||
}
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
@@ -138,7 +167,6 @@ 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
|
||||
|
||||
52
config/hooks/live/0003_cdi_autostart.chroot
Normal file
52
config/hooks/live/0003_cdi_autostart.chroot
Normal file
@@ -0,0 +1,52 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-10-11; 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 -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
|
||||
if [[ -f /root/.cdi ]]; then
|
||||
|
||||
cat << EOF >| /etc/systemd/system/cdi-starter.service
|
||||
[Unit]
|
||||
Description=CISS CDI post-boot starter
|
||||
Documentation=https://git.coresecret.dev/msw/CISS.debian.live.builder.git
|
||||
ConditionPathIsExecutable=/usr/local/sbin/9999-cdi-starter.sh
|
||||
After=live-config.service systemd-user-sessions.service getty.target
|
||||
After=network-online.target NetworkManager-wait-online.service systemd-networkd-wait-online.service
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=idle
|
||||
ExecStart=/usr/local/sbin/9999-cdi-starter.sh
|
||||
TimeoutStartSec=1min
|
||||
Nice=5
|
||||
IOSchedulingClass=best-effort
|
||||
Environment=LANG=C.UTF-8
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
chmod 0644 /etc/systemd/system/cdi-starter.service
|
||||
|
||||
systemctl enable cdi-starter.service
|
||||
|
||||
rm -f /root/.cdi
|
||||
|
||||
fi
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
77
config/hooks/live/0007_update_logrotate.chroot
Normal file
77
config/hooks/live/0007_update_logrotate.chroot
Normal file
@@ -0,0 +1,77 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-10-11; 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 -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
|
||||
[[ -r /root/ciss_xdg_tmp.sh ]] && . /root/ciss_xdg_tmp.sh
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
|
||||
rm -f "/etc/logrotate.conf"
|
||||
cat << EOF >| "/etc/logrotate.conf"
|
||||
# See "man logrotate" for details. Global options do not affect preceding include directives.
|
||||
|
||||
# Rotate log files daily
|
||||
daily
|
||||
|
||||
# Keep 384 daily worth of backlogs.
|
||||
rotate 90
|
||||
|
||||
# Hard cap: delete rotated logs older than 384 days.
|
||||
maxage 90
|
||||
|
||||
# Do not rotate the log if it is empty (this overrides the ifempty option).
|
||||
notifempty
|
||||
|
||||
# Create new (empty) log files after rotating old ones.
|
||||
create
|
||||
|
||||
# Use date as a suffix of the rotated file.
|
||||
dateext
|
||||
|
||||
# Use yesterday's instead of today's date to create the dateext extension, so that the rotated log file has a date in its name
|
||||
# that is the same as the timestamps within it.
|
||||
dateyesterday
|
||||
|
||||
# Enable compression
|
||||
compress
|
||||
|
||||
# Use zstd instead of gzip.
|
||||
compresscmd /usr/bin/zstd
|
||||
|
||||
# File extension for compressed logs.
|
||||
compressext .zst
|
||||
|
||||
# Set zstd level 3 (default).
|
||||
compressoptions -20
|
||||
|
||||
# How to decompress for 'logrotate -d' or similar.
|
||||
uncompresscmd /usr/bin/unzstd
|
||||
|
||||
# Keep the most recent rotation uncompressed for one cycle.
|
||||
delaycompress
|
||||
|
||||
# Delete log files using shred -u instead of unlink().
|
||||
shred
|
||||
|
||||
# packages drop log rotation information into this directory
|
||||
include /etc/logrotate.d
|
||||
|
||||
# system-specific logs may also be configured here.
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=conf
|
||||
EOF
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,34 +9,27 @@
|
||||
# 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
apt-get update -y
|
||||
apt-get install --no-install-recommends haveged -y
|
||||
[[ -r /root/ciss_xdg_tmp.sh ]] && . /root/ciss_xdg_tmp.sh
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
apt-get install -y --no-install-recommends apparmor apparmor-utils apparmor-profiles apparmor-profiles-extra
|
||||
|
||||
cd /root
|
||||
cat << 'EOF' >| /etc/default/haveged
|
||||
# Configuration file for haveged
|
||||
install -d /etc/systemd/system/apparmor.service.d
|
||||
cat << EOF >| /etc/systemd/system/apparmor.service.d/10-live-force.conf
|
||||
[Unit]
|
||||
### Drop any negative live conditions that would skip AppArmor on overlay.
|
||||
ConditionPathExists=
|
||||
|
||||
# Options to pass to haveged:
|
||||
DAEMON_ARGS="-w 2048 -v 1"
|
||||
### Ensure we only rely on the security=apparmor condition.
|
||||
ConditionSecurity=apparmor
|
||||
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
|
||||
install -d -m 0755 /var/cache/apparmor
|
||||
|
||||
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
|
||||
44
config/hooks/live/0040_ssh_config_setup.chroot
Normal file
44
config/hooks/live/0040_ssh_config_setup.chroot
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-10-11; 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 -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
|
||||
cat << EOF >> /etc/ssh/ssh_config.d/10-sshfp.conf
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-10-11; 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
|
||||
|
||||
Host git.coresecret.dev
|
||||
Port 42842
|
||||
VerifyHostKeyDNS yes
|
||||
StrictHostKeyChecking yes
|
||||
GlobalKnownHostsFile /etc/ssh/ssh_known_hosts
|
||||
UserKnownHostsFile /dev/null
|
||||
HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,ssh-ed25519,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-256
|
||||
CanonicalizeHostname no
|
||||
UpdateHostKeys no
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=conf
|
||||
EOF
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,24 +9,24 @@
|
||||
# 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
|
||||
set -Ceuo 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
|
||||
|
||||
# shellcheck disable=SC2312
|
||||
cp /etc/shadow /root/.ciss/dlb/backup/shadow.bak."$(date +%F_%T)"
|
||||
chmod 600 /root/.ciss/dlb/backup/shadow.bak.*
|
||||
chmod 0600 /root/.ciss/dlb/backup/shadow.bak.*
|
||||
|
||||
declare hashed_pwd
|
||||
declare safe_hashed_pwd
|
||||
@@ -38,16 +38,18 @@ 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,10 +9,9 @@
|
||||
# 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
cat << 'EOF' >| /etc/default/keyboard
|
||||
XKBMODEL="pc105"
|
||||
@@ -22,10 +21,11 @@ XKBOPTIONS=""
|
||||
BACKSPACE="guess"
|
||||
EOF
|
||||
|
||||
[[ -r /root/ciss_xdg_tmp.sh ]] && . /root/ciss_xdg_tmp.sh
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,17 +9,25 @@
|
||||
# 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
|
||||
set -Ceuo 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
|
||||
[[ -r /root/ciss_xdg_tmp.sh ]] && . /root/ciss_xdg_tmp.sh
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
apt-get install -y --no-install-recommends jitterentropy-rngd
|
||||
|
||||
cd /root
|
||||
|
||||
mkdir -p /etc/systemd/system/jitterentropy-rngd.service.d
|
||||
|
||||
cat << 'EOF' >> /etc/systemd/system/jitterentropy-rngd.service.d/override.conf
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=/usr/sbin/jitterentropy-rngd --osr=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
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,10 +9,9 @@
|
||||
# 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
|
||||
set -Ceuo 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
|
||||
@@ -28,7 +27,6 @@ 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,10 +9,9 @@
|
||||
# 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
cd /root
|
||||
if [[ -f /var/lib/dbus/machine-id ]]; then
|
||||
@@ -22,7 +21,7 @@ fi
|
||||
cat << 'EOF' >| /var/lib/dbus/machine-id
|
||||
b08dfa6083e7567a1921a715000001fb
|
||||
EOF
|
||||
chmod 644 /var/lib/dbus/machine-id
|
||||
chmod 0644 /var/lib/dbus/machine-id
|
||||
|
||||
if [[ -f /etc/machine-id ]]; then
|
||||
rm /etc/machine-id
|
||||
@@ -34,7 +33,6 @@ 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,10 +9,9 @@
|
||||
# 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
cd /root
|
||||
|
||||
@@ -24,7 +23,9 @@ wget -qO- https://raw.githubusercontent.com/eza-community/eza/main/deb.asc | 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
|
||||
[[ -r /root/ciss_xdg_tmp.sh ]] && . /root/ciss_xdg_tmp.sh
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
apt-get update -qq
|
||||
apt-get install -y eza
|
||||
|
||||
git clone https://github.com/eza-community/eza-themes.git
|
||||
@@ -145,10 +146,7 @@ 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,20 +9,20 @@
|
||||
# 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
|
||||
set -Ceuo 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
|
||||
[[ -r /root/ciss_xdg_tmp.sh ]] && . /root/ciss_xdg_tmp.sh
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
apt-get update -qq
|
||||
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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,20 +9,35 @@
|
||||
# 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
|
||||
set -Ceuo 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
|
||||
|
||||
[[ -r /root/ciss_xdg_tmp.sh ]] && . /root/ciss_xdg_tmp.sh
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
export TZ="Etc/UTC"
|
||||
|
||||
apt-get install -y adjtimex chrony tzdata
|
||||
|
||||
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
|
||||
chmod 0644 /root/.ciss/dlb/backup/chrony.conf.bak
|
||||
|
||||
cat << EOF >| /etc/chrony/chrony.conf
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-10-11; 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
|
||||
|
||||
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
|
||||
@@ -36,16 +51,14 @@ 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 minpoll 5 maxpoll 9
|
||||
server sth1.ntp.se iburst nts minpoll 5 maxpoll 9
|
||||
server ntp0.fau.de iburst nts minpoll 5 maxpoll 9
|
||||
server ntp13.metas.ch iburst nts minpoll 5 maxpoll 9
|
||||
# server ntp.ripe.net iburst nts minpoll 5 maxpoll 9
|
||||
# server ntp2.tecnico.ulisboa.pt iburst nts minpoll 5 maxpoll 9
|
||||
# server ntp.ripe.net iburst nts minpoll 5 maxpoll 9
|
||||
server ptbtime3.ptb.de iburst nts minpoll 5 maxpoll 9
|
||||
server ptbtime2.ptb.de iburst nts minpoll 5 maxpoll 9
|
||||
server ptbtime1.ptb.de iburst nts minpoll 5 maxpoll 9
|
||||
# server ntp13.metas.ch iburst nts minpoll 5 maxpoll 9
|
||||
# server time-c-b.nist.gov iburst nts minpoll 5 maxpoll 9
|
||||
# server sth1.ntp.se iburst nts minpoll 5 maxpoll 9
|
||||
server ntp0.fau.de iburst nts minpoll 5 maxpoll 9
|
||||
|
||||
leapsectz right/UTC
|
||||
|
||||
@@ -55,13 +68,52 @@ maxupdateskew 100.0
|
||||
|
||||
rtcsync
|
||||
|
||||
makestep 1 3
|
||||
makestep 0.25 3
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=conf
|
||||
EOF
|
||||
|
||||
chmod 644 /etc/chrony/chrony.conf
|
||||
chmod 0644 /etc/chrony/chrony.conf
|
||||
|
||||
[[ -f /root/.ciss/check_chrony.sh ]] && chmod 0700 /root/.ciss/check_chrony.sh
|
||||
|
||||
### Build right/UTC from tzdata leap table if missing.
|
||||
if [[ ! -e /usr/share/zoneinfo/right/UTC ]]; then
|
||||
|
||||
install -d -m 0755 /usr/share/zoneinfo/right
|
||||
|
||||
### Minimal zic source for a fixed UTC zone.
|
||||
declare -r tmp_src="/tmp/UTC.src"
|
||||
printf 'Zone UTC 0 - UTC\n' > "${tmp_src}"
|
||||
|
||||
### Prefer the zic-format leapseconds file.
|
||||
declare leap_zic="/usr/share/zoneinfo/leapseconds"
|
||||
|
||||
if [[ -s "${leap_zic}" ]]; then
|
||||
|
||||
zic -d /usr/share/zoneinfo/right -L "${leap_zic}" "${tmp_src}"
|
||||
|
||||
else
|
||||
|
||||
echo "WARNING: ${leap_zic} not found; building right/UTC without leap info." >&2
|
||||
zic -d /usr/share/zoneinfo/right -L /dev/null "${tmp_src}"
|
||||
|
||||
fi
|
||||
|
||||
rm -f "${tmp_src}"
|
||||
|
||||
fi
|
||||
|
||||
if [[ -e /usr/share/zoneinfo/right/UTC ]]; then
|
||||
|
||||
### Expect to see 'Sat Dec 31 23:59:60 UTC 2016' rendered in right/UTC
|
||||
TZ=right/UTC date -ud '2017-01-01 00:00:00 -1 second' || true
|
||||
|
||||
fi
|
||||
|
||||
chronyd -Q -f /etc/chrony/chrony.conf 2>&1
|
||||
|
||||
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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,16 +9,14 @@
|
||||
# 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
|
||||
set -Ceuo 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,10 +9,9 @@
|
||||
# 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
cd /root
|
||||
declare target_script="/etc/cron.d/restart-ssh"
|
||||
@@ -21,12 +20,12 @@ cat << 'EOF' >| "${target_script}"
|
||||
@reboot root /usr/local/bin/restart-ssh.sh
|
||||
EOF
|
||||
|
||||
chmod 644 "${target_script}"
|
||||
chmod 0444 "${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-CreationInfo: 2025-10-11; 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>
|
||||
@@ -43,10 +42,8 @@ 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,16 +9,14 @@
|
||||
# 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
|
||||
set -Ceuo 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,16 +9,14 @@
|
||||
# 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
|
||||
set -Ceuo 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,16 +9,14 @@
|
||||
# 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
|
||||
set -Ceuo 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,12 +9,12 @@
|
||||
# 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
apt-get install -y curl
|
||||
[[ -r /root/ciss_xdg_tmp.sh ]] && . /root/ciss_xdg_tmp.sh
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - && \
|
||||
apt-get install -y nodejs
|
||||
|
||||
@@ -22,7 +22,6 @@ 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,16 +9,14 @@
|
||||
# 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
|
||||
set -Ceuo 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,16 +9,14 @@
|
||||
# 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
|
||||
set -Ceuo 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,16 +9,14 @@
|
||||
# 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
cd /root/git
|
||||
git clone https://github.com/dnsviz/dnsviz.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
|
||||
|
||||
64
config/hooks/live/0860_sops.chroot
Normal file
64
config/hooks/live/0860_sops.chroot
Normal file
@@ -0,0 +1,64 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-10-11; 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 -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
|
||||
[[ -r /root/ciss_xdg_tmp.sh ]] && . /root/ciss_xdg_tmp.sh
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
|
||||
SOPS_VER="v3.11.0"
|
||||
ARCH="$(dpkg --print-architecture)"
|
||||
case "${ARCH}" in
|
||||
amd64) SOPS_FILE="sops-${SOPS_VER}.linux.amd64" ;;
|
||||
arm64) SOPS_FILE="sops-${SOPS_VER}.linux.arm64" ;;
|
||||
*) echo "Unsupported arch: ${ARCH}" >&2; exit 1 ;;
|
||||
esac
|
||||
|
||||
cd /tmp
|
||||
|
||||
curl -fsSLO "https://github.com/getsops/sops/releases/download/${SOPS_VER}/${SOPS_FILE}"
|
||||
curl -fsSLO "https://github.com/getsops/sops/releases/download/${SOPS_VER}/sops-${SOPS_VER}.checksums.txt"
|
||||
curl -fsSLO "https://github.com/getsops/sops/releases/download/${SOPS_VER}/sops-${SOPS_VER}.checksums.pem"
|
||||
curl -fsSLO "https://github.com/getsops/sops/releases/download/${SOPS_VER}/sops-${SOPS_VER}.checksums.sig"
|
||||
|
||||
cosign verify-blob "sops-${SOPS_VER}.checksums.txt" \
|
||||
--certificate "sops-${SOPS_VER}.checksums.pem" \
|
||||
--signature "sops-${SOPS_VER}.checksums.sig" \
|
||||
--certificate-identity-regexp="https://github.com/getsops" \
|
||||
--certificate-oidc-issuer="https://token.actions.githubusercontent.com"
|
||||
|
||||
sha256sum -c "sops-${SOPS_VER}.checksums.txt" --ignore-missing
|
||||
|
||||
install -m 0755 "${SOPS_FILE}" /usr/local/bin/sops
|
||||
sops --version --check-for-updates
|
||||
age --version
|
||||
|
||||
rm -f "/tmp/${SOPS_FILE}"
|
||||
rm -f "/tmp/sops-${SOPS_VER}.checksums.txt"
|
||||
rm -f "/tmp/sops-${SOPS_VER}.checksums.pem"
|
||||
rm -f "/tmp/sops-${SOPS_VER}.checksums.sig"
|
||||
|
||||
umask 0077
|
||||
|
||||
mkdir -p /root/.config/sops/age
|
||||
|
||||
cat << 'EOF' >| /root/.config/sops/age/keys.txt
|
||||
{{ secrets.CISS_PHYS_AGE }}
|
||||
EOF
|
||||
|
||||
chmod 0400 /root/.config/sops/age/keys.txt
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,19 +9,18 @@
|
||||
# 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
mkdir -p /root/.ciss/dlb/backup
|
||||
chmod 0700 /root/.ciss/dlb/backup
|
||||
[[ -r /root/ciss_xdg_tmp.sh ]] && . /root/ciss_xdg_tmp.sh
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
|
||||
mkdir -p /root/git
|
||||
chmod 0700 /root/git
|
||||
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/local/bin/yq && chmod +x /usr/local/bin/yq
|
||||
|
||||
yq --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
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,13 +9,12 @@
|
||||
# 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
declare -r UFW_OUT_POLICY="deny"
|
||||
declare -r SSHPORT="MUST_BE_SET"
|
||||
declare -r SSHPORT="SSHPORT_MUST_BE_SET"
|
||||
|
||||
ufw --force reset
|
||||
|
||||
@@ -51,6 +50,7 @@ if [[ ${UFW_OUT_POLICY,,} == "deny" ]]; then
|
||||
ufw allow out 853/udp comment 'Outgoing DoQ'
|
||||
fi
|
||||
|
||||
### Allowing ICMP IPv4 outgoing per default.
|
||||
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
|
||||
@@ -61,7 +61,6 @@ 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,25 +9,31 @@
|
||||
# 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
[[ -r /root/ciss_xdg_tmp.sh ]] && . /root/ciss_xdg_tmp.sh
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,10 +9,9 @@
|
||||
# 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
|
||||
set -Ceuo 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
|
||||
@@ -24,8 +23,7 @@ EOF
|
||||
|
||||
chmod 0755 /etc/update-motd.d/10-uname
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' successful applied. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' successfully applied. \e[0m\n" "${0}"
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,10 +9,9 @@
|
||||
# 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
|
||||
set -Ceuo 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"
|
||||
@@ -27,17 +26,24 @@ declare -ax expired_certificates=()
|
||||
# search_dirs
|
||||
# dir
|
||||
# Arguments:
|
||||
# None
|
||||
# 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
|
||||
|
||||
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}"
|
||||
}
|
||||
|
||||
@@ -52,25 +58,32 @@ create_backup() {
|
||||
# EXPIRED_CERTIFICATES
|
||||
# SEARCH_DIRS
|
||||
# Arguments:
|
||||
# None
|
||||
# None
|
||||
#######################################
|
||||
check_certificates() {
|
||||
declare dir=""
|
||||
declare cert=""
|
||||
declare cert_date=""
|
||||
declare cert_date_seconds=""
|
||||
|
||||
for dir in "${search_dirs[@]}"; do
|
||||
|
||||
# shellcheck disable=SC2312
|
||||
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.
|
||||
@@ -80,13 +93,17 @@ check_certificates() {
|
||||
# cert
|
||||
# line
|
||||
# Arguments:
|
||||
# None
|
||||
# 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=()
|
||||
@@ -97,33 +114,57 @@ delete_expired_from_all_bundles() {
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
@@ -141,30 +182,38 @@ 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,17 +9,18 @@
|
||||
# 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
|
||||
set -Ceuo 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*
|
||||
|
||||
# shellcheck disable=SC2312
|
||||
ssh-keygen -o -N "" -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -C "root@live-$(date -I)"
|
||||
# shellcheck disable=SC2312
|
||||
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
|
||||
@@ -44,7 +45,26 @@ ssh-keygen -r @ >| /root/sshfp
|
||||
# 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
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-10-11; 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
|
||||
|
||||
case $- in
|
||||
*i*)
|
||||
TMOUT=14400
|
||||
export TMOUT
|
||||
readonly TMOUT
|
||||
;;
|
||||
esac
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
EOF
|
||||
|
||||
chmod +x /etc/profile.d/idle-users.sh
|
||||
@@ -58,7 +78,6 @@ 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
|
||||
|
||||
93
config/hooks/live/9935_hardening_ssh.chroot.tmpl
Normal file
93
config/hooks/live/9935_hardening_ssh.chroot.tmpl
Normal file
@@ -0,0 +1,93 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-10-11; 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 -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
|
||||
cd /etc/ssh || {
|
||||
printf "\e[91mm++++ ++++ ++++ ++++ ++++ ++++ ++ Could not find /etc/ssh \e[0m\n"
|
||||
}
|
||||
|
||||
cat << 'EOF' >| ssh_host_ed25519_key
|
||||
{{ secrets.CISS_DLB_SSH_HOST_ED25519_KEY }}
|
||||
EOF
|
||||
|
||||
cat << 'EOF' >| ssh_host_ed25519_key.pub
|
||||
{{ secrets.CISS_DLB_SSH_HOST_ED25519_KEY_PUB }}
|
||||
EOF
|
||||
|
||||
cat << 'EOF' >| ssh_host_rsa_key
|
||||
{{ secrets.CISS_DLB_SSH_HOST_RSA_KEY }}
|
||||
EOF
|
||||
|
||||
cat << 'EOF' >| ssh_host_rsa_key.pub
|
||||
{{ secrets.CISS_DLB_SSH_HOST_RSA_KEY_PUB }}
|
||||
EOF
|
||||
|
||||
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
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-10-11; 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
|
||||
|
||||
case $- in
|
||||
*i*)
|
||||
TMOUT=14400
|
||||
export TMOUT
|
||||
readonly TMOUT
|
||||
;;
|
||||
esac
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
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}"
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,18 +9,23 @@
|
||||
# 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
|
||||
set -Ceuo 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
|
||||
|
||||
grep -Eq '^[[:space:]]*\*[[:space:]]+soft[[:space:]]+core[[:space:]]+0[[:space:]]*$' /etc/security/limits.conf \
|
||||
|| sed -i -E '/^[[:space:]]*#?[[:space:]]*soft[[:space:]]+core[[:space:]]+0[[:space:]]*$/ i\* soft core 0' /etc/security/limits.conf
|
||||
|
||||
grep -Eq '^[[:space:]]*\*[[:space:]]+hard[[:space:]]+core[[:space:]]+0[[:space:]]*$' /etc/security/limits.conf \
|
||||
|| sed -i -E '/^[[:space:]]*#?[[:space:]]*root[[:space:]]+hard[[:space:]]+core[[:space:]]+100000[[:space:]]*$/ 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
|
||||
@@ -31,7 +36,6 @@ 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
|
||||
|
||||
@@ -1,148 +0,0 @@
|
||||
#!/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.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.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
|
||||
241
config/hooks/live/9950_hardening_fail2ban.chroot
Normal file
241
config/hooks/live/9950_hardening_fail2ban.chroot
Normal file
@@ -0,0 +1,241 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-10-11; 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 -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
|
||||
cd /root
|
||||
|
||||
cp -u /etc/fail2ban/fail2ban.conf /root/.ciss/dlb/backup/fail2ban.conf.bak
|
||||
chmod 0400 /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 0400 /root/.ciss/dlb/backup/defaults-debian.conf.bak
|
||||
|
||||
cat << EOF >| /etc/fail2ban/jail.d/ciss-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.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
[DEFAULT]
|
||||
banaction = nftables-multiport
|
||||
banaction_allports = nftables-allports
|
||||
dbpurgeage = 384d
|
||||
# 127.0.0.1/8 - IPv4 loopback range (local host)
|
||||
# ::1/128 - IPv6 loopback
|
||||
# fe80::/10 - IPv6 link-local (on-link only; NDP/RA/DAD)
|
||||
# ff00::/8 - IPv6 multicast (not an unicast host)
|
||||
# ::/128 - IPv6 unspecified (all zeros; never a real peer)
|
||||
ignoreip = 127.0.0.1/8 ::1/128 fe80::/10 ff00::/8 ::/128 IGNORE_IP_MUST_BE_SET
|
||||
usedns = yes
|
||||
|
||||
[recidive]
|
||||
enabled = true
|
||||
banaction = nftables[type=custom, family=inet, table=f2b-table, chain=f2b-chain, blocktype=drop]
|
||||
bantime = 8d
|
||||
bantime.increment = true
|
||||
bantime.factor = 1
|
||||
bantime.maxtime = 128d
|
||||
bantime.multipliers = 1 2 4 8 16
|
||||
bantime.overalljails = true
|
||||
bantime.rndtime = 877s
|
||||
filter = recidive
|
||||
findtime = 16d
|
||||
logpath = /var/log/fail2ban/fail2ban.log*
|
||||
maxretry = 3
|
||||
|
||||
### 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
|
||||
bantime = 1h
|
||||
bantime.increment = true
|
||||
bantime.factor = 1
|
||||
bantime.maxtime = 16d
|
||||
bantime.multipliers = 1 2 4 8 16 32 64 128 256 384
|
||||
bantime.overalljails = true
|
||||
bantime.rndtime = 877s
|
||||
filter = sshd
|
||||
findtime = 16m
|
||||
maxretry = 4
|
||||
mode = aggressive
|
||||
port = PORT_MUST_BE_SET
|
||||
protocol = tcp
|
||||
|
||||
[sshd-refused]
|
||||
enabled = true
|
||||
bantime = 1h
|
||||
bantime.increment = true
|
||||
bantime.factor = 1
|
||||
bantime.maxtime = 16d
|
||||
bantime.multipliers = 1 2 4 8 16 32 64 128 256 384
|
||||
bantime.overalljails = true
|
||||
bantime.rndtime = 877s
|
||||
filter = ciss-sshd-refused
|
||||
findtime = 16m
|
||||
logpath = /var/log/auth.log
|
||||
maxretry = 1
|
||||
port = PORT_MUST_BE_SET
|
||||
protocol = tcp
|
||||
|
||||
#
|
||||
# CISS aggressive approach:
|
||||
# Any valid client communicating with our server should be going directly to the service ports opened in ufw (ssh, 80, ...).
|
||||
# Any client touching other ports is treated as malicious and therefore should be blocked access to ALL ports after 1 attempt.
|
||||
#
|
||||
|
||||
[ufw]
|
||||
enabled = true
|
||||
banaction = nftables[type=custom, family=inet, table=f2b-table, chain=f2b-chain, blocktype=drop]
|
||||
bantime = 1h
|
||||
bantime.increment = true
|
||||
bantime.factor = 1
|
||||
bantime.maxtime = 16d
|
||||
bantime.multipliers = 1 2 4 8 16 32 64 128 256 384
|
||||
bantime.overalljails = true
|
||||
bantime.rndtime = 877s
|
||||
filter = ciss-ufw
|
||||
findtime = 16m
|
||||
logpath = /var/log/ufw.log
|
||||
maxretry = 1
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=conf
|
||||
EOF
|
||||
|
||||
cat << EOF >| /etc/fail2ban/filter.d/ciss-ufw.conf
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-10-18; 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.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
[Definition]
|
||||
# Match UFW BLOCK/REJECT with a source IP and *any* port field (SPT or DPT), protocol may be missing.
|
||||
failregex = ^.*UFW (?:BLOCK|REJECT).*?\bSRC=<HOST>\b.*?(?:\bDPT=\d+\b|\bSPT=\d+\b).*$
|
||||
ignoreregex =
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=conf
|
||||
EOF
|
||||
|
||||
cat << 'EOF' >| /etc/fail2ban/filter.d/ciss-sshd-refused.conf
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-10-18; 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.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
[Definition]
|
||||
failregex = ^refused connect from \S+ \(<HOST>\)
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=conf
|
||||
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 -p /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
|
||||
|
||||
[Database]
|
||||
# Keep entries for at least 384 days to cover recidive findtime.
|
||||
dbpurgeage = 384d
|
||||
EOF
|
||||
|
||||
###########################################################################################
|
||||
# Remarks: Logrotate must be updated either #
|
||||
###########################################################################################
|
||||
cp -a /etc/logrotate.d/fail2ban /root/.ciss/dlb/backup/fail2ban_logrotate.bak
|
||||
cat << EOF >| /etc/logrotate.d/fail2ban
|
||||
/var/log/fail2ban/fail2ban.log {
|
||||
daily
|
||||
rotate 384
|
||||
maxage 384
|
||||
notifempty
|
||||
dateext
|
||||
dateyesterday
|
||||
compress
|
||||
compresscmd /usr/bin/zstd
|
||||
compressext .zst
|
||||
compressoptions -20
|
||||
uncompresscmd /usr/bin/unzstd
|
||||
delaycompress
|
||||
shred
|
||||
missingok
|
||||
postrotate
|
||||
fail2ban-client flushlogs 1>/dev/null
|
||||
endscript
|
||||
# If fail2ban runs as non-root it still needs to have write access
|
||||
# to logfiles.
|
||||
# create 640 fail2ban adm
|
||||
create 640 root adm
|
||||
}
|
||||
EOF
|
||||
|
||||
touch /var/log/fail2ban/fail2ban.log
|
||||
chmod 0640 /var/log/fail2ban/fail2ban.log
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,10 +9,9 @@
|
||||
# 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
###########################################################################################
|
||||
# Remarks: Turn off Energy saving mode and ctrl-alt-del #
|
||||
@@ -25,7 +24,6 @@ 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,24 +9,23 @@
|
||||
# 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
[[ -r /root/ciss_xdg_tmp.sh ]] && . /root/ciss_xdg_tmp.sh
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
|
||||
cd /etc
|
||||
|
||||
apt-get purge exim4 -y
|
||||
apt-get purge exim4-base -y
|
||||
apt-get purge exim4-config -y
|
||||
|
||||
apt-get purge exim4 exim4-base 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 update -qq
|
||||
apt-get upgrade -y
|
||||
|
||||
if [[ -d /etc/exim4 ]]; then
|
||||
@@ -34,7 +33,6 @@ if [[ -d /etc/exim4 ]]; then
|
||||
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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,37 +9,38 @@
|
||||
# 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
[[ -r /root/ciss_xdg_tmp.sh ]] && . /root/ciss_xdg_tmp.sh
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
apt-get install -y usbguard
|
||||
|
||||
# sleep 1
|
||||
|
||||
# Preparing USBGuard: see https://www.privacy-handbuch.de/handbuch_91a.htm
|
||||
### 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
|
||||
#sed -i "s/PresentDevicePolicy=apply-policy/PresentDevicePolicy=allow/" /etc/usbguard/usbguard-daemon.conf
|
||||
|
||||
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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,10 +9,9 @@
|
||||
# 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
|
||||
set -Ceuo 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
|
||||
@@ -71,7 +70,6 @@ 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,39 +9,46 @@
|
||||
# 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
apt-get update -y
|
||||
[[ -r /root/ciss_xdg_tmp.sh ]] && . /root/ciss_xdg_tmp.sh
|
||||
|
||||
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
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
|
||||
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
|
||||
apt-get update -qq
|
||||
|
||||
apt-get purge -y exim4 exim4-daemon-light exim4-base exim4-config postfix-mta-sts-resolver postfix qemu-guest-agent rmail
|
||||
|
||||
apt-mark hold exim4 exim4-daemon-light exim4-base exim4-config postfix-mta-sts-resolver postfix qemu-guest-agent rmail
|
||||
|
||||
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')
|
||||
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
|
||||
@@ -52,8 +59,7 @@ apt-get autopurge -y
|
||||
|
||||
updatedb
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' successful applied. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' successfully applied. \e[0m\n" "${0}"
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,10 +9,9 @@
|
||||
# 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
chmod 0644 /etc/banner
|
||||
chmod 0644 /etc/issue
|
||||
@@ -55,8 +54,8 @@ 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
|
||||
chmod 0644 /root/.backup/cron.allow.bak
|
||||
chmod 0600 /etc/cron.allow
|
||||
cat << EOF >| /etc/cron.allow
|
||||
root
|
||||
EOF
|
||||
@@ -99,8 +98,18 @@ for bin in as gcc g++ cc clang; do
|
||||
done
|
||||
unset bin target
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' successful applied. \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
### Directories: 0700
|
||||
find /root -type d -exec chmod 0700 {} +
|
||||
### Executable files: 0700 (any x-bit set)
|
||||
find /root -type f -perm /111 -exec chmod 0700 {} +
|
||||
### Non-executable files: 0600
|
||||
find /root -type f ! -perm /111 -exec chmod 0600 {} +
|
||||
### Ownership: UID:GID (do not dereference symlinks; stay on this filesystem)
|
||||
find /root -xdev -exec chown -h root:root {} +
|
||||
|
||||
rm -f /etc/tmpfiles.d/legacy.conf
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' successfully applied. \e[0m\n" "${0}"
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,34 +9,38 @@
|
||||
# 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
|
||||
set -Ceuo 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
|
||||
# shellcheck disable=SC2312
|
||||
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"
|
||||
chage --maxdays "${max_days}" "${user}"
|
||||
done
|
||||
|
||||
unset max_days user users_to_update
|
||||
@@ -46,7 +50,6 @@ 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,24 +9,28 @@
|
||||
# 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
[[ -r /root/ciss_xdg_tmp.sh ]] && . /root/ciss_xdg_tmp.sh
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
apt-get install -y aide > /dev/null 2>&1
|
||||
|
||||
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 > /dev/null 2>&1; 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -13,17 +13,19 @@
|
||||
### 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
# shellcheck disable=SC2155
|
||||
declare -r VAR_DATE="$(date +%F)"
|
||||
|
||||
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
|
||||
cat << EOF >| /etc/security/pwquality.conf
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: ${VAR_DATE}; 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>
|
||||
@@ -129,7 +131,6 @@ 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,15 +9,13 @@
|
||||
# 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
|
||||
set -Ceuo 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -12,36 +12,61 @@
|
||||
|
||||
### https://github.com/linux-audit/audit-userspace/tree/master/rules
|
||||
|
||||
set -C -e -u -o pipefail
|
||||
set -Ceuo pipefail
|
||||
|
||||
#######################################
|
||||
# Simple error terminal logger.
|
||||
# Arguments:
|
||||
# None
|
||||
#######################################
|
||||
log() { printf '[auditd-build] %s\n' "${*}" >&2; }
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
cd /root
|
||||
|
||||
apt-get install auditd -y
|
||||
[[ -r /root/ciss_xdg_tmp.sh ]] && . /root/ciss_xdg_tmp.sh
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
apt-get install -y auditd
|
||||
|
||||
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
|
||||
############################################################### /etc/audit/rules.d/00-base-config.rules
|
||||
cat << EOF >| /etc/audit/rules.d/00-base-config.rules
|
||||
## First rule - delete all
|
||||
-D
|
||||
|
||||
## Increase the buffers to survive stress events.
|
||||
## Make this bigger for busy systems
|
||||
-b 8192
|
||||
## Make this bigger for busy systems.
|
||||
-b 16384
|
||||
|
||||
## This determine how long to wait in burst of events
|
||||
--backlog_wait_time 60000
|
||||
## Rate Limit. Cap kernel->userspace message rate (0 = unlimited).
|
||||
-r 200
|
||||
|
||||
## Set failure mode to syslog
|
||||
## This determine how long to wait in burst of events. How long to wait in bursts (us).
|
||||
--backlog_wait_time 1024
|
||||
|
||||
## Set failure mode to syslog.
|
||||
-f 1
|
||||
EOF
|
||||
|
||||
############################################################### /etc/audit/rules.d/10-ciss-noise-floor.rules
|
||||
cat << EOF >| /etc/audit/rules.d/10-ciss-noise-floor.rules
|
||||
## Ignore kernel/daemon noise without a loginuid (unset = 4294967295).
|
||||
-a never,exit -F auid=4294967295
|
||||
|
||||
## Make privileged exec tracing user-initiated only (no boot-time daemons).
|
||||
-a always,exit -F arch=b64 -S execve -F euid=0 -F auid>=1000 -F auid!=-1 -k exec_root
|
||||
-a always,exit -F arch=b32 -S execve -F euid=0 -F auid>=1000 -F auid!=-1 -k exec_root
|
||||
|
||||
## (Optional, same principle for suid/sgid transitions).
|
||||
-a always,exit -F arch=b64 -S execve -C uid!=euid -F auid>=1000 -F auid!=-1 -k exec_suid_sgid
|
||||
-a always,exit -F arch=b32 -S execve -C uid!=euid -F auid>=1000 -F auid!=-1 -k exec_suid_sgid
|
||||
EOF
|
||||
|
||||
############################################################### /etc/audit/rules.d/11-loginuid.rules
|
||||
cat << EOF >| /etc/audit/rules.d/11-loginuid.rules
|
||||
--loginuid-immutable
|
||||
@@ -84,6 +109,17 @@ cat << EOF >| /etc/audit/rules.d/22-ignore-chrony.rules
|
||||
-a never,exit -F arch=b32 -S adjtimex -F auid=unset -F uid=_chrony
|
||||
EOF
|
||||
|
||||
############################################################### /etc/audit/rules.d/25-ciss-exec.rules
|
||||
cat << EOF >| /etc/audit/rules.d/25-ciss-exec.rules
|
||||
## Focus on privileged exec, not every user command
|
||||
-a always,exit -F arch=b64 -S execve -F euid=0 -k exec_root
|
||||
-a always,exit -F arch=b32 -S execve -F euid=0 -k exec_root
|
||||
-a always,exit -F arch=b64 -S execve -F exe=/usr/bin/sudo -k exec_sudo
|
||||
-a always,exit -F arch=b32 -S execve -F exe=/usr/bin/sudo -k exec_sudo
|
||||
-a always,exit -F arch=b64 -S execve -C uid!=euid -k exec_suid_sgid
|
||||
-a always,exit -F arch=b32 -S execve -C uid!=euid -k exec_suid_sgid
|
||||
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)
|
||||
@@ -101,17 +137,6 @@ cat << EOF >| /etc/audit/rules.d/30-ospp-v42-1-create-failed.rules
|
||||
-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)
|
||||
@@ -129,17 +154,6 @@ cat << EOF >| /etc/audit/rules.d/30-ospp-v42-2-modify-failed.rules
|
||||
-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.
|
||||
@@ -149,14 +163,6 @@ cat << EOF >| /etc/audit/rules.d/30-ospp-v42-3-access-failed.rules
|
||||
-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
|
||||
@@ -166,13 +172,6 @@ cat << EOF >| /etc/audit/rules.d/30-ospp-v42-4-delete-failed.rules
|
||||
-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
|
||||
@@ -182,13 +181,6 @@ cat << EOF >| /etc/audit/rules.d/30-ospp-v42-5-perm-change-failed.rules
|
||||
-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
|
||||
@@ -198,13 +190,6 @@ cat << EOF >| /etc/audit/rules.d/30-ospp-v42-6-owner-change-failed.rules
|
||||
-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
|
||||
@@ -330,8 +315,65 @@ cat << EOF >| /etc/audit/rules.d/99-finalize.rules
|
||||
-e 2
|
||||
EOF
|
||||
|
||||
shopt -s nullglob
|
||||
rules=(/etc/audit/rules.d/*.rules)
|
||||
if (( ${#rules[@]} == 0 )); then
|
||||
log "ERROR: /etc/audit/rules.d is empty. Seed rules before this hook."
|
||||
exit 127
|
||||
fi
|
||||
|
||||
if ! /sbin/augenrules --check >/dev/null 2>&1; then
|
||||
log "ERROR: augenrules --check failed. Fix the /etc/audit/rules.d/*.rules first."
|
||||
exit 128
|
||||
fi
|
||||
|
||||
# shellcheck disable=2155
|
||||
declare tmp="$(mktemp)"
|
||||
printf '%s\0' "${rules[@]}" \
|
||||
| xargs -0 -I{} basename "{}" \
|
||||
| sort -V \
|
||||
| while read -r fname; do
|
||||
f="/etc/audit/rules.d/${fname}"
|
||||
### Normalize CRLF and strip UTF-8 BOM.
|
||||
sed -e 's/\r$//' -e '1s/^\xEF\xBB\xBF//' "${f}" >> "${tmp}"
|
||||
printf '\n' >> "${tmp}"
|
||||
done
|
||||
|
||||
# shellcheck disable=2155
|
||||
declare tmp_stripped="$(mktemp)"
|
||||
sed -e '/^[[:space:]]*#/d' -e '/^[[:space:]]*$/d' "${tmp}" >| "${tmp_stripped}"
|
||||
sed -E 's/[[:space:]]+#.*$//' -i "${tmp_stripped}"
|
||||
|
||||
install -m 0600 -o root -g root "${tmp_stripped}" /etc/audit/audit.rules
|
||||
rm -f "${tmp}" "${tmp_stripped}"
|
||||
|
||||
if ! grep -Eq '(^-a|^-w|^-e[[:space:]]+1|^-e[[:space:]]+2)' /etc/audit/audit.rules; then
|
||||
log "WARN: /etc/audit/audit.rules contains no -a/-w rules or '-e 1/2'; is this intended?"
|
||||
fi
|
||||
|
||||
log "Done. /etc/audit/audit.rules generated at build-time (no kernel load)."
|
||||
|
||||
mkdir -p /etc/systemd/system/audit-rules.service.d
|
||||
|
||||
cat << EOF >| /etc/systemd/system/audit-rules.service.d/10-ciss.conf
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-10-11; 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
|
||||
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=/usr/sbin/augenrules --load
|
||||
|
||||
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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,28 +9,32 @@
|
||||
# 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
cd /root
|
||||
|
||||
apt-get install --no-install-recommends debsums -y
|
||||
[[ -r /root/ciss_xdg_tmp.sh ]] && . /root/ciss_xdg_tmp.sh
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
apt-get install -y --no-install-recommends debsums
|
||||
|
||||
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 > /dev/null 2>&1; 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
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,10 +9,12 @@
|
||||
# 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
# shellcheck disable=SC2155
|
||||
declare -r VAR_DATE="$(date +%F)"
|
||||
|
||||
cd /root
|
||||
|
||||
@@ -22,7 +24,7 @@ fi
|
||||
|
||||
cat << 'EOF' >| /etc/apt/sources.list
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <cendev@coresecret.eu>
|
||||
# SPDX-CreationInfo: ${VAR_DATE}; 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>
|
||||
@@ -53,7 +55,6 @@ deb-src https://deb.debian.org/debian/ bookworm-backports main contrib non-free
|
||||
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
|
||||
|
||||
@@ -9,10 +9,15 @@
|
||||
# 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
[[ -r /root/ciss_xdg_tmp.sh ]] && . /root/ciss_xdg_tmp.sh
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
|
||||
# shellcheck disable=SC2155
|
||||
declare -r VAR_DATE="$(date +%F)"
|
||||
|
||||
cd /root
|
||||
|
||||
@@ -29,7 +34,7 @@ EOF
|
||||
if [[ ! -f /etc/apt/sources.list.d/trixie.sources ]]; then
|
||||
cat << EOF >| /etc/apt/sources.list.d/trixie.sources
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-08-11; WEIDNER, Marc S.; <cendev@coresecret.eu>
|
||||
# SPDX-CreationInfo: ${VAR_DATE}; 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>
|
||||
@@ -52,7 +57,7 @@ fi
|
||||
if [[ ! -f /etc/apt/sources.list.d/trixie-security.sources ]]; then
|
||||
cat << EOF >| /etc/apt/sources.list.d/trixie-security.sources
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-08-11; WEIDNER, Marc S.; <cendev@coresecret.eu>
|
||||
# SPDX-CreationInfo: ${VAR_DATE}; 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>
|
||||
@@ -75,7 +80,7 @@ fi
|
||||
if [[ ! -f /etc/apt/sources.list.d/trixie-updates.sources ]]; then
|
||||
cat << EOF >| /etc/apt/sources.list.d/trixie-updates.sources
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-08-11; WEIDNER, Marc S.; <cendev@coresecret.eu>
|
||||
# SPDX-CreationInfo: ${VAR_DATE}; 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>
|
||||
@@ -99,7 +104,7 @@ fi
|
||||
if [[ ! -f /etc/apt/sources.list.d/trixie-backports.sources ]]; then
|
||||
cat << EOF >| /etc/apt/sources.list.d/trixie-backports.sources
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-08-11; WEIDNER, Marc S.; <cendev@coresecret.eu>
|
||||
# SPDX-CreationInfo: ${VAR_DATE}; 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>
|
||||
@@ -119,8 +124,12 @@ Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
||||
EOF
|
||||
fi
|
||||
|
||||
apt-get update -qq
|
||||
apt-get dist-upgrade -y # (= apt full-upgrade) allow installs/replacements/removals.
|
||||
apt-get autoremove --purge -y # 'autopurge' == 'autoremove --purge'.
|
||||
apt-get clean -y # Stronger than autoclean: removes the entire '.deb'-cache.
|
||||
|
||||
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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -9,17 +9,19 @@
|
||||
# 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
# sleep 1
|
||||
|
||||
# shellcheck disable=SC2155
|
||||
declare -r VAR_DATE="$(date +%F)"
|
||||
|
||||
mv /etc/network/interfaces /root/.ciss/dlb/backup/interfaces.chroot
|
||||
rm -f /etc/network/interfaces
|
||||
|
||||
cat << 'EOF' >| /etc/network/interfaces
|
||||
cat << EOF >| /etc/network/interfaces
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: ${VAR_DATE}; 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>
|
||||
@@ -32,6 +34,9 @@ cat << 'EOF' >| /etc/network/interfaces
|
||||
# This file describes the network interfaces available on your system
|
||||
# and how to activate them. For more information, see interfaces(5).
|
||||
|
||||
EOF
|
||||
|
||||
cat << 'EOF' >> /etc/network/interfaces
|
||||
### The loopback network interface
|
||||
auto lo
|
||||
iface lo inet loopback
|
||||
@@ -59,7 +64,6 @@ 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
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
66
config/hooks/live/9999_yyyy_logrotate.chroot
Normal file
66
config/hooks/live/9999_yyyy_logrotate.chroot
Normal file
@@ -0,0 +1,66 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-10-11; 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 -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
|
||||
### Declare Arrays, HashMaps, and Variables.
|
||||
declare -ar ary_logrotate=(
|
||||
"alternatives"
|
||||
"apt"
|
||||
"btmp"
|
||||
"chrony"
|
||||
"clamav-daemon"
|
||||
"clamav-freshclam"
|
||||
"dpkg"
|
||||
"fail2ban"
|
||||
"rkhunter"
|
||||
"rsnapshot"
|
||||
"rsyslog"
|
||||
"ufw"
|
||||
"unattended-upgrades"
|
||||
"usbguard"
|
||||
"wtmp"
|
||||
)
|
||||
|
||||
declare var_file="" var_log=""
|
||||
[[ -r /root/ciss_xdg_tmp.sh ]] && . /root/ciss_xdg_tmp.sh
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
|
||||
for var_log in "${ary_logrotate[@]}"; do
|
||||
|
||||
var_file="/etc/logrotate.d/${var_log}"
|
||||
|
||||
[[ -e "${var_file}" ]] || continue
|
||||
|
||||
### Replace leading 'monthly'/'weekly' directives with 'daily', preserving indentation and trailing comments.
|
||||
sed -E -i \
|
||||
-e 's/^([[:space:]]*)(monthly|weekly)([[:space:]]*)(#.*)?$/\1daily\3\4/' \
|
||||
-e 's/^([[:space:]]*)rotate([[:space:]]+[0-9]+)?([[:space:]]*)(#.*)?$/\1rotate 90\3\4/' \
|
||||
"${var_file}"
|
||||
|
||||
done
|
||||
|
||||
if ! logrotate -d /etc/logrotate.conf; then
|
||||
|
||||
printf "\e[91m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ 'logrotate -d /etc/logrotate.conf' failed. \e[0m\n"
|
||||
|
||||
else
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ 'logrotate -d /etc/logrotate.conf' successful. \e[0m\n"
|
||||
|
||||
fi
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
81
config/hooks/live/9999_zzzz.chroot
Normal file
81
config/hooks/live/9999_zzzz.chroot
Normal file
@@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-10-11; 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 -Ceuo pipefail
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
|
||||
declare var_dm="" var_unit_dir="" var_link="/etc/systemd/system/default.target"
|
||||
|
||||
### Determine the canonical systemd unit dir inside chroot.
|
||||
if [[ -d /lib/systemd/system ]]; then
|
||||
|
||||
var_unit_dir=/lib/systemd/system
|
||||
|
||||
elif [[ -d /usr/lib/systemd/system ]]; then
|
||||
|
||||
var_unit_dir=/usr/lib/systemd/system
|
||||
|
||||
fi
|
||||
|
||||
### Enforce 'default.target' -> 'multi-user.target' as a symlink.
|
||||
if [[ -e "${var_link}" ]] && [[ ! -L "${var_link}" ]]; then
|
||||
|
||||
### A regular file here is wrong; we remove it to avoid vendor fallback to graphical.
|
||||
rm -f -- "${var_link}"
|
||||
|
||||
fi
|
||||
|
||||
if [[ ! -L "${var_link}" ]]; then
|
||||
|
||||
ln -s "${var_unit_dir}/multi-user.target" "${var_link}"
|
||||
|
||||
else
|
||||
|
||||
### Ensure it points to multi-user.
|
||||
# shellcheck disable=SC2312
|
||||
if [[ "$(readlink -f "${var_link}")" != "${var_unit_dir}/multi-user.target" ]]; then
|
||||
|
||||
rm -f -- "${var_link}"
|
||||
ln -s "${var_unit_dir}/multi-user.target" "${var_link}"
|
||||
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
### Hard-block any display manager (mask via /dev/null symlink). Include common DMs, and the generic alias:
|
||||
ary_dm_units=(
|
||||
"display-manager.service"
|
||||
"gdm.service"
|
||||
"gdm3.service"
|
||||
"sddm.service"
|
||||
"lightdm.service"
|
||||
"xdm.service"
|
||||
"lxdm.service"
|
||||
"slim.service"
|
||||
)
|
||||
|
||||
for var_dm in "${ary_dm_units[@]}"; do
|
||||
|
||||
if [[ ! -L "/etc/systemd/system/${var_dm}" ]]; then
|
||||
|
||||
ln -s /dev/null "/etc/systemd/system/${var_dm}"
|
||||
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
rm -f /root/ciss_xdg_tmp.sh
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' applied successfully. \e[0m\n" "${0}"
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
10
config/hooks/normal/.keep
Normal file
10
config/hooks/normal/.keep
Normal file
@@ -0,0 +1,10 @@
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-10-26; 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
|
||||
@@ -8,6 +8,7 @@
|
||||
# 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
|
||||
LIVE_CONFIGS="username"
|
||||
USERNAME=root
|
||||
|
||||
# LIVE_CONFIG_CMDLINE="${LIVE_CONFIG_CMDLINE} ADD PARAMETER HERE"
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-08-12; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-11; 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>
|
||||
@@ -93,6 +93,7 @@ TTYPERM 0600
|
||||
#
|
||||
ERASECHAR 0177
|
||||
KILLCHAR 025
|
||||
UMASK 077
|
||||
|
||||
# HOME_MODE is used by useradd(8) and newusers(8) to set the mode for new
|
||||
# home directories.
|
||||
@@ -203,7 +204,9 @@ NONEXISTENT /nonexistent
|
||||
USERGROUPS_ENAB yes
|
||||
|
||||
#
|
||||
# Added by CISS.debian.live.builder for redundance
|
||||
umask 077
|
||||
# Added by CISS.debian.live.builder for redundancy
|
||||
UMASK 027
|
||||
SHA_CRYPT_MIN_ROUNDS 8388608
|
||||
SHA_CRYPT_MAX_ROUNDS 8388608
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=conf
|
||||
|
||||
17
config/includes.chroot/etc/ssh/ssh_known_hosts
Normal file
17
config/includes.chroot/etc/ssh/ssh_known_hosts
Normal file
@@ -0,0 +1,17 @@
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-10-10; 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
|
||||
|
||||
# Version Master V8.13.294.2025.10.28
|
||||
|
||||
[git.coresecret.dev]:42842 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGQA107AVmg1D/jnyXiqbPf38zQRl8s3c+PM1zbfpeQl
|
||||
[git.coresecret.dev]:42842 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDYD9ysmMWZlejUnxu0qOzeWcIYezoFLbYdo6ffGUL5kqOBAYb+5CF4bJLUpA93XFYVF+TbrcMV1yJh6JaHFL0VU5CvgAzruCeedx0c4qUV6lWcJUGNk5K0yb9n2Wosdy6F/zTOxL9KXBt/TV+cscsen2Dahvx0ctMKgNbu+vvUcWxHf9lOkbYoF/uA/nW5CVXy5XUPVUDFUhEeKXL85+6gid5AEMfYT8aRl5YDGvo1iMBmBYOljN4S7MnRe14qbAZG0GDGvF22eHbSU2pILcFIjc2Lo/S5Ox/MJpbLAqpFlLPTKgr6F7yVwfNMSNwl05ysUOZfrQKSXzCU6+lfqKYCwemLALyG/n1ernpp7/8W/2RYoz3fd+TQyfhW++rx3yUHpYCkTv9A4LRYZYGSAWKMHSBEYq3EcATQUxQi0xpwmcR+u0uC9F9eta5Bim+sBZD6F2hgPJ5xgYT8LFm880g1YadAwBoD4TAkqSvl+jYW0VA2GH9CknKHJ36gc/X4eeUHDC1Hf/E8M5RBj4D6NuHfeVRik/ahHmoCqKQUW7VU/EBsWFsngDiLEHcV71iMtWiUddWOHwoAPHIzn6p9HTeLCxTwsPMG5UDGK/S9HUozqDXxexRtqbcFa7DWuzRvZ1bcZ2VQsaafuzKCkkc4NjC7h1wssel7q9aeYPFg+1vS6Q==
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=conf
|
||||
@@ -1,5 +1,5 @@
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: 2025-10-10; 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>
|
||||
@@ -9,7 +9,7 @@
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
### Version Master V8.13.008.2025.08.22
|
||||
# Version Master V8.13.294.2025.10.28
|
||||
|
||||
### https://www.ssh-audit.com/
|
||||
### ssh -Q cipher | cipher-auth | compression | kex | kex-gss | key | key-cert | key-plain | key-sig | mac | protocol-version | sig
|
||||
@@ -28,7 +28,7 @@ LogLevel VERBOSE
|
||||
AddressFamily any
|
||||
ListenAddress 0.0.0.0
|
||||
ListenAddress ::
|
||||
Port MUST_BE_CHANGED
|
||||
PORT_MUST_BE_CHANGED
|
||||
AllowUsers root
|
||||
UseDNS no
|
||||
### Force a key exchange after transferring 1 GiB of data or 1 hour of session time, whichever occurs first.
|
||||
@@ -46,9 +46,9 @@ StrictModes yes
|
||||
LoginGraceTime 2m
|
||||
MaxAuthTries 3
|
||||
MaxSessions 2
|
||||
### Begin randomly dropping new unauthenticated connections after the 8th attempt,
|
||||
### with a 64% chance to drop each additional connection, up to a hard limit of 16.
|
||||
MaxStartups 08:64:16
|
||||
### Begin randomly dropping new unauthenticated connections after the 2nd attempt,
|
||||
### with a 64% chance to drop each additional connection, up to a hard limit of 08.
|
||||
MaxStartups 02:64:08
|
||||
### Restrict each individual source IP to only 4 unauthenticated connection slot
|
||||
### in the concurrent MaxStartups pool, preventing one IP from monopolizing slots.
|
||||
PerSourceMaxStartups 8
|
||||
@@ -65,12 +65,12 @@ GatewayPorts no
|
||||
### A+ Rating 100/100
|
||||
RequiredRSASize 4096
|
||||
Ciphers aes256-gcm@openssh.com
|
||||
KexAlgorithms sntrup761x25519-sha512@openssh.com,sntrup761x25519-sha512,gss-curve25519-sha256-
|
||||
HostKeyAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-256
|
||||
KexAlgorithms mlkem768x25519-sha256,sntrup761x25519-sha512@openssh.com,sntrup761x25519-sha512
|
||||
HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,ssh-ed25519,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-256
|
||||
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com
|
||||
CASignatureAlgorithms rsa-sha2-512,rsa-sha2-256,ssh-ed25519,sk-ssh-ed25519@openssh.com
|
||||
CASignatureAlgorithms rsa-sha2-512,rsa-sha2-256,ssh-ed25519
|
||||
GSSAPIKexAlgorithms gss-curve25519-sha256-,gss-group16-sha512-
|
||||
HostbasedAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-256
|
||||
HostbasedAcceptedAlgorithms ssh-ed25519-cert-v01@openssh.com,ssh-ed25519,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-256
|
||||
PubkeyAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-256
|
||||
|
||||
### Change to yes to enable challenge-response passwords (beware issues with some PAM modules and threads)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
### Version Master V8.13.008.2025.08.22
|
||||
# Version Master V8.13.294.2025.10.28
|
||||
|
||||
### https://docs.kernel.org/
|
||||
### https://github.com/a13xp0p0v/kernel-hardening-checker/
|
||||
@@ -280,15 +280,6 @@ net.ipv4.conf.all.forwarding=0
|
||||
net.ipv6.conf.all.accept_ra=0
|
||||
net.ipv6.conf.default.accept_ra=0
|
||||
|
||||
###########################################################################################
|
||||
# These parameters relate to secure ICMP redirects. ICMP redirects are messages that a
|
||||
# router sends to a device to inform it that there is a better route for the data traffic.
|
||||
# This setting prevents the system from responding to redirects that have been spoofed by
|
||||
# potential attackers to redirect traffic (e.g., for man-in-the-middle attacks).
|
||||
###########################################################################################
|
||||
net.ipv4.conf.all.secure_redirects=1
|
||||
net.ipv4.conf.default.secure_redirects=1
|
||||
|
||||
###########################################################################################
|
||||
# This setting prevents the disclosure of TCP timestamps that can be used for system
|
||||
# fingerprinting:
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# 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
|
||||
set -Ceuo pipefail
|
||||
|
||||
# The example names get mapped to their roles here
|
||||
declare timestamp
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
declare -gr VERSION="Master V8.13.008.2025.08.22"
|
||||
declare -gr VERSION="Master V8.13.294.2025.10.28"
|
||||
|
||||
### VERY EARLY CHECK FOR DEBUGGING
|
||||
if [[ $* == *" --debug "* ]]; then
|
||||
|
||||
@@ -112,4 +112,4 @@ d-i preseed/late_command string sh /preseed/.ash/3_di_preseed_late_command.sh
|
||||
|
||||
# Please consider donating to my work at: https://coresecret.eu/spenden/
|
||||
###########################################################################################
|
||||
# Written by: ./preseed_hash_generator.sh Version: Master V8.13.008.2025.08.22 at: 10:18:37.9542
|
||||
# Written by: ./preseed_hash_generator.sh Version: Master V8.13.294.2025.10.28 at: 10:18:37.9542
|
||||
|
||||
@@ -11,8 +11,18 @@
|
||||
|
||||
[[ $- != *i* ]] && return
|
||||
|
||||
### Never use errexit/pipefail in interactive shells
|
||||
set +o errexit +o pipefail
|
||||
### Never use 'errexit' | 'nounset' | 'pipefail' in interactive shells.
|
||||
set +o errexit +o nounset +o pipefail
|
||||
|
||||
# shellcheck disable=SC2312
|
||||
if [[ "$(id -u)" -eq 0 ]]; then
|
||||
umask 0022
|
||||
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
else
|
||||
umask 0077
|
||||
PATH="/usr/local/bin:/usr/bin:/bin"
|
||||
fi
|
||||
export PATH
|
||||
|
||||
trap ' "${SHELL}" /root/.ciss/clean_logout.sh ' EXIT
|
||||
source /root/.ciss/alias
|
||||
@@ -20,18 +30,29 @@ source /root/.ciss/f2bchk.sh
|
||||
source /root/.ciss/shortcuts
|
||||
source /root/.ciss/scan_libwrap
|
||||
|
||||
### Never use 'errexit' | 'nounset' | 'pipefail' in interactive shells.
|
||||
set +o errexit +o nounset +o pipefail
|
||||
### Preferred editor for local and remote sessions.
|
||||
export EDITOR="nano"
|
||||
|
||||
### History-Settings
|
||||
# The name of the file in which command history is saved. The default value is ~/.bash_history. If unset, the command history
|
||||
# is not saved when a shell exits.
|
||||
export HISTFILE="${XDG_STATE_HOME}/bash/history"
|
||||
|
||||
touch "${HISTFILE}"
|
||||
chmod 0660 "${HISTFILE}"
|
||||
chown root:root "${HISTFILE}"
|
||||
|
||||
### History
|
||||
touch /tmp/.bash_history
|
||||
chmod 0660 /tmp/.bash_history
|
||||
chown root:root /tmp/.bash_history
|
||||
export HISTFILE=/tmp/.bash_history
|
||||
export HISTSIZE=2048
|
||||
export HISTFILESIZE=2048
|
||||
shopt -s histappend
|
||||
|
||||
# Optional, cautious filters (avoids trivial leaks, but not foolproof). Caution: HISTIGNORE is coarse-grained, don't overdo it.
|
||||
export HISTIGNORE='*PASS*:*pass*:*secret*:*token*:*API_KEY*'
|
||||
|
||||
# -'ignoreboth' Do not put duplicate lines or lines starting with space in the history.
|
||||
# -'erasedups' Causes all previous lines matching the current line to be removed from the history before that line is saved.
|
||||
export HISTCONTROL='ignoreboth:erasedups'
|
||||
|
||||
### Define colors for bash prompt
|
||||
export CRED='\033[1;91m'
|
||||
export CGRE='\033[1;92m'
|
||||
@@ -62,23 +83,15 @@ alias cp="cp -iv"
|
||||
alias mv='mv -iv'
|
||||
alias rm='rm -iv'
|
||||
|
||||
### Welcome message after login
|
||||
printf "\n"
|
||||
printf "\e[91m🔐 Coresecret Channel Established. \e[0m\n"
|
||||
printf "\e[92m✅ Welcome back\e[0m"
|
||||
printf "\e[95m '%s' \e[0m" "${USER}"; printf "\e[92m! Type\e[0m"; printf "\e[95m 'celp'\e[0m"; printf "\e[92m for shortcuts. \e[0m\n"
|
||||
printf "\n"
|
||||
printf "\n"
|
||||
|
||||
### Welcome message after login.
|
||||
#printf "\n"
|
||||
#printf "%s🔐 Coresecret Channel Established. %s%s" "${CRED}" "${CRES}" "${NL}"
|
||||
#printf "%s✅ Welcome back %s " "${CGRE}" "${CRES}"
|
||||
#printf "%s'%s'%s" "${CMAG}" "${USER}" "${CRES}"
|
||||
#printf "%s! Type%s " "${CGRE}" "${CRES}"
|
||||
#printf "%s'celp'%s " "${CMAG}" "${CRES}"
|
||||
#printf "%sfor shortcuts. %s%s" "${CGRE}" "${CRES}" "${NL}"
|
||||
#printf "\n"
|
||||
#printf "\n"
|
||||
printf "%b" "${NL}"
|
||||
printf "%b🔐 Coresecret Channel Established. %b%b" "${CRED}" "${CRES}" "${NL}"
|
||||
printf "%b✅ Welcome back %b " "${CGRE}" "${CRES}"
|
||||
printf "%b'%s'%b" "${CMAG}" "${USER}" "${CRES}"
|
||||
printf "%b! Type%b" "${CGRE}" "${CRES}"
|
||||
printf "%b 'celp'%b" "${CMAG}" "${CRES}"
|
||||
printf "%b for shortcuts. %b%b" "${CGRE}" "${CRES}" "${NL}"
|
||||
printf "%b" "${NL}"
|
||||
printf "%b" "${NL}"
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
# SPDX-PackageName: CISS.debian.live.builder
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
########################################################################################### Alpha
|
||||
alias genkeyfile='haveged -n 1048576 >| /tmp/secure_keyfile_$(date +%s)'
|
||||
|
||||
########################################################################################### Bash
|
||||
alias clear="printf '\033c'"
|
||||
alias c='clear'
|
||||
@@ -222,13 +219,12 @@ swget() {
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Wrapper for loading CISS.2025 hardened Kernel Parameters.
|
||||
# Wrapper for loading CISS hardened Kernel Parameters.
|
||||
# Arguments:
|
||||
# None
|
||||
#######################################
|
||||
sysp() {
|
||||
sysctl -p /etc/sysctl.d/99_local.hardened
|
||||
# sleep 1
|
||||
# shellcheck disable=SC2312
|
||||
sysctl -a | grep -E 'kernel|vm|net' >| /var/log/sysctl_check"$(date +"%Y-%m-%d_%H:%M:%S")".log
|
||||
}
|
||||
@@ -240,7 +236,31 @@ sysp() {
|
||||
#######################################
|
||||
trel() {
|
||||
declare depth=${1:-3}
|
||||
tree -C -h --dirsfirst -L "${depth}"
|
||||
|
||||
if ! [[ "${depth}" =~ ^[0-9]+$ ]]; then
|
||||
echo "Error: '${depth}' is not a valid depth. Please provide a positive integer." >&2
|
||||
return 2
|
||||
fi
|
||||
|
||||
if ! command -v eza >/dev/null 2>&1; then
|
||||
echo "Error: 'eza' is not installed." >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
(( $# > 0 )) && shift
|
||||
|
||||
eza --tree \
|
||||
--level="${depth}" \
|
||||
--group-directories-first \
|
||||
--icons=auto \
|
||||
--color=always \
|
||||
--long \
|
||||
--no-permissions \
|
||||
--no-user \
|
||||
--no-time \
|
||||
"$@"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
#######################################
|
||||
|
||||
142
config/includes.chroot/root/.ciss/check_chrony.sh
Normal file
142
config/includes.chroot/root/.ciss/check_chrony.sh
Normal file
@@ -0,0 +1,142 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-10-10; 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 -Ceuo pipefail
|
||||
|
||||
#######################################
|
||||
# Minimal leap-second probe for Debian/chrony systems.
|
||||
# - Prints kernel leap flags & TAI offset (delta AT).
|
||||
# - Reads tzdata's leap-seconds list (authoritative TAI-UTC).
|
||||
# - Shows chrony tracking summary (incl. leap status).
|
||||
# - Demonstrates 23:59:60 rendering via TZ=right/UTC.
|
||||
# Globals:
|
||||
# None
|
||||
# Arguments:
|
||||
# None
|
||||
# Returns:
|
||||
# 0: on success
|
||||
#######################################
|
||||
main() {
|
||||
### 1) System TZ and tzdata source.
|
||||
printf "System TZ link: [%s]\n\n" "$(readlink -f /etc/localtime || true)"
|
||||
|
||||
if [[ -f /usr/share/zoneinfo/leap-seconds.list ]]; then
|
||||
|
||||
declare tz_leap_line tz_tai tz_ntp ts_human
|
||||
|
||||
tz_leap_line="$(awk '($1 !~ /^#/) {L=$0} END{print L}' /usr/share/zoneinfo/leap-seconds.list)"
|
||||
tz_ntp="$(awk '{print $1}' <<<"${tz_leap_line}")"
|
||||
tz_tai="$(awk '{print $2}' <<<"${tz_leap_line}")"
|
||||
ts_human="$(awk -F'#' '{gsub(/^[[:space:]]+/, "", $2); print $2}' <<<"${tz_leap_line}")"
|
||||
|
||||
printf "tzdata delta AT (TAI-UTC): %s s [last change at: %s; NTP ts: %s]\n\n" "${tz_tai:-?}" "${ts_human:-?}" "${tz_ntp:-?}"
|
||||
|
||||
else
|
||||
|
||||
printf "tzdata leap-seconds.list not found.\n"
|
||||
|
||||
fi
|
||||
|
||||
### 2) Kernel view (requires adjtimex).
|
||||
if command -v adjtimex >/dev/null 2>&1; then
|
||||
|
||||
printf "Kernel time status (adjtimex -p):\n"
|
||||
adjtimex -p | sed 's/^/ /'
|
||||
declare k_tai
|
||||
k_tai="$(adjtimex -p | awk '/^tai:/ {print $2}')"
|
||||
|
||||
if [[ -n "${k_tai:-}" ]]; then
|
||||
|
||||
printf "Kernel-exported delta AT [tai]: %s s\n" "${k_tai}"
|
||||
|
||||
fi
|
||||
|
||||
else
|
||||
|
||||
printf "Package: 'adjtimex' not found. Install 'adjtimex' for kernel leap/TAI details.\n\n"
|
||||
|
||||
fi
|
||||
|
||||
### 3) Chrony summary.
|
||||
if command -v chronyc >/dev/null 2>&1; then
|
||||
|
||||
printf "\n"
|
||||
printf "chronyc tracking:\n"
|
||||
chronyc -n tracking | sed 's/^/ /'
|
||||
|
||||
else
|
||||
|
||||
printf "Package: 'chronyc' not found. Skipping chrony status.\n\n"
|
||||
|
||||
fi
|
||||
|
||||
### 4) right/UTC demonstration of 23:59:60 (uses 2016-12-31 leap).
|
||||
if [[ -f /usr/share/zoneinfo/right/UTC ]]; then
|
||||
|
||||
printf "\n"
|
||||
printf "right/UTC leap rendering check (expect 23:59:60):\n\n"
|
||||
TZ=right/UTC date -ud '2017-01-01 00:00:00 -1 second' || true
|
||||
|
||||
else
|
||||
|
||||
printf "\n"
|
||||
printf "File: 'tzdata right/UTC' zone not installed; skipping 23:59:60 demo.\n\n"
|
||||
|
||||
fi
|
||||
|
||||
printf "\n"
|
||||
printf "Hint:\n"
|
||||
|
||||
printf " - delta AT (TAI-UTC) should match tzdata and kernel (chrony sets kernel TAI if leapsectz/leapseclist is used).\n"
|
||||
printf " - For monotonic intervals, apps must use CLOCK_MONOTONIC, not CLOCK_REALTIME.\n"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
### Build right/UTC from tzdata leap table if missing.
|
||||
if [[ ! -e /usr/share/zoneinfo/right/UTC ]]; then
|
||||
|
||||
install -d -m 0755 /usr/share/zoneinfo/right
|
||||
|
||||
### Minimal zic source for a fixed UTC zone.
|
||||
declare -r tmp_src="/tmp/UTC.src"
|
||||
printf 'Zone UTC 0 - UTC\n' > "${tmp_src}"
|
||||
|
||||
### Prefer the zic-format leapseconds file.
|
||||
declare leap_zic="/usr/share/zoneinfo/leapseconds"
|
||||
|
||||
if [[ -s "${leap_zic}" ]]; then
|
||||
|
||||
zic -d /usr/share/zoneinfo/right -L "${leap_zic}" "${tmp_src}"
|
||||
|
||||
else
|
||||
|
||||
echo "WARNING: ${leap_zic} not found; building right/UTC without leap info." >&2
|
||||
zic -d /usr/share/zoneinfo/right -L /dev/null "${tmp_src}"
|
||||
|
||||
fi
|
||||
|
||||
rm -f "${tmp_src}"
|
||||
|
||||
fi
|
||||
|
||||
if [[ -e /usr/share/zoneinfo/right/UTC ]]; then
|
||||
|
||||
### Expect to see 'Sat Dec 31 23:59:60 UTC 2016' rendered in right/UTC
|
||||
TZ=right/UTC date -ud '2017-01-01 00:00:00 -1 second' || true
|
||||
|
||||
fi
|
||||
|
||||
main "$@"
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
@@ -41,7 +41,6 @@ declare -ga shortcuts=(
|
||||
"f2bubn: f2b unban --all"
|
||||
"f2bufw: f2b status ufw"
|
||||
"free: free -m"
|
||||
"genkeyfile: 1MiBi"
|
||||
"genpasswd: PWD"
|
||||
"genpasswdhash: PWD Hash"
|
||||
"genstring: Random String"
|
||||
|
||||
27
config/includes.chroot/root/.zshenv
Normal file
27
config/includes.chroot/root/.zshenv
Normal file
@@ -0,0 +1,27 @@
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-10-19; 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
|
||||
|
||||
: "${XDG_CONFIG_HOME:=${HOME}/.config}"
|
||||
: "${XDG_CACHE_HOME:=${HOME}/.cache}"
|
||||
: "${XDG_DATA_HOME:=${HOME}/.local/share}"
|
||||
: "${XDG_STATE_HOME:=${HOME}/.local/state}"
|
||||
|
||||
# Do NOT set XDG_RUNTIME_DIR here.
|
||||
|
||||
export XDG_CONFIG_HOME XDG_CACHE_HOME XDG_DATA_HOME XDG_STATE_HOME
|
||||
|
||||
### Zsh history -> XDG_STATE_HOME (best-effort; zsh might not read /etc/profile)
|
||||
if [ "${ENABLE_XDG_ZSH_HISTORY:-1}" = "1" ] && [ -n "${ZSH_VERSION:-}" ]; then
|
||||
[ -d "${XDG_STATE_HOME}/zsh" ] || install -d -m 0700 -- "${XDG_STATE_HOME}/zsh"
|
||||
export HISTFILE="${XDG_STATE_HOME}/zsh/history"
|
||||
fi
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
@@ -8,5 +8,7 @@
|
||||
# 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
|
||||
|
||||
grub-efi-amd64-signed
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
@@ -8,5 +8,7 @@
|
||||
# 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
|
||||
|
||||
grub-efi-arm64-signed
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
# 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
|
||||
|
||||
adjtimex
|
||||
age
|
||||
apparmor
|
||||
apparmor-profiles-extra
|
||||
apparmor-utils
|
||||
@@ -21,6 +24,7 @@ bash-completion
|
||||
bat
|
||||
bc
|
||||
bind9-dnsutils
|
||||
bison
|
||||
bsdmainutils
|
||||
btrfs-progs
|
||||
build-essential
|
||||
@@ -28,7 +32,9 @@ bzip2
|
||||
ca-certificates
|
||||
clamav
|
||||
clamav-daemon
|
||||
clang-18
|
||||
console-setup
|
||||
cosign
|
||||
cpuid
|
||||
cryptsetup
|
||||
cryptsetup-nuke-password
|
||||
@@ -47,6 +53,7 @@ dirmngr
|
||||
dmsetup
|
||||
dnsviz
|
||||
dosfstools
|
||||
dpkg-dev
|
||||
e2fsprogs
|
||||
efibootmgr
|
||||
expect
|
||||
@@ -54,16 +61,17 @@ fail2ban
|
||||
fdisk
|
||||
figlet
|
||||
fio
|
||||
flex
|
||||
fzf
|
||||
gawk
|
||||
gdisk
|
||||
git
|
||||
gnupg
|
||||
haveged
|
||||
htop
|
||||
iftop
|
||||
iproute2
|
||||
iputils-ping
|
||||
jitterentropy-rngd
|
||||
jq
|
||||
keyboard-configuration
|
||||
keychain
|
||||
@@ -75,11 +83,12 @@ libpwquality-tools
|
||||
libtomcrypt-dev
|
||||
libtommath-dev
|
||||
libtool
|
||||
linux-doc-6.12
|
||||
linux-doc-6.16
|
||||
linux-source
|
||||
live-boot
|
||||
live-config
|
||||
live-config-systemd
|
||||
lld-18
|
||||
locate
|
||||
logrotate
|
||||
lsb-release
|
||||
@@ -89,7 +98,6 @@ man
|
||||
man-db
|
||||
manpages
|
||||
manpages-dev
|
||||
mdadm
|
||||
mtr
|
||||
musl-tools
|
||||
nano
|
||||
@@ -102,8 +110,8 @@ nmap
|
||||
nodejs
|
||||
openssl
|
||||
parted
|
||||
pciutils
|
||||
perl
|
||||
pollinate
|
||||
pwgen
|
||||
python3
|
||||
rkhunter
|
||||
@@ -138,7 +146,7 @@ whois
|
||||
wngerman
|
||||
xfsprogs
|
||||
xz-utils
|
||||
yq
|
||||
zip
|
||||
zsh
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
@@ -8,7 +8,7 @@ include_toc: true
|
||||
**Centurion Intelligence Consulting Agency Information Security Standard**<br>
|
||||
*Debian Live Build Generator for hardened live environment and CISS Debian Installer*<br>
|
||||
**Master Version**: 8.13<br>
|
||||
**Build**: V8.13.008.2025.08.22<br>
|
||||
**Build**: V8.13.294.2025.10.28<br>
|
||||
|
||||
# 2. DNSSEC Status
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ include_toc: true
|
||||
**Centurion Intelligence Consulting Agency Information Security Standard**<br>
|
||||
*Debian Live Build Generator for hardened live environment and CISS Debian Installer*<br>
|
||||
**Master Version**: 8.13<br>
|
||||
**Build**: V8.13.008.2025.08.22<br>
|
||||
**Build**: V8.13.294.2025.10.28<br>
|
||||
|
||||
# 2. Haveged Audit on Netcup RS 2000 G11
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ include_toc: true
|
||||
**Centurion Intelligence Consulting Agency Information Security Standard**<br>
|
||||
*Debian Live Build Generator for hardened live environment and CISS Debian Installer*<br>
|
||||
**Master Version**: 8.13<br>
|
||||
**Build**: V8.13.008.2025.08.22<br>
|
||||
**Build**: V8.13.294.2025.10.28<br>
|
||||
|
||||
# 2. Lynis Audit:
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user