Commit d89e69e
authored
fix(daemon): gate managed.policy.set IPC on admin-token validation (PILOT-233) (#172)
The managed.policy.set IPC handler accepted arbitrary policy JSON
from any same-UID process with no admin-token check. A malicious
process could inject a policy that disables network gates by either
setting "allow_everything" or exploiting fail-open semantics on
evaluation error.
This adds an admin-token gate to the daemon-side handler:
- Wire format extended from [netID(2)][policyJSON...] to
[netID(2)][tokenLen(2)][token...][policyJSON...]
- Daemon validates the token via constant-time comparison against
its configured AdminToken (if set).
- Driver.PolicySet signature updated to accept adminToken.
- When no admin token is configured, the gate is a no-op.
Closes PILOT-2331 parent e05aa1f commit d89e69e
6 files changed
Lines changed: 39 additions & 10 deletions
File tree
- cmd/pilotctl
- pkg
- daemon
- driver
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6393 | 6393 | | |
6394 | 6394 | | |
6395 | 6395 | | |
6396 | | - | |
| 6396 | + | |
6397 | 6397 | | |
6398 | 6398 | | |
6399 | 6399 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
1669 | 1670 | | |
1670 | 1671 | | |
1671 | 1672 | | |
1672 | | - | |
1673 | | - | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
1674 | 1697 | | |
1675 | 1698 | | |
1676 | 1699 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
458 | | - | |
459 | | - | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
460 | 464 | | |
461 | 465 | | |
462 | 466 | | |
463 | 467 | | |
464 | | - | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
465 | 471 | | |
466 | 472 | | |
467 | 473 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
704 | 704 | | |
705 | 705 | | |
706 | 706 | | |
707 | | - | |
| 707 | + | |
708 | 708 | | |
709 | 709 | | |
710 | 710 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
398 | | - | |
| 398 | + | |
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
| |||
458 | 458 | | |
459 | 459 | | |
460 | 460 | | |
461 | | - | |
| 461 | + | |
462 | 462 | | |
463 | 463 | | |
464 | 464 | | |
| |||
0 commit comments