<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Firewall - Architect the cloud</title>
	<atom:link href="https://blog.slepcevic.net/tag/firewall/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.slepcevic.net</link>
	<description></description>
	<lastBuildDate>Tue, 19 Dec 2023 11:25:08 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>Assigning a firewall to Linode NodeBalancer using Terraform and Cloud Manager.</title>
		<link>https://blog.slepcevic.net/assigning-a-firewall-to-linode-nodebalancer-using-terraform-and-cloud-manager/</link>
					<comments>https://blog.slepcevic.net/assigning-a-firewall-to-linode-nodebalancer-using-terraform-and-cloud-manager/#respond</comments>
		
		<dc:creator><![CDATA[Alesandro Slepčević]]></dc:creator>
		<pubDate>Tue, 19 Dec 2023 11:25:08 +0000</pubDate>
				<category><![CDATA[Akamai Connected Cloud]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Terraform]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Linode]]></category>
		<category><![CDATA[Nodebalancer]]></category>
		<guid isPermaLink="false">http://172.233.40.105/blog.slepcevic.net/?p=220</guid>

					<description><![CDATA[<p>Linode has finally rolled out support to assign a firewall device to a NodeBalancer (Linode&#8217;s managed load balancing service)! Assigning a firewall via CloudManager is quite easy and self-explanatory. Create a firewall, add the rules you need and simply select...</p>
<p>The post <a href="https://blog.slepcevic.net/assigning-a-firewall-to-linode-nodebalancer-using-terraform-and-cloud-manager/">Assigning a firewall to Linode NodeBalancer using Terraform and Cloud Manager.</a> first appeared on <a href="https://blog.slepcevic.net">Architect the cloud</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><a href="https://www.linode.com">Linode</a> has<strong> finally rolled out support to assign a firewall device to a NodeBalancer</strong> (Linode&#8217;s managed load balancing service)!</p>



<p>Assigning a firewall via CloudManager is quite easy and self-explanatory. Create a firewall, add the rules you need and simply select that firewall when you create a load balancer. </p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="522" src="https://blog.slepcevic.net/wp-content/uploads/2023/12/Firewall-Nodebalancer-Screenshot-1064x542-1-1024x522.png" alt="" class="wp-image-221" srcset="https://blog.slepcevic.net/wp-content/uploads/2023/12/Firewall-Nodebalancer-Screenshot-1064x542-1-1024x522.png 1024w, https://blog.slepcevic.net/wp-content/uploads/2023/12/Firewall-Nodebalancer-Screenshot-1064x542-1-300x153.png 300w, https://blog.slepcevic.net/wp-content/uploads/2023/12/Firewall-Nodebalancer-Screenshot-1064x542-1-768x391.png 768w, https://blog.slepcevic.net/wp-content/uploads/2023/12/Firewall-Nodebalancer-Screenshot-1064x542-1.png 1064w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>More fun part is to use IaC, mainly Terraform. </p>



<p>Example code which will create a NodeBalancer,  Firewall device and assign it to a load balancer. </p>



<p>NodeBalancer Terraform code: </p>



<pre class="wp-block-code"><code>resource "linode_nodebalancer" "primaryregion-lb" {
    label = "nodebalancer-web-${var.primary_region}"
    region = var.primary_region
    client_conn_throttle = 0
}

resource "linode_nodebalancer_config" "primaryregion-lb-config" {
    nodebalancer_id = linode_nodebalancer.primaryregion-lb.id
    port = 80
    protocol = "http"
    check = "http"
    check_path = "/"
    check_attempts = 3
    check_timeout = 30
    stickiness = "none"
    algorithm = "leastconn"
}

resource "linode_nodebalancer_node" "primary" {
    count = "2"
    nodebalancer_id = linode_nodebalancer.primaryregion-lb.id
    config_id = linode_nodebalancer_config.primaryregion-lb-config.id
    address = "${element(linode_instance.web-primary.*.private_ip_address, count.index)}:80"
    label = "nodebalancer-web-${var.primary_region}"
    weight = 50
}</code></pre>



<p>Terraform code to create a Firewall and assign it to the said load balancer.</p>



<pre class="wp-block-code"><code>
resource "linode_firewall" "lb-fw" {
  label = "lb-pub"

  inbound {
    label    = "allow-http"
    action   = "ACCEPT"
    protocol = "TCP"
    ports    = "80"
    ipv4     = &#091;"0.0.0.0/0"]
    ipv6     = &#091;"::/0"]
  }

  inbound {
    label    = "allow-https"
    action   = "ACCEPT"
    protocol = "TCP"
    ports    = "443"
    ipv4     = &#091;"0.0.0.0/0"]
    ipv6     = &#091;"::/0"]
  }

  inbound_policy = "DROP"

  outbound_policy = "ACCEPT"

  nodebalancers = &#091;linode_nodebalancer.primaryregion-lb.id]
}</code></pre>



<p>If you&#8217;ve ever used Terraform and Linode, you will notice it&#8217;s exactly the same approach we do when we want to assign a firewall device to a Linode (virtual machine); only difference is that we reference the &#8220;nodebalancer&#8221; instead of &#8220;linodes&#8221;. </p>



<p></p>



<p>Cheers, </p>



<p>Alex. </p><p>The post <a href="https://blog.slepcevic.net/assigning-a-firewall-to-linode-nodebalancer-using-terraform-and-cloud-manager/">Assigning a firewall to Linode NodeBalancer using Terraform and Cloud Manager.</a> first appeared on <a href="https://blog.slepcevic.net">Architect the cloud</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.slepcevic.net/assigning-a-firewall-to-linode-nodebalancer-using-terraform-and-cloud-manager/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)

Served from: blog.slepcevic.net @ 2025-12-26 10:15:41 by W3 Total Cache
-->