KVM: enable no-mac-spoofing on virtual nics#8951
KVM: enable no-mac-spoofing on virtual nics#8951weizhouapache wants to merge 1 commit intoapache:4.22from
Conversation
0347115 to
5e0aa25
Compare
|
@NuxRo @DaanHoogland and me have tested it. mac anti-spoofing works, but ip anti-spoofing does not work. |
|
@blueorangutan package |
|
@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9339 |
|
@blueorangutan test rocky8 kvm-rocky8 |
|
@weizhouapache a [SL] Trillian-Jenkins test job (rocky8 mgmt + kvm-rocky8) has been kicked to run smoke tests |
|
Hey @weizhouapache, can you provide more context to the issue fixed by this PR? Should we add a no arp spoofing as well? |
@BryanMLima |
|
[SF] Trillian test result (tid-9937)
|
|
On KVM hypervisors with Security Groups enabled (Advanced + Shared networking) this is already handled by ebtables in security_group.py Doing this you would do double packet inspection and there might even be a conflict. Have you looked at this? My suggestion:
|
meaning, @wido , this is good but we need to add a removal of some of the " -j DROP/ACCEPT" lines from the script? sounds like some precision surgery. Do you know which ones to drop? cc @weizhouapache . |
It would, I think if you take a look it starts here:
Those would no longer be needed |
@wido other than that, the upgrade could be an issue as the VMs started in old versions (before upgrade) do not have the configuration in their VM XML definition. |
I second that. It will be simpler and the will not cripple the much security groups implementation. |
Sounds good. I would only add this to VMs without any SG. That would get my approval. |
|
[SF] Trillian Build Failed (tid-10024) |
|
[SF] Trillian test result (tid-10030)
|
|
@weizhouapache Good effort. Like @wido says, the problems this would solve are not an issue in SG zones usually, so indeed we should not apply any of this there. Otherwise it'd be a nice "win" for operators of regular Advanced Zones to apply anti-spoofing measures. We already have something somewhat similar for VMWare. I'd be happy to use all reasonable libvirt nwfilter features, make them options in Network Offering:
Would it even be reasonable to allow the operator to specify more nwfilter? Ie load whatever xml file from /usr/share/libvirt/nwfilter/ that they want? |
NuxRo
left a comment
There was a problem hiding this comment.
LGTM, but taking into consideration the comments, particularly re security groups.
|
@weizhouapache when you've bandwidth can you check why the github actions are/were failing (I've rekicked them now) |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.22 #8951 +/- ##
=======================================
Coverage ? 17.00%
Complexity ? 13275
=======================================
Files ? 5270
Lines ? 465547
Branches ? 54500
=======================================
Hits ? 79184
Misses ? 377497
Partials ? 8866
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@weizhouapache Since this is for the 4.22.1 release, could you retarget the PR to the 4.22 branch? |
Description
In shared, isolated networks and vpcs in advanced zone, user vms can easily perform ip/arp/mac spoofing by pretending to be another vm in the same network.
libvirt has a network traffic filtering subsystem which can be used to prevent spoofing. (https://libvirt.org/formatnwfilter.html#concepts)
clean-traffic, however, theIP/ARP anti-spoofing does not workin our testing, as the IP is not specified in the libvirt vm definition XML by cloudstack.This PR adds
no-mac-spoofingfor each nic to prevent mac spoofing.It could be an improvement PR to support all MAC/IP/ARP spoofing
clean-trafficis good, but it might not be what we want. we need to evaluate the pre-existing network filters and probably consider creating customized filters. refer to https://libvirt.org/firewall.html#the-network-filter-driverTypes of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?