14:00:37 #startmeeting neutron_drivers 14:00:38 Meeting started Fri Apr 3 14:00:37 2020 UTC and is due to finish in 60 minutes. The chair is slaweq. Information about MeetBot at http://wiki.debian.org/MeetBot. 14:00:39 Useful Commands: #action #agreed #help #info #idea #link #topic #startvote. 14:00:41 The meeting name has been set to 'neutron_drivers' 14:00:44 o/ 14:00:50 hi everyone :) 14:01:01 hi 14:02:21 lets wait few more minutes for njohnston haleyb amotoki and yamamoto 14:02:30 hi 14:03:11 /me had a conversation recently with dalvarez. He agrees that slaweq "esta jodido con ese jefe" 14:03:40 :) 14:03:42 while we wait I might as well share 14:03:45 hi 14:04:59 ok, we have quorum already so I think we can start 14:05:06 o/ 14:05:13 #topic RFEs 14:05:24 we have 3 rfes for today 14:05:33 first one is: https://bugs.launchpad.net/neutron/+bug/1592028 14:05:34 Launchpad bug 1592028 in neutron "[RFE] Support security-group-rule creation with address-groups" [Wishlist,Triaged] - Assigned to Roey Chen (roeyc) 14:07:54 Wow, that is quite an oldie 14:08:13 well, I resucitated it 14:08:15 njohnston: yes, but mlavalle told me that he is interested in doing that 14:08:38 I think it's a good idea; any sophisticated firewall system has the ability to construct these kinds of objects 14:08:46 at my employer we want to implement it 14:09:18 I think yamamoto has got valid question, he asked it in comment to this RFE 14:09:20 we would develop upstream and then use it in our internal deployments 14:09:46 It would be especially good if they could be either global or tenant-local; in the private cloud scenario the ability for a central admin group to be able define IP blocks for common services is something I have seen a lot of pent up demand for 14:10:43 and the answer to yamamoto's question is most likely yes 14:10:59 although I would have to dig deeper in our use case 14:12:21 personally I don't think that such update would be more complex than now add of new port to same security group when 'remote_group_id' is used there 14:12:42 You need to update ipset on all hosts where this is used and IMO in this new case it would be similar 14:14:20 mlavalle: are You going to implement that only for iptables_hybrid driver or for others too? 14:15:46 I don't think our intent is implement it for the hybrid driver 14:16:08 we don't use the hybrid driver 14:16:15 so only openvswitch driver? 14:16:28 yes 14:16:49 I'm all right with that 14:17:00 me too 14:17:09 I would just want to clarify one more thing 14:17:13 I mean, is the way forward, right? 14:17:16 in RFE there is written something like: 14:17:19 "NOTE: For the purpose of the use-case above, the default allow-egress rules are removed ("zero trust" model) once the default sg is created." 14:17:49 but You are not going to propose removal of those rules from default groups? 14:18:12 no, keep in mind we are re-purposing an existing RFE 14:18:26 that clearly needs adaptation 14:18:43 yeah, it was unclear to me why that would be a mandatory part of the proposal 14:18:44 yes, I just wanted to make this clear as this would be pretty big backward incompatibility :) 14:18:55 LOL 14:19:12 other than that I'm fine with accepting this rfe 14:19:24 I like this on a number of levels. +1 14:19:27 but we will also probably need spec with description of new API 14:19:36 yes definitely 14:19:37 so +1 from me 14:19:45 +1 from me (waiting for the spec) 14:19:52 yeah, we are fully expecting that the next step is a spec 14:20:12 +1 14:20:45 haleyb: any thoughts? 14:21:07 i'm fine with it, +1 from me 14:21:31 ok, thanks, I'll assign that RFE to me then 14:21:34 ok, so rfe approved, as a next step we are waiting for spec :) 14:21:43 and will write the spec 14:21:44 thx mlavalle for revive this old spec 14:21:49 yes thanks mlavalle! 14:21:50 :-) 14:22:07 so next one 14:22:09 https://bugs.launchpad.net/neutron/+bug/1869129 14:22:10 Launchpad bug 1869129 in neutron "neutron accepts CIDR in security groups that are invalid in ovn" [Undecided,In progress] - Assigned to Jake Yip (waipengyip) 14:22:21 this one was reported as bug in ovn SG driver first 14:22:44 but then someone raised point that this is currently potential security issue e.g. in iptables driver 14:22:54 and that we should fix it on API level 14:23:13 so I wanted to discuss it here as potentially new rfe 14:23:23 so i did have a thought on this one, as it reminded me of another bug i fixed 14:23:38 https://bugs.launchpad.net/neutron/+bug/1582500 14:23:39 Launchpad bug 1582500 in neutron "icmp, icmpv6 and ipv6-icmp should raise duplicated sg rule exception" [Wishlist,Fix released] - Assigned to Miguel Lavalle (minsel) 14:23:43 https://review.opendev.org/#/c/453346/ was the fix 14:24:24 in that case the SG api was changed to always force the SG rule to have a common name, can we just treat this bug similarly and change it to write the correct value to the DB? 14:25:00 and maybe have to change the RPC side as well, or fix the other drivers 14:25:01 I was thinking along similar lines to haleyb 14:25:05 haleyb: so if someone will set e.g. 192.168.1.100/24 in rule, we will change it to 192.168.1.0/24 14:25:10 correct? 14:25:28 slaweq: yes, use cidr.cidr from netaddr.IPNetwork() 14:25:51 i realize the caller might notice the difference 14:26:38 we can add e.g warning in logs to tell at least to cloud admin that we did such convertion 14:27:19 yes, if the caller did "create rule with $ip/$mask; check for creation by listing groups and grepping for $ip/$mask" then we broke them if $ip gets converted. Hopefully people don't use such antipatterns though. 14:27:49 right. i haven't verified but if we allow 192.168.1.100/24 and 192.168.1.99/24 rules, fixing to use the network would also possibly fix a duplicate rule issue 14:28:21 haleyb: You mean this warning on agent's side? 14:28:48 I think the warning would be on the server side since we should do this conversion before we store it in the db 14:29:32 does it solve the security concern? (i don't understand the security concern) 14:29:33 * cgoncalves lurks and notices a potential Neutron stable API breakage coming 14:29:33 slaweq: would have to be a warning on the server side i think if at all, i can't remember if we warn for the icmp one i mentioned 14:30:12 cgoncalves: no, i want to leave the API alone and not start failing on these cidrs 14:31:08 haleyb, IIRC you said you'd store in the DB the "good" CIDR so I expect the API to return it instead of the user-provided CIDR 14:31:15 cgoncalves raises a good point though, we should consider if "the ip you put in the rule is the same IP you expect to get out of the rule" is implicit in the api contract 14:32:30 i don't know, but we have precedence for doing this in the ipv6-icmp case 14:33:25 I wouldn't follow this path: we should not sanitize a CIDR (store the correct one in the DB) and don't fail 14:33:27 the tempest SG case might notice this and fail though 14:33:33 because the user won't notice that 14:33:37 yamamoto: security concern raised in comment #5 is that if user will set bad cidr in rule, he may open his SG for wider range 14:33:48 this will really break the compatibility 14:34:06 slaweq: he will get what he specified, won't he? 14:34:37 yamamoto: I would need to check it but according to c#5 14:34:40 ralonsoh: even if what we're actually enforcing is the "correct" cidr? 14:34:50 yamamoto, not depending on the backend 14:35:00 setting 192.168.1.1/0 will end up with rule like "-A neutron-linuxbri-i4abb52c4-d -j ACCEPT" 14:35:34 haleyb, yes because (1) now we'll probably have duplicated rules and (2) we must warn the user (or fail) 14:35:34 slaweq, human config error will always happen. it is not a security issue. the system does what it is told to enforce 14:35:53 slaweq, that is correct. there is nothing wrong with it 14:35:59 isn't that correct behavior for a 0 netmask? why would you ever use a /0 netmask unless you wanted to open it up tot he world? Working As Intended 14:36:16 cgoncalves, I don't agree, if we can detect that we should raise an exception 14:36:26 njohnston: cgoncalves TBH I agree with You - we can't prevent users from making any mistakes 14:36:40 ralonsoh, it's a valid CIDR per the RFC 14:36:50 ralonsoh: i think we would actually catch duplicate rules now as we'd actually use netaddr.IPNetwork(ip).cidr 14:37:09 I have used /0 netmasks before, but that was when I intended to expose a service tot he world 14:37:14 ralonsoh, if you want to prevent that, sure, create a new API but don't touch the existing one 14:38:51 I lean towards to avoid getting in the mind reading business 14:39:21 let's do what the user is asking us to do through the API 14:39:28 so it seems that with haleyb's proposal even, the only improvement would be that we would change what user send in request that he could see "correct" cidr in rule show 14:39:44 >>> n = netaddr.IPNetwork("192.168.1.1/0") 14:39:46 >>> n.cidr 14:39:48 IPNetwork('0.0.0.0/0') 14:39:57 but still security "issue" would be the same 14:40:00 exactly 14:40:12 cgoncalves, and "192.168.1.1/0" is not a valid CIDR 14:40:20 the CIDR is 0.0.0.0/0 14:40:57 ralonsoh, sure it is a valid CIDR 14:41:23 >>> netaddr.IPNetwork('192.168.1.100/24').cidr 14:41:23 IPNetwork('192.168.1.0/24') 14:41:32 ahh, I see your point ralonsoh 14:41:35 no complaints from netaddr 14:41:46 haleyb: yes, I also checked that 14:42:10 so it would have basically same effect in e.g. iptables as is now 14:42:35 the difference would be that user would see "correct" network address in rule get 14:43:04 i agree the /0 is an odd case, but really is user error if i'm remembering the last time we thought about it 14:43:39 I think the /0 case is unrelated to correcting the network address 14:43:52 slaweq: yes, it would behave the same in iptables, and maybe fix OVN? what to do about old rules in the OVN case? 14:44:23 I got disconnected so let me replay the last couple of lines I sent: 14:44:37 so back to the core issue here, it looks like OVN only accepts the network number when specifying a CIDR as opposed to any IP in the network, and that is not standard behavior. I think that if OVN has this incompatibility, does it impose a significant efficiency penalty for OVN to handle it within the OVN driver code? 14:44:39 for ovn - we can simply do such convertion on driver's level and left all in db like it is now 14:45:29 njohnston: ack, i think we'd need to fix something in OVN if even just to deal with existing rules 14:46:06 and fyi, the API says this for remote_ip_prefix - "The remote IP prefix that is matched by this security group rule." 14:46:11 so basically the main question here is: do we want to fix it on ovn driver's level for ovn that it will work with our current API, or do we want to change API/DB and make it works for all drivers in same way? 14:47:09 if the latter, wouldn't we have a backwards compatibility issue? 14:47:10 slaweq: i think we have to fix OVN regardless 14:47:47 mlavalle: IMO with latter we will have some api change 14:48:35 yeah and then wouldn't we incur in backwards compatibility issue? 14:48:40 so my proposal is to fix/change it in ovn driver and add maybe some warning in API ref that this should be network adress, otherwise it will be converted to network address by driver 14:49:14 mlavalle: do you mean at the API level? 14:49:21 yes 14:50:03 I'm just trying to explore the implications 14:50:29 it depends on if we think changing the cidr in the rule to be what we're enforcing vs what was in the POST is ok 14:51:06 we do tweak it for ipv6-icmp and noone's noticed 14:51:25 so far at least 14:51:32 LOL 14:51:34 * haleyb crosses fingers 14:51:48 but for cidr it may be noticed faster IMHO 14:52:02 that's true 14:55:00 i wonder if tempest checks, it definitely fails with the API change, and that enforcement could be a bigger backwards-compat issue 14:56:23 WRT /0 I think we have traditionally not been in the business of preventing users from shooting themselves in the foot 14:56:36 haleyb: https://github.com/openstack/neutron-tempest-plugin/blob/master/neutron_tempest_plugin/api/test_security_groups.py seems that is comparing rules' ids :) 14:56:50 njohnston: no, the gun is loaded 14:57:32 I could imagine creating a new exception “you asked for a rule with an IP specified but a net ask of /0; to request a wide open rule you must specify 0.0.0.0/0” 14:58:01 njohnston_++ for such api change :) 14:58:11 njohnston: yes, that would be ok with me (or use "any" which is also a synonym) 14:58:45 ok, we are almost on top of hour so we need to finish here for today 14:59:00 I will summarize this disussion in comment to the LP bug 14:59:08 and we will get back to it next week 14:59:13 fine for You? 14:59:16 yes 14:59:20 yes 14:59:24 yes 14:59:26 yes, thanks 14:59:26 Nate's suggestion is not backward compatible 15:00:08 ok, thx for attending and have a great weekend (at home mostly) 15:00:10 o/ 15:00:13 #endmeeting