feat(serviceradar-agent): siper XDP firewall integration #1000
Labels
No labels
1week
2weeks
Failed compliance check
IP cameras
NATS
Possible security concern
Review effort 1/5
Review effort 2/5
Review effort 3/5
Review effort 4/5
Review effort 5/5
UI
aardvark
accessibility
amd64
api
arm64
auth
back-end
bgp
blog
bug
build
checkers
ci-cd
cleanup
cnpg
codex
core
dependencies
device-management
documentation
duplicate
dusk
ebpf
enhancement
eta 1d
eta 1hr
eta 3d
eta 3hr
feature
fieldsurvey
github_actions
go
good first issue
help wanted
invalid
javascript
k8s
log-collector
mapper
mtr
needs-triage
netflow
network-sweep
observability
oracle
otel
plug-in
proton
python
question
reddit
redhat
research
rperf
rperf-checker
rust
sdk
security
serviceradar-agent
serviceradar-agent-gateway
serviceradar-web
serviceradar-web-ng
siem
snmp
sysmon
topology
ubiquiti
wasm
wontfix
zen-engine
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
carverauto/serviceradar#1000
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from GitHub.
Original GitHub issue: #2778
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/issues/2778
Original created: 2026-02-10T20:50:08Z
PRD: ServiceRadar "Fortress" (eBPF Shield & Sentinel)
Target Component:
pkg/ebpf/fortressTarget Platform: Linux 5.10+ (LSM and CO-RE support required)
Security Level: Hardened / Self-Defending
1. Executive Summary
ServiceRadar Fortress is an integrated eBPF security suite for the
serviceradar-agent. It provides two primary defense layers:By embedding these capabilities directly into the signed agent binary, Fortress creates a "kernel-fortified" process that is resistant to tampering even by root-level attackers.
2. Architecture
2.1 The Fortress Umbrella
Fortress operates as a unified service within the Go agent, managing multiple eBPF program types:
2.2 Control Plane (Go)
ControlStream./sys/fs/bpf/serviceradarto ensure defenses survive an agent restart or crash.3. The "Airtight" Security Model
Layer 1: Immutable Provenance (No-Object-Files)
bpf2goto generate Go packages that embed the ELF bytecode via//go:embed.Layer 2: Instruction Sanitization (The Sandbox)
BPF_CALLinstructions and cross-reference them against an Allowlist.bpf_probe_write_userandbpf_override_returnare strictly prohibited.Layer 3: Shield LSM (Process Isolation)
bpf_map_update_elemchecks the calling process identity.serviceradar-agentPID can modify rules. Evenrootusingbpftoolwill be denied access to Shield maps.Layer 4: Sentinel LSM (File Self-Defense)
inode_permission,inode_rename, andinode_unlink.WRITEaccess to theserviceradar-agentexecutable for all processes except the system update manager.WRITEaccess to/etc/serviceradar/*.jsonto any process other than the Agent.Layer 5: Management Safety Valve (The Golden Rule)
4. Functional Requirements
4.1 Shield (Network Firewall)
LPM_TRIE(Longest Prefix Match) for IPv4/IPv6.XDP_DROPfor matches,XDP_PASSfor misses.4.2 Sentinel (Integrity & Monitoring)
open,write, andunlinkon sensitive paths.PerfEventArrayorRingBuffor immediate transmission to the Gateway.5. Technical Specifications
5.1 Standards & Tooling
github.com/cilium/ebpf(Pure Go loader).vmlinux.h.5.2 Performance Targets
6. Implementation Rules for Contributors
7. Success Metrics
rm -rf /etc/serviceradar/sweep.jsonand is blocked by the kernel.agent.servicerestart.Imported GitHub comment.
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/issues/2778#issuecomment-3880808082
Original created: 2026-02-10T21:28:50Z
siper is gplv3Imported GitHub comment.
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/issues/2778#issuecomment-3882017568
Original created: 2026-02-11T04:11:13Z
https://github.com/harshavmb/fim-ebpf
Imported GitHub comment.
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/issues/2778#issuecomment-3902746513
Original created: 2026-02-14T22:58:56Z
Implementing the Fortress spec requires a tight marriage between Go's user-space management and eBPF's kernel-space enforcement.
To solve your primary dilemma—how to reliably identify the "Agent" process in an LSM hook without relying on unstable PIDs—there are three "industry-standard" patterns used in modern eBPF security tools (like Tetragon or Falco).
1. Solution: The "Binary Inode & Device" Identity
Instead of PIDs, identify the process by the Inode of its executable file. Since Layer 4 of your PRD already makes the agent binary immutable, the Inode becomes a "Kernel-level Fingerprint" that cannot be spoofed.
How it works:
stat("/usr/bin/serviceradar-agent")to get the Inode and Device ID.map_config).lsm/bpf_map_update_elemhook, you helper-call to get the current task's executable file and compare its Inode.Note: This works perfectly in Docker/K8s because the kernel sees the underlying overlayfs Inode.
2. Implementation: Layer 2 (Instruction Sanitizer)
Using
cilium/ebpf, you can inspect the bytecode after it's embedded but before it's loaded into the kernel. This prevents "Helper Hijacking."3. Implementation: Layer 3 & 4 (The LSM "Sentinel")
To protect the files and the BPF maps themselves, you should use the
lsm/inode_permissionhook. This is more performant than hooking everyopen()orwrite()syscall.Logic for Sentinel:
/etc/serviceradar/(mask & MAY_WRITE)AND(process_inode != agent_inode), thenreturn -EPERM.The "Atomic Safety" Rule:
When updating the Shield (XDP) CIDR maps, use
BPF_ANYflags orBatchUpdate. Since the XDP program is just reading from theLPM_TRIE, user-space can swap entries atomically without the XDP program ever seeing a "partial" IP match.4. Handling Containers (Docker/K8s)
You mentioned concerns about the agent running in different environments.
/system.slice/serviceradar.service. In the LSM hook, you can usebpf_get_current_cgroup_id()and compare it to a value the agent learned at boot.current->tgid, and marks that specific Process ID as "Authenticated" in a Task Local Storage map.Recommended Implementation Plan
bpf2govmlinux.h+ LSM HooksControlStreamto sync theLPM_TRIEmap.cilium/ebpfconst volatile.BPF_CORE_READA Quick Warning on Layer 5 (The Safety Valve)
The PRD mentions a "hardcoded bypass for the Gateway IP."
Implementation Tip: Use a BPF
Global Variablefor this. This allows you to update the Gateway IP via the Go agent if the Gateway moves, without re-compiling the BPF code, while still keeping the bypass logic inside the high-speed XDP path.Does the Inode-based identification strategy satisfy your concerns about robustness in Docker/K8s? It's generally considered the "Gold Standard" for self-defending agents because the kernel's internal
filepointers are very difficult for a root user to manipulate compared to PIDs or Cgroups.