-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Draft] KVM: enable no-mac-spoofing on virtual nics #8951
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
base: main
Are you sure you want to change the base?
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:
|
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.
clgtm
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. |
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.
Lgtm didn’t test
[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? |
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.
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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8951 +/- ##
=============================================
+ Coverage 15.13% 17.00% +1.87%
+ Complexity 13469 13275 -194
=============================================
Files 4863 5270 +407
Lines 326031 465547 +139516
Branches 45838 54500 +8662
=============================================
+ Hits 49349 79184 +29835
- Misses 270066 377497 +107431
- Partials 6616 8866 +2250
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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 work
in our testing, as the IP is not specified in the libvirt vm definition XML by cloudstack.This PR adds
no-mac-spoofing
for each nic to prevent mac spoofing.It could be an improvement PR to support all MAC/IP/ARP spoofing
clean-traffic
is 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?