Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
container users and groups from process root #677
container users and groups from process root #677
Changes from all commits
52e623b
d6ef995
efd036e
16e05ab
2f96e73
08d5204
75524d8
2d9d8d0
a183ea5
c371d3d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind that
sinsp_threadinfo::set_user
gets called byparse_chroot_exit
,parse_clone_exit
,parse_execve_exit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it "too early"? Because we caught a thread switching into the container? What if the container is started as root?
What is
uid
here? If we're calling this from all sorts of parsers, it's not a special uid, like thedocker -u
user, right? So how does theuid != 0
check work?Maybe hardcoding uid=0 as "root" would be good enough btw?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deepskyblue86 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By trial and error, I found that the thread had the container id but wasn't really inside the container (i.e.
runc:[1:CHILD]
in my tests).We'll have
<NA>
🤷 but if / when it switches to a different user we'll load the users.uid
here?a)
sinsp_threadinfo::set_user
is being called byparse_chroot_exit
,parse_clone_exit
,parse_execve_exit
,parse_setuid_exit
,parse_setresuid_exit
.b) It's actually the user of
docker -u
or k8srunAsUser
.c) you can see that it's being tested (test/e2e/tests/test_process/test_container.py) by starting a
hashicorp/http-echo:alpine
container with11:110
I was a bit uncertain about doing so, but if it's already two of us I'd go with that 😀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense.