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(userspace/libsinsp): fixed podman as user detection #236

Merged
merged 1 commit into from
Mar 3, 2022

Conversation

FedeDP
Copy link
Contributor

@FedeDP FedeDP commented Mar 2, 2022

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area build

/area driver-kmod

/area driver-ebpf

/area libscap

/area libsinsp

/area tests

/area proposals

What this PR does / why we need it:

The PR fixes a problem in podman as user detection; basically, in podman we have 2 runc matching cgroups layouts:

/user.slice/user-1000.slice/user@1000.service/user.slice/libpod-$ID.scope/container
/machine.slice/libpod-$ID.scope/container

While we were able to parse the container ID just fine, we did not checked if the cgroup belonged to an user or root.
This behavior broke podman as user detection.

Moreover, fixed some inconsistencies in docker/base.cpp that was still using CT_DOCKER in various calls.

Which issue(s) this PR fixes:

Fixes #

(Falco: falcosecurity/falco#1912)

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

fix(userspace/libsinsp): fixed podman as user detection

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
@FedeDP
Copy link
Contributor Author

FedeDP commented Mar 2, 2022

/cc @gnosek

Copy link
Member

@leogr leogr left a comment

Choose a reason for hiding this comment

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

LGTM!

/approve

@poiana poiana added the lgtm label Mar 3, 2022
@poiana
Copy link
Contributor

poiana commented Mar 3, 2022

LGTM label has been added.

Git tree hash: 8c8a14c0d31139138118ea16aa3704efe3c7c6ba

@poiana
Copy link
Contributor

poiana commented Mar 3, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: FedeDP, leogr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana merged commit 2bc27c0 into master Mar 3, 2022
@poiana poiana deleted the fix_podman_as_user branch March 3, 2022 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants