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

Add net_bind_service capability to nats-server binary #150

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

tamalsaha
Copy link
Contributor

@tamalsaha tamalsaha commented Apr 20, 2024

I am trying to run nats in k8s as nonroot user and hostport mode. nats-server is listening to port 443 for wss protocol. This change allows nats-server to bind to port 443 .

The reason this is required is because k8s does not support ambient capabilities yet.

ingress-nginx project also uses this in their Dockerfile to allow nonroot user
https://github.com/kubernetes/ingress-nginx/blob/48fbdfe3ba0c0e258890c970e2561caecea532dd/rootfs/Dockerfile#L70

Signed-off-by: Tamal Saha tamal@appscode.com

@wallyqs
Copy link
Member

wallyqs commented Apr 21, 2024

Thanks for the PR, this also seems to be what caddy is doing in its official image so it should be supported when published by docker team:

Copy link
Member

@wallyqs wallyqs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Tamal Saha <tamal@appscode.com>
@wallyqs wallyqs merged commit 71b9ce8 into nats-io:main Apr 23, 2024
6 checks passed
@wallyqs
Copy link
Member

wallyqs commented May 21, 2024

related feedback from when including into the official release: docker-library/official-images#16797 (comment)

@ramonberrutti-f3
Copy link

ramonberrutti-f3 commented May 22, 2024

I believe that will be better to nats internally or by the entrypoint.sh request the capability if is needed.

Maybe you can also try:

    - containerPort: 8443
      hostPort: 443

@rverenich
Copy link

Hello! Secure installations stopped working (with non-root user and dropped capabilities by default). Maybe it is better to request capability change only if needed, not by default?

@wallyqs
Copy link
Member

wallyqs commented May 22, 2024

Thanks for the report, we are going to rollback this change: #155

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.

4 participants