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

Does this app run a root privilege pod? #490

Open
smartaquarius10 opened this issue Feb 6, 2024 · 10 comments
Open

Does this app run a root privilege pod? #490

smartaquarius10 opened this issue Feb 6, 2024 · 10 comments
Labels
needs discussion waiting for response Waiting for a response by the original author of the ticket

Comments

@smartaquarius10
Copy link

smartaquarius10 commented Feb 6, 2024

While connecting the bridge using vscode plugin it creates a new pod with AllowPrivilegeEscalation* to true.

Is this mandatory to set as true. Because in a restricted organization environment it is not possible to run a pod like this.

SMALL CORRECTION:- Referring runAsNonRoot as true not AllowPrivilegeEscalation*.

@smartaquarius10 smartaquarius10 changed the title Does this app need run privileged pod? Does this app run a privilege pod? Feb 6, 2024
@hsubramanianaks
Copy link
Collaborator

hsubramanianaks commented Feb 6, 2024

@smartaquarius10 Thanks for this question. I think we can move this to discussions if you are willing to talk more about it, but answer to this is NO, Bridge to Kubernetes doesn't create pods with securityContext: allowPrivilegeEscalation and I looked through the places where bridge creates pod specs I don't see anywhere it is setting security context.

It creates two pods remote agent in the same name as the service/pod you are debugging (runs with image lpkremoteagent) and another pod with same name as your service/pod but with -restore at the end (runs with image lpkrestorationjob). Please let me know if you have further questions or share logs if you face issues. Thanks again.

@hsubramanianaks hsubramanianaks added waiting for response Waiting for a response by the original author of the ticket needs discussion labels Feb 6, 2024
@smartaquarius10
Copy link
Author

@hsubramanianaks Thank you so much for the prompt reply. I am extremely sorry my bad. I've mentioned AllowPrivilegeEscalation but the error was coming because of runAsNonRoot as true.

Does this flag has to be false for this plugin. In company's environment, this flag is never allowed as well. You can test it using this sample operator

Just deploy it and vscode plugin connection with kubernetes shall fail. The remote agent pod will not spin. The moment you change this to false pod will start working

@smartaquarius10 smartaquarius10 changed the title Does this app run a privilege pod? Does this app run a root privilege pod? Feb 6, 2024
@hsubramanianaks
Copy link
Collaborator

@smartaquarius10 Even this flag I don't find in bridge codebase, I believe it is something to do with the operator or your company environment. Thank you.

@smartaquarius10
Copy link
Author

@smartaquarius10
Copy link
Author

@hsubramanianaks if you have some free time. Just deploy this operator and try connecting plugin. You’ll get the error. You dont have to change anything in the code to get the error.

@smartaquarius10
Copy link
Author

smartaquarius10 commented Feb 6, 2024

@hsubramanianaks The remote agent pod created by plugin throws an error to set run as non root flag false

@smartaquarius10
Copy link
Author

smartaquarius10 commented Feb 9, 2024

@hsubramanianaks any update on this please. Did u get some time to check this

@hsubramanianaks
Copy link
Collaborator

@smartaquarius10 Apologies I was occupied, I will take a look into this today. Thanks for your patience.

@smartaquarius10
Copy link
Author

smartaquarius10 commented Feb 14, 2024

@hsubramanianaks Hey np. Sure thanks.. :)

Regards,
Tanul

@nam-osisoft
Copy link

Any updates on this issue? Are there any plans to make b2k run as non-root or require root access?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs discussion waiting for response Waiting for a response by the original author of the ticket
Projects
None yet
Development

No branches or pull requests

3 participants