falcosecurity / event-generator

Generate a variety of suspect actions that are detected by Falco rulesets
Apache License 2.0
95 stars 40 forks source link

adding an event on rule `exfiltrating artifacts via kubernetes control plane` with the utility of creating `kind cluster` #206

Open h4l0gen opened 7 months ago

h4l0gen commented 7 months ago

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 #192

Special notes for your reviewer:

poiana commented 7 months ago

[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: - **[OWNERS](https://github.com/falcosecurity/event-generator/blob/main/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
h4l0gen commented 7 months ago

This PR involves the following steps:

For cleanup:

I've separated the above setup from the event as it can be reused (as a utility). Finally, in event ExfiltratingArtifactsViaKubernetesControlPlane:

createKindCluster waitForClusterReadiness createTestPod copyFileFromContainer deleteTestPod deleteKindCluster

Functions are called in sequence. copyFileFromContainer runs the kubectl cp command and deletes the copied file in the host's /tmp directory.

h4l0gen commented 7 months ago

Rule triggered successfully image

h4l0gen commented 6 months ago

@leogr @FedeDP @jasondellaluce PTAL at this PR and provide me your valuable feedback. Thank you :)

poiana commented 3 months ago

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

leogr commented 3 months ago

/remove-lifecycle stale