-
Notifications
You must be signed in to change notification settings - Fork 74
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
Mirror port #219
Comments
It is not possible with the current implementation. Having OVS' port mirroring available in the CNI would be nice, do you have an idea of how the API could look like? |
To create a mirror it could be done in two places:
While to inject the mirror interface we may need on the destination pod an annotation like Do you think it's reasonable? |
From the two options, I think it should be on the NetworkAttachmentDefinition level. This object is managed by an administrator while Pod belongs to untrustworthy users (sorry users). If we exposed this option on Pod, users could abuse it and force their traffic to be mirrored where it should not. Having this on NetworkAttachmentDefinition sounds good. Could be the One remaining question is about scheduling - I assume that mirroring is limited to the node, right? So somebody would need to make sure that both the producer and consumer pods are on the same node. We can make this easy for ourselves by saying that this is a responsibility of the owner of the consumer pod - they have to set their podAffinity to land on the same node as the producer. Would that be sufficient? |
I partially agree with this concern. Allowing users to mirror the pod traffic with an annotation on the pod itself can be an issue only in terms on waste of resources, but is not adding any security risk. The risk is more on allowing consumers to read mirrored traffic. Moreover having the annotation only at NetworkAttachmentDefinition means that the whole VLAN would be mirrored even tough you may want to mirror just the traffic of a subset of pods/ports.
I have some doubts on how the
I guess what you stated is correct. Not sure how this mirroring can be done in a distributed environment, probably either you can't or it is very complex and network-bandwidth consuming. Anyway I think it's up to the owner responsibility to schedule pods on the right nodes via podAffinity. |
Thanks for the detailed response, I will answer inline.
But if there is an option for a third Pod to inject its traffic into the mirror, you would no longer be able to prove the source of the sniffed traffic and it could add noise to your captured data, no? I don't have experience with use of port mirroring, so pardon my ignorance.
I see your point here. The option would be to create a duplicated NetworkAttachmentDefinition for the Pod you want to monitor, with additional On the other hand, I don't know if Multus allows you to pass arbitrary arguments in the
Sounds good to me.
We could take an approach that is similar to the producer - you would create a duplicated NetworkAttachmentDefinition. It would be the same as the regular one, but also set the I wonder, would it make sense to treat this as a standalone CNI (it could live under this project and use the infrastructure). I'm thinking - Before we get to implementation, it would be important to make sure the design is sound. If you decide to start working on this, would you please first post a design document under |
Sorry for the delay of my response, at the moment we are compiling
Normally you want to capture the mirrored traffic and pass it through an IDS/IPS system or a net-probe software in order to catch any unusual behaviour that could harm the network. Adding some noise doesn't cause an issue but I can think of at least two security threats:
So I agree with you, we need to think really carefully on how avoid these kind of threats.
That's a good note. For our use case we are not using any IPAM cause we need a real DHCP server pod to emulate a realistic network behaviour. So this not a blocker to us but for sure this is something to take into consideration to make the plugin fully compatible with other use cases.
I don't know either. I've tried adding an additional param into the
It makes sense. Basically we'll end up with three "types" of NADs. The first is the regular one with no mirroring, the other two allow users to either produce to the mirror or consume from the mirror.
From an architectural point of view it does make a lot of sense. Seems a very clean approach.
Sure, we can collaborate on that. Thank you for being interested in our use case! I guess we'll need support from the community cause this is the first time we look so in detail into the CNI. |
I think you are right. I looked into Multus' API definitions and there is a special field in the Let me know how this goes, it sounds interesting for sure o/ |
I was just now updating the Issue to give you an update on this same topic, when I've seen your message being popped up! That's crazy :) haha Anyway... I've run a simple test to verify that, by using the following annotation:
By printing the content of I guess we only miss it in the NetConf struct to correctly parse |
We opened a PR containing the proposal #227 |
Is it possibile to inject a mirror (span) port into a pod? Can't find any reference in code or documentation. Thanks
The text was updated successfully, but these errors were encountered: