Commit c37b17a
committed
Fix nmap bypass: comm-based tracking for pre-monitor openclaw workers
Root cause: openclaw-gateway workers created before the monitor starts
are never added to tracked_pids because the fork hook only propagates
tracking for already-tracked parents. Short-lived worker processes
(e.g. the gateway's executor) are invisible in /proc at bootstrap time,
so their children (bash, nmap, etc.) run without BPF enforcement.
Fix:
- bpf_hooks.c: add tracked_comms map and hash_comm_buf() helper;
extend sched_process_fork to fall back to comm-name lookup when the
parent is not in tracked_pids — auto-backfills the process into
tracked_pids so it and all descendants are tracked immediately
- monitor.py: add populate_tracked_comms() that registers djb2 hashes
of openclaw worker comm strings at startup; sources both target_paths
basenames and a /proc scan that catches openclaw-gateway (comm
"openclaw-gatewa") and similar workers already running before load
- dashboard/app.py: suppress PATH-LIN-015 self-noise from monitor's
own npm subprocess; raise parse_log_lines cap to 5000; include
rotated log backup in BLOCK_LOG_PATHS1 parent dc4b13b commit c37b17a
3 files changed
+225
-53
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
| |||
231 | 232 | | |
232 | 233 | | |
233 | 234 | | |
234 | | - | |
| 235 | + | |
235 | 236 | | |
236 | 237 | | |
237 | 238 | | |
| |||
249 | 250 | | |
250 | 251 | | |
251 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
252 | 261 | | |
253 | 262 | | |
254 | | - | |
| 263 | + | |
255 | 264 | | |
256 | 265 | | |
257 | 266 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
| |||
124 | 128 | | |
125 | 129 | | |
126 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
127 | 144 | | |
128 | 145 | | |
129 | 146 | | |
| |||
732 | 749 | | |
733 | 750 | | |
734 | 751 | | |
| 752 | + | |
735 | 753 | | |
736 | | - | |
737 | 754 | | |
738 | 755 | | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
739 | 771 | | |
740 | 772 | | |
741 | 773 | | |
| |||
998 | 1030 | | |
999 | 1031 | | |
1000 | 1032 | | |
1001 | | - | |
1002 | | - | |
1003 | | - | |
1004 | | - | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
1005 | 1044 | | |
1006 | 1045 | | |
1007 | 1046 | | |
| |||
0 commit comments