<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Security on 0x2142 | Networking Nonsense</title>
    <link>https://0x2142.com/tags/security/</link>
    <description>Recent content in Security on 0x2142 | Networking Nonsense</description>
    <image>
      <title>0x2142 | Networking Nonsense</title>
      <url>https://0x2142.com/logo.jpg</url>
      <link>https://0x2142.com/logo.jpg</link>
    </image>
    <generator>Hugo -- 0.143.1</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 02 Aug 2022 14:50:51 +0000</lastBuildDate>
    <atom:link href="https://0x2142.com/tags/security/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>[How to] Set up Wireguard VPN on OPNsense</title>
      <link>https://0x2142.com/how-to-set-up-wireguard-on-opnsense/</link>
      <pubDate>Tue, 02 Aug 2022 14:50:51 +0000</pubDate>
      <guid>https://0x2142.com/how-to-set-up-wireguard-on-opnsense/</guid>
      <description>In this post, we&amp;rsquo;ll walk through a simple WireGuard remote-access VPN configuration on OPNsense - including client setup examples with Windows &amp;amp; Android.</description>
      <content:encoded><![CDATA[<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;">
      <iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="allowfullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/b58PpuIsQ3A?autoplay=0&amp;controls=1&amp;end=0&amp;loop=0&amp;mute=0&amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"></iframe>
    </div>

<p>So in my <a href="/opnsense-qotom-q750gs/">last post</a>, I picked up a Qotom Mini-PC to run OPNsense on. After a few months, the device has been running well &amp; I&rsquo;m very happy with it.</p>
<p>One of the new things I got to try out with OPNsense was Wireguard VPN. I had previously been using something else for VPN connectivity back to my home network - but I heard good things about Wireguard &amp; wanted to give it a try.</p>
<p>So far my experience has been good! I&rsquo;ve been pleasantly suprised with how easy it is to configure &amp; get running. In addition, the performance &amp; overall experience has been very positive. The VPN connects quicker than anything I&rsquo;ve used in the past, and just simply works without issue.</p>
<p>All that being said - I wanted to put together a quick guide on how to configure Wireguard on OPNsense. Specifically, this configuraion will be for remote-access VPN - where clients will connect to a VPN headend. We&rsquo;ll walk through the OPNsense configuration &amp; a few clients as well. So let&rsquo;s dig in!</p>
<hr>
<h2 id="topology">Topology</h2>
<p>For the purpose of this blog post, we&rsquo;ll be using the lab topology below:</p>
<p><img alt="topology" loading="lazy" src="/content/images/2022/07/topology.png#center"></p>
<p>I will be using the reserved IP range 203.0.113.0/24 for the WAN-side addressing. I&rsquo;ll have one Windows &amp; one Android client that we&rsquo;ll walk through &amp; connect to the VPN.</p>
<h2 id="installing-the-wireguard-plugin">Installing the Wireguard Plugin</h2>
<p>To get started, first thing we will want to do is install the Wireguard plugin for OPNsense. By default, OPNsense will have standard IPSec &amp; OpenVPN already available - but other VPN options can be enabled easily.</p>
<p>So in OPNsense, we&rsquo;ll navigate down to <strong>System &gt; Firmware &gt; Plugins</strong>, then search for <strong>wireguard</strong> and click the plus icon.</p>
<p><img alt="addplugin" loading="lazy" src="/content/images/2022/07/addplugin.png#center"></p>
<p>This should pull down the package &amp; install pretty quickly. No reboot required here!</p>
<p><img alt="plugindownload" loading="lazy" src="/content/images/2022/07/plugindownload.png#center"></p>
<p>Once installed, you may have to refresh the page or navigate to a new page so that the menu bar has a chance to reload. Then we&rsquo;ll have a new option under <strong>VPN</strong>:</p>
<p><img alt="vpnmenu" loading="lazy" src="/content/images/2022/07/vpnmenu.png#center"></p>
<h2 id="wireguard-tunnel-configuration">Wireguard Tunnel Configuration</h2>
<p>Next we&rsquo;ll begin configuring Wireguard on the OPNsense side.</p>
<p>There is a little bit of a chicken &amp; egg scenario here since everything is based on cryptographic keys. We&rsquo;ll need to generate keys on the firewall, which we need to enter on the client - but we also need the client keys to enter on the firewall. A bit of bouncing between the two - but for now we&rsquo;ll try to complete as much as we can on the firewall side.</p>
<p>We&rsquo;ll enable Wireguard by dropping down to <strong>VPN &gt; WireGuard</strong> then clicking <strong>Enable</strong> and <strong>Apply</strong></p>
<p><img alt="enablewg" loading="lazy" src="/content/images/2022/07/enablewg.png#center"></p>
<p>Next we&rsquo;ll set up the Wireguard tunnel interface on OPNsense. This will be a virtual tunnel interface that will be created as interface <code>wg&lt;instance number&gt;</code>.</p>
<p>To do this, we&rsquo;ll navigate to the <strong>Local</strong> tab, and click the plus icon to add a new tunnel.</p>
<p><img alt="localconfig-pt1-1" loading="lazy" src="/content/images/2022/07/localconfig-pt1-1.png#center"></p>
<p>In the above screenshot, I&rsquo;ve filled in just a few details.</p>
<p>For <strong>Name</strong>, I&rsquo;ve entered our virtual interface name <code>wg1</code>. Since OPNsense shows the <strong>Instance</strong> as <code>1</code> - it will create a <code>wg</code> interface with that instance number.</p>
<p>We&rsquo;ll leave <strong>Public Key</strong> &amp; <strong>Private Key</strong> blank for now. OPNsense will auto-generate these keys once we save this config.</p>
<p>For <strong>Listen Port</strong>, I&rsquo;ve set this to 51820 which is the default for Wireguard. It&rsquo;s not stated here, but this is a UDP tunnel.</p>
<p>For <strong>Tunnel Address</strong> - this is where we add the IP address of the virtual tunnel interface. This will be the gateway for our remote clients. In my lab I&rsquo;ll be using 10.50.50.1/24 here.</p>
<p>We have no peers configured yet - so we can&rsquo;t select any here. We&rsquo;ll leave this blank for now, but come back later.</p>
<p>We will leave <strong>Disable Routes</strong> unchecked. By default, OPNsense will add static/connected routes for any client via the tunnel interface. You might not want this behavior if you wanted to do custom routing - for example, in a site-to-site VPN connection - but we&rsquo;ll leave this enabled.</p>
<p>Once we&rsquo;re done, we&rsquo;ll click <strong>Save</strong>.</p>
<p>Like I mentioned before, OPNsense will now auto-generate our crypto keys for the tunnels. So if we edit our tunnel, we&rsquo;ll now see those fields populated:</p>
<p><img alt="localconfig-pt2-1" loading="lazy" src="/content/images/2022/07/localconfig-pt2-1.png#center"></p>
<p>We&rsquo;ll want to copy the <strong>Public Key</strong> &amp; save it for later. This will need to be imported onto our clients, so that they can communicate securely with our firewall.</p>
<h2 id="wireguard-interface-assignment">Wireguard Interface Assignment</h2>
<p>Now that we have our headend tunnel interface defined, we can map our <code>wg1</code> interface to an OPNsense interface. The OPNsense documentation suggests this is optional, but I would recommend it since it will allow us to create firewall rules to permit/deny access to clients.</p>
<p>We&rsquo;ll navigate to <strong>Interfaces &gt; Assignments</strong>, and we should see a <strong>New interface</strong> available: our <code>wg1</code> tunnel.</p>
<p>We can assign this a name, then click the plus icon &amp; <strong>Save</strong>.</p>
<p><img alt="newinterface" loading="lazy" src="/content/images/2022/07/newinterface.png#center"></p>
<p>Next we&rsquo;ll enable the interface by navigating to <strong>Interfaces &gt; WG1</strong>. Here we&rsquo;ll only need to click <strong>Enable</strong> &amp; save the change - nothing else is necessary.</p>
<p><img alt="enableinterface" loading="lazy" src="/content/images/2022/07/enableinterface.png#center"></p>
<p>Of course, we&rsquo;ll be prompted to apply the changes - which we will do:</p>
<p><img alt="applychangeinterface" loading="lazy" src="/content/images/2022/07/applychangeinterface.png#center"></p>
<p>By default, all traffic through our <code>WG1</code> firewall interface will be blocked - so please make sure to configure a firewall rule to permit traffic from the Wireguard clients.</p>
<h2 id="firewall-rules-allow-inbound-wireguard-traffic">Firewall Rules: Allow Inbound Wireguard Traffic</h2>
<p>Next we need to permit the Wireguard traffic into our firewall. By default the WAN interface will block all traffic that isn&rsquo;t explicitly allowed - including our Wireguard traffic.</p>
<p>For this, we&rsquo;ll navigate to <strong>Firewall &gt; Rules &gt; WAN</strong>. Then click the plus icon to add a new rule.</p>
<p><img alt="waninboundfwrule" loading="lazy" src="/content/images/2022/07/waninboundfwrule.png#center"></p>
<p>The screenshot above shows what our firewall rule will look like.</p>
<p>Here&rsquo;s the summary:</p>
<ul>
<li>Action: Pass</li>
<li>Interface: WAN</li>
<li>Direction: In</li>
<li>TCP/IP Version: IPv4
<ul>
<li>You can enable IPv6 as well, if you have IPv6 connectivity (this is a lab box, which does not)</li>
</ul>
</li>
<li>Protocol: UDP</li>
<li>Source: Any
<ul>
<li>This will allow anyone on the internet to reach our VPN. We could restrict source IP addresses, if our clients had permanent, static IPs.</li>
</ul>
</li>
<li>Destination: WAN Address
<ul>
<li>The firewall itself is the destination for this traffic</li>
</ul>
</li>
<li>Destination Port Range: (other) / 51820</li>
</ul>
<p>I also enabled logging &amp; added a quick description. After we have all this configured, we can click <strong>Save</strong> - then <strong>Apply Changes</strong>.</p>
<h2 id="client-setup---windows">Client Setup - Windows</h2>
<p>So first we&rsquo;ll start with an easy configuration on a Windows client. Wireguard client software can be found on the Wireguard site <a href="https://www.wireguard.com/install/">here</a>.</p>
<p>For the sake of the walkthrough, we will manually configure each client. However, this can be a difficult task if there is a large number of clients. Wireguard does support importing configurations, and there are a number of free tools available to help automate generating config files for clients - including some which will generate QR codes for easy import on mobile clients.</p>
<p>So on my lab Windows machine, we&rsquo;ll open up the Wireguard client &amp; click <strong>Add Empty Tunnel:</strong></p>
<p><img alt="windows-addnew" loading="lazy" src="/content/images/2022/07/windows-addnew.png#center"></p>
<p>Then we&rsquo;ll be given a blank config file, with only the devices public &amp; private key pair generated for us.</p>
<p>We&rsquo;re going to fill in details similar to the below screenshot:</p>
<p><img alt="windows-tunnelconfig" loading="lazy" src="/content/images/2022/07/windows-tunnelconfig.png#center"></p>
<p>The configuration under [Interface] is the local, client-side configuration. I&rsquo;ve added the client&rsquo;s tunnel address - which will be 10.50.50.15/32. I&rsquo;ve also configured DNS servers which the client can reach via the VPN.</p>
<p>Then we&rsquo;ll add the [Peer] section, which contains info about our VPN headend. Here&rsquo;s where we&rsquo;ll need the public key from our OPNsense firewall. We&rsquo;ll also specify the <strong>Endpoint</strong> address, which is the IP or hostname of our VPN headend &amp; the port (which by default is 51820).</p>
<p>We&rsquo;ve also configured <strong>AllowedIPs</strong> as <code>0.0.0.0/0</code>. This will force <strong>all</strong> client traffic over the VPN tunnel - including general internet traffic. However, we could limit this to specific subnets. For example, let&rsquo;s say your network only used 172.16.90.0/24 &amp; 10.1.1.0/16 subnets &amp; we only wanted the user to be able to access those. We would configure the following: <code>AllowedIPs = 172.16.90.0/24, 10.1.1.0/16</code>. In this case, only traffic for those subnets would be routed over the VPN - any other traffic would use the devices default internet connection.</p>
<p>Now, we&rsquo;ll save this - and again need to copy the device&rsquo;s <strong>Public Key</strong>, which we&rsquo;ll need to enter on the OPNsense firewall.</p>
<h2 id="client-setup---adding-clients-to-opnsense">Client Setup - Adding Clients to OPNsense</h2>
<p>In order for the Windows machine to connect to OPNsense, we&rsquo;ll also need to configure a client profile on the firewall.</p>
<p>In OPNsense, we&rsquo;ll navigate back to <strong>VPN &gt; WireGuard</strong>, then click on the <strong>Endpoints</strong> tab.</p>
<p><img alt="wg-client-win" loading="lazy" src="/content/images/2022/07/wg-client-win.png#center"></p>
<p>Here we&rsquo;ll configure a name for our client &amp; paste in the client&rsquo;s <strong>Public Key</strong>.</p>
<p>We&rsquo;ll also set <strong>AllowedIPs</strong> to the client&rsquo;s IP address, which we have configured as <code>10.50.50.15/32</code>. This controls what IP addresses are reachable via this endpoint.</p>
<p>We do have some additional fields available, which we will leave blank. For example - <strong>Endpoint Address</strong> &amp; <strong>Endpoint Port</strong> would be used to define a public IP that we expect our client to connect from. Since a remote-access client could connect from any IP, we leave those fields blank to allow this.</p>
<p>Once we&rsquo;re done, we&rsquo;ll click <strong>Save</strong> then <strong>Apply</strong>.</p>
<p>Next we&rsquo;ll jump back to the <strong>Local</strong> tab, and edit our headend tunnel configuration.</p>
<p>We should now see our windows client in the <strong>Peers</strong> dropdown. We&rsquo;ll select that client, so that Wireguard will permit that client to connect via this tunnel interface.</p>
<p><img alt="localconfig-pt3" loading="lazy" src="/content/images/2022/07/localconfig-pt3.png#center"></p>
<p>Then, as always, click <strong>Save</strong> &amp; <strong>Apply</strong></p>
<p>Last but not least - we should restart our Wireguard server on OPNsense. This can be done by either disabling &amp; re-enabling Wireguard - or by navigating back to the OPNsense dashboard &amp; clicking the restart icon next to the <strong>wireguard-go</strong> service.</p>
<h2 id="testing-the-connection">Testing The Connection</h2>
<p>Okay - now that we have all that completed, it&rsquo;s finally time to test connectivity from our client.</p>
<p>On my Windows client, I&rsquo;ll just click the <strong>Activate</strong> button for the tunnel:</p>
<p><img alt="windows-tunnelconnected" loading="lazy" src="/content/images/2022/07/windows-tunnelconnected.png#center"></p>
<p>And we&rsquo;ll see that the <strong>Status</strong> shows <strong>Active</strong>, and we&rsquo;ll start to see updates to the <strong>Last Handshake</strong> &amp; <strong>Transfer</strong> fields - indicating we are connected &amp; sending data.</p>
<p>To further validate, we can check the <strong>Log</strong> tab:</p>
<p><img alt="windows-log" loading="lazy" src="/content/images/2022/07/windows-log.png#center"></p>
<p>The key things to look for here, are the following messages:</p>
<ul>
<li><strong>Receiving handshake response</strong> which indicates our firewall responded to our request to connect</li>
<li><strong>Keypair 1 created</strong> which indicates that our connection is healthy to our peer</li>
<li><strong>Receiving keepalive packet from peer</strong> - we should see these periodically to maintain our connection. If keepalives stop flowing, then we may have a break in connectivity between client &amp; peer.</li>
</ul>
<p>We should also be able to reach out <code>wg1</code> tunnel address from the Windows client:</p>
<p><img alt="windows-ping" loading="lazy" src="/content/images/2022/07/windows-ping.png#center"></p>
<p>On the OPNsense side of things, we can check what client is connected via the <strong>List Configuration</strong> tab, under <strong>VPN &gt; Wireguard</strong>:</p>
<p><img alt="wireguard-listconfig" loading="lazy" src="/content/images/2022/07/wireguard-listconfig.png#center"></p>
<p>On this screen, we can see we have 1 peer connected - which matches the IP &amp; public key of our Windows client. We&rsquo;ll see similar output like the Windows client, where we can see the latest handshake &amp; data transfer.</p>
<p>Additionally, for easier access we can add the Wireguard widget to the OPNsense dashboard.</p>
<p>If we navigate to our dashboard, then click <strong>Add widget</strong> - we can add the <strong>Wireguard</strong> widget.</p>
<p>Here&rsquo;s what that looks like:</p>
<p><img alt="wg-widget" loading="lazy" src="/content/images/2022/07/wg-widget.png#center"></p>
<h2 id="additional-client-setup---android">Additional Client Setup - Android</h2>
<p>Let&rsquo;s also take a quick look at a mobile client. I&rsquo;ll get through this pretty quickly, since the configuration will be very similar to our other client - just a different UI.</p>
<p>On my Android device - if I open up the Wireguard app, I have a few options for creating or importing a tunnel:</p>
<p><img alt="android-create-1" loading="lazy" src="/content/images/2022/07/android-create-1.png#center"></p>
<p>In this case, we&rsquo;ll again walk through creating a tunnel manually. Again, it&rsquo;s worth mentioning that there are 3rd party apps available to auto-generate config imports or QR codes to make this easier.</p>
<p>First we&rsquo;ll have a handful of fields to fill in about the Android-side configuration. This includes a name for the tunnel, an address, and DNS servers.</p>
<p>We can click on the refresh icon in the <strong>Private Key</strong> field to auto-generate our key pairs:</p>
<p><img alt="android-interface-1" loading="lazy" src="/content/images/2022/07/android-interface-1.png#center"></p>
<p>One of the interesting parts of the mobile app is the ability to permit/exclude individual apps from traversing the VPN tunnel.</p>
<p>Here&rsquo;s a quick screenshot, where we can pick either to allow only certain apps to use the VPN - or permit all except a few we choose to exclude:</p>
<p><img alt="android-app-list-1" loading="lazy" src="/content/images/2022/07/android-app-list-1.png#center"></p>
<p>In my case, I&rsquo;ll keep this set to allow all applications.</p>
<p>Next we&rsquo;ll work on the peer config:</p>
<p><img alt="android-peer-1" loading="lazy" src="/content/images/2022/07/android-peer-1.png#center"></p>
<p>After that, all we need to do is save our VPN configuration - then we can toggle the tunnel on or off:</p>
<p><img alt="android-enable-1" loading="lazy" src="/content/images/2022/07/android-enable-1.png#center"></p>
<p>And similar to the Windows client, we can click on the tunnel itself to see current status / data transfer:</p>
<p><img alt="android-stats-1" loading="lazy" src="/content/images/2022/07/android-stats-1.png#center"></p>
<p>So it looks like we should be connected &amp; can try accessing VPN resources!</p>
<p>We can also use the same methods as earlier to check connectivity from the OPNsense side.</p>
<hr>
<p>Okay - that&rsquo;s all I wanted to share today. I&rsquo;ve been quite pleased with how easy to use WireGuard has been  - and how well it performs! I hope this blog post was helpful if you&rsquo;re interested in trying it out.</p>
<p>Thanks!!</p>
]]></content:encoded>
    </item>
    <item>
      <title>[How To] Connect Cisco SD-WAN to Umbrella SIG/SWG</title>
      <link>https://0x2142.com/cisco-sdwan-and-umbrella-sig-integration/</link>
      <pubDate>Thu, 22 Apr 2021 15:17:50 +0000</pubDate>
      <guid>https://0x2142.com/cisco-sdwan-and-umbrella-sig-integration/</guid>
      <description>A tutorial for configuring Viptela SDWAN with Cisco Umbrella Secure Internet Gateway &amp;amp; Secure Web Gateway</description>
      <content:encoded><![CDATA[<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;">
      <iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="allowfullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/kJwtIVp0-R4?autoplay=0&amp;controls=1&amp;end=0&amp;loop=0&amp;mute=0&amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"></iframe>
    </div>

<p>In this post, we&rsquo;ll walk through configuring a Cisco Viptela SD-WAN network to integrate with Cisco Umbrella&rsquo;s Secure Internet Gateway (SIG) &amp; Secure Web Gateway (SWG).</p>
<p>If you&rsquo;re interested in reading more about what SIG &amp; SWG are, please check out my <a href="/meraki-mx-and-umbrella-sig-integration/">last post</a> where I walked through this integration with a Meraki MX firewall.</p>
<p>For additional reading, there&rsquo;s also a good Umbrella blog post on all the components of Cisco&rsquo;s SASE architecture, which you can find <a href="https://umbrella.cisco.com/blog/what-goes-into-the-secure-access-service-edge-sase-solution">here</a>.</p>
<p>Okay, with that being said - let&rsquo;s get started!</p>
<hr>
<h2 id="step-1-umbrella-api-keys">Step 1: Umbrella API Keys</h2>
<p>Okay, so we&rsquo;ll start on the Umbrella side. We&rsquo;ll need to generate a set of API keys, which we&rsquo;ll push out to our WAN edge devices. These API keys will allow our remote devices to reach out to Umbrella &amp; auto-configure their SIG tunnels.</p>
<p>We&rsquo;ll log into our Umbrella dashboard at <a href="https://login.umbrella.com/">https://login.umbrella.com/</a></p>
<p>Once we log in, we&rsquo;ll hop over to <strong>Admin &gt; API Keys</strong>. Then up in the upper-right corner, click <strong>Create</strong>.</p>
<p><img alt="001&mdash;umbrella-api-keys-1" loading="lazy" src="/content/images/2021/04/001---umbrella-api-keys-1.png#center"></p>
<p>For this integration, we&rsquo;ll need to select <strong>Umbrella Management</strong> to make sure our API keys have the access they need. Then click <strong>Create.</strong> Easy enough, right?</p>
<p>Once we do that, the Umbrella dashboard will display our API keys - which we&rsquo;ll need to copy over to our Viptela SD-WAN environment.</p>
<p><img alt="002&mdash;umbrella-keys" loading="lazy" src="/content/images/2021/04/002---umbrella-keys.png#center"></p>
<p>We&rsquo;ll also need to collect our Umbrella Organization ID. This is actually just embedded within the Umbrella Dashboard URL, and should be a seven-digit number. For example, if we look at our current URL on the API keys page:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">https://dashboard.umbrella.com/o/&lt;ORG ID&gt;/#/admin/apikeys
</span></span></code></pre></div><p>And that&rsquo;s all we need for now from the Umbrella side. So let&rsquo;s hop over to Viptela.</p>
<h2 id="step-2-viptela-templates--config">Step 2: Viptela Templates &amp; Config</h2>
<p>For this post, I&rsquo;ll be using my SD-WAN lab in EVE-NG. Currently I just upgraded the lab to run Viptela version 20.4.1, though the SIG integration has been supported since 20.1.</p>
<p>Just for reference, here is the lap topology that I&rsquo;m working with:</p>
<p><img alt="003&mdash;eve-topology-1" loading="lazy" src="/content/images/2021/04/003---eve-topology-1.png#center"></p>
<p>This lab includes a bridged connection to allow direct internet access from the lab network.</p>
<p>To configure our SIG automatic tunnels, we&rsquo;ll need to create / update a few templates:</p>
<ul>
<li>Create a <strong>SIG Credentials</strong> feature template</li>
<li>Create a <strong>SIG</strong> feature template</li>
<li>Assign SIG templates to device templates</li>
<li>Edit Service-side VPN Template to inject a service route</li>
</ul>
<h3 id="2a-creating-a-sig-credentials-template">2a: Creating a SIG Credentials Template</h3>
<p>First we&rsquo;ll create a template which will store our Umbrella API credentials.</p>
<p>In the vManage dashboard, we&rsquo;ll go to <strong>Configuration &gt; Templates</strong>, then drop into the <strong>Feature</strong> tab, and click on <strong>Add Template</strong>.</p>
<p><img alt="004&mdash;add-template" loading="lazy" src="/content/images/2021/04/004---add-template.png#center"></p>
<p>Once we get to the next screen, we&rsquo;ll select our device type. In my case, I&rsquo;m using a <strong>vEdge Cloud</strong>.</p>
<p>A list of templates will pop up - we&rsquo;ll drop down to <strong>SIG Credentials</strong>, which will be near the bottom under the <strong>Other Templates</strong> header.</p>
<p><img alt="005&mdash;SIGCREDTEMPLATE" loading="lazy" src="/content/images/2021/04/005---SIGCREDTEMPLATE.png#center"></p>
<p>We&rsquo;ll then be taken to the page where we create our template.</p>
<p>We&rsquo;ll fill in our template name &amp; description, then paste in our Umbrella details (Org ID, API Key, API Secret).</p>
<p><img alt="006&mdash;SIG-Cred-template-page" loading="lazy" src="/content/images/2021/04/006---SIG-Cred-template-page.png#center"></p>
<p>Once we&rsquo;re done - We&rsquo;ll hit <strong>Save</strong>.</p>
<blockquote>
<p>Note: At time of writing, the &ldquo;Get Keys&rdquo; button only functions if you&rsquo;ve purchased your SD-WAN subscription with DNA Premier licensing. This license level includes Umbrella SIG, and allows this 1-click integration that pulls your Umbrella API keys automatically.</p></blockquote>
<h3 id="2b-creating-a-sig-tunnel-template">2b: Creating a SIG Tunnel Template</h3>
<p>Okay, next we&rsquo;ll need to create another feature template to specify our IPSec tunnel configuration.</p>
<p>Just like before, we&rsquo;ll head back over to <strong>Configuration &gt; Templates &gt; Feature &gt; Add Template</strong>.</p>
<p>This time, after selecting our device type, we&rsquo;ll choose <strong>Secure Internet Gateway (SIG) / WAN</strong> - which is located under the <strong>VPN</strong> header.</p>
<p><img alt="007&mdash;SIGWANTEMPLATE" loading="lazy" src="/content/images/2021/04/007---SIGWANTEMPLATE.png#center"></p>
<p>In the template configuration, we&rsquo;ll give the template a name &amp; description as always. Then we&rsquo;ll jump down to the tunnel config.</p>
<p>We&rsquo;ll select <strong>Umbrella</strong> for SIG Provider, then click <strong>Add Tunnel</strong>.</p>
<p><img alt="008&mdash;sig-tunnel-02" loading="lazy" src="/content/images/2021/04/008---sig-tunnel-02.png#center"></p>
<p>Within the tunnel config, we&rsquo;ll specify an interface name - I&rsquo;ll name mine <em>ipsec1</em> (and I&rsquo;ll create an <em>ipsec2</em> shortly). We&rsquo;ll also specify a <em>Tunnel Source</em>, which in my lab is <strong>ge0/0</strong> for the biz-internet VPN 0 interface.</p>
<p><img alt="008&mdash;sig-tunnel-03" loading="lazy" src="/content/images/2021/04/008---sig-tunnel-03.png#center"></p>
<p>We&rsquo;ll keep <strong>Data-Center</strong> as <strong>Primary</strong>, then click <strong>Add</strong>. Then - we&rsquo;ll add a second tunnel configuration, but using <strong>Data-Center</strong> as <strong>Secondary</strong> and the interface name as <em>ipsec2</em>.</p>
<p>When all that is done, we should have the following:</p>
<p><img alt="008&mdash;sig-tunnel-04" loading="lazy" src="/content/images/2021/04/008---sig-tunnel-04.png#center"></p>
<p>If we scroll down to the bottom of the template config, we&rsquo;ll have some settings for <strong>High Availability</strong>. Here, we&rsquo;ll specify what our active &amp; backup IPSec tunnels are, and their weights. I&rsquo;ll specify <em>ipsec1</em> as active &amp; <em>ipsec2</em> as backup. Then click <strong>Save</strong> to finish our template.</p>
<blockquote>
<p>Note: Weight settings are only available starting with 20.4.1 &amp; allow for ECMP routing to SIG. Not shown above, you can create up to four HA tunnel pairs. Depending on weighting, you can equal-cost or unequal-cost load balance between those pairs.</p>
<p>Why would you want to load balance across multiple tunnels? At time of writing, each IPSec tunnel is limited to a maximum 250Mb/s throughput. By creating multiple tunnels &amp; load balancing, we can overcome this limitation if we need higher bandwidth.</p></blockquote>
<h3 id="2c-attaching-sig-to-device-templates">2c: Attaching SIG to Device Templates</h3>
<p>After we&rsquo;ve built out our two SIG templates, we can now attach them to our device templates.</p>
<p>For me, I currently only have a single device template which is applied to all of my remote WAN edge devices.</p>
<p>So we&rsquo;ll go back to <strong>Configuration &gt; Templates</strong> and find whichever device template we want to use - then click the ellipsis on the far right, end select <strong>Edit</strong>.</p>
<p><img alt="009&mdash;edit-device-template" loading="lazy" src="/content/images/2021/04/009---edit-device-template.png#center"></p>
<p>In the device template, we&rsquo;ll scroll down and look for our <strong>VPN 0</strong> configuration under <strong>Transport &amp; Management VPN</strong>. We&rsquo;ll attach our SIG tunnel template to VPN 0, since that&rsquo;s where those IPSec tunnels are being sourced from.</p>
<p>On the right side, under <strong>Additional VPN 0 Templates</strong>, we&rsquo;ll click <strong>Secure Internet Gateway</strong> to add our template. Then from the drop-down, we can select the feature template we just created:</p>
<p><img alt="010&mdash;device-template-vpn0" loading="lazy" src="/content/images/2021/04/010---device-template-vpn0.png#center"></p>
<p>We&rsquo;ll also include our SIG credentials template, which we can find at the bottom of the page, under <strong>Additional Templates</strong>:</p>
<p><img alt="011&mdash;sig-cred-template-attach-1" loading="lazy" src="/content/images/2021/04/011---sig-cred-template-attach-1.png#center"></p>
<p>Once we&rsquo;re done, we can click <strong>Save</strong> at the bottom. This will take us through the process of pushing out these changes to our remote WAN edge devices. When this configuration is deployed, each vEdge will now reach out to Umbrella &amp; auto-configure an IPSec tunnel.</p>
<blockquote>
<p>Note: While the IPSec tunnels will be established when this configuration is pushed - no traffic will flow over them yet. We&rsquo;ll need to add a service route for that, which we&rsquo;ll do next!</p></blockquote>
<h3 id="2d-injecting-a-service-route">2d: Injecting a Service Route</h3>
<p>Now we have our IPSec tunnels deployed - all we need to do is start routing traffic out to Umbrella. We&rsquo;ll accomplish this using a service route on our LAN-side VPN.</p>
<p>So we&rsquo;ll go over to <strong>Configuration &gt; Templates &gt; Feature</strong> - and we&rsquo;ll scroll down &amp; find whichever template we&rsquo;re currently using on our LAN side. For me, I want VPN 10 to route over the tunnels, so I&rsquo;ll be editing my VPN 10 template.</p>
<p>Within the template, we&rsquo;ll scroll down to the <strong>Service Route</strong> section, click <strong>New Service Route</strong>, and we&rsquo;ll enter our desired prefix. This will be what traffic will be routed over the IPSec tunnel to Umbrella. Since this is intended to be an internet gateway, I&rsquo;ll enter 0.0.0.0/0 to inject a default route to Umbrella.</p>
<p>Service should be pre-selected as <strong>SIG</strong>, so we&rsquo;ll click <strong>Add</strong>, then <strong>Update</strong> &amp; deploy our changes to the remote edge devices.</p>
<p><img alt="012&mdash;service-route" loading="lazy" src="/content/images/2021/04/012---service-route.png#center"></p>
<h2 id="step-3-validation--troubleshooting">Step 3: Validation &amp; Troubleshooting</h2>
<p>Awesome! Now we should have everything configured &amp; working. So let&rsquo;s jump through some initial testing and validation we can do.</p>
<p>Within vManage, we can check the status of our IPSec tunnels. We&rsquo;ll go over to <strong>Monitor &gt; Network</strong> then select one of our WAN edge devices.</p>
<p>We&rsquo;ll click on the <strong>Interfaces</strong> tab on the left side - and we should be able to see a list of all interfaces on our device. This should include an ipsec1 &amp; ipsec2 interface.</p>
<p>I&rsquo;ve also selected the <strong>Real Time</strong> monitor on mine, and filtered to just show traffic on the ipsec1 interface:</p>
<p><img alt="013&mdash;monitor" loading="lazy" src="/content/images/2021/04/013---monitor.png#center"></p>
<p>You might recall from my topology above, that I have a linux VM running behind each of the two vEdge Cloud appliances. Using these, I can also test web access &amp; see what my external IP is:</p>
<p><img alt="014&mdash;linuxVM" loading="lazy" src="/content/images/2021/04/014---linuxVM.png#center"></p>
<p>And sure enough, I am getting a 146.112.x.x address - which belongs to the Umbrella datacenter.</p>
<p>If we log into one of our vEdge devices, we can check the routing table with <strong>show ip route vpn 10</strong> (or whichever VPN you&rsquo;re using for the LAN-side). We should see our default 0.0.0.0/0 route via ipsec1, with a next-hop-VPN of VPN0:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">vEdge-01# show ip route vpn 10
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">     ADDRESS               PATH             PROTOCOL          NEXTHOP  NEXTHOP                         NEXTHOP
</span></span><span class="line"><span class="cl">VPN  FAMILY   PREFIX       ID    PROTOCOL   SUB TYPE  METRIC  IFNAME   ADDR     TLOC IP  COLOR  ENCAP  VPN      STATUS
</span></span><span class="line"><span class="cl">------------------------------------------------------------------------------------------------------------------------
</span></span><span class="line"><span class="cl">10   ipv4     0.0.0.0/0    0     std-ipsec  -         0       ipsec1   -        -        -      -      0        F,S
</span></span><span class="line"><span class="cl">10   ipv4     10.2.2.0/24  0     connected  -         0       ge0/2    -        -        -      -      -        F,S
</span></span></code></pre></div><p>We can also check specifically our SIG tunnel status using the command <strong>show secure-internet-gateway tunnels</strong>:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">vEdge-01# show secure-internet-gateway tunnels
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">TUNNEL                                                        API   LAST
</span></span><span class="line"><span class="cl">IF                                                            HTTP  SUCCESSFUL     TUNNEL
</span></span><span class="line"><span class="cl">NAME    TUNNEL ID  TUNNEL NAME                     FSM STATE  CODE  REQ            STATE
</span></span><span class="line"><span class="cl">-------------------------------------------------------------------------------------------
</span></span><span class="line"><span class="cl">ipsec1  530233543  SITE200SYS10x10x10x235IFipsec1  st-tun-up  200   create-tunnel  -
</span></span><span class="line"><span class="cl">ipsec2  530233542  SITE200SYS10x10x10x235IFipsec2  st-tun-up  200   create-tunnel  -
</span></span></code></pre></div><p>In that output above, we&rsquo;ll see that we have both ipsec1 &amp; ipsec2 tunnels shown. The last API queries to Umbrella have a HTTP 200, which is good. We&rsquo;ll also see our tunnel names, which we can use to find our device tunnel configuration in the Umbrella dashboard.</p>
<p>The tunnel name might look like a mess at first, but it&rsquo;s a unique identifier to represent each tunnel that was created. So if we break it down for this vEdge:</p>
<ul>
<li>This vEdge is at Site ID 200
<ul>
<li>Shown as &ldquo;SITE200&rdquo;</li>
</ul>
</li>
<li>This vEdge has a system IP of 10.10.10.235
<ul>
<li>Shown as &ldquo;SYS10x10x10x235&rdquo;</li>
</ul>
</li>
<li>This vEdge has two IPSec interfaces, ipsec1 &amp; ipsec2
<ul>
<li>Shown as &ldquo;IFipec1&rdquo; and &ldquo;IFipsec2&rdquo;</li>
</ul>
</li>
</ul>
<p>If we jump over to the Umbrella dashboard, we&rsquo;ll see the same. Within the Umbrella dashboard, we can jump to <strong>Deployments &gt; Network Tunnels</strong>.</p>
<p>On this page, we should see a total of four tunnels listed (two from each vEdge appliance):</p>
<p><img alt="015&mdash;Umbrella-tunnel-status" loading="lazy" src="/content/images/2021/04/015---Umbrella-tunnel-status.png#center"></p>
<p>And with everything configured &amp; validated - now we can move onto configuring firewall and web filtering policies within Umbrella!</p>
<p>If you&rsquo;re interested in seeing how to configure Umbrella&rsquo;s cloud firewall &amp; web filtering policies - please check out my <a href="https://www.youtube.com/watch?v=kJwtIVp0-R4">YouTube Video</a> above!</p>
]]></content:encoded>
    </item>
    <item>
      <title>Privileged Access is Dangerous</title>
      <link>https://0x2142.com/privileged-access-is-dangerous/</link>
      <pubDate>Thu, 16 Jul 2020 18:02:27 +0000</pubDate>
      <guid>https://0x2142.com/privileged-access-is-dangerous/</guid>
      <description>My thoughts on the recent Twitter hack, and why access-control is important</description>
      <content:encoded><![CDATA[<p>This week at Twitter, there was a security incident that allowed access to a number of high profile accounts. The end result was a Bitcoin scam, with every account promising to &ldquo;double any BTC sent&rdquo; to them.</p>
<p>Twitter has come out fairly quickly to say that the incident was a result of social engineering. Someone convinced an employee at Twitter to hijack accounts via a backdoor administrative system.</p>
<p>What I wanted to focus on today is this: Why do backdoor systems like this exist - and how do we protect ourselves?</p>
<blockquote>
<p>We detected what we believe to be a coordinated social engineering attack by people who successfully targeted some of our employees with access to internal systems and tools.</p>
<ul>
<li>Twitter Support (@TwitterSupport)</li>
</ul></blockquote>
<h1 id="everything-has-a-backdoor">Everything Has a Backdoor</h1>
<p>If you think there isn&rsquo;t a backdoor way into a system, you probably just haven&rsquo;t found it yet.</p>
<p>From years as working in IT - one thing is certain: Someone controls the data. And that person(s) can do with it what they wish.</p>
<p>Are backdoors always a bad thing? Not inherently, no. We all want the convenience of being able to regain access to a locked account right? Then someone has to have the keys to override the system to make that change.</p>
<p>We all take our corporate email and domain logins for granted. Sure, we have a kind helpdesk employee that may help to reset a password - but how much access does that person have to our account? Even so, maybe we expect that in this case.</p>
<p>For example, there was a company I worked for a long while ago. HR/Payroll wanted to switch to using internal email to distribute paystubs. In order to do so, they required that every employee manually opt-in. None of the systems admins in the organization opted-in. We all knew how easy it was for any of us to read each others email. In fact, our internal security policy <em>required</em> any email containing sensitive information going in or out of the organization to be manually reviewed by someone. You know what qualifies as sensitive info? Payroll data.</p>
<p>Social media platforms (or any major website really) are no different. Someone needs to manage the backend systems. Someone has to be able to reset passwords &amp; assist those who use the platform. In this particular case, someone at Twitter had the ability to hijack accounts by changing email addresses &amp; resetting the passwords.</p>
<h1 id="what-about-mfa">What About MFA?</h1>
<p>MFA is like anything else in security - it&rsquo;s another layer, but it doesn&rsquo;t solve all problems.</p>
<p>MFA can protect you from someone who has your login credentials (username/password). If they don&rsquo;t have your token, phone, or whatever else you&rsquo;re using - they can&rsquo;t successfully authenticate.</p>
<p>That being said, if you already control the keys to the backend systems - bypassing or disabling MFA is just another click on your journey to taking over accounts.</p>
<h1 id="how-do-we-prevent-this">How Do We Prevent This?</h1>
<p>That&rsquo;s a good question. And a hard one to answer.</p>
<p>The general idea is to limit the amount of privilege that a single individual has. For example, if the average Twitter help desk employee is only responsible for resetting passwords - they shouldn&rsquo;t even have the option to disable MFA or change email addresses.</p>
<p>That being said - that&rsquo;s not always easy to accomplish. Systems need to be built around security and implement strict access control where necessary. Unfortunately we still live in a world where security is often an afterthought - or at least not designed into the solution on Day 1. That&rsquo;s not even considering that often security is still under-funded, and/or under-prioritized&hellip;.</p>
<p>Depending on the size of the organization, this control comes in many flavors. On the more strict side, we could have an administrative panel that is only accessible by high-level, trusted employees. Even then, we could implement a multi-step process by which a single employee could not make changes to sensitive accounts without secondary approval (or more). Going a step further - proper logging &amp; alerting may be triggered to alert someone that a change has happened, which prompts review to see if this was legitimate.</p>
<p>More commonly, what I see in organizations is just a simple policy. Yes, we acknowledge that you have unrestricted access to view/modify/delete customer data. But we have a <em>policy</em> that tells you not to.</p>
<p>The problem with that? One, it expects that most people read (and care about) the policies. I&rsquo;ve seen quite a number of organizations that hand you a huge pile of policies &amp; paperwork to review in your first week of employment. How many people truly take the time to read, review, and consider the content of those?</p>
<p>For two, a policy does nothing to prevent someone from taking action. Sure, fear of repercussion or losing a job may help. But if we&rsquo;re talking about a potentially malicious individual, those things likely do not concern them.</p>
<p>As another example, I&rsquo;ve previously worked at an organization with such policies. &ldquo;Don&rsquo;t look at customer data unless you have explicit approval from the customer&rdquo;. Okay, but the customer opened a support ticket because of some issue they&rsquo;re having. This issue sounds familiar and I can fix it real quick, if I just log into their tenant and make a change. OH. Whoops. I just saw sensitive data.</p>
<p>I wish I could say things like that never happened&hellip;</p>
<hr>
<h1 id="what-now">What Now?</h1>
<p>Well, now we wait.</p>
<p>Twitter has been fairly forthcoming with information so far. Yes, it&rsquo;s been vague - but that&rsquo;s to be expected while they pick up the pieces of what happened. The important thing is that they&rsquo;ve been steadily communicating what they <em>do</em> know so far.</p>
<p>Rumors are that an internal employee may have been paid to make changes to the accounts. I suppose we&rsquo;ll find out eventually - but if this is truly the case, there isn&rsquo;t much to be done.</p>
<p>One would hope that access to high-profile accounts would be restricted. One would hope that the people with that access are trusted, reliable individuals. Yet here we are.</p>
<p>It will certainly be interesting to see how much data Twitter releases about the actual events &amp; timeline. Preventing this from happening again will likely require further restricting access to those accounts &amp; possibly some form of the multi-tiered change approval mentioned earlier.</p>
<p>In the end - it sounds very likely this was an internal job. Those can be extremely hard to prevent, and require security training, additional security controls, etc. Even then - Humans create security controls, which means we also create ways to get around them.</p>
]]></content:encoded>
    </item>
    <item>
      <title>The Future Web: Privacy or Security (You Only Get One)</title>
      <link>https://0x2142.com/the-future-web-privacy-or-security-you-only-get-one/</link>
      <pubDate>Tue, 04 Sep 2018 10:00:06 +0000</pubDate>
      <guid>https://0x2142.com/the-future-web-privacy-or-security-you-only-get-one/</guid>
      <description>Sometimes it feels like technology advancement conflicts with trying to encourage security</description>
      <content:encoded><![CDATA[<p>With the release of Android 9.0 recently, Google enabled a big change for how user&rsquo;s can protect their privacy: DNS over TLS. While the concept isn&rsquo;t brand new, it also hasn&rsquo;t exactly exploded in usage either. This is going to start changing as Google rolls out the new version of their operating system that not only comes with the feature, but also enables it by default.</p>
<p>How does this actually protect user privacy? Best described in the intro to <a href="https://tools.ietf.org/html/rfc7858https://tools.ietf.org/html/rfc7858">RFC 7858</a>, DNS over TLS &ldquo;eliminates opportunities for eavesdropping and on-path tampering with DNS queries&rdquo;. Using the new standard, DNS queries of a client can be encrypted using TLS and tunneled directly to the DNS server. The intent is that monitoring of user activity becomes more difficult, since their DNS requests are no longer sent across the network in plain text.</p>
<p>It seems that DNS security has become a point of focus recently. Over the past year or so, we have seen two new big companies join the public DNS space: <a href="https://www.quad9.net/">Quad9</a> (backed by IBM) and <a href="https://www.cloudflare.com">CloudFlare</a>. Both companies advertise that they are focused on security and privacy of the individual user. They offer features like: blocking of malicious domains, DNS over TLS support, and limited historical logging of user requests. CloudFlare has even already <a href="https://blog.cloudflare.com/enable-private-dns-with-1-1-1-1-on-android-9-pie">posted steps</a> for enabling their DNS over TLS service with the new version of Android. For the end user, this is great - free services that offer better security and increased privacy. However, this can impact how businesses protect their users.</p>
<p>A lot of organizations use web filtering as an important step toward securing client traffic - which can be accomplished through DNS filtering and/or web proxies. These methods might be used for compliance reasons, malware/threat detection, or even just managers who want to monitor productivity. However, there are a few big changes happening in user security/privacy right now that begin to make that more difficult: Increased focus on DNS privacy and the recent release of TLS 1.3.</p>
<p>Years ago I used to work for a local government organization where security was a high priority for IT operations. Web access was extremely limited and configured to whitelist only for known sites that were business related. If you wanted general internet access, you had to log into one of two segmented computers that were dedicated to that purpose. Even still, our IT security manager had concerns on the potential for threats and/or data exfiltration via HTTPS-enabled websites. One of my projects was to tackle this problem by implementing SSL decryption on our web filtering platform. At the time, implementing a web proxy as a man-in-the-middle wasn&rsquo;t very complicated. Generate a CA cert for the proxy, distribute that cert to clients, then enable SSL decryption. Sure, there were bumps and hurdles - but the overall process achieved the result we were looking for.</p>
<p>The problem today is that newer standards and features (like TLS1.3, HSTS, or certificate pinning) are adding enhanced privacy features - which make that user data more difficult to reliably decrypt. That&rsquo;s good right? Well, maybe - but only for the user. As an organization trying to secure your systems and private information, these measures are making life a lot more difficult. Even as a network admin, it&rsquo;s become more difficult to troubleshoot web applications via packet captures. The use of ephemeral keys for TLS connections means that you can&rsquo;t decrypt the session even if you have the server-side private keys.</p>
<p>Now the addition of DNS over TLS give us more of the same problem. Even if you couldn&rsquo;t look into an encrypted web session, maybe you could gather what the destination is by reading the DNS requests. Instead, users now have the ability to encrypt their DNS queries, encrypt their web sessions, and make the life of a security admin a nightmare.</p>
<p>From the perspective of a corporate security team, the future is going to be more challenging (and probably for a lot more reasons than just this). However, I think that at some point we will have to reach a better balance of user privacy while still providing adequate security coverage. For some that might mean installing feature-heavy agents on every client device to inspect everything before it leaves the device. Or it might mean trying to rely on statistical, analytical, and behavioral data to detect patterns and anomalies (something like what <a href="https://www.cisco.com/c/en/us/solutions/enterprise-networks/enterprise-network-security/eta.html">ETA</a> is trying to accomplish) rather than just tearing apart the individual user sessions.</p>
<p>Whatever the solution ends up being, it should be an interesting area to watch develop. In the meantime, let&rsquo;s just agree not downgrade user security or privacy just to shove our security tools in. We&rsquo;re all users of some service or another, and we all have some expectation of privacy. Is it worth reducing security and increasing risk just to see if your employees are using their web access responsibly? Probably not. Instead it&rsquo;s time to look for new ways to solve this problem, and find ways to stay secure while still ensuring user privacy.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Thoughts on Cisco&#39;s 2018 Annual CyberSecurity Report</title>
      <link>https://0x2142.com/thoughts-on-ciscos-2018-annual-cybersecurity-report/</link>
      <pubDate>Wed, 21 Feb 2018 09:00:58 +0000</pubDate>
      <guid>https://0x2142.com/thoughts-on-ciscos-2018-annual-cybersecurity-report/</guid>
      <description>My thoughts on Cisco&amp;rsquo;s Annual CyberSecurity Report</description>
      <content:encoded><![CDATA[<p>When I started in networking, I never would have thought that security would be such an important part of my job. However, it has become something that I&rsquo;m involved with almost every day - tasks like applying security configurations, participating in audits, or spending a day chasing down the latest vulnerabilities. It&rsquo;s already become second nature to watch for what&rsquo;s new in the security realm, so that I&rsquo;ll be more prepared when someone asks about it.</p>
<p>Earlier today, Cisco released their <a href="https://www.cisco.com/c/en/us/products/security/security-reports.html">2018 Annual Cyber Security Report</a>. I&rsquo;ve spent some time digging through the report and thinking about what they&rsquo;ve written. It&rsquo;s interesting to read through the trends and survey results, and try to get an idea of where security efforts should be focused for the coming year.
This post is going to cover just a subset of what&rsquo;s in the complete report. I&rsquo;ll be covering the topics that I found particularly interesting, and give my own thoughts/views on them.</p>
<h2 id="the-encrypted-web-is-great-for-attackers">The Encrypted Web is Great&hellip; For Attackers</h2>
<p>Unsurprisingly, Cisco reports a growing trend in attacks and exploits that are taking advantage of encrypted transport. As a lot of large companies and Internet bodies are pushing for a 100% encrypted web, should we be surprised? Nah, it&rsquo;s the logical next step. Users want encryption because it means privacy - but that privacy also brings a method of concealing attacks.</p>
<p><img alt="image" loading="lazy" src="/content/images/2018/02/figure-1-volume-of-encrypted-traffic.png#center"></p>
<p>New exploits and malware are heavily leveraging encrypted transport to bypass all of the security we put in place to detect them. Typical defense technologies like intrusion prevention systems (IPS) are fantastic, but only when they can actually <em>read</em> the data. If a user download&rsquo;s malware through an HTTPS call, IPS won&rsquo;t usually catch it. And when that malware can now take advantage of SSL to reach back out to a command &amp; control server? Yeah, IPS might not help us there either.</p>
<p>There are technologies out there that allow enterprises to see this traffic - but maybe not enough of us are adopting it yet. A forward proxy for outbound web filtering is great. One that implements SSL decryption and inspection is even better. If your company isn&rsquo;t already decrypting outbound web traffic, then this needs to be a priority.</p>
<p>Inbound web traffic can be just as dangerous. New IIS vulnerability? Sure, let&rsquo;s grab the latest IPS signatures and &hellip; Oh wait, our IPS runs on our edge firewall, which sits in front of those web servers - which are all using SSL for encryption. That means any malicious traffic is going to slide right through our IPS undetected and land on our unpatched web servers. Get a Web Application Firewall (WAF), and let it front-end your SSL traffic. These things can be expensive and a nightmare to configure and tune properly, but right now they are one of your best options for inspecting web traffic.</p>
<h2 id="old-attacks-arent-going-away---theyre-just-getting-an-upgrade">Old Attacks Aren&rsquo;t Going Away - They&rsquo;re Just Getting an Upgrade</h2>
<p>This year&rsquo;s report highlighted that much of the older attacks are still here, and they&rsquo;re not giving up yet. Attacks via email are still present and doing more damage than you would hope. We&rsquo;re certainly getting better about implementing spam filters with reputation filtering, but attackers aren&rsquo;t giving up yet.</p>
<p>Email attacks are relying more on social engineering and targeted phishing. These messages are also utilizing SSL to encrypt the malicious links within the emails. Infected attachments are surprisingly still a big issue, with Microsoft Office and PDF files still being the worst offenders.
Just because attackers are finding new and exciting ways to hit us doesn&rsquo;t mean they&rsquo;re giving up on the tried and true methods. We still need to focus on all the standard attack vectors, like email. Implementing intelligent email/spam filters and providing user awareness training are the primary methods we have to combat this.</p>
<h2 id="the-cloud-is-secure-we-think">The Cloud is Secure! &hellip;We Think</h2>
<p>This one I found particularly fun. Out of all the companies surveyed by Cisco for this report, 57% of them said they believe the cloud offers better security. Wait - Did I misread that? More than <em>half</em>of respondents think that the cloud offers better security than their own infrastructure! This makes me wonder&hellip;</p>
<p><img alt="image" loading="lazy" src="/content/images/2018/02/figure-27-cloud-offers-security.png#center"></p>
<p>From my perspective, a cloud service provider is just another company. In most cases, they run just another network and hit a lot of the same challenges that non-cloud companies are facing. And we can only assume that cloud providers are prioritizing security and not just trying to turn a quick profit. Cloud companies have the advantage of being able to hire a dedicated security team that their customers can leverage. However, enterprises are complaining about lack of skilled security engineers, and I&rsquo;ll bet it&rsquo;s not because cloud providers are picking them all up.</p>
<p>Cloud definitely offers benefits - but this needs to be a well-calculated risk. For a smaller company without dedicated IT staff, a cloud solution would most likely offer security improvements over their own infrastructure. As companies scale, however, their security requirements do too. We need to make sure that the cloud providers we choose are also capable of adhering to those standards. Before you move to the cloud: ask questions about their security practices, get answers, and demand more information on the parts that are important to your business.</p>
<p>Another fun note from Cisco - some of the damage done by cloud providers is a simple mis-understanding of ownership. If you subscribe to a complete Software as a Service (SaaS) provider, chances are good that the provider worries about all of the critical security configurations. However, if you&rsquo;re going to a cloud provider just for infrastructure (like AWS), then you are likely responsible. In the case of AWS, you&rsquo;re being provided a server - and that&rsquo;s where Amazon&rsquo;s responsibilities end. It&rsquo;s up to the enterprise to still make sure that those servers are patched, hardened, and audited. Treat the cloud as an extension of your own infrastructure and polices, not a separate entity.</p>
<h2 id="diversifying-risks-maybe-not">Diversifying Risks? Maybe not</h2>
<p>It used to be a somewhat well-established security practice to use multiple vendors. Have a need for two sets of firewalls? Make sure you use two vendors, so that a vulnerability in one doesn&rsquo;t affect the other. Seems like sounds logic - until you have to train staff to be experts on multiple platforms, and keep up to date on all the latest patches from each vendor.</p>
<p>Cisco is finding that the more vendors a company has in their environment, the more problem we have maintaining everything. From my own experiences, I can say this is certainly a problem. In environments where I&rsquo;ve had up to four vendors for firewalls and switching, it becomes difficult to work with. It&rsquo;s hard on IT staff to maintain knowledge of configuration and best practices for each different vendor - and when a new vulnerability comes out, we end up spending way more time trying to track down each vendor&rsquo;s responses and patches.</p>
<p>It makes sense that companies who have a more tightly integrated infrastructure might have an easier time managing it. Cisco might want you to buy 100% into their ecosystem (of course), but I do think there is value in consolidating your infrastructure. One or two vendors will be much easier to establish relationships with than half a dozen of them. Your IT staff can dedicate their focus to mastering only a couple of technologies, rather than spreading themselves over a dozen different platforms. And when that new vulnerability is released? It should be much more straightforward to patch all of your systems quickly.</p>
<h2 id="theres-that-automation-thing-again">There&rsquo;s That Automation Thing Again</h2>
<p>I think we&rsquo;re finally beginning to reach a point where automation is really showing it&rsquo;s value in the security realm. A typical company is going to have so many different systems and alerts that it doesn&rsquo;t make sense for someone to manually review and act upon every one. This is where automation really begins to shine.</p>
<p>Cisco&rsquo;s report shows that more companies are relying heavily on automation. This can be used for alert response, reporting, and behavioral analytics. Especially when I keep hearing that there is a skills shortage in security, we need to take advantage of what automation can offer. This doesn&rsquo;t always have to be home-grown scripts either - there are a number of offerings already available.</p>
<p>Take a <a href="/you-should-automate-something-this-year/">second look</a> this year. Try to see where automation can fit into your infrastructure to help improve both operations and security.</p>
<hr>
<p>Thanks for reading! Just as a friendly reminder - All of the opinions stated in this post (and all others here) are 100% my own, and do not represent any vendor or employer. Since security has become more of an important part of my job, reports like this are always very interesting to read. I&rsquo;ve only covered a handful of what was in the report - just what was particularly interesting to me. If you&rsquo;re interested in reading more, check out the full report <a href="https://www.cisco.com/c/en/us/products/security/security-reports.html">here</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>What is Risk Acceptance?</title>
      <link>https://0x2142.com/what-is-risk-acceptance/</link>
      <pubDate>Wed, 14 Feb 2018 10:00:35 +0000</pubDate>
      <guid>https://0x2142.com/what-is-risk-acceptance/</guid>
      <description>Are all risks bad? If not, how do we determine what is acceptable?</description>
      <content:encoded><![CDATA[<p>You can&rsquo;t always get what you want. As an engineer though, it&rsquo;s your job to determine what&rsquo;s best for the company and recommend it to management. What happens if your suggestion gets turned down? Well certainly your proposal must have been mis-understood, right? Maybe the decision-makers don&rsquo;t truly understand the risk involved in <em>not</em> following your recommendation, whether that be financial, security, or otherwise. But maybe they do understand - and not only do they understand but they&rsquo;re willing to accept that risk.</p>
<p>Risk acceptance is something that I&rsquo;ve seen misunderstood by engineers over and over again. Especially when you&rsquo;re earlier in your career, you get the feeling that you know what you&rsquo;re doing - and therefore management should listen to you. I get it - I&rsquo;ve been there too. It can be hard to propose an idea, then have that idea immediately shot down by your peers or management. That&rsquo;s not to say that they <em>aren&rsquo;t</em> listening, but maybe you might not have a great view of everything behind their decision.</p>
<p>Let&rsquo;s take an example. As an engineer (server/network/security/etc), you&rsquo;ve been alerted by your vendor that there is a huge vulnerability in a critical business application. That vendor has been extremely proactive, and has promptly provided you with detailed KB articles and download links to the upgrade package. The vulnerability that&rsquo;s been disclosed certainly seems bad enough - it allows for remote code execution by an unauthenticated user. What do we do with this? Well we immediately meet with management to tell them that we need to patch this application immediately.</p>
<p>Their answer?</p>
<p><strong>No.</strong></p>
<p>Well that seems just impractical, doesn&rsquo;t it? They don&rsquo;t <em>really</em> want to leave the company at a massive risk to attack, do they? No - they certainly don&rsquo;t. However, it may be that management has chosen to accept the risk for one reason or another. Let&rsquo;s dig into a few reasons why they might:</p>
<p><strong>Expense (Money)</strong> - It could be that the cost to remediate the issue is significant. Maybe the software is a bit out-dated and the company hasn&rsquo;t paid for support. Renewing that support contract might be tens of thousands of dollars or more. If there are enough mitigating factors, that cost might not be worth it.</p>
<p><strong>Expense (Time)</strong> - People also cost money, and time spent on fixing this issue also means lost productivity on other tasks. For some enterprises, an upgrade of a critical business application could take months of work. What happens when this new version breaks compatibility with another business application? Well now we&rsquo;ve added on extra time so we can upgrade both. If there is no other value to the upgrade, then the fix might be held until there is.</p>
<p><strong>Mitigating Factors</strong> - There may be enough other security controls in the network to reduce risk. Maybe in this case only the core servers for this application are affected - and they reside on their own network segment behind a firewall. Maybe that firewall also runs an intrusion prevention system, which has already been updated with signatures to stop this particular attack. There could be a number of things going on which have given management the comfort that the system is still safe.</p>
<p>Any of these might lead to the final decision: we&rsquo;re going to live with this risk. By accepting it, we&rsquo;ve evaluated it, we&rsquo;re aware of it, and we are consciously choosing not to fix it. We may have limited the scope of this risk via other mitigations - but ultimately we are not completely ridding ourselves of this risk.</p>
<p>Does risk acceptance only apply to security? Nope. It applies to just about anything really. What if I recommend that we need to replace older hardware or risk network instability? That risk could be acceptable if the hardware isn&rsquo;t critical. Same thing goes if we decide to forego renewing support on a pair of firewalls. Maybe it&rsquo;s even suggesting an implementation of a new technology. Proposing to a big cloud provider that they should prepare for IPv6? There is a good chance they may still accept the risk of IPv4 depletion 🙂</p>
<p>As an IT engineer, it&rsquo;s not just our job to keep things running and get projects done - it&rsquo;s also our responsibility to keep the best interests of the business in mind when it comes to design, implementation, and maintenance. We need to evaluate all our options and always recommend what we think the best path is. However, we also need to respect that our recommendations may not always be followed. There may always be something else going on that we&rsquo;re not aware of.</p>
<p>One last piece of advice I can give - If there is ever something you feel very strong about, get the final decision in writing. If you truly feel that the risk is too great, and you&rsquo;ve made your pitch that has still been rejected - get the decision in writing (whether email, chat log, etc). This may seem silly at the time, but it&rsquo;s better to be safe. People forget, whether intentionally or not - and if the risk becomes a reality, you don&rsquo;t want to give them any reason to put the blame on you.</p>
]]></content:encoded>
    </item>
    <item>
      <title>What&#39;s wrong with VLAN 1?</title>
      <link>https://0x2142.com/whats-wrong-with-vlan-1/</link>
      <pubDate>Tue, 05 Dec 2017 09:07:06 +0000</pubDate>
      <guid>https://0x2142.com/whats-wrong-with-vlan-1/</guid>
      <description>&amp;ldquo;VLAN 1 is bad!&amp;rdquo; - I&amp;rsquo;m sure you&amp;rsquo;ve heard this before. Ever wonder why?</description>
      <content:encoded><![CDATA[<p>Earlier this year I was involved in a string of interviews for an open network engineer position. The questions and scenarios provided during the interviews were aimed for someone mid-level. One of the more basic-ish scenario questions I like to ask is the following:</p>
<blockquote>
<p>Given a brand new switch, can you provide me the commands you would use to configure the first four ports for hosts in VLAN 15?</p></blockquote>
<p>This question is always interesting because I get such a wide variety of responses. You can certainly filter out people quickly who have never touched a switch. Some people will start with <code>conf t</code>, while others just jump straight into setting the VLAN tag. Some people specify that they&rsquo;ll use an <code>interface range</code> command, while others get confused and want to configure the ports as a trunk. In fact, during this year&rsquo;s interviews I had quite a significant number of people who completed the scenario by providing the commands to configure a trunk port, instead of static access. One thing that struck me as noteworthy is that the people who did this also provided the commands they needed to change the default native VLAN.</p>
<p>For a vast majority of networking devices (maybe all of them), the default/native VLAN for a trunk port is VLAN 1. This is not the best configuration for reasons we&rsquo;ll get into a bit later - but unfortunately it needs to be manually changed. In every interview where the candidate suggested this be changed, I followed up with asking why. I asked so that I can find out two things: How well the individual is at explaining concepts, and whether or not this is something they just do because they were taught or if they actually <a href="/how-to-improve-stop-doing-start-understanding/">understand</a> the logic behind it. Surprisingly, a vast majority of the candidates could only provide the reasoning that &ldquo;Well, VLAN 1 is bad&rdquo; - but they couldn&rsquo;t elaborate on why.</p>
<h2 id="so-why-is-vlan-1-bad-to-use">So why is VLAN 1 bad to use?</h2>
<p>Technically, VLAN 1 itself isn&rsquo;t the problem. The concept of a <em>default VLAN</em> allows for someone to attack a network by taking advantage of how switches use a default VLAN. Since VLAN 1 is typically set as the default for most vendors, then it becomes a well-known configuration for attackers to abuse. If every vendor had set the default native VLAN to 52, then we would still run into the exact same problem except the &lsquo;bad&rsquo; VLAN would be 52.
So let&rsquo;s back up just a little here and explain a bit of background. The concept of a VLAN is a segmented logical network. Rather than requiring a different piece of physical hardware to keep hosts separate, we can assign them into different virtual LAN segments. This is accomplished by &rsquo;tagging&rsquo; each Ethernet packet with a VLAN ID. Internally, the switch code does not allow packets that contain one VLAN ID tag to be sent to hosts configured with a different VLAN ID tag.</p>
<p>Let&rsquo;s look at a few practical examples of how this works. When you configure a host port, you would configure the switch with the appropriate VLAN ID tag that the host should be assigned to. The actual server may know nothing about the VLAN it is in, but the switch knows to inject that VLAN tag into the Ethernet headers of every packet received from that server. For the rest of that packet&rsquo;s life on the network, every switch reads that VLAN tag to assist in forwarding decisions. Trunk ports are commonly used between switches, and these ports are enabled to carry multiple VLAN ID tags. The problem here is that each switch is expecting that the packets it receives already contain a VLAN tag in the Ethernet header.</p>
<p>So whats the problem with the default native VLAN? This is a special type of VLAN in which the switch <em>never</em> attaches a VLAN tag to the headers. Whenever we connect two switches via a trunk port, we are likely configuring multiple VLANs that need to cross that link. However, the switches themselves still need to communicate directly with eachother (for protocol negotiations/spanning-tree), and each switch isn&rsquo;t necessarily going to know what VLAN the other wants to use for this management traffic. This is where the concept of a native VLAN comes in. For every configured trunk link, each switch has a default native VLAN for which it expects to receive packets with no VLAN tag headers. Even though normal network traffic crossing a trunk link is going to require a VLAN tag in the headers, the switch-to-switch control-plane communication is sent with no header present.</p>
<p>This is where VLAN 1 becomes a problem because of the native VLANs are processed/interpreted by the switch. Whenever a switch receives a packet which contains the VLAN ID set to the native VLAN, it knows that packet doesn&rsquo;t need to contain a VLAN header - so it <em>removes</em> the VLAN ID header.</p>
<p>How could this be exploited? Well for example, let&rsquo;s say that we had a network where every developer PC was using a trunk port and permitted to use VLAN tags. This might be so they could run local VMs for testing that connect to both the DEV and QA networks. If we leave the default native VLAN as 1, then a malicious developer could exploit this to gain access to another segment. This is accomplished by using a software package to double-tag an Ethernet packet with two separate VLAN ID headers. The first VLAN tag header will be set to the native VLAN (VLAN 1), and the second header will be set to the target VLAN - let&rsquo;s say we use VLAN 20 for the accounting network. When the switch receives the packet across the trunk link, it will read the Ethernet headers. When it processes the first VLAN tag and sees that it matches the default native VLAN, the switch strips this header - which then leaves the second VLAN tag header for VLAN 20. When the switch goes to forward this traffic to it&rsquo;s destination, the remaining VLAN header will allow the packet to bypass any security measures and be directly forwarded on VLAN 20.</p>
<p>Well what if we don&rsquo;t provide end users with a trunk port? Could they still execute this type of attack? Remember that the default switchport configuration allows for dynamic negotiation - where the connecting computer can tell the switch whether or not it needs an access port or a trunk port.</p>
<h2 id="if-vlan-1-is-well-known-as-the-default-what-should-the-native-vlan-be-set-to">If VLAN 1 is well-known as the default, what should the native VLAN be set to?</h2>
<p>Anything you like! The key thing is that it should be a VLAN which has no access to any network resources - so it should be a VLAN with no hosts and gateway. I usually don&rsquo;t even create the VLAN on the switch itself, therefore immediately black-holing all traffic sent to that VLAN.</p>
<h2 id="how-else-can-this-be-prevented">How else can this be prevented?</h2>
<p>Always statically set your end user ports <code>to switchport mode access</code>, and enable <code>switchport nonegotiate</code>. This will prevent the switch from allowing port negotiations, which prevents a user from tricking the switch into assigning a trunk port.</p>
<p>Newer Cisco switches also support a global configuration command: <code>vlan dot1q tag native</code>. This command will force the switch to require VLAN tags to be present on packets in the native VLAN. See more detail <a href="https://www.cisco.com/c/m/en_us/techdoc/dc/reference/cli/nxos/commands/l2/vlan-dot1q-tag-native.html">here</a>. This will need to be configured on all switches in your network to be effective.</p>
<hr>
<p>Do you change the native VLAN in your network? Or is it not a big security concern for you? Comment below!</p>
]]></content:encoded>
    </item>
    <item>
      <title>How to Improve: Stop Doing, Start Understanding</title>
      <link>https://0x2142.com/how-to-improve-stop-doing-start-understanding/</link>
      <pubDate>Tue, 28 Nov 2017 08:07:54 +0000</pubDate>
      <guid>https://0x2142.com/how-to-improve-stop-doing-start-understanding/</guid>
      <description>The best way to truly understand a technology is to dig deeper than surface-level configurations</description>
      <content:encoded><![CDATA[<p>There is a key to being successful at just about any IT job: Stop just doing work, and start understanding what you&rsquo;re doing. Might seem like an odd thing to say right? But this is something that I have seen confuse engineers at earlier points in their careers.</p>
<p>In a lot of jobs, the initial training you receive is fairly straightforward. You are usually taught how to respond to a task by following a series of steps to get an intended result. Training like this is great - It helps to achieve consistency and efficiency. You bring in any new person and give them the exact same troubleshooting steps, implementation steps, and/or validation steps - and you&rsquo;re likely to get a similar result every time.</p>
<p>This is the point where I have seen far too many people stop though. They are happy with doing their job, and don&rsquo;t necessarily want to progress their career or maybe they don&rsquo;t know how. These engineers will continue to produce decent work at the quality that they were taught at. Even for those who try and progress further (maybe through certifications or otherwise), there is a difference between learning new technologies/concepts and truly understanding them. For some people out there, having this basic level of skill is all they really want - and if that&rsquo;s their goal in life, then this type task-based knowledge is perfect. But if you really want to master the domain of technology that you are interested in, then you need to put forth the time and effort into gaining that understanding.</p>
<p>For me, a true understanding of a technology means that you&rsquo;re able to speak confidently about how something works, abstract concepts to apply to similar products, and mentally walk though how the technology might handle a given situation.</p>
<p>Let me provide an example or two that might help to frame this a bit better. Given a particular network, an engineer might know that for traffic to get from point A to point B, it travels through two firewalls. Every time there is a new request to permit a new traffic flow, that engineer knows that they must make a configuration change to one or both of those firewalls to allow that traffic through. However, to this engineer, the inner workings of that firewall are a complete mystery. The firewalls are complete black boxes which take in traffic through one interface and spit it out another. So when there is a technical issue within the firewall appliance, they may be extremely limited in their troubleshooting abilities - and they may have no choice but to call the vendor for support.</p>
<p>Another engineer who has a deeper understanding of how firewalls work might see the problem differently. This engineer knows that for every packet received, the firewall follows a specific flow of processing. That flow could include any number of things, including NAT, routing, firewalling, IPS, VPN, etc. This engineer knows which order those things get processed and what effects those processes can have on the traffic. So when we have a technical issue with this firewall appliance, this engineer may be able to mentally walk though the packet flow/processing and determine where the problem may be - sometimes without even looking further than general log files.</p>
<p>Another example is something that I see quite often. An engineer is asked to implement something - let&rsquo;s say a new port configuration for a server. They follow their known process for implementing this change, but something doesn&rsquo;t quite work right. So they change settings or maybe delete the entire port configuration and start over - but eventually they get it working. They don&rsquo;t know why it didn&rsquo;t work the first time, or what caused it to work the second time - but it works now, so they aren&rsquo;t concerned with it. However, it&rsquo;s possible this engineer ends up running into this same problem more than once. The ideal step here would be to step back and look at what was different between the original configuration and the working configuration. Maybe there is an additional command in the original configuration which seems suspect - a quick search of the internet could turn up an explanation behind why that command was preventing the port from working as expected. After that research, that engineer would not only know why their configuration didn&rsquo;t work - but now they know what that command actually does, which could be beneficial in a future scenario.</p>
<p>As I briefly mentioned earlier, not all IT admins or engineers are concerned with gaining a significant level of understanding. There are those who want to come to work, get their job done, then go home to their families - and there is absolutely nothing wrong with that. For me personally, I can&rsquo;t handle running into a problem and not knowing exactly what the cause was. An issue that &ldquo;fixes itself&rdquo; is never an acceptable answer to me, because if something caused the problem once then it can certainly happen again. I don&rsquo;t enjoy having to blindly configure an option on a system without knowing what&rsquo;s going on in the background. Some people might call me crazy, but this seems to be a skill/trait shared by many higher-level engineers I have worked with.
So how do you get to a point where you really understand a system? For me, it&rsquo;s been a lot of playing in labs, reading vendor documentation, and not settling until I feel like I can speak confidently to how something works. I never feel truly comfortable in a new company until I can mentally walk through every device a packet touches from source to destination - and know which devices configs/routes may have an impact on that flow. Any time there is a problem with something, I spend time digging into it until I know what caused it - even if the problem is only momentary and goes away. Not only do I then understand why the problem happened, but I also learn how to quickly identify similar issues again.</p>
<p>Especially if you&rsquo;re still in the beginning stages of your career, I can&rsquo;t stress enough how important it is to understand the technologies you&rsquo;re responsible for. Take the extra time and study it, play with it, break it and fix it again. Know how things work and what their behaviors are under different conditions. Don&rsquo;t settle for &ldquo;It just works because it does&rdquo;. One of the key skills I&rsquo;ve seen in engineers who truly understand their domain of technology, is the ability to abstract concepts to apply to other systems. Someone who has a deep understanding of routing and switching technologies might prefer to work with a certain vendor, but given any router/switch they can make it work.</p>
<p>Have you worked with anyone who you think has a great understanding of what they do? What other skills or traits do they display that makes them successful? Comment below!</p>
]]></content:encoded>
    </item>
    <item>
      <title>What&#39;s Going Out of Your Network?</title>
      <link>https://0x2142.com/whats-going-out-of-your-network/</link>
      <pubDate>Tue, 21 Nov 2017 08:00:53 +0000</pubDate>
      <guid>https://0x2142.com/whats-going-out-of-your-network/</guid>
      <description>Ever consider enabling firewall filtering for outgoing traffic from your network? Let&amp;rsquo;s look at why that could be interesting&amp;hellip;</description>
      <content:encoded><![CDATA[<p>Over this past weekend I purchased a few upgrades to my home network/lab. One of which was upgrading my older Ubiquiti 802.11n wireless access point to the newer 802.11ac model they have out. The other purchase was a new external firewall. I had previously been running on a Cisco ASA5505, but the device is older and doesn&rsquo;t support some of the newer features I would like to play with. In addition, in my current job I no longer support Cisco firewalls. So I bought a <a href="https://www.amazon.com/gp/product/B01ICEO2U4/ref=as_li_qf_asin_il_tl?ie=UTF8&amp;tag=0x2142-20&amp;creative=9325&amp;linkCode=as2&amp;creativeASIN=B01ICEO2U4&amp;linkId=35fbe8300af4e5d1e26e7a860782b3ca">Juniper SRX300</a> - which should allow me to play with some new features I want, plus it can be a playground for testing things I want to do at work.</p>
<p>Anyways - after I cut over to my new firewall, I&rsquo;ve been digging through logs to make sure that I didn&rsquo;t miss anything. I have all of my device/lab logs going into an instance of Splunk Light (their free product). It makes it easy to collect and search through logs, and it&rsquo;s extremely easy to set up and use. A few quick queries and I came across one or two minor things that needed to be tweaked on my firewall - but I also saw some traffic that I wasn&rsquo;t sure about.</p>
<p>So that brings me to my question of the day: Do you know what&rsquo;s going out of your network?</p>
<p>A lot of people I know only use firewalls to block inbound access, both in homes and businesses. For homes it&rsquo;s more understandable since most average people aren&rsquo;t network admins. However, it still surprises me how many businesses are willing to add a &lsquo;permit any any&rsquo; out to the internet. Yes, I block all traffic by default through my home firewall, both inbound and outbound. Yes, it&rsquo;s a bit of a pain sometimes when something isn&rsquo;t quite working right - but it&rsquo;s usually a quick ACL change, and overall I would rather take the minor inconvenience for the security gains.</p>
<p>When I originally built the firewall policy for my network, I started off simple. I know we need DNS, HTTP, and HTTPS outbound - easy enough, right? Then I started watching logs for blocked traffic and trying to decipher what else was trying to communicate outbound using another port. Some things were very easy to determine - TCP 5228 out to a Google owned IP? Yep that&rsquo;s actually a known thing - a lot of Google services, like Chrome, will use this. Some other things were harder to figure out - like game consoles which use a very wide range of non-standard ports. Many of these weren&rsquo;t really documented well by the console manufacturer, and meant that I spent a while between browsing forums and some trial and error.</p>
<p>This really gets interesting when you start digging past the stuff you know about. What about a PC in my home network that is trying (and getting blocked) to reach a few random IPs in Korea and Russia over a bunch of non-standard TCP ports? Yeah that doesn&rsquo;t make me feel comfortable. Could it be a legitimate application, or is it malware? A few quick searches on the internet don&rsquo;t turn up anything immediately helpful. For the time being, I&rsquo;ll keep stuff like this blocked until I have time to spin up some packet captures to see what this traffic is actually doing.</p>
<p>For a business I feel like this type of thing is even more important than just what I&rsquo;m doing at home. You certainly don&rsquo;t want end users (or servers) possibly running strange applications, which might be transferring data to some unknown external party. It seems like larger companies seem to have a better handle on restricting outbound access than most smaller companies, who likely don&rsquo;t have the time or see the value. However, I&rsquo;ve also worked with a few larger organizations who still permit all user and server traffic out to the internet with no filtering in place.</p>
<p>If you&rsquo;re not already blocking outbound traffic - Get some good logging in place. Use something like Splunk Light and start collecting firewall logs for everything going out of your environment. Start with the basics - create a list of the software/ports you know you&rsquo;ll need to open. After a few weeks, start digging through the logs to figure out what else might need to be added to your list. Once you feel comfortable that you&rsquo;ve compiled a sufficient base ruleset, schedule a time to make the change and put it in place. Start blocking the unknown traffic - and only permit when necessary.</p>
<p>How do you have your firewalls configured today? Do you permit everything or are you very restrictive? Comment below - I&rsquo;m curious to see what other people are doing.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Quick Tips for Better BGP</title>
      <link>https://0x2142.com/quick-tips-for-better-bgp/</link>
      <pubDate>Tue, 02 May 2017 10:26:42 +0000</pubDate>
      <guid>https://0x2142.com/quick-tips-for-better-bgp/</guid>
      <description>A lot of BGP setups I run into are bare-bones, but there are a few quick ways to improve your configurations</description>
      <content:encoded><![CDATA[<p>A while back I wrote some basic information on how to get started implementing <a href="/bgp-getting-started-with-multi-homed-internet">multi-homed internet using BGP</a>. The details and configurations listed in that post are enough to get the connection up and running - but not quite in an ideal state. So today I want to share some quick tips that will help you maintain a better and more secure BGP connection.</p>
<h2 id="securing-your-bgp-peeringknow-who-youre-connecting-to">Securing your BGP peering (Know who you&rsquo;re connecting to)</h2>
<p>BGP is a little different from most other routing protocols, since it uses a single unicast TCP connection between peers to exchange routing updates. Lucky for us, that means that we can easily filter traffic from only known peers. Once you have direct connectivity up between your edge router/firewall and your direct peer, lock down that connection with an ACL. Permit TCP port 179 traffic <strong>ONLY</strong> from your directly connected peer IP - no one else.</p>
<p>While you&rsquo;re at it, let&rsquo;s take it another step further: Request that your ISP set up BGP authentication. Sure, a majority of BGP implementations today still require use of MD5 for auth (which is terrible) - but some authentication is still better than none. This can usually be arranged at the time of turning up peering. Both sides configure the same authentication password and with any luck the peering still establishes.</p>
<p>BGP by nature is unfortunately not the most secure protocol - but a few simple steps like this will help ensure you&rsquo;re only connecting out to authorized peers.</p>
<h2 id="route-filtering-dont-trust-anyone">Route filtering (Don&rsquo;t trust anyone)</h2>
<p>Usually when you&rsquo;re filling out the BGP peering paperwork for your service provider, they will ask you what kinds of routes you want. In most cases, you should be able to request one of the following:</p>
<p><strong>Default only</strong> - Exactly what it sounds like. Your provider will only advertise a route for 0.0.0.0/0. In many cases, this is probably what you&rsquo;re going to want. With this type of advertisement, each upstream provider will just give us the same default route to the internet. From there we can weight which one we want to use, and traffic will automatically fail-over to the secondary connection should the primary fail.</p>
<p><strong>Partial</strong> - If for any reason you want to weight routes to certain destinations differently, then we might request this. In this case, you&rsquo;re probably going to still receive 0.0.0.0/0 plus any specific routes you ask for. A good example of this is if we wanted to specifically manipulate routes for a remote office we have. Maybe we want to weight Internet traffic for one uplink, and VPN traffic to a remote office on the other uplink.</p>
<p><strong>Full</strong> - In 99% of typical business cases, this won&rsquo;t be required. This option means the upstream providers will be dumping the <em>entire</em> Internet routing table on you. While this offers you a ton of control over path manipulation, it also requires significant memory resources on your routers in order to maintain that routing table.</p>
<p>After we figure this out, the next step is to make sure we are filtering the routes we accept from the upstream provider. Wait - didn&rsquo;t we just tell them exactly what routes to send us? Why do we need to filter them? Well you can never be too safe here - and we would rather perform an unnecessary filtering than have an ISP accidentally misconfigure route advertisements. So if you&rsquo;re only expecting a route for 0.0.0.0/0, then filter your inbound route advertisements so you only accept that route.</p>
<p>Same thing goes for outbound route advertisement  - if we own a /24 of public IP space, then we only want that range to be advertised out. Some providers may already filter this on their end, but again it doesn&rsquo;t hurt here to be extra cautious. If we are accepting anything other than a default route from our provider, then we run the risk of leaking those additional routes between the two providers - which would lead to inadvertently becoming a transit AS. Chances are pretty good that you don&rsquo;t want that, so make sure you configure filtering for all outbound route advertisements.</p>
<h2 id="minimumadvertisement-oh-no-we-have-to-re-address-everything">Minimum Advertisement (Oh no, we have to re-address everything)</h2>
<p>I mentioned this in the original post - but typically when you are peering with two separate upstream providers, you need to advertise no less than a /24. We ran into this at my last job, where we had been provided a /25 by AT&amp;T but we needed to bring in a second carrier via BGP. The reasoning behind this is to keep global routing tables as small as possible, by not allowing them to end up flooded with a ton of routes for smaller subnets. It makes sense, but on the other hand I feel like requiring a /24 in all cases can be a bit wasteful. My last job only required maybe 30 publicly addressable hosts - which meant that the remaining addresses went unused.</p>
<p>At any rate - should you find yourself in this scenario then you&rsquo;re going to have to face the inevitable: Renumbering into a new IP space. Any time you have to do this, it&rsquo;s going to be a bit of a pain - but for external addressing like this it might be easier. So in our case, the entire /25 space was hosted on our external firewall then NAT&rsquo;ed into DMZ servers.</p>
<p>Here is the quick steps that I used to do a side-by-side migration without taking any significant downtime:</p>
<ul>
<li>Get the new subnet up and running - assign the interface addresses on your firewall and BGP up and running</li>
<li>Assign new IP addresses to all of your existing services</li>
<li>Configure NAT rules for the new external IP addresses to the DMZ hosts - while leaving the existing NAT rules for the old subnet (Also make sure your firewall rules permit the same traffic to either IP)</li>
<li>Migrate DNS entries externally to point to the new IP space</li>
<li>Once traffic stops flowing to the old IP, remove the old NAT</li>
</ul>
<p>As a side note - if you procure redundant internet connections through the <em>same</em> upstream provider, then you might be able to work out something else. They may be able to provide you a private ASN to use, and they will likely accept any minimum advertisement - since they will be summarizing upstream within their network anyways.</p>
<hr>
<p>I had a few more things I originally intended to cover here - but it seems that these topics are filling way more space than I thought they would. Specifically, I&rsquo;m thinking about a dedicated post to BGP path manipulation - which is probably something you&rsquo;re going to want to implement after peering is established.
Hopefully these tips help! If you have any questions, throw them in the comments below.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Port Security: Worth the effort?</title>
      <link>https://0x2142.com/port-security-worth-the-effort/</link>
      <pubDate>Tue, 14 Mar 2017 08:00:40 +0000</pubDate>
      <guid>https://0x2142.com/port-security-worth-the-effort/</guid>
      <description>An exploration of practical applications of port-security configurations, based on my past experiences</description>
      <content:encoded><![CDATA[<p>Port Security. Always seems like one of those things covered in Cisco exams, yet how many businesses actually use it? For those that aren&rsquo;t implementing it, should they? Or is it too much of a headache?</p>
<p>So the concept of port security is fairly simple - We want to secure each individual switch port to a physical layer 2 MAC address, or at least limit how many unique MAC addresses might be learned on an individual port. The technology could be used to just limit the number of simultaneous devices on a port - by just setting a MAC threshold. Or we can also take it to the extreme and lock down each port to a hard-coded MAC address - which will never allow another device to connect. You might be thinking that the second method is absolutely ridiculous, but it really depends on the business needs.</p>
<p>First, let&rsquo;s take brief look at the typical port security configuration and some of the options available.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">SecureSwitch(config)# interface x/x  ! Whichever interface we want to lock down
</span></span><span class="line"><span class="cl">SecureSwitch(config-if)# switchport port-security max xx  ! Max number of MAC addresses that can be learned
</span></span><span class="line"><span class="cl">SecureSwitch(config-if)# switchport port-security violation xxxxx  ! Choose to either restrict or shutdown the port (description below)
</span></span><span class="line"><span class="cl">SecureSwitch(config-if)# switchport port-security  ! This actually enables the port security config
</span></span></code></pre></div><p>Fairly straight-forward, right? We choose a port (or you could do a range) and set a few options. The default number of MAC addresses able to be learned on a port is 1, so it&rsquo;s likely you&rsquo;re going to want to change this - unless 1 is all you need. Port security can only be enabled on <strong>access ports</strong>, so 1 MAC address works in most cases  - except where you have a PC daisy-chained off of an IP phone (in which case this will need to be set to 2 or 3).</p>
<p>Next we set our preferred violation action. This step is pretty important because it defines what happens when the port exceeds it&rsquo;s MAC count. <strong>Restrict</strong> is the passive approach. If we have two PC&rsquo;s plugged into a single access port (maybe using an unmanaged switch), then the second PC will just never be able to work as long as our max MAC limit is 1. The first PC to connect will be fine, and the switch will log a message and send an SNMP trap when the second MAC is picked up. <strong>Shutdown</strong> is the more forceful approach. Once that second MAC address turns up on the port, the switch puts the port in an err-disabled state - which shuts down the port to all traffic. This event is also logged and generates an SNMP trap - however the port will not come back online until an administrator manually re-enables it.</p>
<p>Now that we see a basic config, let&rsquo;s take a look at a few different use cases for this feature. In one of my previous jobs, I worked as a network admin for a local government organization. Port security configuration in that environment was <em>extremely</em> strict. Each switchport was configured to permit only one MAC address, shutdown upon violation, and the <code>switchport port-security mac-address sticky</code> command was also used. This command takes the first MAC address learned on the port and commits it to the running configuration, which means that this MAC is essentially hard-coded to be the <strong>only</strong> MAC permitted on the port. So in this environment, a single PC was tied to a single port - nothing else could ever be plugged into that port without either shutting down the port or administrator intervention. In a government office, this was absolutely necessary because every device on the network needed to be tracked and personal devices were not permitted to be connected. We needed to know if anything was ever plugged in that wasn&rsquo;t an authorized device - so manual intervention and investigation was a requirement.</p>
<p>In a more typical office environment - port security configurations can just be a good security practice without going overboard with it. We never want a user to plug in a rouge switch into our network without our knowledge, right? So maybe we assume each user has an IP phone and PC, and limit the port to 2 MAC addresses. In this case, we can go ahead and just set the port to restrict. We don&rsquo;t want to prevent the user from working if a port violation occurs, nor do we want to spend time resetting the port for them - but we might still want to be notified, especially if it happens often. In addition, port security is an excellent way to secure ports public areas. For example, maybe we have an IP phone or kiosk PC in our lobby. These need access to the network, but we don&rsquo;t want anyone to be able to unplug that device and gain access into our network. In cases like this, it would actually make sense to have the switch only permit access from that single MAC address.</p>
<p>Outside of the &lsquo;practical&rsquo; use cases, there is also the strictly security side of things. I&rsquo;ve touched on a few considerations already - but there are also certain types of attacks that can be defeated by port security. One of those would be exhausting the CAM table resources. A malicious person could use publicly available tools to spoof MAC addresses in the packets they send to the switch. Tools like this force the switch to learn hundreds of thousands of MAC addresses, which eventually will overload the CAM table. When a switch CAM table becomes full, the switch begins flooding packets out all interfaces. This is because the switch can no longer assign mappings between MAC addresses and the ports they originate from - so the switch has no choice but to flood everything and hope the correct recipient receives the data. For the attacker, this means they can run a packet capture on the port and collect information they wouldn&rsquo;t have otherwise needed to. This scenario could be prevented by implementing port security, which could simply restrict the number of MAC addresses learned off of any individual interface.</p>
<p>Port security configuration can be implemented in a few different ways depending on your use case. Overall though, it can prove to be a useful way to help implement security controls on your network.  What do you think about port security? Extremely useful or does it just get in the way? Comment below and tell me how you have implemented it!</p>
]]></content:encoded>
    </item>
  </channel>
</rss>
