Skip to content

Security Group rules not applied at all for XenServer 6.5 / Advanced Zone #3192

Closed

Description

@andrijapanicsb
ISSUE TYPE
  • Bug Report
COMPONENT NAME
Management Server most probably
CLOUDSTACK VERSION
4.11.2, 4.12-RC2/RC3
CONFIGURATION

Advanced Zone with Security Groups enabled, VM deployed inside Shared Network

OS / ENVIRONMENT

Hypervisor: XenServer 6.5(sp1)

SUMMARY

Security Group rules (iptable rules) not applied at all on XenServer 6.5 / 6.5SP1, in Advanced Zone with SG enabled on 4.11+ (FYI: works in 4.9.3 release)

Also migrating a VM to another host, does NOT remove rules from source host and does NOT create rules (just an empty iptable chains) on the destination host

STEPS TO REPRODUCE
  • Deploy a VM in a Shared Network with Security Groups (Advanced Zone with Security Groups enabled) will result in no rules being applied on the Hypervisor side (XenServer 6.5 / 6.5SP1)
  • Edit default Security Group and add a few rules for incoming/outgoing traffic
  • On XenServer 6.5 do "iptables -L -n | grep i-2-3-VM" and observe no rules for specific ports are present (i-2-3-VM being VM in test; specific ports being ports you added to default SG previously)

For migration issue - simply migrate VM to another host and run "iptables -L -n | grep i-2-3-VM" and observe no rules on destination host are created.

EXPECTED RESULTS
Security Group rules (iptable rules) applied properly on XenServer 6.5
ACTUAL RESULTS
no rules applied. cloud.log from XenServer on 4.9.3.1 vs 4.11.2 below (confirmed issue also for 4.12-RC2/RC3)

4112-logs.txt
4391-logs.txt

Activity

  1. GabrielBrascher commented on Feb 28, 2019

    @GabrielBrascher
    Member

    @andrijapanicsb please review PR #3197. Thanks!

  2. andrijapanicsb commented on Mar 1, 2019

    @andrijapanicsb
    ContributorAuthor

    Give me 5min @GabrielBrascher ...

  3. GabrielBrascher commented on Mar 1, 2019

    @GabrielBrascher
    Member

    No problem @andrijapanicsb

  4. added this to the 4.12.0.0 milestone on Mar 1, 2019
  5. GabrielBrascher commented on Mar 1, 2019

    @GabrielBrascher
    Member

    Are you ok with PR #3197 @andrijapanic?

  6. andrijapanicsb commented on Mar 1, 2019

    @andrijapanicsb
    ContributorAuthor

    Nope, not OK (also related to an email on mailing list today/yesterday) :

    Migrating a VM from host A to host B, does NOT remove iptable rules on host A (source) and does NOT create iptables rules on host B (destination host)

    (after VM migration done)

    SOURCE HOST (no more VM running here)

    iptables-save | grep i-2-3-VM
    :i-2-3-VM - [0:0]
    :i-2-3-VM-def - [0:0]
    :i-2-3-VM-eg - [0:0]
    -A BRIDGE-FIREWALL -m physdev --physdev-in vif3.0 --physdev-is-bridged -j i-2-3-VM-def
    -A BRIDGE-FIREWALL -m physdev --physdev-out vif3.0 --physdev-is-bridged -j i-2-3-VM-def
    -A i-2-3-VM -p tcp -m tcp --dport 22 -m conntrack --ctstate NEW -j ACCEPT
    -A i-2-3-VM -j DROP
    -A i-2-3-VM-def -p udp -m physdev --physdev-in vif3.0 --physdev-is-bridged -m set --match-set i-2-3-VM src -m udp --dport 53 -j RETURN
    -A i-2-3-VM-def -m physdev --physdev-in vif3.0 --physdev-is-bridged -m set ! --match-set i-2-3-VM src -j DROP
    -A i-2-3-VM-def -m physdev --physdev-out vif3.0 --physdev-is-bridged -m set ! --match-set i-2-3-VM dst -j DROP
    -A i-2-3-VM-def -m physdev --physdev-in vif3.0 --physdev-is-bridged -m set --match-set i-2-3-VM src -j i-2-3-VM-eg
    -A i-2-3-VM-def -m physdev --physdev-out vif3.0 --physdev-is-bridged -j i-2-3-VM
    -A i-2-3-VM-eg -p tcp -m tcp --dport 88 -m conntrack --ctstate NEW -j RETURN
    -A i-2-3-VM-eg -j DROP

    DESTINATION HOST (VM now running here)

    iptables-save | grep i-2-3-VM
    :i-2-3-VM - [0:0]
    :i-2-3-VM-def - [0:0]
    :i-2-3-VM-eg - [0:0]

    I prefer this is fixed in this PR please, since this is also a blocker thing - updating the issue desc with migration thing...

  7. andrijapanicsb commented on Mar 1, 2019

    @andrijapanicsb
    ContributorAuthor

    Might be a related issue: #3088

  8. andrijapanicsb commented on Mar 1, 2019

    @andrijapanicsb
    ContributorAuthor
  9. GabrielBrascher commented on Mar 1, 2019

    @GabrielBrascher
    Member

    Just pointing that the issue #3088 and PR #2990 addressed KVM (security_group.py); thus, that PR did not break XenServer (vmops).

    @andrijapanicsb I will perform some tests here and debug it. Did you test migrating between XenServer 6.5 hosts?

  10. andrijapanicsb commented on Mar 1, 2019

    @andrijapanicsb
    ContributorAuthor

    @GabrielBrascher - that is the only thing I have tested (XenServer 6.5sp1) - didn't do any tests with KVM at all. Thx for looking into this.

  11. GabrielBrascher commented on Mar 1, 2019

    @GabrielBrascher
    Member

    Ok @andrijapanicsb, just checking. Thanks for pointing that!

  12. GabrielBrascher commented on Mar 6, 2019

    @GabrielBrascher
    Member

    Closing this issue as PR #3197 has been merged.

  13. yadvr commented on Aug 13, 2019

    @yadvr
    Member

    Checked, not available in 4.11.3.0; but will be available in master/4.13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions