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

adding event for this rule mount launched in privileged container #207

Merged
merged 2 commits into from
May 20, 2024

Conversation

h4l0gen
Copy link
Contributor

@h4l0gen h4l0gen commented Apr 22, 2024

What type of PR is this?

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

/kind bug

/kind cleanup

/kind documentation

/kind tests
/kind feature

Any specific area of the project related to this PR?

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

/area commands

/area pkg

/area events

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #204

Special notes for your reviewer:

@h4l0gen
Copy link
Contributor Author

h4l0gen commented Apr 22, 2024

In this event, flags are set syscall.CLONE_NEWNS | syscall.CLONE_NEWUSER as this action is in the privileged container.
Rule triggered successfully but this action shows an error as to launch mount inside privileged container we need more flags and permission like (cap_sys_admin) IMO that just make this event complex. What you think @leogr @FedeDP
WhatsApp Image 2024-04-18 at 05 59 46_98a6b37a

@h4l0gen h4l0gen requested a review from FedeDP May 17, 2024 11:47
Cloneflags: syscall.CLONE_NEWNS | syscall.CLONE_NEWUSER,
}

return cmd.Run()
Copy link
Contributor

Choose a reason for hiding this comment

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

Since cmd will always fail but it is enough to trigger the rule we might want to ignore the error and just return nil, wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

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

sorry i just noticed!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes @FedeDP, just return nil is also fine. As I've added err statement initially just to make clear that error will occur during this event. Can we add comment for this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense to add a small comment, yes!

Signed-off-by: h4l0gen <[email protected]>

squashing commits

Signed-off-by: h4l0gen <[email protected]>
@h4l0gen h4l0gen force-pushed the mountLaunchedInPrivilegedContainer branch from 1313c7a to afe083c Compare May 17, 2024 17:46
@h4l0gen
Copy link
Contributor Author

h4l0gen commented May 17, 2024

@FedeDP If everything looks good to you, then we are good to go with this PR.

Co-authored-by: Federico Di Pierro <[email protected]>
Signed-off-by: Kapil Sharma <[email protected]>
@h4l0gen
Copy link
Contributor Author

h4l0gen commented May 20, 2024

@FedeDP changes done.

Copy link
Contributor

@FedeDP FedeDP left a comment

Choose a reason for hiding this comment

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

/approve

@poiana
Copy link

poiana commented May 20, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

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
Copy link

poiana commented May 20, 2024

LGTM label has been added.

Git tree hash: ea44683f41d733400b2020195fdbec33155df70e

@poiana poiana merged commit 883cdf3 into falcosecurity:main May 20, 2024
4 checks passed
@leogr leogr added this to the v0.12.0 milestone Oct 2, 2024
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.

event on enabled incubating rule Mount launched in privileged container
4 participants