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

K8s: cannot run in Restricted PSS profile #1461

Open
zc-devs opened this issue Apr 26, 2024 · 0 comments
Open

K8s: cannot run in Restricted PSS profile #1461

zc-devs opened this issue Apr 26, 2024 · 0 comments

Comments

@zc-devs
Copy link
Contributor

zc-devs commented Apr 26, 2024

I deploy Blocky in Kubernetes and always try to comply with Restricted profile of Pod Security Standard. It requires to drop all capabilities, except NET_BIND_SERVICE.

I deploy Blocky on high port:

    ports:
      dns: 1053
      http: 4000

with container settings below:

      containers:
        - name: blocky
          image: ghcr.io/0xerr0r/blocky:v0.23
          securityContext:
            allowPrivilegeEscalation: false
            readOnlyRootFilesystem: true
            capabilities:
              drop:
                - ALL
          ports:
            - name: dns-tcp
              containerPort: 1053
            - name: dns-udp
              containerPort: 1053
              protocol: UDP
            - name: http
              containerPort: 4000

Currently, Blocky cannot run in Restricted profile. I get log line

exec /app/blocky: operation not permitted

and container gets restarted.

If I comment out capabilities: drop: - ALL, then container runs.

While working on #1460, I built custom image without setcap 'cap_net_bind_service=+ep', commenting out BIN_AUTOCAB=1. This image runs well in fully restricted PSS profile.

Besides, I want to mention #1353.

That being said, it would be great to have an image without capabilities. It could be separate version like v0.23-unprivileged.

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

No branches or pull requests

1 participant