)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"b6a957f6ce22c5314ce49765c3d1bc6336094186","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This commit adds iptables rules that allow traffic coming from the"},{"line_number":14,"context_line":"subnet to which the DHCP agent is connected, and drop everything else."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: Ifc93a6f9ab8a553ba440e6284d08f6786131683a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7a740942_757c65eb","line":15,"updated":"2015-12-11 08:32:07.000000000","message":"add the related bug to commit message","commit_id":"c3d2abd5ca4a6ec2ead80dfaa8d32e0bb6c42077"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"417721f2f8ed4d0f8ff700392aabfc63aec990d7","unresolved":false,"context_lines":[{"line_number":13,"context_line":"This commit adds iptables rules that allow traffic coming from the"},{"line_number":14,"context_line":"subnet to which the DHCP agent is connected, and drop everything else."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Related-bug: 1501206"},{"line_number":17,"context_line":"Change-Id: Ifc93a6f9ab8a553ba440e6284d08f6786131683a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"fa69d971_77a20c4d","line":16,"updated":"2016-01-05 10:10:26.000000000","message":"+1","commit_id":"4cb1e8c21a34182b039696be1036ac8f96df6fbc"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"eaff63d1b001e8c151c4aa27ff6caa3ba91a80fb","unresolved":false,"context_lines":[{"line_number":13,"context_line":"This commit adds iptables rules that allow traffic coming from the"},{"line_number":14,"context_line":"subnet to which the DHCP agent is connected, and drop everything else."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Related-bug: 1501206"},{"line_number":17,"context_line":"Change-Id: Ifc93a6f9ab8a553ba440e6284d08f6786131683a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"fa69d971_3a157148","line":16,"updated":"2016-01-04 21:55:55.000000000","message":"Seems like this should be Closes-Bug not related.","commit_id":"4cb1e8c21a34182b039696be1036ac8f96df6fbc"}],"neutron/agent/linux/dhcp.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"2808af952ea9fae2c587c769786605aaf73a782e","unresolved":false,"context_lines":[{"line_number":1262,"context_line":""},{"line_number":1263,"context_line":"    def drop_input_from_remote_subnets(self, network):"},{"line_number":1264,"context_line":"        \"\"\"Drop requests to the DHCP agent coming from remote subnets.\"\"\""},{"line_number":1265,"context_line":"        iptables_mgr \u003d iptables_manager.IptablesManager(use_ipv6\u003dTrue,"},{"line_number":1266,"context_line":"                namespace\u003dnetwork.namespace)"},{"line_number":1267,"context_line":""},{"line_number":1268,"context_line":"        tables \u003d {"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a710552_702cd8ab","line":1265,"updated":"2015-12-15 03:16:11.000000000","message":"Should use ipv6_utils.is_enabled() here, which will still allow the iptables manager to store the rules, but won\u0027t try to apply them if IPv6 is disabled.","commit_id":"e0eca4e4bad741757de80516a18904f870eeb4c3"},{"author":{"_account_id":18152,"name":"Benoît Knecht","email":"benoit.knecht@fsfe.org","username":"byte"},"change_message_id":"657cd38fd1bbc6b5a4a674e5f159f5f8a809be54","unresolved":false,"context_lines":[{"line_number":1262,"context_line":""},{"line_number":1263,"context_line":"    def drop_input_from_remote_subnets(self, network):"},{"line_number":1264,"context_line":"        \"\"\"Drop requests to the DHCP agent coming from remote subnets.\"\"\""},{"line_number":1265,"context_line":"        iptables_mgr \u003d iptables_manager.IptablesManager(use_ipv6\u003dTrue,"},{"line_number":1266,"context_line":"                namespace\u003dnetwork.namespace)"},{"line_number":1267,"context_line":""},{"line_number":1268,"context_line":"        tables \u003d {"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a710552_111eb00c","line":1265,"in_reply_to":"5a710552_702cd8ab","updated":"2015-12-15 07:17:27.000000000","message":"Done","commit_id":"e0eca4e4bad741757de80516a18904f870eeb4c3"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"2808af952ea9fae2c587c769786605aaf73a782e","unresolved":false,"context_lines":[{"line_number":1277,"context_line":"        tables[4].add_rule(\u0027INPUT\u0027,"},{"line_number":1278,"context_line":"                \u0027-p udp -s 0.0.0.0 --sport %d \u0027"},{"line_number":1279,"context_line":"                \u0027-d 255.255.255.255 --dport %d -j ACCEPT\u0027 %"},{"line_number":1280,"context_line":"                (constants.DHCP_CLIENT_PORT, constants.DHCP_SERVER_PORT))"},{"line_number":1281,"context_line":""},{"line_number":1282,"context_line":"        link_local \u003d {\u0027ip_version\u0027: 6, \u0027cidr\u0027: \u0027fe80::/10\u0027}"},{"line_number":1283,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5a710552_c43f0d24","line":1280,"updated":"2015-12-15 03:16:11.000000000","message":"If you restart the dhcp-agent do you see this rule added multiple times?  I know the iptables_manager can be picky about constructing the rule lines.","commit_id":"e0eca4e4bad741757de80516a18904f870eeb4c3"},{"author":{"_account_id":18152,"name":"Benoît Knecht","email":"benoit.knecht@fsfe.org","username":"byte"},"change_message_id":"d822e168c41c90fc289defd591334dcca6303c84","unresolved":false,"context_lines":[{"line_number":1277,"context_line":"        tables[4].add_rule(\u0027INPUT\u0027,"},{"line_number":1278,"context_line":"                \u0027-p udp -s 0.0.0.0 --sport %d \u0027"},{"line_number":1279,"context_line":"                \u0027-d 255.255.255.255 --dport %d -j ACCEPT\u0027 %"},{"line_number":1280,"context_line":"                (constants.DHCP_CLIENT_PORT, constants.DHCP_SERVER_PORT))"},{"line_number":1281,"context_line":""},{"line_number":1282,"context_line":"        link_local \u003d {\u0027ip_version\u0027: 6, \u0027cidr\u0027: \u0027fe80::/10\u0027}"},{"line_number":1283,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5a710552_7137f4b0","line":1280,"in_reply_to":"5a710552_c43f0d24","updated":"2015-12-15 07:16:31.000000000","message":"No, the rule is only added once. In fact, if the dhcp port existed before applying the patch, it won\u0027t be added at all. You\u0027d have to remove and re-create it for the iptables rules to be added.","commit_id":"e0eca4e4bad741757de80516a18904f870eeb4c3"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"417721f2f8ed4d0f8ff700392aabfc63aec990d7","unresolved":false,"context_lines":[{"line_number":1201,"context_line":"                             port.mac_address,"},{"line_number":1202,"context_line":"                             namespace\u003dnetwork.namespace)"},{"line_number":1203,"context_line":"            self.fill_dhcp_udp_checksums(namespace\u003dnetwork.namespace)"},{"line_number":1204,"context_line":"            self.drop_input_from_remote_subnets(network)"},{"line_number":1205,"context_line":"        ip_cidrs \u003d []"},{"line_number":1206,"context_line":"        for fixed_ip in port.fixed_ips:"},{"line_number":1207,"context_line":"            subnet \u003d fixed_ip.subnet"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa69d971_178cf0d8","line":1204,"updated":"2016-01-05 10:10:26.000000000","message":"it looks like this will only be called when a dnsmasq instance is first plugged into a network. We need to make sure the rules are updated whenever the subnets for a network change as well.","commit_id":"4cb1e8c21a34182b039696be1036ac8f96df6fbc"},{"author":{"_account_id":18152,"name":"Benoît Knecht","email":"benoit.knecht@fsfe.org","username":"byte"},"change_message_id":"f7228a9b6204038a96b96f5206b5b719ffdb52ae","unresolved":false,"context_lines":[{"line_number":1201,"context_line":"                             port.mac_address,"},{"line_number":1202,"context_line":"                             namespace\u003dnetwork.namespace)"},{"line_number":1203,"context_line":"            self.fill_dhcp_udp_checksums(namespace\u003dnetwork.namespace)"},{"line_number":1204,"context_line":"            self.drop_input_from_remote_subnets(network)"},{"line_number":1205,"context_line":"        ip_cidrs \u003d []"},{"line_number":1206,"context_line":"        for fixed_ip in port.fixed_ips:"},{"line_number":1207,"context_line":"            subnet \u003d fixed_ip.subnet"}],"source_content_type":"text/x-python","patch_set":5,"id":"dae33548_ab7695d4","line":1204,"in_reply_to":"fa69d971_178cf0d8","updated":"2016-02-18 07:14:21.000000000","message":"You\u0027re right. The latest version of the patch fixes that.","commit_id":"4cb1e8c21a34182b039696be1036ac8f96df6fbc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"417721f2f8ed4d0f8ff700392aabfc63aec990d7","unresolved":false,"context_lines":[{"line_number":1275,"context_line":"                    \u0027-m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT\u0027)"},{"line_number":1276,"context_line":""},{"line_number":1277,"context_line":"        tables[4].add_rule(\u0027INPUT\u0027,"},{"line_number":1278,"context_line":"                \u0027-p udp -s 0.0.0.0 --sport %d \u0027"},{"line_number":1279,"context_line":"                \u0027-d 255.255.255.255 --dport %d -j ACCEPT\u0027 %"},{"line_number":1280,"context_line":"                (constants.DHCP_CLIENT_PORT, constants.DHCP_SERVER_PORT))"},{"line_number":1281,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa69d971_3789f4c9","line":1278,"updated":"2016-01-05 10:10:26.000000000","message":"the source limit of 0.0.0.0 shouldn\u0027t be necessary. If someone can get a packet to the dnsmasq instance with a destination of 255.255.255.255 it means they are already local or someone has intentionally setup broadcast routing so we don\u0027t need to restrict that.\n\nThis is especially true if a subnet on a network has been modified and the ports have had new IPs assigned to them. We want the server to see the renewal from the stale address, NACK it, and give the new one.","commit_id":"4cb1e8c21a34182b039696be1036ac8f96df6fbc"},{"author":{"_account_id":18152,"name":"Benoît Knecht","email":"benoit.knecht@fsfe.org","username":"byte"},"change_message_id":"f7228a9b6204038a96b96f5206b5b719ffdb52ae","unresolved":false,"context_lines":[{"line_number":1275,"context_line":"                    \u0027-m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT\u0027)"},{"line_number":1276,"context_line":""},{"line_number":1277,"context_line":"        tables[4].add_rule(\u0027INPUT\u0027,"},{"line_number":1278,"context_line":"                \u0027-p udp -s 0.0.0.0 --sport %d \u0027"},{"line_number":1279,"context_line":"                \u0027-d 255.255.255.255 --dport %d -j ACCEPT\u0027 %"},{"line_number":1280,"context_line":"                (constants.DHCP_CLIENT_PORT, constants.DHCP_SERVER_PORT))"},{"line_number":1281,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"dae33548_abafb528","line":1278,"in_reply_to":"fa69d971_3789f4c9","updated":"2016-02-18 07:14:21.000000000","message":"Good point, I dropped the source condition.","commit_id":"4cb1e8c21a34182b039696be1036ac8f96df6fbc"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"820e9039c8084ef54820f70370fae9e4df95f717","unresolved":false,"context_lines":[{"line_number":1256,"context_line":"        iptables_mgr \u003d iptables_manager.IptablesManager(use_ipv6\u003dFalse,"},{"line_number":1257,"context_line":"                                                        namespace\u003dnamespace)"},{"line_number":1258,"context_line":"        ipv4_rule \u003d (\u0027-p udp --dport %d -j CHECKSUM --checksum-fill\u0027"},{"line_number":1259,"context_line":"                     % constants.DHCP_CLIENT_PORT)"},{"line_number":1260,"context_line":"        iptables_mgr.ipv4[\u0027mangle\u0027].add_rule(\u0027POSTROUTING\u0027, ipv4_rule)"},{"line_number":1261,"context_line":"        iptables_mgr.apply()"},{"line_number":1262,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9a68dd71_d1ba18c0","line":1259,"updated":"2016-01-21 21:39:58.000000000","message":"is this related?","commit_id":"612c48f5a8fad447ec950a282c4e5fad7086a688"},{"author":{"_account_id":18152,"name":"Benoît Knecht","email":"benoit.knecht@fsfe.org","username":"byte"},"change_message_id":"3d9e8b8604339e78596ec134817fc58cf9de77c9","unresolved":false,"context_lines":[{"line_number":1256,"context_line":"        iptables_mgr \u003d iptables_manager.IptablesManager(use_ipv6\u003dFalse,"},{"line_number":1257,"context_line":"                                                        namespace\u003dnamespace)"},{"line_number":1258,"context_line":"        ipv4_rule \u003d (\u0027-p udp --dport %d -j CHECKSUM --checksum-fill\u0027"},{"line_number":1259,"context_line":"                     % constants.DHCP_CLIENT_PORT)"},{"line_number":1260,"context_line":"        iptables_mgr.ipv4[\u0027mangle\u0027].add_rule(\u0027POSTROUTING\u0027, ipv4_rule)"},{"line_number":1261,"context_line":"        iptables_mgr.apply()"},{"line_number":1262,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"dae33548_cb56795b","line":1259,"in_reply_to":"9a68dd71_d1ba18c0","updated":"2016-02-17 06:21:19.000000000","message":"It is, in a way. I introduced constants.DHCP_SERVER_PORT for the purpose of this patch, and it seemed that constants.DHCP_RESPONSE_PORT wasn\u0027t a very clear name in comparison (is it the client\u0027s response port or the server\u0027s response port?) If it\u0027s a problem, I\u0027ll revert, but I\u0027d rather keep it this way.","commit_id":"612c48f5a8fad447ec950a282c4e5fad7086a688"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"d6abb7be5a10c8bc139d8415c0fc98f4ed411d82","unresolved":false,"context_lines":[{"line_number":1260,"context_line":"        iptables_mgr.ipv4[\u0027mangle\u0027].add_rule(\u0027POSTROUTING\u0027, ipv4_rule)"},{"line_number":1261,"context_line":"        iptables_mgr.apply()"},{"line_number":1262,"context_line":""},{"line_number":1263,"context_line":"    def drop_input_from_remote_subnets(self, network):"},{"line_number":1264,"context_line":"        \"\"\"Drop requests to the DHCP agent coming from remote subnets.\"\"\""},{"line_number":1265,"context_line":"        iptables_mgr \u003d iptables_manager.IptablesManager("},{"line_number":1266,"context_line":"                use_ipv6\u003dipv6_utils.is_enabled(), namespace\u003dnetwork.namespace)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a68dd71_1173d04e","line":1263,"range":{"start_line":1263,"start_character":8,"end_line":1263,"end_character":38},"updated":"2016-01-21 21:39:18.000000000","message":"??? The aim of the change is to secure dnsmasq DNS service but it secures DHCP ports!","commit_id":"612c48f5a8fad447ec950a282c4e5fad7086a688"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"820e9039c8084ef54820f70370fae9e4df95f717","unresolved":false,"context_lines":[{"line_number":1260,"context_line":"        iptables_mgr.ipv4[\u0027mangle\u0027].add_rule(\u0027POSTROUTING\u0027, ipv4_rule)"},{"line_number":1261,"context_line":"        iptables_mgr.apply()"},{"line_number":1262,"context_line":""},{"line_number":1263,"context_line":"    def drop_input_from_remote_subnets(self, network):"},{"line_number":1264,"context_line":"        \"\"\"Drop requests to the DHCP agent coming from remote subnets.\"\"\""},{"line_number":1265,"context_line":"        iptables_mgr \u003d iptables_manager.IptablesManager("},{"line_number":1266,"context_line":"                use_ipv6\u003dipv6_utils.is_enabled(), namespace\u003dnetwork.namespace)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a68dd71_919d805b","line":1263,"updated":"2016-01-21 21:39:58.000000000","message":"this is an internal method. can we prefix with _?","commit_id":"612c48f5a8fad447ec950a282c4e5fad7086a688"},{"author":{"_account_id":18152,"name":"Benoît Knecht","email":"benoit.knecht@fsfe.org","username":"byte"},"change_message_id":"3d9e8b8604339e78596ec134817fc58cf9de77c9","unresolved":false,"context_lines":[{"line_number":1260,"context_line":"        iptables_mgr.ipv4[\u0027mangle\u0027].add_rule(\u0027POSTROUTING\u0027, ipv4_rule)"},{"line_number":1261,"context_line":"        iptables_mgr.apply()"},{"line_number":1262,"context_line":""},{"line_number":1263,"context_line":"    def drop_input_from_remote_subnets(self, network):"},{"line_number":1264,"context_line":"        \"\"\"Drop requests to the DHCP agent coming from remote subnets.\"\"\""},{"line_number":1265,"context_line":"        iptables_mgr \u003d iptables_manager.IptablesManager("},{"line_number":1266,"context_line":"                use_ipv6\u003dipv6_utils.is_enabled(), namespace\u003dnetwork.namespace)"}],"source_content_type":"text/x-python","patch_set":6,"id":"dae33548_abf7b589","line":1263,"range":{"start_line":1263,"start_character":8,"end_line":1263,"end_character":38},"in_reply_to":"9a68dd71_1173d04e","updated":"2016-02-17 06:21:19.000000000","message":"No, it does secure DNS as well. In fact, it filters all traffic from remote subnets to the DHCP agent, not just DNS traffic.","commit_id":"612c48f5a8fad447ec950a282c4e5fad7086a688"},{"author":{"_account_id":18152,"name":"Benoît Knecht","email":"benoit.knecht@fsfe.org","username":"byte"},"change_message_id":"3d9e8b8604339e78596ec134817fc58cf9de77c9","unresolved":false,"context_lines":[{"line_number":1260,"context_line":"        iptables_mgr.ipv4[\u0027mangle\u0027].add_rule(\u0027POSTROUTING\u0027, ipv4_rule)"},{"line_number":1261,"context_line":"        iptables_mgr.apply()"},{"line_number":1262,"context_line":""},{"line_number":1263,"context_line":"    def drop_input_from_remote_subnets(self, network):"},{"line_number":1264,"context_line":"        \"\"\"Drop requests to the DHCP agent coming from remote subnets.\"\"\""},{"line_number":1265,"context_line":"        iptables_mgr \u003d iptables_manager.IptablesManager("},{"line_number":1266,"context_line":"                use_ipv6\u003dipv6_utils.is_enabled(), namespace\u003dnetwork.namespace)"}],"source_content_type":"text/x-python","patch_set":6,"id":"dae33548_ab25f509","line":1263,"in_reply_to":"9a68dd71_919d805b","updated":"2016-02-17 06:21:19.000000000","message":"Absolutely, I\u0027ll fix that.","commit_id":"612c48f5a8fad447ec950a282c4e5fad7086a688"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"820e9039c8084ef54820f70370fae9e4df95f717","unresolved":false,"context_lines":[{"line_number":1266,"context_line":"                use_ipv6\u003dipv6_utils.is_enabled(), namespace\u003dnetwork.namespace)"},{"line_number":1267,"context_line":""},{"line_number":1268,"context_line":"        tables \u003d {"},{"line_number":1269,"context_line":"                4: iptables_mgr.ipv4[\u0027filter\u0027],"},{"line_number":1270,"context_line":"                6: iptables_mgr.ipv6[\u0027filter\u0027]"},{"line_number":1271,"context_line":"        }"},{"line_number":1272,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9a68dd71_d193f84d","line":1269,"updated":"2016-01-21 21:39:58.000000000","message":"indentation here is dodgy","commit_id":"612c48f5a8fad447ec950a282c4e5fad7086a688"},{"author":{"_account_id":18152,"name":"Benoît Knecht","email":"benoit.knecht@fsfe.org","username":"byte"},"change_message_id":"3d9e8b8604339e78596ec134817fc58cf9de77c9","unresolved":false,"context_lines":[{"line_number":1266,"context_line":"                use_ipv6\u003dipv6_utils.is_enabled(), namespace\u003dnetwork.namespace)"},{"line_number":1267,"context_line":""},{"line_number":1268,"context_line":"        tables \u003d {"},{"line_number":1269,"context_line":"                4: iptables_mgr.ipv4[\u0027filter\u0027],"},{"line_number":1270,"context_line":"                6: iptables_mgr.ipv6[\u0027filter\u0027]"},{"line_number":1271,"context_line":"        }"},{"line_number":1272,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"dae33548_4b7b89f5","line":1269,"in_reply_to":"9a68dd71_d193f84d","updated":"2016-02-17 06:21:19.000000000","message":"I\u0027ll fix that as well.","commit_id":"612c48f5a8fad447ec950a282c4e5fad7086a688"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"516bae94ec03aba1bc766f6b15e5b3b8ca2c0490","unresolved":false,"context_lines":[{"line_number":1287,"context_line":"        recursor from being abused as a DDoS amplification source in case the"},{"line_number":1288,"context_line":"        DHCP agent is connected to a public network, for instance."},{"line_number":1289,"context_line":"        \"\"\""},{"line_number":1290,"context_line":"        iptables_mgr \u003d iptables_manager.IptablesManager("},{"line_number":1291,"context_line":"                use_ipv6\u003dipv6_utils.is_enabled(), namespace\u003dnetwork.namespace)"},{"line_number":1292,"context_line":""},{"line_number":1293,"context_line":"        tables \u003d {"}],"source_content_type":"text/x-python","patch_set":7,"id":"3afc51ec_48591e5a","line":1290,"updated":"2016-03-13 22:39:13.000000000","message":"We can build iptables_mgr once in __init__","commit_id":"64fc10153db6ee1f7b4e11a7819060ef674fb3d6"},{"author":{"_account_id":18152,"name":"Benoît Knecht","email":"benoit.knecht@fsfe.org","username":"byte"},"change_message_id":"64bf3c77de738ffec89dea617656cf03bc5f5c88","unresolved":false,"context_lines":[{"line_number":1287,"context_line":"        recursor from being abused as a DDoS amplification source in case the"},{"line_number":1288,"context_line":"        DHCP agent is connected to a public network, for instance."},{"line_number":1289,"context_line":"        \"\"\""},{"line_number":1290,"context_line":"        iptables_mgr \u003d iptables_manager.IptablesManager("},{"line_number":1291,"context_line":"                use_ipv6\u003dipv6_utils.is_enabled(), namespace\u003dnetwork.namespace)"},{"line_number":1292,"context_line":""},{"line_number":1293,"context_line":"        tables \u003d {"}],"source_content_type":"text/x-python","patch_set":7,"id":"3afc51ec_e907457f","line":1290,"in_reply_to":"3afc51ec_48591e5a","updated":"2016-03-14 07:54:55.000000000","message":"I\u0027m not so sure. How do I get network.namespace in __init__?","commit_id":"64fc10153db6ee1f7b4e11a7819060ef674fb3d6"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"b3626dc846f42d8917d062c53760853fc091bce5","unresolved":false,"context_lines":[{"line_number":1283,"context_line":"    def update(self, network, device_name):"},{"line_number":1284,"context_line":"        \"\"\"Update device settings for the network\u0027s DHCP on this host.\"\"\""},{"line_number":1285,"context_line":"        self._set_default_route(network, device_name)"},{"line_number":1286,"context_line":"        self._filter_input(network)"},{"line_number":1287,"context_line":""},{"line_number":1288,"context_line":"    def destroy(self, network, device_name):"},{"line_number":1289,"context_line":"        \"\"\"Destroy the device used for the network\u0027s DHCP on this host.\"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"9abb7d3a_6343d813","line":1286,"updated":"2016-06-01 14:44:22.000000000","message":"What about when a subnet is removed?  We need to remove its rule below which won\u0027t happen currently.","commit_id":"7e3a38eb0174d3523667298ed4bca07c1c5612bb"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"7c96fbf0dd2de416afb85b1d2b3cf27fd25feec9","unresolved":false,"context_lines":[{"line_number":1283,"context_line":"    def update(self, network, device_name):"},{"line_number":1284,"context_line":"        \"\"\"Update device settings for the network\u0027s DHCP on this host.\"\"\""},{"line_number":1285,"context_line":"        self._set_default_route(network, device_name)"},{"line_number":1286,"context_line":"        self._filter_input(network)"},{"line_number":1287,"context_line":""},{"line_number":1288,"context_line":"    def destroy(self, network, device_name):"},{"line_number":1289,"context_line":"        \"\"\"Destroy the device used for the network\u0027s DHCP on this host.\"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"9abb7d3a_be05d346","line":1286,"in_reply_to":"9abb7d3a_6343d813","updated":"2016-06-01 14:56:35.000000000","message":"+1","commit_id":"7e3a38eb0174d3523667298ed4bca07c1c5612bb"},{"author":{"_account_id":18152,"name":"Benoît Knecht","email":"benoit.knecht@fsfe.org","username":"byte"},"change_message_id":"14be5e95bd5636d3fc890db01169328fd5265e9f","unresolved":false,"context_lines":[{"line_number":1283,"context_line":"    def update(self, network, device_name):"},{"line_number":1284,"context_line":"        \"\"\"Update device settings for the network\u0027s DHCP on this host.\"\"\""},{"line_number":1285,"context_line":"        self._set_default_route(network, device_name)"},{"line_number":1286,"context_line":"        self._filter_input(network)"},{"line_number":1287,"context_line":""},{"line_number":1288,"context_line":"    def destroy(self, network, device_name):"},{"line_number":1289,"context_line":"        \"\"\"Destroy the device used for the network\u0027s DHCP on this host.\"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"9abb7d3a_493e852a","line":1286,"in_reply_to":"9abb7d3a_6343d813","updated":"2016-06-02 11:13:35.000000000","message":"When a subnet is removed, the corresponding rule is removed as well, I\u0027ve tested it.","commit_id":"7e3a38eb0174d3523667298ed4bca07c1c5612bb"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"b3626dc846f42d8917d062c53760853fc091bce5","unresolved":false,"context_lines":[{"line_number":1321,"context_line":""},{"line_number":1322,"context_line":"        for table in tables.values():"},{"line_number":1323,"context_line":"            table.add_rule(\u0027INPUT\u0027,"},{"line_number":1324,"context_line":"                    \u0027-m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT\u0027)"},{"line_number":1325,"context_line":""},{"line_number":1326,"context_line":"        # Allow ICMP echo requests because they\u0027re often used in tests and"},{"line_number":1327,"context_line":"        # monitoring"}],"source_content_type":"text/x-python","patch_set":9,"id":"9abb7d3a_9da1f996","line":1324,"updated":"2016-06-01 14:44:22.000000000","message":"This should be just like the iptables_firewall code does it in _allow_established().\n\nI also think all of these should be -j RETURN, right?","commit_id":"7e3a38eb0174d3523667298ed4bca07c1c5612bb"},{"author":{"_account_id":18152,"name":"Benoît Knecht","email":"benoit.knecht@fsfe.org","username":"byte"},"change_message_id":"14be5e95bd5636d3fc890db01169328fd5265e9f","unresolved":false,"context_lines":[{"line_number":1321,"context_line":""},{"line_number":1322,"context_line":"        for table in tables.values():"},{"line_number":1323,"context_line":"            table.add_rule(\u0027INPUT\u0027,"},{"line_number":1324,"context_line":"                    \u0027-m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT\u0027)"},{"line_number":1325,"context_line":""},{"line_number":1326,"context_line":"        # Allow ICMP echo requests because they\u0027re often used in tests and"},{"line_number":1327,"context_line":"        # monitoring"}],"source_content_type":"text/x-python","patch_set":9,"id":"9abb7d3a_e9a2d94a","line":1324,"in_reply_to":"9abb7d3a_9da1f996","updated":"2016-06-02 11:13:35.000000000","message":"The only difference with _allow_established() is that it uses state instead of conntrack, but state is an alias for conntrack. I can change it, but it\u0027s absolutely equivalent.\n\nYou\u0027re right about RETURN, I\u0027ll change that.","commit_id":"7e3a38eb0174d3523667298ed4bca07c1c5612bb"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"16d852505ab386a251592e05c7d4d48e39148589","unresolved":false,"context_lines":[{"line_number":1323,"context_line":"            table.add_rule(\u0027INPUT\u0027,"},{"line_number":1324,"context_line":"                    \u0027-m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT\u0027)"},{"line_number":1325,"context_line":""},{"line_number":1326,"context_line":"        # Allow ICMP echo requests because they\u0027re often used in tests and"},{"line_number":1327,"context_line":"        # monitoring"},{"line_number":1328,"context_line":"        tables[4].add_rule(\u0027INPUT\u0027,"},{"line_number":1329,"context_line":"                \u0027-p icmp --icmp-type echo-request -j ACCEPT\u0027)"},{"line_number":1330,"context_line":"        tables[6].add_rule(\u0027INPUT\u0027,"},{"line_number":1331,"context_line":"                \u0027-p icmpv6 --icmpv6-type echo-request -j ACCEPT\u0027)"},{"line_number":1332,"context_line":""},{"line_number":1333,"context_line":"        tables[4].add_rule(\u0027INPUT\u0027,"},{"line_number":1334,"context_line":"                \u0027-p udp --sport %d \u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"9abb7d3a_2cbf0fab","line":1331,"range":{"start_line":1326,"start_character":0,"end_line":1331,"end_character":65},"updated":"2016-06-01 11:19:00.000000000","message":"Is there any specific reason why this was added atop last PS?\n\nIMHO, if this is connected to the public network and by default if you are planning to drop everything except traffic from the subnets, then the echo requests should be avoided (ping attacks) as well!\n\nOr you could add a config var to enable this, and turn it off by default. What do you think?\n\n-1, just to get some attention :-)","commit_id":"7e3a38eb0174d3523667298ed4bca07c1c5612bb"},{"author":{"_account_id":18152,"name":"Benoît Knecht","email":"benoit.knecht@fsfe.org","username":"byte"},"change_message_id":"1fbeb23161c230a391db28aa372fea40d193199e","unresolved":false,"context_lines":[{"line_number":1323,"context_line":"            table.add_rule(\u0027INPUT\u0027,"},{"line_number":1324,"context_line":"                    \u0027-m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT\u0027)"},{"line_number":1325,"context_line":""},{"line_number":1326,"context_line":"        # Allow ICMP echo requests because they\u0027re often used in tests and"},{"line_number":1327,"context_line":"        # monitoring"},{"line_number":1328,"context_line":"        tables[4].add_rule(\u0027INPUT\u0027,"},{"line_number":1329,"context_line":"                \u0027-p icmp --icmp-type echo-request -j ACCEPT\u0027)"},{"line_number":1330,"context_line":"        tables[6].add_rule(\u0027INPUT\u0027,"},{"line_number":1331,"context_line":"                \u0027-p icmpv6 --icmpv6-type echo-request -j ACCEPT\u0027)"},{"line_number":1332,"context_line":""},{"line_number":1333,"context_line":"        tables[4].add_rule(\u0027INPUT\u0027,"},{"line_number":1334,"context_line":"                \u0027-p udp --sport %d \u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"9abb7d3a_dd00a104","line":1331,"range":{"start_line":1326,"start_character":0,"end_line":1331,"end_character":65},"in_reply_to":"9abb7d3a_2cbf0fab","updated":"2016-06-01 14:22:12.000000000","message":"Thanks for your feedback! (You would have had my full attention even without the -1 :) )\n\nThis was added because dropping echo requests made a lot of tests in other projects fail, because they were checking if the DHCP server was up by pinging it.\n\nSince the test failures have made this change fail to be integrated so far, I thought it would be better to address the core issue (open DNS resolver) and leave this tiny \"hole\" in the firewall. Closing everything else off is already a huge improvement on the current situation, and allowing echo requests through might even avoid some headache when trying to debug a production setup. Besides, contrary to DNS traffic ICMP cannot be used in amplification attacks, so apart from letting an attacker know that this IP exists on your network, it doesn\u0027t do any harm.","commit_id":"7e3a38eb0174d3523667298ed4bca07c1c5612bb"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"b3626dc846f42d8917d062c53760853fc091bce5","unresolved":false,"context_lines":[{"line_number":1323,"context_line":"            table.add_rule(\u0027INPUT\u0027,"},{"line_number":1324,"context_line":"                    \u0027-m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT\u0027)"},{"line_number":1325,"context_line":""},{"line_number":1326,"context_line":"        # Allow ICMP echo requests because they\u0027re often used in tests and"},{"line_number":1327,"context_line":"        # monitoring"},{"line_number":1328,"context_line":"        tables[4].add_rule(\u0027INPUT\u0027,"},{"line_number":1329,"context_line":"                \u0027-p icmp --icmp-type echo-request -j ACCEPT\u0027)"},{"line_number":1330,"context_line":"        tables[6].add_rule(\u0027INPUT\u0027,"},{"line_number":1331,"context_line":"                \u0027-p icmpv6 --icmpv6-type echo-request -j ACCEPT\u0027)"},{"line_number":1332,"context_line":""},{"line_number":1333,"context_line":"        tables[4].add_rule(\u0027INPUT\u0027,"},{"line_number":1334,"context_line":"                \u0027-p udp --sport %d \u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"9abb7d3a_72cc44bb","line":1331,"range":{"start_line":1326,"start_character":0,"end_line":1331,"end_character":65},"in_reply_to":"9abb7d3a_2cbf0fab","updated":"2016-06-01 14:44:22.000000000","message":"You can\u0027t put a rule like this in here, only add what is necessary for the protocol to operate.  If an admin wants to allow something else they can do that outside of neutron.","commit_id":"7e3a38eb0174d3523667298ed4bca07c1c5612bb"},{"author":{"_account_id":18152,"name":"Benoît Knecht","email":"benoit.knecht@fsfe.org","username":"byte"},"change_message_id":"14be5e95bd5636d3fc890db01169328fd5265e9f","unresolved":false,"context_lines":[{"line_number":1323,"context_line":"            table.add_rule(\u0027INPUT\u0027,"},{"line_number":1324,"context_line":"                    \u0027-m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT\u0027)"},{"line_number":1325,"context_line":""},{"line_number":1326,"context_line":"        # Allow ICMP echo requests because they\u0027re often used in tests and"},{"line_number":1327,"context_line":"        # monitoring"},{"line_number":1328,"context_line":"        tables[4].add_rule(\u0027INPUT\u0027,"},{"line_number":1329,"context_line":"                \u0027-p icmp --icmp-type echo-request -j ACCEPT\u0027)"},{"line_number":1330,"context_line":"        tables[6].add_rule(\u0027INPUT\u0027,"},{"line_number":1331,"context_line":"                \u0027-p icmpv6 --icmpv6-type echo-request -j ACCEPT\u0027)"},{"line_number":1332,"context_line":""},{"line_number":1333,"context_line":"        tables[4].add_rule(\u0027INPUT\u0027,"},{"line_number":1334,"context_line":"                \u0027-p udp --sport %d \u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"9abb7d3a_4ccdee5c","line":1331,"range":{"start_line":1326,"start_character":0,"end_line":1331,"end_character":65},"in_reply_to":"9abb7d3a_72cc44bb","updated":"2016-06-02 11:13:35.000000000","message":"I added this because a lot of tests were failing without it. They use echo requests to see it the dhcp agent is up. As I said, the goal is to prevent amplification attacks on DNS, and even with this rule, the security of the dhcp agent would be much improved (since right now, nothing is filtered at all).","commit_id":"7e3a38eb0174d3523667298ed4bca07c1c5612bb"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"4837482f2906d7e172446e8f657f294c3c4f869a","unresolved":false,"context_lines":[{"line_number":1323,"context_line":"            table.add_rule(\u0027INPUT\u0027,"},{"line_number":1324,"context_line":"                    \u0027-m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT\u0027)"},{"line_number":1325,"context_line":""},{"line_number":1326,"context_line":"        # Allow ICMP echo requests because they\u0027re often used in tests and"},{"line_number":1327,"context_line":"        # monitoring"},{"line_number":1328,"context_line":"        tables[4].add_rule(\u0027INPUT\u0027,"},{"line_number":1329,"context_line":"                \u0027-p icmp --icmp-type echo-request -j ACCEPT\u0027)"},{"line_number":1330,"context_line":"        tables[6].add_rule(\u0027INPUT\u0027,"},{"line_number":1331,"context_line":"                \u0027-p icmpv6 --icmpv6-type echo-request -j ACCEPT\u0027)"},{"line_number":1332,"context_line":""},{"line_number":1333,"context_line":"        tables[4].add_rule(\u0027INPUT\u0027,"},{"line_number":1334,"context_line":"                \u0027-p udp --sport %d \u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"9abb7d3a_e3f6a85b","line":1331,"range":{"start_line":1326,"start_character":0,"end_line":1331,"end_character":65},"in_reply_to":"9abb7d3a_dd00a104","updated":"2016-06-01 14:45:15.000000000","message":"I agree with you that ICMP do not have the amplification effect, and is good for debug scenarios.\n\nHave you considered adding a config var to enable it? i.e the default will be all closed Off, \u0027allow_icmpv4/v6\u003dTrue\u0027 will turn that alone On.\n\nWe could add some documentation to educate the admin on this. Also will be easy for the tests to pass with conf var turned On explicitly in test code. \n\nThis is just a suggestion, am not a fan of too many config vars but thought this is a good point to have one. That\u0027s all :)","commit_id":"7e3a38eb0174d3523667298ed4bca07c1c5612bb"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"b3626dc846f42d8917d062c53760853fc091bce5","unresolved":false,"context_lines":[{"line_number":1333,"context_line":"        tables[4].add_rule(\u0027INPUT\u0027,"},{"line_number":1334,"context_line":"                \u0027-p udp --sport %d \u0027"},{"line_number":1335,"context_line":"                \u0027-d 255.255.255.255 --dport %d -j ACCEPT\u0027 %"},{"line_number":1336,"context_line":"                (constants.DHCP_RESPONSE_PORT, DHCPV4_PORT))"},{"line_number":1337,"context_line":""},{"line_number":1338,"context_line":"        tables[6].add_rule(\u0027INPUT\u0027, \u0027-s fe80::/10 -j ACCEPT\u0027)"},{"line_number":1339,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"9abb7d3a_f245d442","line":1336,"updated":"2016-06-01 14:44:22.000000000","message":"You should always put rules in the format iptables-save prints them:\n\n-s 0.0.0.0/32 -d 255.255.255.255/32 -p udp -m udp --sport %d --dport %d -j ACCEPT\n\nAnd these really need to be just like _spoofing_rule() does it over in the firewall code.","commit_id":"7e3a38eb0174d3523667298ed4bca07c1c5612bb"},{"author":{"_account_id":18152,"name":"Benoît Knecht","email":"benoit.knecht@fsfe.org","username":"byte"},"change_message_id":"14be5e95bd5636d3fc890db01169328fd5265e9f","unresolved":false,"context_lines":[{"line_number":1333,"context_line":"        tables[4].add_rule(\u0027INPUT\u0027,"},{"line_number":1334,"context_line":"                \u0027-p udp --sport %d \u0027"},{"line_number":1335,"context_line":"                \u0027-d 255.255.255.255 --dport %d -j ACCEPT\u0027 %"},{"line_number":1336,"context_line":"                (constants.DHCP_RESPONSE_PORT, DHCPV4_PORT))"},{"line_number":1337,"context_line":""},{"line_number":1338,"context_line":"        tables[6].add_rule(\u0027INPUT\u0027, \u0027-s fe80::/10 -j ACCEPT\u0027)"},{"line_number":1339,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"9abb7d3a_8cffd6a9","line":1336,"in_reply_to":"9abb7d3a_f245d442","updated":"2016-06-02 11:13:35.000000000","message":"OK, I\u0027ll use the iptables-save format. I\u0027m not matching the source though, because clients renew their lease using their IP as source.","commit_id":"7e3a38eb0174d3523667298ed4bca07c1c5612bb"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"b3626dc846f42d8917d062c53760853fc091bce5","unresolved":false,"context_lines":[{"line_number":1335,"context_line":"                \u0027-d 255.255.255.255 --dport %d -j ACCEPT\u0027 %"},{"line_number":1336,"context_line":"                (constants.DHCP_RESPONSE_PORT, DHCPV4_PORT))"},{"line_number":1337,"context_line":""},{"line_number":1338,"context_line":"        tables[6].add_rule(\u0027INPUT\u0027, \u0027-s fe80::/10 -j ACCEPT\u0027)"},{"line_number":1339,"context_line":""},{"line_number":1340,"context_line":"        for subnet in network.subnets:"},{"line_number":1341,"context_line":"            tables[subnet.ip_version].add_rule(\u0027INPUT\u0027,"}],"source_content_type":"text/x-python","patch_set":9,"id":"9abb7d3a_ddd541e5","line":1338,"updated":"2016-06-01 14:44:22.000000000","message":"This is going to allow all link-local traffic, seems wrong.","commit_id":"7e3a38eb0174d3523667298ed4bca07c1c5612bb"},{"author":{"_account_id":18152,"name":"Benoît Knecht","email":"benoit.knecht@fsfe.org","username":"byte"},"change_message_id":"14be5e95bd5636d3fc890db01169328fd5265e9f","unresolved":false,"context_lines":[{"line_number":1335,"context_line":"                \u0027-d 255.255.255.255 --dport %d -j ACCEPT\u0027 %"},{"line_number":1336,"context_line":"                (constants.DHCP_RESPONSE_PORT, DHCPV4_PORT))"},{"line_number":1337,"context_line":""},{"line_number":1338,"context_line":"        tables[6].add_rule(\u0027INPUT\u0027, \u0027-s fe80::/10 -j ACCEPT\u0027)"},{"line_number":1339,"context_line":""},{"line_number":1340,"context_line":"        for subnet in network.subnets:"},{"line_number":1341,"context_line":"            tables[subnet.ip_version].add_rule(\u0027INPUT\u0027,"}],"source_content_type":"text/x-python","patch_set":9,"id":"9abb7d3a_0c2ac62c","line":1338,"in_reply_to":"9abb7d3a_ddd541e5","updated":"2016-06-02 11:13:35.000000000","message":"See comment below.","commit_id":"7e3a38eb0174d3523667298ed4bca07c1c5612bb"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"b3626dc846f42d8917d062c53760853fc091bce5","unresolved":false,"context_lines":[{"line_number":1339,"context_line":""},{"line_number":1340,"context_line":"        for subnet in network.subnets:"},{"line_number":1341,"context_line":"            tables[subnet.ip_version].add_rule(\u0027INPUT\u0027,"},{"line_number":1342,"context_line":"                    \u0027-s %s -j ACCEPT\u0027 % subnet.cidr)"},{"line_number":1343,"context_line":""},{"line_number":1344,"context_line":"        for table in tables.values():"},{"line_number":1345,"context_line":"            table.add_rule(\u0027INPUT\u0027, \u0027-j DROP\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9abb7d3a_5884bf09","line":1342,"updated":"2016-06-01 14:44:22.000000000","message":"If you\u0027re only trying to allow DNS traffic here then you need to be specific by using a port, otherwise this will allow everything.","commit_id":"7e3a38eb0174d3523667298ed4bca07c1c5612bb"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"86488a627f2b1e15592e9553ae3fa0c1281990ff","unresolved":false,"context_lines":[{"line_number":1339,"context_line":""},{"line_number":1340,"context_line":"        for subnet in network.subnets:"},{"line_number":1341,"context_line":"            tables[subnet.ip_version].add_rule(\u0027INPUT\u0027,"},{"line_number":1342,"context_line":"                    \u0027-s %s -j ACCEPT\u0027 % subnet.cidr)"},{"line_number":1343,"context_line":""},{"line_number":1344,"context_line":"        for table in tables.values():"},{"line_number":1345,"context_line":"            table.add_rule(\u0027INPUT\u0027, \u0027-j DROP\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3ac371cc_8d0837db","line":1342,"updated":"2016-08-16 09:27:52.000000000","message":"This will block tenants from using dnsmasq on another network connected by a router (e.g. the dnsmasq sitting on a shared network).\n\nI suggest we take an alternate approach and force a configurable low TTL (default of like 2) on outgoing DNS responses from the agent.","commit_id":"7e3a38eb0174d3523667298ed4bca07c1c5612bb"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"7c96fbf0dd2de416afb85b1d2b3cf27fd25feec9","unresolved":false,"context_lines":[{"line_number":1339,"context_line":""},{"line_number":1340,"context_line":"        for subnet in network.subnets:"},{"line_number":1341,"context_line":"            tables[subnet.ip_version].add_rule(\u0027INPUT\u0027,"},{"line_number":1342,"context_line":"                    \u0027-s %s -j ACCEPT\u0027 % subnet.cidr)"},{"line_number":1343,"context_line":""},{"line_number":1344,"context_line":"        for table in tables.values():"},{"line_number":1345,"context_line":"            table.add_rule(\u0027INPUT\u0027, \u0027-j DROP\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9abb7d3a_5e0e678c","line":1342,"in_reply_to":"9abb7d3a_5884bf09","updated":"2016-06-01 14:56:35.000000000","message":"I thought, from the known subnet all traffic is allowed! Isn\u0027t it so?","commit_id":"7e3a38eb0174d3523667298ed4bca07c1c5612bb"},{"author":{"_account_id":18152,"name":"Benoît Knecht","email":"benoit.knecht@fsfe.org","username":"byte"},"change_message_id":"14be5e95bd5636d3fc890db01169328fd5265e9f","unresolved":false,"context_lines":[{"line_number":1339,"context_line":""},{"line_number":1340,"context_line":"        for subnet in network.subnets:"},{"line_number":1341,"context_line":"            tables[subnet.ip_version].add_rule(\u0027INPUT\u0027,"},{"line_number":1342,"context_line":"                    \u0027-s %s -j ACCEPT\u0027 % subnet.cidr)"},{"line_number":1343,"context_line":""},{"line_number":1344,"context_line":"        for table in tables.values():"},{"line_number":1345,"context_line":"            table.add_rule(\u0027INPUT\u0027, \u0027-j DROP\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9abb7d3a_ec02e271","line":1342,"in_reply_to":"9abb7d3a_5884bf09","updated":"2016-06-02 11:13:35.000000000","message":"The goal of this patch wasn\u0027t to lock down the dhcp agent from local subnets, but to prevent remote hosts from talking to it. So yes, we could be more restrictive and also filter traffic coming from local subnets, but there isn\u0027t really a threat we\u0027re trying to address here.","commit_id":"7e3a38eb0174d3523667298ed4bca07c1c5612bb"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"b3626dc846f42d8917d062c53760853fc091bce5","unresolved":false,"context_lines":[{"line_number":1342,"context_line":"                    \u0027-s %s -j ACCEPT\u0027 % subnet.cidr)"},{"line_number":1343,"context_line":""},{"line_number":1344,"context_line":"        for table in tables.values():"},{"line_number":1345,"context_line":"            table.add_rule(\u0027INPUT\u0027, \u0027-j DROP\u0027)"},{"line_number":1346,"context_line":""},{"line_number":1347,"context_line":"        iptables_mgr.apply()"}],"source_content_type":"text/x-python","patch_set":9,"id":"9abb7d3a_c3e0c42b","line":1345,"updated":"2016-06-01 14:44:22.000000000","message":"I think if we\u0027re going to do this right, we should follow what the firewall code does.  That\u0027s my $.02","commit_id":"7e3a38eb0174d3523667298ed4bca07c1c5612bb"}],"neutron/tests/unit/agent/dhcp/test_agent.py":[{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"2b38647da1058a263feb4d0a482ea50e4e3b35bc","unresolved":false,"context_lines":[{"line_number":1283,"context_line":"                {\u0027port\u0027: {\u0027name\u0027: \u0027\u0027, \u0027admin_state_up\u0027: True,"},{"line_number":1284,"context_line":"                          \u0027network_id\u0027: net.id, \u0027tenant_id\u0027: net.tenant_id,"},{"line_number":1285,"context_line":"                          \u0027fixed_ips\u0027:"},{"line_number":1286,"context_line":"                          # FIXME: The order of the following list is"},{"line_number":1287,"context_line":"                          # non-deterministic, so we would like to match the"},{"line_number":1288,"context_line":"                          # elements in any order. It doesn\u0027t seem possible"},{"line_number":1289,"context_line":"                          # though, so in case there is more than one element,"}],"source_content_type":"text/x-python","patch_set":7,"id":"3afc51ec_0c9383a4","line":1286,"updated":"2016-03-14 16:01:26.000000000","message":"This doesn\u0027t look right...it should be deterministic, depends on which subnets of the network for which dhcp is enabled. Something like:\n\n[{\u0027subnet_id\u0027: subnet.id} for subnet in net.subnets if subnet.enable_dhcp]\n\nshould do","commit_id":"64fc10153db6ee1f7b4e11a7819060ef674fb3d6"},{"author":{"_account_id":18152,"name":"Benoît Knecht","email":"benoit.knecht@fsfe.org","username":"byte"},"change_message_id":"00df9482fef4524343095bca3825263eb638cbc0","unresolved":false,"context_lines":[{"line_number":1283,"context_line":"                {\u0027port\u0027: {\u0027name\u0027: \u0027\u0027, \u0027admin_state_up\u0027: True,"},{"line_number":1284,"context_line":"                          \u0027network_id\u0027: net.id, \u0027tenant_id\u0027: net.tenant_id,"},{"line_number":1285,"context_line":"                          \u0027fixed_ips\u0027:"},{"line_number":1286,"context_line":"                          # FIXME: The order of the following list is"},{"line_number":1287,"context_line":"                          # non-deterministic, so we would like to match the"},{"line_number":1288,"context_line":"                          # elements in any order. It doesn\u0027t seem possible"},{"line_number":1289,"context_line":"                          # though, so in case there is more than one element,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1af94dfe_da14dbf6","line":1286,"in_reply_to":"3afc51ec_0c9383a4","updated":"2016-03-16 06:41:31.000000000","message":"I think I didn\u0027t explain very well why this doesn\u0027t work. The list bellow this comment (and the list you suggested) are in deterministic order, but the list that is passed to the actual create_dhcp_port function isn\u0027t. It is called in neutron/agent/linux/dhcp.py:1161, with the fixed_ips argument set to unique_ip_subnets, which is a list built from the dhcp_subnets dictionary: unique_ip_subnets \u003d [dict(subnet_id\u003ds) for s in dhcp_subnets]. Since dictionary keys are returned in random order, that list is in random order as well, so the test would fail randomly.","commit_id":"64fc10153db6ee1f7b4e11a7819060ef674fb3d6"}]}
