Skip to content

Setup: create agent users with an empty skeleton (useradd -k), so agent homes start with no outward links (follow-up to #899) #922

Open

Description

@jayden1711

Follow-up to #899 (#798), from #899's round-3 review: #899 (comment)

Problem. Setup creates agent users with useradd --create-home, which copies /etc/skel (scripts/setup/lib.sh:67). A host whose skeleton holds outward links (CI's runner has ~/.ghcup -> /usr/local/.ghcup, root-owned and world-writable) puts those links into every agent home. That is why #899 can't simply refuse every outward link: it has to pin the directories along such a link's path and bind its target read-only. It also leaves a measured cross-user residual: another user's sandboxed command can rewrite a world-writable target that an agent's home links to.

Wanted.

  • Create agent users with an empty skeleton: useradd -m -k <empty dir>, an empty root-owned 0755 directory. The agent's home then starts with no outward links, and the strict rule (refuse any outward link through a writable hop) costs nothing on new installs.
  • Existing installs: doctor reports outward links in agent homes, with the exact root fix.
  • Tests that fail without it:
    • a new agent user's home contains no symlinks;
    • doctor flags a planted outward link.

Protected: setup scripts are in the critical set.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions