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

Kh add rule detect ephemeral container #1339

Merged
merged 1 commit into from
Aug 6, 2020

Conversation

Kaizhe
Copy link
Contributor

@Kaizhe Kaizhe commented Jul 31, 2020

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

If contributing rules or changes to rules, please make sure to also uncomment one of the following line:

/kind rule-update

/kind rule-create

Any specific area of the project related to this PR?

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

/area build

/area engine

/area rules

/area tests

/area proposals

What this PR does / why we need it:
Create a new rule to detect ephemeral container is created in a pod.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:
https://kubernetes.io/docs/concepts/workloads/pods/ephemeral-containers/
Audit log:

{"kind":"Event","apiVersion":"audit.k8s.io/v1","level":"Request","auditID":"b1737080-a7fd-44c5-87b5-3777dcf493c4","stage":"ResponseComplete","requestURI":"/api/v1/namespaces/default/pods/ubuntu-2/ephemeralcontainers","verb":"update","user":{"username":"admin","uid":"admin","groups":["system:masters","system:authenticated"]},"sourceIPs":["98.207.36.92"],"userAgent":"kubectl/v1.18.6 (darwin/amd64) kubernetes/dff82dc","objectRef":{"resource":"pods","namespace":"default","name":"ubuntu-2","apiVersion":"v1","subresource":"ephemeralcontainers"},"responseStatus":{"metadata":{},"code":200},"requestObject":{"kind":"EphemeralContainers","apiVersion":"v1","metadata":{"name":"ubuntu-2","creationTimestamp":null},"ephemeralContainers":[{"name":"debugger","image":"busybox","command":["sleep","3600"],"resources":{},"terminationMessagePolicy":"File","imagePullPolicy":"IfNotPresent","stdin":true,"tty":true}]},"requestReceivedTimestamp":"2020-07-31T21:45:48.728559Z","stageTimestamp":"2020-07-31T21:45:48.736514Z","annotations":{"authorization.k8s.io/decision":"allow","authorization.k8s.io/reason":""}}

Does this PR introduce a user-facing change?:

rule(EphemeralContainers Created): add new rule to detect ephemeral container created

@poiana poiana requested review from leodido and mfdii July 31, 2020 22:12
@poiana poiana added the size/S label Jul 31, 2020
@Kaizhe Kaizhe requested review from mstemm and removed request for mfdii July 31, 2020 22:12
…container created

Signed-off-by: kaizhe <derek0405@gmail.com>
@Kaizhe Kaizhe force-pushed the kh_add-rule-detect-ephemeral-container branch from 39e36e3 to df04439 Compare July 31, 2020 22:19
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,

thanks!

@poiana poiana added the lgtm label Aug 6, 2020
@poiana
Copy link

poiana commented Aug 6, 2020

LGTM label has been added.

Git tree hash: 8d68ee9080ab1dad77f6378f251505a77a90dffa

@poiana poiana added the approved label Aug 6, 2020
@poiana
Copy link

poiana commented Aug 6, 2020

[APPROVALNOTIFIER] This PR is APPROVED

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

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 511ef52 into master Aug 6, 2020
@poiana poiana deleted the kh_add-rule-detect-ephemeral-container branch August 6, 2020 20:42
@leogr leogr added this to the 0.25.0 milestone Aug 25, 2020
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.

None yet

4 participants