AEGIS โ Stackable Linux Security Module
An in-tree Linux Security Module (LSM) that boots from upstream
torvalds/linux. Process protection, SHA-256 file integrity, syscall auditing, and kernel module control โ stacked with the existing LSMs, configurable per subsystem. Booted end-to-end in QEMU with a one-command reproduce script.
What It Doesโ
AEGIS (Advanced Guardian for Integrated System Security) is C code that lives inside
the Linux kernel's security/ tree. It registers a hook table through the LSM
framework, so instead of replacing the kernel's own security model it stacks on top
of it โ alongside capability, Yama, and AppArmor. Every subsystem is independent and
compiled behind its own Kconfig flag.
Key Featuresโ
๐ก๏ธ Process Protectionโ
Restricts ptrace(PTRACE_ATTACH) and PTRACE_TRACEME per process โ makes
debugger-aided privilege escalation attackers work much harder.
๐ SHA-256 File Integrityโ
Digest tracking and write-protection for critical system files, enforced from
file_open / file_permission / inode_permission hooks.
๐ Syscall Auditโ
Blocking and logging of dangerous syscalls per process policy, driven from the
bprm_check_security hook.
๐ Module Controlโ
Restricts kernel_load_data and kernel_read_file โ runtime tightening of kernel
module loading.
โ๏ธ Runtime Interfacesโ
/proc/sys/kernel/aegis (sysctl) and /sys/kernel/security/aegis (securityfs) โ
toggle features live, list protected procs/files, dump blocked syscalls.
๐ฅ๏ธ Bootable DevKitโ
Static PID 1 initramfs + aegisctl control tool + QEMU launcher. CI compiles the
module in-tree and builds the userspace. No mocking โ a real built kernel.
Architectureโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ user space (aegisctl) โ
โ status ยท enable ยท stats ยท procs โ
โโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโ
โผ โผ
/proc/sys/kernel/aegis /sys/kernel/security/aegis
โ โ
โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ aegis_sysctl.c aegis_โฆfs.c โ
โโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ aegis_lsm.c โ hook table โ
โ LSM_HOOK_INIT(task_alloc, โฆ) โ
โ LSM_HOOK_INIT(ptrace_*, โฆ) โ
โ LSM_HOOK_INIT(file_*, inode_*, โฆ) โ
โ LSM_HOOK_INIT(bprm_check_security) โ
โ LSM_HOOK_INIT(kernel_load_data, โฆ) โ
โโโฌโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โผ โผ โผ
file.c audit.c module.c
process.c
Every hook is registered through LSM_HOOK_INIT, so AEGIS behaves exactly like any
other mainline LSM and composes with the rest of the stack.
Tech Stackโ
| Component | Technology |
|---|---|
| Language | C (six source files, ~1,900 lines) |
| Kernel | Linux 7.3-rc1 (upstream torvalds/linux) |
| Framework | LSM (security/, LSM_HOOK_INIT) |
| Integrity | SHA-256 |
| Interfaces | sysctl + securityfs |
| Userspace tool | aegisctl (C, static) |
| Runtime | QEMU (nographic / GUI / GDB) |
| Config | CONFIG_LOCALVERSION="-aegis" |
| CI | GitHub Actions โ in-tree module build + devkit build |
Reproduce Itโ
$ ./apply.sh
==> Cloning upstream kernel...
==> Installing AEGIS module source
==> Applying integration patches
==> Building kernel (this takes a while)...
==> Done.
Kernel : /tmp/aegis-build/linux/arch/x86/boot/bzImage
Then boot it:
$ cd devkit && make initramfs && make qemu
/ # uname -r
7.3.0-1-aegis
/ # aegisctl status
AEGIS LSM status: enabled
Feature flags: process-protect file-integrity syscall-audit module-control
Links: GitHub