Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Injection as Non-Root User #2263

Open
RothAndrew opened this issue Jan 26, 2024 · 0 comments
Open

Data Injection as Non-Root User #2263

RothAndrew opened this issue Jan 26, 2024 · 0 comments
Labels
enhancement ✨ New feature or request

Comments

@RothAndrew
Copy link
Contributor

Is your feature request related to a problem? Please describe.

As far as I can tell, the Data Injection capability requires the container that is being targeted for injection to be running as user 0 (root). Ideally that should not be the case, as it violates standard cluster policies that prevent containers from running as root.

After lots of testing, here is the securityContext that I believe represents the least-privilege for the Data Injection capability. Making it any more secure makes the Data Injection capability break.

securityContext:
  allowPrivilegeEscalation: false
  capabilities:
    drop:
      - ALL
  privileged: false
  readOnlyRootFilesystem: true
  runAsGroup: 0
  runAsNonRoot: false
  runAsUser: 0

The errors receive are:
image

Of note is that the desired data IS injected. The errors happen when trying to create the ###ZARF_DATA_INJECTION_MARKER### file.

Describe the solution you'd like

I'm able to use the Data Injection capability without giving my container root. Ideally I'd be able to use this SecurityContext:

securityContext:
  allowPrivilegeEscalation: false
  capabilities:
    drop:
      - ALL
  privileged: false
  readOnlyRootFilesystem: true
  runAsGroup: 1337
  runAsNonRoot: false
  runAsUser: 1337

(Note: I'm injecting into a mounted PVC. If that weren't the case I wouldn't expect readOnlyRootFilesystem to be able to be true)

Additional context

link to internal slack conversation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
Status: Triage
Development

No branches or pull requests

2 participants