Security Architecture
The security model is built on multiple layers:Hardware Security Foundation
KASLR and ASLR using RDRAND (hardware RNG) with RDTSC fallback for entropy
Kernel Security Features
Address Space Layout Randomization
KASLR (Kernel ASLR)
KASLR (Kernel ASLR)
Randomizes kernel base address at boot time within a 1GB range.Implementation:
kernel/src/security/kaslr.c:22- Offset Range: 0 to 1GB from kernel base (0xFFFFFFFF80000000)
- Alignment: 2MB boundaries for huge page compatibility
- Entropy Source: RDRAND instruction with RDTSC fallback
Userspace ASLR
Userspace ASLR
Randomizes process heap, stack, and shared library addresses.Entropy Source: Primary: RDRAND (Intel IvyBridge+, AMD Zen+)
Fallback: RDTSC-seeded Xorshift64 (non-cryptographic but boot-unique)
kernel/src/security/aslr.c:58Fallback: RDTSC-seeded Xorshift64 (non-cryptographic but boot-unique)
Stack Protection
Compiled with-fstack-protector-strong and runtime canary verification.
Canary Initialization: kernel/src/security/canary.c:15
The canary’s low byte is zeroed to detect string-based buffer overflows that use null terminators.
kernel/src/security/canary.c:22
When corruption is detected, __stack_chk_fail() triggers an immediate kernel panic:
Memory Protection
- NX Bit Enforcement: Non-executable stack and data pages via page table NX flag
- Per-Process Page Tables: Complete address space isolation with CR3 register switching on context switch
- Write XOR Execute: Code pages are executable but not writable; data pages are writable but not executable
Access Control
Capability Tokens
seL4-inspired unforgeable 64-bit tokens for IPC access control. Token Structure:kernel/src/ipc/caps.h:26
| Permission | Value | Description |
|---|---|---|
CAP_READ | 1 | Read access |
CAP_WRITE | 2 | Write access |
CAP_EXEC | 4 | Execute permission |
CAP_IPC | 8 | IPC endpoint access |
CAP_NET | 16 | Network socket access |
CAP_FS | 32 | Filesystem access |
kernel/src/ipc/caps.c
Mandatory Access Control (MAC)
Hybrid label-based policy with Bell-LaPadula fallback rules. Policy Matrix:kernel/src/security/mac.c:36
- Labels: Each process and object has a security label with a trust level (0 = untrusted, higher = more trusted)
- Operations:
MAC_OP_READ,MAC_OP_WRITE,MAC_OP_EXEC - Policy: Explicit allow/deny rules override default Bell-LaPadula rules
kernel/src/security/mac.c:128
- No Read Up: Processes cannot read objects at higher trust levels
- No Write Down: Processes cannot write to objects at lower trust levels (prevents information leakage)
Module Signing
All kernel modules must be cryptographically signed before loading. Signature Format:kernel/src/security/modsign.c:16
kernel/src/security/modsign.c:44
Current implementation uses FNV-1a hashing. Production will use SHA-256 with Ed25519 signatures.
kernel/src/security/modsign.c:25)
Agent Runtime Sandbox
Strongly isolated execution environment for agent processes.Syscall Filtering
Bitmap-based whitelist similar to Linux seccomp. Filter Map:userland/agent-runtime/syscall_filter.c:13
- Default: All syscalls denied
- Granularity: Per-agent, per-syscall
- Performance: O(1) lookup via bitmap indexing
Resource Isolation
Sandbox Structure:userland/agent-runtime/sandbox.c:10
userland/agent-runtime/sandbox.c:40
Security Scope
In Scope for Vulnerability Reports
- Kernel vulnerabilities (memory corruption, privilege escalation, information disclosure)
- Agent runtime sandbox escapes
- WASM runtime security issues (browser sandbox bypass)
- Authentication/authorization bypasses
- Cryptographic weaknesses in module signing or update verification
- Supply chain attacks on build/release pipeline
Out of Scope
- Denial of service via resource exhaustion (unless trivially exploitable)
- Issues requiring physical access to hardware
- Social engineering attacks
- Vulnerabilities in third-party dependencies (report upstream; notify us for tracking)
Security Roadmap
| Feature | Status | Target |
|---|---|---|
| KASLR with RDRAND | ✅ Implemented | v0.1 |
| Stack canaries | ✅ Implemented | v0.1 |
| Capability tokens | ✅ Implemented | v0.1 |
| Module signing (FNV-1a) | ✅ Implemented | v0.1 |
| Ed25519 signature verification | 🔄 Planned | v1.0 |
| SHA-256 module hashing | 🔄 Planned | v1.0 |
| Formal threat model | 🔄 Planned | Phase 9 |
| Security audit | 🔄 Planned | Pre-GA |
| PGP key publication | 🔄 Planned | Pre-GA |
References
- KASLR Implementation
- seL4 Capability Model
- Linux seccomp
- Intel RDRAND Instruction
- Monocypher (Ed25519 reference)