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

fix: Add non-root user into KubeArmor container(#1401) #1834

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yp969803
Copy link

Signed-off-by: Yash Patel [email protected]

Purpose of PR?:

Fixes #1401

Does this PR introduce a breaking change?

If the changes in this PR are manually verified, list down the scenarios covered::

Additional information for reviewer? :
Mention if this PR is part of any design or a continuation of previous PRs

Checklist:

  • Bug fix. Fixes #
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • PR Title follows the convention of <type>(<scope>): <subject>
  • Commit has unit tests
  • Commit has integration tests

@yp969803
Copy link
Author

@rksharma95 can you review the pr

Copy link
Member

@kranurag7 kranurag7 left a comment

Choose a reason for hiding this comment

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

@yp969803 Can you please also update the helm chart for this?

As of now, I'm not sure if this will work or not. Last time, I checked with non-root user the controller was failing. Having said that, we have refactored the controller a lot so please let me know if you've already verified the changes at runtime.

EDIT:
Also, I think it would be great if we have something like this uid=65532(nonroot) gid=65532(nonroot) groups=65532(nonroot) (not a blocker for this PR and can be done as a follow up)

Comment on lines +417 to +418
RunAsUser: ptr.To(int64(1000)),
RunAsGroup: ptr.To(int64(1000)),
Copy link
Member

Choose a reason for hiding this comment

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

Let's avoid this and change the Dockerfile instead to use non root user

Copy link
Author

Choose a reason for hiding this comment

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

Dockerfile already have configuration to use non-root user

Copy link
Collaborator

Choose a reason for hiding this comment

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

only for ubi based image not for alpine one.
PTAL here

FROM alpine:3.20 as kubearmor

@daemon1024
Copy link
Member

Please check with a containerd environment locally if it works or not.

@daemon1024
Copy link
Member

Please fill the PR template completely.
I don't think this PR was validated at all locally, would appreciate PRs being tested locally before being opened.
Same for #1833. We already see that tests fail so it was not tested out.

@rksharma95
Copy link
Collaborator

@yp969803 one more point i would like to add is, make sure you first validate if non-root user works with apparmor enforcer.

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.

Add non-root user into KubeArmor container
4 participants