🛡️ Sentinel: Secure socket creation in private directory#104
🛡️ Sentinel: Secure socket creation in private directory#104
Conversation
…sions 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: The daemon created its Unix socket directly in
/tmp/with a predictable name (cc-agent-<user>.sock). This allowed local attackers to pre-create the socket file (DoS) or potentially hijack the connection if directory permissions were loose.🧠 Risk: Denial of Service (preventing agent startup) or Information Disclosure (if attacker tricks exec command into connecting to their socket).
🛠️ Fix:
/tmp/cc-agent-<uid>/cc-agent.sock(or/tmp/cc-agent-<user>/on Windows).ensureSocketDirhelper to enforce0700permissions on this directory before creation.daemonto use this new secure path logic.🧪 Tests:
TestEnsureSocketDirto verify directory creation and permission enforcement.go test -v ./cmd/...(passed).📎 Notes:
sync_jobs), so service disruption should be minimal (only pending jobs during the restart window might fail).execcommand automatically picks up the new path if--socket-pathis not specified, or via the updated cron job arguments.Automated nightly security task.
PR created automatically by Jules for task 10612344924168496973 started by @minibota