fix(hermes-agent): restrict /proc access in systemd services
Hermes strips sensitive env vars from tool subprocesses, but child processes can recover them by reading /proc/<parent_pid>/environ. Add ProtectProc=invisible and ProcSubset=pid to both systemd services to hide other processes' /proc entries and limit /proc to the service's own PID namespace. Ref: https://github.com/NousResearch/hermes-agent/issues/4427
This commit is contained in:
@@ -76,6 +76,8 @@ Environment="HERMES_HOME=/home/hermes/.hermes"
|
|||||||
Environment="HOME=/home/hermes"
|
Environment="HOME=/home/hermes"
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
ProtectProc=invisible
|
||||||
|
ProcSubset=pid
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
@@ -103,6 +105,8 @@ Environment="PATH=/home/hermes/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sb
|
|||||||
Environment="NODE_OPTIONS=--max-old-space-size=3072"
|
Environment="NODE_OPTIONS=--max-old-space-size=3072"
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
ProtectProc=invisible
|
||||||
|
ProcSubset=pid
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|||||||
Reference in New Issue
Block a user