Skip to content

yasindce1998/warmor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

warmor: Cross-Platform WASM-Powered Security Enforcer

warmor logo

Go Version Rust License Status

warmor (WebAssembly + Armor) solves the "Policy Portability Problem" by using WASM as the policy execution engine and platform-specific hooks as the enforcement mechanism.


🎯 The Problem

Traditional security enforcers are platform-specific:

  • Linux policies (eBPF, AppArmor, SELinux) don't work on Windows
  • Windows policies don't work on macOS
  • Each platform requires different expertise and tooling
  • Organizations with hybrid environments must maintain multiple policy implementations

πŸ’‘ The Solution

warmor decouples the "Brain" from the "Hands":

  • WASM = Brain: Portable policy logic that runs identically everywhere
  • Platform Hooks = Hands: OS-specific syscall interception (eBPF, ESF, KMD)
  • Result: Write-once-run-anywhere security policies
Application β†’ Platform Hook (eBPF/ESF/KMD) β†’ warmor Daemon β†’ WASM Policy β†’ Decision

✨ Key Features

Core Capabilities

  • βœ… Cross-Platform: Same policy works on Linux, Windows, and macOS
  • βœ… Safe: WASM sandbox prevents policy bugs from crashing the system
  • βœ… Portable: Write policies in Rust, Go, or C and compile to WASM
  • βœ… Hot-Reload: Update policies without restarting the enforcer
  • βœ… High Performance: <100ΞΌs policy evaluation latency (P95)
  • βœ… Zero Trust: Kernel-level enforcement that can't be bypassed

Phase 2 Features

  • βœ… Decision Caching: 10k-entry LRU cache with >90% hit rate
  • βœ… Structured Logging: JSON logs with zerolog for easy parsing
  • βœ… Prometheus Metrics: Full observability with /metrics endpoint
  • βœ… Pattern Matching: Glob and regex support in policies
  • βœ… Action Enforcement: ALLOW/DENY/LOG with statistics tracking

Phase 3 Features (NEW!)

  • βœ… Multi-Syscall Support: Monitor execve, openat, connect, and more
  • βœ… Type-Safe Events: ProcessEvent, FileEvent, NetworkEvent
  • βœ… Policy Testing Framework: Automated testing and benchmarking
  • βœ… Comprehensive Policies: 14+ rules across process, file, and network
  • βœ… Backward Compatible: 100% compatible with Phase 1/2 policies

πŸš€ Quick Start

Prerequisites

  • Go 1.26.2+
  • Rust 1.70+ (for building policies)
  • Linux Kernel 5.10+ (for eBPF support)
  • Clang/LLVM (for compiling eBPF programs)

Installation

# Clone the repository
git clone https://github.com/yasindce1998/warmor.git
cd warmor

# Install dependencies
make deps

# Build everything (on Linux)
make all

# Note: Code compiles on Windows/macOS too, but eBPF requires Linux
# On Linux, after first build, delete: rm internal/ebpf/generated_stubs.go

# Run (requires root for eBPF)
sudo ./warmor-daemon

Your First Policy

Create a simple policy in Rust:

#[no_mangle]
pub extern "C" fn evaluate_syscall(event_ptr: *const u8, event_len: usize) -> i32 {
    let event: Event = parse_event(event_ptr, event_len);
    
    // Block root from running bash
    if event.uid == 0 && event.filename.contains("bash") {
        return ACTION_DENY;
    }
    
    ACTION_ALLOW
}

Compile and run:

cd policies/example
make
cd ../..
sudo ./warmor-daemon -policy policies/example/policy.wasm

πŸ“Š Phase 2: Observability & Performance

Prometheus Metrics

warmor exposes metrics on http://localhost:9090/metrics:

# View all metrics
curl http://localhost:9090/metrics

# Example metrics
warmor_events_total{action="ALLOW"} 1523
warmor_events_total{action="DENY"} 42
warmor_events_total{action="LOG"} 156
warmor_cache_hits_total 1450
warmor_cache_misses_total 271
warmor_cache_size 245
warmor_evaluation_latency_microseconds_bucket{le="50"} 1200

Structured Logging

JSON logs for easy parsing and analysis:

# View structured logs
./warmor-daemon | jq .

# Filter denied actions
./warmor-daemon | jq 'select(.action == "DENY")'

# Calculate average latency
./warmor-daemon | jq -s 'map(.latency_us) | add/length'

Example log entry:

{
  "level": "warn",
  "service": "warmor",
  "pid": 1234,
  "uid": 1000,
  "comm": "nc",
  "filename": "/usr/bin/nc",
  "action": "DENY",
  "reason": "Policy denies: /usr/bin/nc by UID 1000",
  "cached": false,
  "latency_us": 45,
  "time": "2026-04-30T12:00:00.123456Z",
  "message": "action_denied"
}

Decision Caching

High-performance LRU cache with configurable TTL:

# Cache statistics are included in periodic stats output
=== Warmor Statistics ===
Total Events: 1721
Allowed: 1523 (88.5%)
Denied: 42 (2.4%)
Logged: 156 (9.1%)
Cache Hits: 1450
Cache Misses: 271
Cache Hit Rate: 84.25%
Cache Size: 245/10000
========================


πŸ“– Documentation


πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Application Layer                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           Interception Layer (Platform-Specific)             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”‚
β”‚  β”‚   eBPF   β”‚    β”‚   ESF    β”‚    β”‚  eBPF-Windows/   β”‚      β”‚
β”‚  β”‚ (Linux)  β”‚    β”‚ (macOS)  β”‚    β”‚      KMD         β”‚      β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              warmor Daemon (User Space)                      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚  β”‚         WASM Runtime (Wazero)                      β”‚     β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚     β”‚
β”‚  β”‚  β”‚        policy.wasm (The Brain)               β”‚  β”‚     β”‚
β”‚  β”‚  β”‚  - Evaluate syscall context                  β”‚  β”‚     β”‚
β”‚  β”‚  β”‚  - Apply security rules                      β”‚  β”‚     β”‚
β”‚  β”‚  β”‚  - Return: ALLOW / DENY / LOG                β”‚  β”‚     β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚     β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🎯 Use Cases

Container Security

  • Enforce egress restrictions on Kubernetes pods
  • Block unauthorized file access in containers
  • Prevent privilege escalation attempts

Endpoint Protection

  • Prevent malware execution on developer machines
  • Enforce data loss prevention (DLP) policies
  • Control USB device access

Zero-Trust Architecture

  • Implement microsegmentation at the process level
  • Enforce identity-based access controls
  • Monitor and control lateral movement

πŸ“Š Current Status

Phase 1: Linux PoC (In Progress)

  • Project structure and documentation
  • eBPF program for execve monitoring
  • WASM runtime integration (Wazero)
  • Example Rust policy
  • Full eBPF + WASM integration
  • Hot-reload capability
  • Testing and validation

Next Phases:

  • Phase 2: Observability (Prometheus, Grafana)
  • Phase 3: Kubernetes deployment
  • Phase 4: Windows and macOS support
  • Phase 5: Production features
  • Phase 6: Complete documentation

See IMPLEMENTATION_ROADMAP.md for details.


πŸ› οΈ Development

Build Commands

make all          # Build everything
make build-bpf    # Compile eBPF program
make build-policy # Build WASM policy
make build-daemon # Build warmor daemon
make test         # Run tests
make clean        # Clean build artifacts

Project Structure

warmor/
β”œβ”€β”€ cmd/                    # Command-line tools
β”‚   β”œβ”€β”€ warmor-daemon/     # Main enforcer
β”‚   β”œβ”€β”€ test-ebpf/         # eBPF testing
β”‚   └── test-wasm/         # WASM testing
β”œβ”€β”€ internal/              # Internal packages
β”‚   β”œβ”€β”€ ebpf/             # eBPF loader
β”‚   β”œβ”€β”€ wasm/             # WASM runtime
β”‚   └── enforcer/         # Enforcement logic
β”œβ”€β”€ pkg/api/              # Public API
β”œβ”€β”€ policies/example/     # Example policy
β”œβ”€β”€ bpf/                  # eBPF C programs
└── docs/                 # Documentation

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Areas We Need Help

  • Windows eBPF implementation
  • macOS Endpoint Security Framework integration
  • Policy testing framework
  • Documentation and examples
  • Performance optimization

πŸ“ License

warmor is licensed under the MIT License.


πŸ™ Acknowledgments


πŸ“ž Contact


Made with ❀️ by the warmor team

Version: Phase 1 (PoC)
Last Updated: 2026-04-29

About

Warmor is a security enforcer that uses eBPF to monitor system calls and applies WebAssembly (WASM)-based policies for workload protection. It is designed to work across multiple platforms while leveraging eBPF for deep system visibility and WASM for portability.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors