Commit 97381fe
committed
Add programmable policy engine for network governance
Replace the three separate governance mechanisms (AllowedPorts, ManagedEngine,
NetworkRules) with a unified policy engine powered by expr-lang/expr expressions.
Networks get a policy document with ordered rules evaluated against protocol
events (connect, dial, datagram, cycle, join, leave). Gate events produce
allow/deny verdicts; action events fire score, tag, prune, fill, evict, and
webhook directives.
- pkg/policy: pure library — parse, validate, compile, evaluate policies
- pkg/daemon: PolicyRunner per network with peer state, cycle timer, persistence
- pkg/registry: ExprPolicy field on NetworkInfo, set/get handlers (admin-gated)
- pkg/driver: PolicyGet/PolicySet IPC methods
- pilotctl: policy get/set/validate/test CLI commands
- Backward compat: RulesToPolicy and AllowedPortsToPolicy bridges
- 71 new tests across policy, daemon, registry, and integration packages1 parent db0181a commit 97381fe
23 files changed
Lines changed: 6320 additions & 77 deletions
File tree
- cmd/pilotctl
- pkg
- daemon
- driver
- policy
- protocol
- registry
- tests
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
0 commit comments