event-generator icon indicating copy to clipboard operation
event-generator copied to clipboard

adding event on `Redirect stdout/stdin to network connection in container`

Open h4l0gen opened this issue 1 year ago • 4 comments

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: this PR triggers rule which prevent potential reverse shell or remote code execution. Which issue(s) this PR fixes:

Fixes #184

Special notes for your reviewer:

h4l0gen avatar Mar 20 '24 23:03 h4l0gen

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: h4l0gen Once this PR has been reviewed and has the lgtm label, please assign fededp for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 avatar Mar 20 '24 23:03 poiana

Hey @leogr and @FedeDP, just an attempt to redirect Stdout is enough to trigger the rule. In this event:

  • Created a listener using the TCP protocol on the container's localhost.
  • Established a client connection using a goroutine.
  • After accepting the connection, called the redirectStdout function.
  • Closed connection and client after excution.

Rule triggered successfully image

h4l0gen avatar Apr 20 '24 11:04 h4l0gen

Issues go stale after 90d of inactivity.

Mark the issue as fresh with /remove-lifecycle stale.

Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Provide feedback via https://github.com/falcosecurity/community.

/lifecycle stale

poiana avatar Aug 05 '24 10:08 poiana

/remove-lifecycle stale

leogr avatar Aug 20 '24 12:08 leogr