Tor activeEN
Hardening — RedderOSMinimise (back to the desktop)Close (back to the desktop)
// docs

Hardening

Hardening is applied through plain-text files in the build's overlay. To audit it, just read them or compare them with diff. This page summarises each one.

Kernel command line

Every GRUB entry carries these parameters (build.sh adds them to config/grub.cfg):

ParameterEffect
lockdown=confidentialityNot even root can read kernel memory or load unsigned code into it.
init_on_alloc=1Memory is zeroed when allocated.
init_on_free=1Memory is zeroed when freed: less data to recover in a cold boot attack.
slab_nomergeDoes not merge kernel allocator caches, which makes overflows harder to exploit.
page_alloc.shuffle=1Randomises the free page lists.
randomize_kstack_offset=onRandom kernel stack offset on every system call.
pti=onKernel page-table isolation (Meltdown).
mitigations=auto,nosmtCPU mitigations enabled and SMT (hyper-threading) disabled where needed.
vsyscall=noneRemoves the legacy fixed-address vsyscall page.
debugfs=offNo debugfs.
apparmor=1 security=apparmorEnables AppArmor as the security module.
ipv6.disable=1IPv6 completely disabled.

sysctl

File: /etc/sysctl.d/99-redderos-hardening.conf.

Kernel

KeyValueEffect
kernel.kptr_restrict2Hides kernel addresses, from root as well.
kernel.dmesg_restrict1Only root can read the kernel log.
kernel.printk3 3 3 3Only serious errors on the console.
kernel.unprivileged_bpf_disabled1BPF for root only.
net.core.bpf_jit_harden2Hardens the BPF JIT compiler.
kernel.kexec_load_disabled1No other kernel can be loaded at runtime.
kernel.yama.ptrace_scope2Only root can debug other processes.
kernel.perf_event_paranoid3No perf for normal users.
kernel.sysrq0Magic SysRq keys disabled.
kernel.core_pattern|/bin/falseNo core dump is ever written.
kernel.unprivileged_userns_clone0No user namespaces for normal users.
dev.tty.ldisc_autoload0Line disciplines are not loaded on demand.
vm.unprivileged_userfaultfd0userfaultfd for root only.
vm.swappiness0Do not use swap (and there is none anyway).

File system

KeyValueEffect
fs.protected_symlinks1Protects against symbolic link tricks in /tmp.
fs.protected_hardlinks1Likewise for hard links.
fs.protected_fifos2Likewise for FIFOs.
fs.protected_regular2Likewise for regular files.
fs.suid_dumpable0setuid programs do not produce core dumps.

Network

KeyValueEffect
net.ipv4.tcp_syncookies1Withstands SYN floods.
net.ipv4.tcp_rfc13371TIME-WAIT protection (RFC 1337).
net.ipv4.tcp_timestamps0No TCP timestamps, which give away the clock.
net.ipv4.conf.*.rp_filter1Drops packets with a spoofed source.
net.ipv4.conf.*.accept_redirects0Ignores ICMP redirects.
net.ipv4.conf.all.secure_redirects0Likewise, including "secure" ones.
net.ipv4.conf.all.send_redirects0Does not send redirects.
net.ipv4.conf.all.accept_source_route0Ignores source routing.
net.ipv4.icmp_echo_ignore_all1Does not answer ping.
net.ipv4.ip_forward0Does not forward traffic.

The self-test checks that each key has the expected value (keys that do not exist in the running kernel are skipped, and this is reported).

Blocked modules

File: /etc/modprobe.d/redderos-blacklist.conf. Each module is replaced by /bin/false, so it cannot be loaded even by hand.

GroupModules
Rarely used network protocolsdccp, sctp, rds, tipc, n-hdlc, ax25, netrom, x25, rose, decnet, econet, af_802154, ipx, appletalk, psnap, p8022
Rarely used file systemscramfs, freevxfs, jffs2, hfs, hfsplus, udf
External DMA and wireless peripheralsfirewire-core, thunderbolt, bluetooth, btusb

The camera (uvcvideo) has a line ready but commented out: uncomment it in the build to disable it completely.

AppArmor

Debian and Ubuntu do not load AppArmor profiles on live systems. RedderOS overrides that condition (/etc/systemd/system/apparmor.service.d/redderos-live.conf) and loads the profiles from apparmor-profiles.

Amnesia: systemd and limits

FileEffect
systemd/journald.conf.d/redderos.confLogs in RAM only (32 MB maximum), not forwarded to syslog.
systemd/coredump.conf.d/redderos.confNo core dumps.
systemd/system.conf.d/redderos.confDefaultLimitCORE=0 for everything systemd starts.
security/limits.d/redderos.confCore dump limit set to 0 for all users.
systemd/logind.conf.d/redderos.confNo user process survives logout.

The build also masks the apt, motd-news, e2scrub and fstrim timers, and disables the live-system scripts that enable swap on the computer's disk, crash reporting (apport) and pollinate.

Users and privileges

  • root is locked: you cannot log in as root.
  • anon, the amnesic session user, has no password and no sudo. Only the Temporary administrator entry gives it sudo, and only for that session.
  • The one exception is redder-wipe: any user can run it as root without a password and without arguments (/etc/sudoers.d/redderos-wipe). It only wipes RAM and shuts down.
  • Profile users are created in RAM when the profile is opened and deleted when it is closed.
  • umask 077: new files can only be read by their owner.

Without administrator rights, a compromised program running as anon cannot get root or change the firewall.

ISO integrity

The build generates md5sum.txt and sha256sum.txt with the checksum of every file in the image, plus a .sha256 for the whole ISO. GPG signing of the ISO is still pending.