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

rule(macro user_known_k8s_client_container): have more strict condition to avoid false positives #962

Merged
merged 2 commits into from
Dec 11, 2019

Conversation

rung
Copy link
Contributor

@rung rung commented Dec 6, 2019

Signed-off-by: Hiroki Suezawa suezawa@gmail.com

What type of PR is this?
/kind rule-update

Any specific area of the project related to this PR?
/area rules

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

  • Output Sample
{"output":"18:14:42.779407953: Warning Docker or kubernetes client executed in container (user=root k8s.ns=kube-system k8s.pod=fluentd-gcp-scaler-54ccb89d5-nqb7c container=42bcc1ab542b parent=scaler.sh cmdline=kubectl get ds -n kube-system fluentd-gcp-v3.1.1 -o jsonpath={.spec.template.spec.containers[?(@.name=='fluentd-gcp')].resources.requests.cpu} image=k8s.gcr.io/fluentd-gcp-scaler:0.5.2) k8s.ns=kube-system k8s.pod=fluentd-gcp-scaler-54ccb89d5-nqb7c container=42bcc1ab542b k8s.ns=kube-system k8s.pod=fluentd-gcp-scaler-54ccb89d5-nqb7c container=42bcc1ab542b","priority":"Warning","rule":"The docker client is executed in a container","time":"2019-12-06T18:14:42.779407953Z", "output_fields": {"container.id":"42bcc1ab542b","container.image.repository":"k8s.gcr.io/fluentd-gcp-scaler","container.image.tag":"0.5.2","evt.time":1575656082779407953,"k8s.ns.name":"kube-system","k8s.pod.name":"fluentd-gcp-scaler-54ccb89d5-nqb7c","proc.cmdline":"kubectl get ds -n kube-system fluentd-gcp-v3.1.1 -o jsonpath={.spec.template.spec.containers[?(@.name=='fluentd-gcp')].resources.requests.cpu}","proc.pname":"scaler.sh","user.name":"root"}}

Does this PR introduce a user-facing change?:

rule(macro user_known_k8s_client_container): when executing the docker client, exclude fluentd-gcp-scaler container running in the `kube-system` namespace to avoid false positives

…on to avoid false positives

Signed-off-by: Hiroki Suezawa <suezawa@gmail.com>
@rung
Copy link
Contributor Author

rung commented Dec 6, 2019

/assign @Kaizhe

rules/falco_rules.yaml Outdated Show resolved Hide resolved
rules/falco_rules.yaml Outdated Show resolved Hide resolved
Copy link
Contributor

@Kaizhe Kaizhe left a comment

Choose a reason for hiding this comment

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

Please see my comments

Copy link
Member

@leodido leodido left a comment

Choose a reason for hiding this comment

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

Overall LGTM.

Agree with @Kaizhe about the rephrasing.

Signed-off-by: Hiroki Suezawa <suezawa@gmail.com>
@rung
Copy link
Contributor Author

rung commented Dec 6, 2019

@Kaizhe @leodido Thank you! I rephrased.

@Kaizhe
Copy link
Contributor

Kaizhe commented Dec 6, 2019

/lgtm

@poiana
Copy link

poiana commented Dec 6, 2019

LGTM label has been added.

Git tree hash: 0012b11a360f9257a3386ce99fd890ea41ed035e

@Kaizhe
Copy link
Contributor

Kaizhe commented Dec 6, 2019

@rung appreciate your quick response to this PR. You help make our community a better place to work with :)

@rung
Copy link
Contributor Author

rung commented Dec 11, 2019

@Kaizhe Hi! Thank you for your review.
Could you approve this PR manually? It seems this isn't approved on GitHub yet.

@leodido leodido self-requested a review December 11, 2019 11:50
@poiana
Copy link

poiana commented Dec 11, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Kaizhe, leodido

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

@leodido leodido merged commit 93fdf8e into falcosecurity:dev Dec 11, 2019
@fntlnz fntlnz added this to the 0.19.0 milestone Jan 22, 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

5 participants