π‘οΈ Sentinel: Enforce Unix socket peer verification#108
π‘οΈ Sentinel: Enforce Unix socket peer verification#108
Conversation
Secure `cc-agent exec` against local spoofing attacks by verifying the socket peer's credentials (`SO_PEERCRED`). - Implemented `verifySocketPeer` in `cmd/security_linux.go`. - Added check in `cmd/exec.go`. - Added verification test `cmd/security_peer_linux_test.go`. Co-authored-by: minibota <1483356+minibota@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
π Issue:
cc-agent execblindly connected to the Unix socket specified by--socket-path(or fallback). If the socket path was in a shared directory (like/tmp, which is used as a fallback or in User Mode), a local attacker could pre-create the socket and intercept execution reports containing sensitive job output (stdout/stderr).π§ Risk: Information Disclosure (High). An unprivileged local attacker could capture output from cron jobs running as other users.
π οΈ Fix:
verifySocketPeerusingsyscall.GetsockoptUcred(on Linux) to validate the peer's UID.var getCurrentUidto allow mocking in tests.π§ͺ Tests:
cmd/security_peer_linux_test.go:go test ./cmd(All Pass).π Notes: This fix focuses on the client side (
execcommand). The daemon side already sets0660permissions, but this adds defense-in-depth against pre-creation attacks in shared directories.PR created automatically by Jules for task 17519485796025406417 started by @minibota