-
Notifications
You must be signed in to change notification settings - Fork 360
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
feat: Not using hostNetwork=true #1392
base: main
Are you sure you want to change the base?
Conversation
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.
Please update deploygen
and all test files with this change .
42ce885
to
0db961a
Compare
include deployments/helm in ci trigger |
Signed-off-by: Shreyas220 <shreyas.ny@gmail.com> fix Signed-off-by: Shreyas220 <shreyas.ny@gmail.com> added Signed-off-by: Shreyas220 <shreyas.ny@gmail.com> asdsa Signed-off-by: Shreyas220 <shreyas.ny@gmail.com> i[dae Signed-off-by: Shreyas220 <shreyas.ny@gmail.com>
8b302cd
to
dc2ad88
Compare
03f4a2b
to
426dc61
Compare
CI failing was because of the condition for grpc variable in util Now as hostNetwork is false it wont work hence now by turning now we are port forwarding we get an error that socat was missing |
Signed-off-by: Shreyas220 <shreyas.ny@gmail.com> test Signed-off-by: Shreyas220 <shreyas.ny@gmail.com> asds Signed-off-by: Shreyas220 <shreyas.ny@gmail.com>
426dc61
to
790a84d
Compare
Hey @kranurag7 , requesting your review here, since you had previously worked on removing |
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.
This PR is only modifying the spec.HostNetwork
field, and I think this should break on some providers. Last time, I check only, setting the value to false
will not work.
Please verify on all the providers and let me know if I'm missing the PR in which this was implemented. I ran this query and was not able to find any PR corresponding to the implementation.
@kranurag7 this has been part of KubeArmor since it's inception so no PRs for this :D |
@Shreyas220 afaik this has been verified on AKS already, can we verify it on GCP and AWS too? |
@kranurag7 afaik hostnetwork is true when we are trying to access something host node's network namespace, I looked thoroughly and in our case we are not so we should not be using hostnetwork=true. (if you see anything do let me know )
@daemon1024 yes i tested on local vm (k3s) and AKS and found it to working properly, as i mentioned above we are not trying to access anything from host network namespace so it should work in all cases but i'll test it on AKS and GKE to be sure |
@Shreyas220 This was the area that I needed to handle during my mentorship
We were aware of this during the mentorship time period as well that we don't require I was mostly testing on GKE and k3s and something at least was breaking and it not then CI was not happy. I tested this very thoroughly with all permutations and combinations. I don't recall what was breaking at that time. We were not able to do this directly, and this was the reason I was keeping an eye on this issue. I brought the same with Barun and Rahul during community call so that we can get rid of host parameters set to true with kubearmor deployment. Having said that, we have evolved a lot in terms of CI flakiness and codebase itself. So, please test this out on different providers and if it works, then we are good to go with setting |
@kranurag7 yup the CI was breaking for me as well, not sure if this was same reason when you were trying The reason the CI was breaking for me was that we were trying to connect to kubearmor using hostIP as now since IP is different changes were required in both relay-server (link) to get PodIP instead of hostIP and tests I'll test on GKE and AWS to see if it works |
To be tested on KinD (Issue potentially only on KinD with AppArmor) |
Create a seperate PR for removing deployment files. |
@daemon1024 has verified that the functionality works as intended on AWS EKS (Amazon Linux and Bottle Rocket.) But, we have an issue when using Kind,
the InitBPF function returns an empty map which causes this error in UpdateNsKeyMap function which is because when hostNetwork is set to false, KubeArmor is unable to mount the /sys/fs/bpf filepath . Usually, such behavior is unexpected. there might be some difference in capabilities or the mounted path , or we need to look into the security policy. |
Purpose of PR?:
Removing the dependency on hostNetwork=true
Fixes #
Does this PR introduce a breaking change?
Yes
If the changes in this PR are manually verified, list down the scenarios covered::
The policy was enforced and was able to receive Block alerts and network logs
Additional information for reviewer? :
Alert
log
on pod
Checklist:
<type>(<scope>): <subject>