Skip to content

atelet: drop privileged from the DaemonSet#346

Open
Benjamin Elder (BenTheElder) wants to merge 1 commit into
agent-substrate:mainfrom
BenTheElder:atelet-drop-privileged
Open

atelet: drop privileged from the DaemonSet#346
Benjamin Elder (BenTheElder) wants to merge 1 commit into
agent-substrate:mainfrom
BenTheElder:atelet-drop-privileged

Conversation

@BenTheElder

Copy link
Copy Markdown
Collaborator

Fix unpack / removal of extracted images to only need running as root.

Validated end-to-end on a kind cluster.

We may need to add back some capabilities in the future. We can add as-needed.

It's a good idea to open an issue first for discussion.

  • Tests pass
  • Appropriate changes to documentation are included in the PR

atelet performs no privilege-requiring host operations: no mounts, netlink,
nftables, device access, or namespace manipulation (all of that lives in the
ateom worker pod). It only reads/writes the /var/lib/ateom-gvisor hostPath as
root, so it needs no Linux capabilities. Replace privileged:true with
runAsUser/runAsGroup 0 and capabilities drop ALL. runAsUser is pinned explicitly
so the root requirement no longer depends on the base image's default user.

Unpacking arbitrary actor images can require writing into image-defined
read-only directories (e.g. ko ships /ko-app as 0555), which root cannot do
without CAP_DAC_OVERRIDE. Instead of granting that cap:

  - untar extracts directories owner-writable, then restores the image's modes
    in a final pass (deepest-first), so directory and file modes are preserved
    faithfully.
  - bundle removal uses removeAllWritable, which re-adds owner write to each
    directory before unlinking, so atelet can also delete a restored read-only
    tree as plain root.

Validated end-to-end on a kind cluster.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant