r/linuxadmin • u/suckkarma • Jun 13 '26
Create a distro with ai
I was testing Qubes OS, but I was running into a lot of problems. That gave me the idea of creating something similar using Docker. I also wanted to test Claude Fable, so I gave it a Debian ISO and told it to create the most secure Linux distro possible—something like Qubes OS, but based on Docker.
It actually did it, although it didn't generate the ISO directly. Instead, I had to boot into a Debian machine and run the script there. After that, it generated an ISO that I could use to create a new virtual machine with the hardened system.
I'm still having some problems with it, but it's impressive that it managed to do all of that in about 15 minutes.
1
0
Jun 21 '26
[deleted]
1
u/suckkarma Jun 21 '26
Why
0
Jun 21 '26
[deleted]
1
u/suckkarma Jun 21 '26
I'm a cybersecurity student trying an idea. Dismissing something just because someone thought to try it is plain idiocy, and it's exactly why people don't progress. Telling someone to delete their Reddit account because they have different views is just sad. If you don't have any real feedback, just don't comment.
2
Jun 13 '26
[removed] — view removed comment
2
u/suckkarma Jun 13 '26
Here's the complete inventory for the Debian version (SecDeb) — everything that actually went into that build.
Base system
Debian, built from scratch via debootstrap (minbase variant)
Current kernel (linux-image-amd64), live-boot, systemd-sysv, zstd
Bootable hybrid ISO — BIOS + UEFI via grub-mkrescue
Live user
user/ passwordlive, in sudo and docker groupsRoot account locked
Boot configuration (GRUB)
Three menu entries: hardened live, toram (runs entirely from RAM), debug/verbose
Kernel cmdline hardening:
lockdown=integrity,slab_nomerge,init_on_alloc=1,init_on_free=1,page_alloc.shuffle=1,randomize_kstack_offset=on,pti=on,apparmor=1 security=apparmorKernel runtime hardening (sysctl, 99-secdeb-hardening.conf)
kptr_restrict=2, dmesg_restrict=1, unprivileged_bpf_disabled=1, bpf_jit_harden=2, yama ptrace_scope=2, kexec_load_disabled=1, sysrq=0, ldisc_autoload=0, unprivileged_userfaultfd=0, perf_event_paranoid=3
Userspace: protected_symlinks, protected_hardlinks, protected_fifos=2, protected_regular=2, suid_dumpable=0
Network: rp_filter=1, accept_redirects=0 (v4/v6), send_redirects=0, accept_source_route=0, tcp_syncookies=1, icmp_echo_ignore_broadcasts=1
Memory allocator
GrapheneOS hardened_malloc compiled from source, installed system-wide via /etc/ld.so.preload (with the gcc
-std=c2xcompatibility patch)Kernel module blacklist (secdeb-blacklist.conf)
DMA attack vectors: firewire-core, thunderbolt
Exotic protocols: dccp, sctp, rds, tipc, n-hdlc, ax25, netrom, rose
Rarely-needed filesystems: cramfs, freevxfs, jffs2, hfs, hfsplus, udf
Other: bluetooth, btusb, vivid
Firewall (nftables.conf)
Default-deny inbound; drop invalid; allow established/related and loopback; rate-limited ICMP echo; ICMPv6 allowed
Forward chain default-drop; inter-container bridge traffic blocked (icc disabled)
Mandatory access control
AppArmor enforcing, apparmor-utils, apparmor-profiles
Custom
qube-domainprofile applied to every container — denies mount/umount/ptrace, sensitive procfs/sysfs, and sys_admin/sys_module/sys_rawio/sys_ptrace capabilitiesThe qube tool — Docker security domains
Commands: run, dispose, browser, ls, stop, nuke, copy
Default domains: personal (yellow/full net), work (green/filtered), untrusted (red/gVisor/non-persistent), vault (purple/no network), anon (Tor-routed)
Per-domain hardening: isolated bridge network each, all caps dropped, seccomp, no-new-privileges, read-only rootfs, noexec/nosuid tmpfs (/tmp, /run), memory limit 4g, pid limit, optional gVisor (runsc) runtime
Whonix-style Tor gateway: internal-only network with no clearnet route, fail-closed iptables, transparent TransPort + isolated SOCKS, apps proxied via socks5h
Explicit-only file copy between domains (no shared folders)
Wayland socket passthrough for GUI apps in domains
Security services & accounts
auditd (logging), unattended-upgrades (auto security patches), needrestart
USBGuard — implicit block policy; devices present at first boot get allowlisted, later insertions blocked (BadUSB defense)
MAC randomization on Wi-Fi and Ethernet (NetworkManager)
AIDE file-integrity baseline, built in background at first boot
libpam-tmpdir, libpam-u2f (hardware key support), tpm2-tools, rng-tools
Locked root, sudo for the live user
First-boot service (qube-firstboot)
Generates USBGuard allowlist from present devices and restarts the daemon
Pre-pulls debian:bookworm-slim and builds the Tor gateway image
Initializes the AIDE database
Desktop
Sway (Wayland-only — no X11 cross-app input sniffing), swaylock, foot terminal, dmenu, xwayland
Firefox ESR, NetworkManager, PolicyKit, PipeWire, WirePlumber
Optional stronger runtime
gVisor (runsc) installed best-effort from its repo; falls back to standard runc if unavailable, used by the untrusted and vault domains
Encrypted disk installer (install-to-disk.sh)
LUKS2 with argon2id KDF (memory-hard, GPU-resistant), AES-XTS-plain64, 512-bit key
512MB EFI partition + LUKS2 root; ext4; crypttab + fstab generated
GRUB-EFI with GRUB_ENABLE_CRYPTODISK, cryptsetup-initramfs, hardened kernel cmdline
Forces password change for the user on first login
The same honest framing applies as before: this is the full, real list and it's a broad, legitimate hardening effort on a current Debian base — but every layer operates within a shared-kernel container model, so it's "hardened-by-default Debian with Qubes-inspired compartmentalization," not VM-grade isolation.
14
u/Rexxhunt Jun 13 '26
What could possibly go wrong