{"id":215,"date":"2017-02-24T01:27:27","date_gmt":"2017-02-24T00:27:27","guid":{"rendered":"http:\/\/hentati.org\/?p=215"},"modified":"2020-12-06T20:53:19","modified_gmt":"2020-12-06T19:53:19","slug":"configure-firewall-as-a-service-fwaas","status":"publish","type":"post","link":"https:\/\/hentati.org\/index.php\/2017\/02\/24\/configure-firewall-as-a-service-fwaas\/","title":{"rendered":"Configure FIREWALL-AS-A-SERVICE (FWAAS)"},"content":{"rendered":"<p><span style=\"color: #000000;\">The Firewall-as-a-Service (FWaaS) plug-in adds perimeter firewall management to OpenStack Networking (neutron). FWaaS uses iptables to apply firewall policy to all virtual routers within a project, and supports one firewall policy and logical firewall instance per project.<\/span><\/p>\n<p><span style=\"color: #000000;\">FWaaS operates at the perimeter by filtering traffic at the OpenStack Networking (neutron) router. This distinguishes it from security groups, which operate at the instance level.<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>NOTE<\/strong><\/span><br \/>\n<span style=\"color: #000000;\">FWaaS is currently in technical preview; untested operation is not recommended.<\/span><\/p>\n<p><span style=\"color: #000000;\">The example diagram below illustrates the flow of ingress and egress traffic for the VM2 instance:<\/span><\/p>\n<p><span style=\"color: #000000;\"><img loading=\"lazy\" class=\"wp-image-217 aligncenter\" src=\"http:\/\/hentati.org\/wp-content\/uploads\/2017\/12\/firewall-300x250.png\" alt=\"\" width=\"614\" height=\"512\" srcset=\"https:\/\/hentati.org\/wp-content\/uploads\/2017\/12\/firewall-300x250.png 300w, https:\/\/hentati.org\/wp-content\/uploads\/2017\/12\/firewall.png 662w\" sizes=\"(max-width: 614px) 100vw, 614px\" \/><\/span><\/p>\n<p style=\"text-align: center;\"><span style=\"color: #000000;\"><em>Figure 1. FWaaS architecture<\/em><\/span><\/p>\n<p>&nbsp;<\/p>\n<h3><span style=\"color: #000000;\"><strong>I-Enable FWaaS<\/strong><\/span><\/h3>\n<ol>\n<li><span style=\"color: #000000;\">Install the FWaaS packages:<\/span><\/li>\n<\/ol>\n<pre><span style=\"color: #000000;\"># yum install openstack-neutron-fwaas python-neutron-fwaas<\/span><\/pre>\n<ol start=\"2\">\n<li><span style=\"color: #000000;\">Enable the FWaaS plugin in the\u00a0neutron.conffile:<\/span><\/li>\n<\/ol>\n<pre><span style=\"color: #000000;\">service_plugins = neutron.services.firewall.fwaas_plugin.FirewallPlugin<\/span><\/pre>\n<ol start=\"3\">\n<li><span style=\"color: #000000;\">Configure FWaaS in the\u00a0fwaas_driver.inifile:<\/span><\/li>\n<\/ol>\n<pre><span style=\"color: #000000;\">[fwaas]<\/span>\r\n\r\n<span style=\"color: #000000;\">driver = neutron.services.firewall.drivers.linux.iptables_fwaas.IptablesFwaasDriver<\/span>\r\n\r\n<span style=\"color: #000000;\">enabled = True<\/span>\r\n\r\n<span style=\"color: #000000;\">[service_providers]<\/span>\r\n\r\n<span style=\"color: #000000;\">service_provider = LOADBALANCER:Haproxy:neutron_lbaas.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default<\/span><\/pre>\n<ol start=\"4\">\n<li><span style=\"color: #000000;\">FWaaS management options are available in OpenStack dashboard. Enable this option in the\u00a0local_settings.pyfile, usually located on the Controller node:<\/span><\/li>\n<\/ol>\n<pre><span style=\"color: #000000;\">\/usr\/share\/openstack-dashboard\/openstack_dashboard\/local\/local_settings.py<\/span>\r\n\r\n<span style=\"color: #000000;\">'enable_firewall' = True<\/span><\/pre>\n<ol start=\"5\">\n<li><span style=\"color: #000000;\">Restart\u00a0neutron-serverto apply the changes.<\/span><\/li>\n<\/ol>\n<pre><span style=\"color: #000000;\"># systemctl restart neutron-server<\/span><\/pre>\n<p>&nbsp;<\/p>\n<h3><span style=\"color: #000000;\"><strong>II-Configure FWaaS<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">First create the firewall rules and create a policy to contain them, then create a firewall and apply the policy:<\/span><\/p>\n<ol>\n<li><span style=\"color: #000000;\">Create a firewall rule:<\/span><\/li>\n<\/ol>\n<pre><span style=\"color: #000000;\">$ neutron firewall-rule-create --protocol &lt;tcp|udp|icmp|any&gt; --destination-port &lt;port-range&gt; --action &lt;allow|deny&gt;<\/span><\/pre>\n<p><span style=\"color: #000000;\">The CLI requires a protocol value; if the rule is protocol agnostic, the\u00a0<em>any<\/em>\u00a0value can be used.<\/span><\/p>\n<ol start=\"2\">\n<li><span style=\"color: #000000;\">Create a firewall policy:<\/span><\/li>\n<\/ol>\n<pre><span style=\"color: #000000;\">$ neutron firewall-policy-create --firewall-rules \"&lt;firewall-rule IDs or names separated by space&gt;\" myfirewallpolicy<\/span><\/pre>\n<p><span style=\"color: #000000;\">The order of the rules specified above is important. You can create an empty firewall policy and add rules later, either with the update operation (when adding multiple rules) or with the insert-rule operations (when adding a single rule).<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>Note:<\/strong>\u00a0FWaaS always adds a default deny all rule at the lowest precedence of each policy. Consequently, a firewall policy with no rules blocks all traffic by default.<\/span><\/p>\n<p>&nbsp;<\/p>\n<h3><span style=\"color: #000000;\"><strong>III-Create a firewall<\/strong><\/span><\/h3>\n<pre><span style=\"color: #000000;\">$ neutron firewall-create &lt;firewall-policy-uuid&gt;<\/span><\/pre>\n<p><span style=\"color: #000000;\">The firewall remains in PENDING_CREATE state until an OpenStack Networking router is created, and an interface is attached.<\/span><\/p>\n<p>&nbsp;<\/p>\n<h3><span style=\"color: #000000;\"><strong>IV-Allowed-address-pairs<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">Allowed-address-pairs allow you to specify mac_address\/ip_address (CIDR) pairs that pass through a port regardless of subnet. This enables the use of protocols such as VRRP, which floats an IP address between two instances to enable fast data plane failover.<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>NOTE<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">The allowed-address-pairs extension is currently only supported by these plug-ins: ML2, Open vSwitch, and VMware NSX.<\/span><\/p>\n<ol>\n<li><span style=\"color: #000000;\">Basic allowed-address-pairs operations<\/span><\/li>\n<\/ol>\n<p><span style=\"color: #000000;\">Create a port with a specific allowed-address-pairs:<\/span><\/p>\n<pre><span style=\"color: #000000;\"># neutron port-create net1 --allowed-address-pairs type=dict list=true mac_address=&lt;mac_address&gt;,ip_address=&lt;ip_cidr&gt;<\/span><\/pre>\n<ol start=\"2\">\n<li><span style=\"color: #000000;\">Adding allowed-address-pairs<\/span><\/li>\n<\/ol>\n<pre><span style=\"color: #000000;\"># neutron port-update &lt;port-uuid&gt; --allowed-address-pairs type=dict list=true mac_address=&lt;mac_address&gt;,ip_address=&lt;ip_cidr&gt;<\/span><\/pre>\n<p><span style=\"color: #000000;\"><strong>NOTE<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">OpenStack Networking prevents setting an allowed-address-pair that matches the\u00a0<strong>mac_address<\/strong>\u00a0and\u00a0<strong>ip_address<\/strong>\u00a0of a port. This is because such a setting would have no effect since traffic matching the\u00a0<strong>mac_address<\/strong>\u00a0and\u00a0<strong>ip_address<\/strong>\u00a0is already allowed to pass through the port.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Firewall-as-a-Service (FWaaS) plug-in adds perimeter firewall management to OpenStack Networking (neutron). FWaaS uses iptables to apply firewall policy to all virtual routers within a project, and supports one firewall &#8230;<\/p>\n","protected":false},"author":1,"featured_media":224,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8,6],"tags":[],"_links":{"self":[{"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/posts\/215"}],"collection":[{"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/comments?post=215"}],"version-history":[{"count":9,"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/posts\/215\/revisions"}],"predecessor-version":[{"id":649,"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/posts\/215\/revisions\/649"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/media\/224"}],"wp:attachment":[{"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/media?parent=215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/categories?post=215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hentati.org\/index.php\/wp-json\/wp\/v2\/tags?post=215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}