Skip to content
obserneticsPublic

About

An eBPF-based Kubernetes Operator for Proactive Attack Surface Minimization

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

298 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pahlevan

Your workload writes its own security policy. The kernel enforces it.

CI Go Report Card License: Apache 2.0 Go 1.26 Latest release GitHub stars
Kubernetes 1.24+ eBPF CO-RE LSM BPF enforcement PRs welcome

Pahlevan learn-then-enforce demo: a workload is profiled during a learning window, the learned surface is shown beside the enforced one, and then an attacker's read of /etc/shadow, exec of a miner, egress to an unlearned address, CAP_SYS_ADMIN, a ptrace of pid 1 and a setuid to root are each denied, killed or recorded in-kernel

The idea

A container runs one program, opens the same files, dials the same few destinations and uses about sixty of the kernel's four hundred syscalls. Pahlevan watches it do that once, then refuses everything else in the kernel with EPERM. Nobody writes a rule, and an attacker inherits the baseline instead of root.

Two panels. On the left, a learning window listing what an nginx container actually did: opened /etc/nginx/* and /var/log/*, connected to 10.0.1.7:5432, executed nginx, and used 61 of roughly 400 syscalls. An arrow labelled 'becomes the allow-set' leads to the right panel, enforcement, where those same three entries are marked ok and three that were never learned are refused with EPERM: /etc/shadow, /tmp/xmrig, and 45.9.1.4:80.

The console

Run pahlevan to see policies, workloads, live events and ATT&CK coverage in one place. It only reads, so it cannot turn enforcement off.

The trade

A baseline narrow enough to stop an attacker is narrow enough to stop you: kubectl exec into a pod and run curl, and it is denied. Start in Monitoring, which reports without denying, and use self-healing and policy exceptions to widen the set deliberately.

Architecture

Pahlevan architecture: a leader-elected operator and the PahlevanPolicy/ContainerProfile/AttackSurface CRDs drive per-node agents that load eBPF programs which observe and deny in-kernel

A per-node agent enforces in the kernel. A leader-elected operator drives the policy lifecycle with no host access; if it is down, enforcement keeps working.

Quick start

kubectl apply -f https://github.com/obsernetics/pahlevan/releases/latest/download/install.yaml
apiVersion: policy.pahlevan.io/v1beta1
kind: PahlevanPolicy
metadata: {name: nginx}
spec:
  selector: {matchLabels: {app: nginx}}
  learningConfig: {duration: 5m, autoTransition: true}
  enforcementConfig: {mode: Monitoring}   # Blocking denies in-kernel

pahlevan policy explain -f policy.yaml shows what a policy will enforce, with no cluster. More in docs/quick-start.md.

Requirements

Kubernetes 1.24+
Linux 5.8+ to observe
Enforcement lsm=bpf on the kernel command line

Without the BPF LSM, Pahlevan observes but cannot refuse. See docs/system-requirements.md.

Status

One maintainer, no public production adopters yet. A workload already compromised when learning starts has that behaviour baselined too. ROADMAP.md says what exists and what does not.

Contributing

Run make test lint. eBPF changes must pass make vm-test, which loads the programs in a VM, never on your machine. See CONTRIBUTING.md. Apache 2.0.

About

An eBPF-based Kubernetes Operator for Proactive Attack Surface Minimization

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages