-
Notifications
You must be signed in to change notification settings - Fork 905
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
rules: the required_engine_version is now on by default #1273
Conversation
/milestone 0.24.0 |
Now that we are scoping the engine version we probably need to do a review and add this to older rules that were subject to an engine version increase too. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
While working on this @leodido and I also took a stub and went back in time to update the minimum engine version in all the rules we have. This is Falco 0.20.0 (engine version 5) if you try to use a rule of the current master (engine version 6)
This is Falco 0.15.0 (engine version 3) if you try to load a rule with engine version 5.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall SGTM, but not yet sure anything is working as expected.
I have tested this rule files with the experimental event-generator test which requires the gRPC bidi, thus I had to:
- disable the
Container Drift Detected (open+create)
since the gRPC bidi branch is still on engine version 5 - add
kubernetes-admin
to theallowed_k8s_users
since events were generate with that user within my installation (Kind)
That being said some k8saudit
tests did not pass:
INFO sleep for 1s action=k8saudit.K8SServiceaccountCreated
INFO create k8s resource action=k8saudit.K8SServiceaccountCreated kind=ServiceAccount name=vanilla-serviceaccount
INFO create k8s resource action=k8saudit.K8SServiceaccountCreated kind=Role name=vanilla-role
INFO create k8s resource action=k8saudit.K8SServiceaccountCreated kind=RoleBinding name=vanilla-role-binding
INFO test passed action=k8saudit.K8SServiceaccountCreated rule="K8s Serviceaccount Created" source=K8S_AUDIT
INFO sleep for 1s action=k8saudit.K8SServiceCreated
INFO create k8s resource action=k8saudit.K8SServiceCreated kind=Service name=vanilla-service
INFO test passed action=k8saudit.K8SServiceCreated rule="K8s Service Created" source=K8S_AUDIT
INFO sleep for 1s action=k8saudit.ClusterRoleWithWritePrivilegesCreated
INFO create k8s resource action=k8saudit.ClusterRoleWithWritePrivilegesCreated kind=Role name=write-privileges-role
WARN context deadline exceeded
INFO sleep for 1s action=k8saudit.CreateSensitiveMountPod
INFO create k8s resource action=k8saudit.CreateSensitiveMountPod kind=Deployment name=sensitive-mount-deployment
WARN rpc error: code = DeadlineExceeded desc = context deadline exceeded
INFO sleep for 1s action=k8saudit.CreatePrivilegedPod
INFO create k8s resource action=k8saudit.CreatePrivilegedPod kind=Deployment name=privileged-deployment
WARN context deadline exceeded
WARN action not enabled action=k8saudit.CreateDisallowedPod
INFO sleep for 1s action=k8saudit.CreateHostNetworkPod
INFO create k8s resource action=k8saudit.CreateHostNetworkPod kind=Deployment name=hostnetwork-deployment
WARN context deadline exceeded
INFO sleep for 1s action=k8saudit.CreateNodePortService
INFO create k8s resource action=k8saudit.CreateNodePortService kind=Service name=nodeport-service
INFO test passed action=k8saudit.CreateNodePortService rule="Create NodePort Service" source=K8S_AUDIT
INFO sleep for 1s action=k8saudit.ClusterRoleWithPodExecCreated
INFO create k8s resource action=k8saudit.ClusterRoleWithPodExecCreated kind=Role name=pod-exec-role
WARN context deadline exceeded
INFO sleep for 1s action=k8saudit.CreateModifyConfigmapWithPrivateCredentials
INFO create k8s resource action=k8saudit.CreateModifyConfigmapWithPrivateCredentials kind=ConfigMap name=private-creds-configmap
INFO test passed action=k8saudit.CreateModifyConfigmapWithPrivateCredentials rule="Create/Modify Configmap With Private Credentials" source=K8S_AUDIT
INFO sleep for 1s action=k8saudit.K8SConfigMapCreated
INFO create k8s resource action=k8saudit.K8SConfigMapCreated kind=ConfigMap name=vanilla-configmap
INFO test passed action=k8saudit.K8SConfigMapCreated rule="K8s ConfigMap Created" source=K8S_AUDIT
INFO sleep for 1s action=k8saudit.K8SDeploymentCreated
INFO create k8s resource action=k8saudit.K8SDeploymentCreated kind=Deployment name=vanilla-deployment
INFO test passed action=k8saudit.K8SDeploymentCreated rule="K8s Deployment Created" source=K8S_AUDIT
INFO sleep for 1s action=k8saudit.ClusterRoleWithWildcardCreated
INFO create k8s resource action=k8saudit.ClusterRoleWithWildcardCreated kind=Role name=wildcard-resources-role
WARN rpc error: code = DeadlineExceeded desc = Deadline Exceeded
N.b.: "context deadline exceeded" means the rule was not triggered within 2 mins.
On the other hand, all syscall
tests passed.
Please, do not take these results as definitive since the tester is still experimental and I have to double-check results again. I will investigate more soon.
/hold There is something going on with the integration tests. |
Does it mean we have a global |
Yes @Kaizhe - every rule inherits the global requirements while specific rules can specify an higher requirement if they contain a field that was added on a specific engine version. |
I might have found the problem with the integration test. I'm working on it. |
/milestone 0.25.0 |
Rebased on the current master. Working on it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that integration tests are not passing for the reason explained here 👉 #1315
I'm investigating and trying to fix this problem.
Please keep on
/hold
Unfortunately, that is not true. I have discovered that rule loader supports It was not immediately apparent because when the I've formatted the Lua code to make the if/elseif chain (that implements the above behavior) clearer. For these reasons, I've converted the Although this PR does not introduce significant changes eventually, IMHO it worths merging this anyway since that comments and code formatting will help folks to understand how to use rules properly). cc @fntlnz |
Co-Authored-By: Leonardo Di Donato <leodidonato@gmail.com> Signed-off-by: Lorenzo Fontana <lo@linux.com>
compatible with engine 6 Co-Authored-By: Leonardo Di Donato <leodidonato@gmail.com> Signed-off-by: Lorenzo Fontana <lo@linux.com>
rule(Create Privileged Pod): required_engine_version 5 rule(Create Sensitive Mount Pod): required_engine_version 5 rule(Create HostNetwork Pod): required_engine_version 5 rule(Pod Created in Kube Namespace): required_engine_version 5 rule(ClusterRole With Wildcard Created): required_engine_version 5 rule(ClusterRole With Write Privileges Created): required_engine_version 5 rule(ClusterRole With Pod Exec Created): required_engine_version 5 Co-Authored-By: Leonardo Di Donato <leodidonato@gmail.com> Signed-off-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
Rebased again to solve conflicts with the master branch. I believe this is ready to be reviewed now. /hold cancel |
/poiana |
@leodido: I'm Poiana, I stop the drama! In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/close |
@fntlnz: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Co-Authored-By: Leonardo Di Donato leodidonato@gmail.com
Signed-off-by: Lorenzo Fontana lo@linux.com
What type of PR is this?
/kind feature
/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 #1272
Special notes for your reviewer:
Does this PR introduce a user-facing change?: