<?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>Projects on Edbro.net - A Cybersecurity Blog</title>
    <link>https://edbro.net/tags/projects/</link>
    <description>Recent content in Projects on Edbro.net - A Cybersecurity Blog</description>
    <image>
      <title>Edbro.net - A Cybersecurity Blog</title>
      <url>https://edbro.net/images/edbro</url>
      <link>https://edbro.net/images/edbro</link>
    </image>
    <generator>Hugo -- 0.147.7</generator>
    <language>en</language>
    <lastBuildDate>Sun, 13 Nov 2022 13:01:14 +0100</lastBuildDate>
    <atom:link href="https://edbro.net/tags/projects/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Connecting a MikroTik AccessPoint to RouterOS via CapsMAN</title>
      <link>https://edbro.net/posts/connecting-a-mikrotik-accesspoint-to-routeros-via-capsman/</link>
      <pubDate>Sun, 13 Nov 2022 13:01:14 +0100</pubDate>
      <guid>https://edbro.net/posts/connecting-a-mikrotik-accesspoint-to-routeros-via-capsman/</guid>
      <description>&lt;p&gt;After getting tiered of the shortcomings of commercial network equipment I decided to invest in some professional devices. However, investigating the different brands are even more difficult than for commercial products. In the end I decided to go for &lt;a href=&#34;https://mikrotik.com&#34;&gt;MikroTik&lt;/a&gt;, due to their small office offerings. The devices are great and when first connecting to them you realise their potential through the sheer volume of configuration. As expected you need to design and configure you network to get it to work at all. This made me realise that I have not touched professional network equipment since university, and that was Cisco equipment. To my dread I could not find a good guide on how to configure a simple network with my equipment, so after finishing this is my guide.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>After getting tiered of the shortcomings of commercial network equipment I decided to invest in some professional devices. However, investigating the different brands are even more difficult than for commercial products. In the end I decided to go for <a href="https://mikrotik.com">MikroTik</a>, due to their small office offerings. The devices are great and when first connecting to them you realise their potential through the sheer volume of configuration. As expected you need to design and configure you network to get it to work at all. This made me realise that I have not touched professional network equipment since university, and that was Cisco equipment. To my dread I could not find a good guide on how to configure a simple network with my equipment, so after finishing this is my guide.</p>
<h2 id="goals">Goals</h2>
<p>When setting up our network we have a couple of goals. Namely we want a stable network where we can plug in wired devices, as well as connect via Wi-Fi. For now we are happy with creating a single wireless network that all devices connect to, and that is not separated from the wired network. However, it would be possible to create a secondary guest network, separated from our trusted devices.</p>
<p>In addition to the main goal the network should be as easy to maintain as possible. The less configuration that can break the better, and the more resilient it is to changes the better.</p>
<h2 id="equipment-and-terminology">Equipment and Terminology</h2>
<p>Due to the configurability of the RouterOS firmware (the firmware used by MikroTik devices) this guide will likely be applicable for other devices as well. However, it is only tested with my setup of a <a href="https://mikrotik.com/product/RBwAP2nD">wireless access point</a>, and a <a href="https://mikrotik.com/product/RB750UPr2">router/switch combo</a>.</p>
<p>To make it easier to follow along while using other devices this guide will use the name (or Identity in RouterOS terms) cap for the access-point and capMan for the router/switch. The table below gives an overview of the name and role of each device.</p>
<table>
  <thead>
      <tr>
          <th>Device</th>
          <th>Model</th>
          <th>Identity</th>
          <th style="text-align: left">Role</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Wireless Access Point</td>
          <td><a href="https://mikrotik.com/product/RBwAP2nD">wAP</a></td>
          <td>CAP</td>
          <td style="text-align: left">The access-point used to provide Wi-Fi access</td>
      </tr>
      <tr>
          <td>Router/Switch</td>
          <td><a href="https://mikrotik.com/product/RB750UPr2">hEX PoE</a></td>
          <td>CAPMAN</td>
          <td style="text-align: left">The router switch combo used as the center of the network. It will be the manager configuring the access-point.</td>
      </tr>
  </tbody>
</table>
<p>To achieve our goal of maintainability we will use a function called <a href="https://wiki.mikrotik.com/wiki/Manual:CAPsMAN">CAPsMAN (Controlled Access Point system Manager)</a>. This will allow us to centrally manage the access point (and new access-points in the future) from a centralised point. The router will then send updates to all access-points, removing the need to manage them one by one.</p>
<h2 id="steps">Steps</h2>
<p>So how to configure a wireless network with MikroTik devices? I&rsquo;ve broken it down into two steps, first the preparations, and then configuring the Wi-Fi network.</p>
<h3 id="preparation">Preparation</h3>
<p>The first step to any network configuration is to ensure that each device is reachable and has a recognisable identity (name). I found that it was easiest to factory reset the access-point from the GUI, and choosing the cap preset. This puts the device into a bridge mode, disabling all router functionality and NAT. This gave a good starting point for the rest of the configuration.</p>
<p>With a reset access-point it is time to ensure that each device have a recognisable identity. As described in <a href="#equipment-and-terminology">Equipment and Terminology</a> I will use CAP for the access-point and CAPMAN for the router. It is also important to ensure that the devices has good passwords and are up to date, so I recommend doing so now.</p>
<p>To make it easier to troubleshoot the network I also recommend setting a static DHCP lease for the CAP device. In my case the following IP configuration is used:</p>
<table>
  <thead>
      <tr>
          <th>Device</th>
          <th>Name</th>
          <th>IP</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Router</td>
          <td>CAPMAN</td>
          <td>192.168.88.1</td>
      </tr>
      <tr>
          <td>Access-Point</td>
          <td>CAP</td>
          <td>192.168.88.2</td>
      </tr>
  </tbody>
</table>
<h3 id="configuring-a-wireless-network-with-mikrotik-devices">Configuring a Wireless Network with MikroTik Devices</h3>
<p>With our network in a state were we have a connection between CAPMAN and CAP we can begin to configure the network. The first step is to configure CAP to ask CAPMAN for configurations. This is done by using <code>[admin@CAP] &gt; /interface wireless cap set caps-man-addresses 192.168.88.1</code>. This command sets the address of the manager and ensures that it is the one responsible for the configuration.</p>
<p>Next up we need to configure the wireless network. This is done in multiple steps, as shown below.</p>
<pre tabindex="0"><code>[admin@CAPMAN] &gt; /caps-man security add name=&#34;wpa2psk&#34; authentication-types=wpa2-psk encryption=aes-ccm
[admin@CAPMAN] &gt; /caps-man security set 0 passphrase=[REDACTED]
[admin@CAPMAN] &gt; /caps-man configuration add name=master-cfg ssid=[My-Wifi-Network] security=wpa2psk country=sweden
[admin@CAPMAN] &gt; /caps-man provisioning add action=create-dynamic-enabled master-configuration=master-cfg
[admin@CAPMAN] &gt; /caps-man configuration set 0 datapath.bridge=bridge
[admin@CAPMAN] &gt; /caps-man manager set enabled yes
</code></pre><p>The first command will create a new security configuration, specifying that the Wi-Fi shall use wpa2-psk for authentication and AES encryption.
After that we set the password. This is the password used to connect to the wireless network when it gets activated.
The third step is to set the name of the Wi-Fi (the SSID). Note that we do not want to configure a band here. This will allow the CAP to create a network on 2.4ghz as well as on 5ghz. Otherwise, it would only create the network on the configured band. If we wish to configure the a second Wi-Fi, we would create a second configuration here and add it as a slave configuration in the next step.
On line 5 we provision the network to be created. This tells CAPMAN what configuration to push to what device.
This means that if you have multiple devices you can set what devices to push it to. For more information use the built-in help or the online documentation for provisioning.
The last row is the thing that got me confused. It tells the CAPMAN what bridge (interfaces) the network should be attached to. In my case this is the default bridge, and this allows devices to connected to the Wi-Fi to access the network.
The last step is to enable the CAPsMAN configuration on CAPMAN. This turns the configuration on and you should now be able to see your wireless network and connect to it.</p>
<p><strong>Note</strong> that if you wish to change something in an existing configuration you need to remove the configured interfaces and then trigger a re provision. This is done by:</p>
<pre tabindex="0"><code>[admin@CAPMAN] &gt; /caps-man interface print
# This shows all interfaces, remove all interfaces
[admin@CAPMAN] &gt; /caps-man interface remove 0
[admin@CAPMAN] &gt; /caps-man remote-cap print
[admin@CAPMAN] &gt; /caps-man remote-cap provision 0
# Reprovision all CAPs
</code></pre><p>There are lots more that can be done with CAPsMAN, but this should be a good starting point. However, I recommend the <a href="https://wiki.mikrotik.com/wiki/Manual:CAPsMAN">MikroTik wiki</a> to read up more on the options. There might be other things relevant for your needs.</p>
<h2 id="summary">Summary</h2>
<p>Setting up a wireless network with MikroTik infrastructure is quite easy, when you know what steps to take. The steps to take are on the managing device (CAPMAN):</p>
<ol>
<li>Set CAP to use CAPMAN for configuration.</li>
<li>Configure the security to use for the Wi-Fi.</li>
<li>Configure the password for the network.</li>
<li>Create a network configuration to use.</li>
<li>Provision the configuration to be pushed to access-points.</li>
<li>Configure datapath for the wireless network.</li>
<li>Enable the network</li>
</ol>
<p>And on the CAP:</p>
<ol>
<li>Configure the CAPsMAN manager to use.</li>
</ol>
<p>This should allow your CAPMAN to dynamically configure any access-points connected to provide network access.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Cloudflare, a Couple Months Later</title>
      <link>https://edbro.net/posts/cloudflare-a-couple-months-later/</link>
      <pubDate>Sun, 11 Jul 2021 00:00:00 +0000</pubDate>
      <guid>https://edbro.net/posts/cloudflare-a-couple-months-later/</guid>
      <description>&lt;p&gt;In a previous &lt;a href=&#34;https://edbro.net/posts/migrating-to-cloudflare/&#34;&gt;post&lt;/a&gt; I shared my experience with moving my page from Github pages to Cloudflare. It is now time to follow up that post and comment on my experiences after approximately a quarter.&lt;/p&gt;
&lt;p&gt;The experience of publishing new posts is about the same as when hosting on Github, you just push an update to the specified branch and then a build is triggered that will be published upon completion. The main difference is that the build process is somewhat slower in Cloudflare than on Github. This means that a build can take about 5 minutes, instead of the previous 1. This is most likely due to the fact that Cloudflare pulls everything and builds locally, instead of using Jekyll remote themes.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>In a previous <a href="https://edbro.net/posts/migrating-to-cloudflare/">post</a> I shared my experience with moving my page from Github pages to Cloudflare. It is now time to follow up that post and comment on my experiences after approximately a quarter.</p>
<p>The experience of publishing new posts is about the same as when hosting on Github, you just push an update to the specified branch and then a build is triggered that will be published upon completion. The main difference is that the build process is somewhat slower in Cloudflare than on Github. This means that a build can take about 5 minutes, instead of the previous 1. This is most likely due to the fact that Cloudflare pulls everything and builds locally, instead of using Jekyll remote themes.</p>
<p>When the post is published, there are no major difference for the user, however the statistics for the creator is much deeper. The pure web analytics (provided by JavaScript) could be implemented wherever the site was hosted, but there is more. The web analytics is the most detailed analytics, since it provides what posts were visited, referrers, user agents and more. The Cloudflare proxy analytics on the other hand does not require JavaScript, and can therefore not be blocked. The amount of information provided is not as detailed, but it gives a broader picture of the visitors. This data contains unique visitors and their origin country, but not much more. This could be seen in the web statistics as well, but that tracking is easily blocked.</p>
<p>Even though I have a quite negative stance on tracking, I think that information that is collected in the server anyway can be shown to the content creator without infringing the readers privacy. By being able to track number of readers it&rsquo;s possible to gain insight in the trends depending on the type of content published. For this blog for example I can from the statistics note that the most interesting content is in the divide between technical security and policies. For example <a href="https://edbro.net/posts/an-analysis-of-the-spotify-gdpr-data-export/">Spotify GDPR Analysis</a> is one of the most read articles on the blog, and it was written before I added analysis, and posts are often read the most directly at launch.</p>
<p>Getting back to the topic at hand, the experience of using Cloudflare, it gives the possibility to handle everything at a single location. This includes managing the domain as an registrar, hosting the application, managing TLS certificates and much more. The only thing I&rsquo;ve found that is a bit tricky is that I&rsquo;ve not found a way to register a new domain, only to transfer an existing one. With that said, I&rsquo;ve been very happy with my switch to Cloudflare, it gives me the tools I need for my blog, and just works.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Migrating to Cloudflare</title>
      <link>https://edbro.net/posts/migrating-to-cloudflare/</link>
      <pubDate>Sat, 17 Apr 2021 00:00:00 +0000</pubDate>
      <guid>https://edbro.net/posts/migrating-to-cloudflare/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve been looking around on how to get some statistics from my blog, especially regarding the number of visitors. Sadly the current solution (GitHub pages) does not seem to natively support this kind of statistics without adding third party tracking. After looking around for different solutions Cloudflare caught my attention. I know that among others, &lt;a href=&#34;https://www.troyhunt.com/&#34;&gt;Troy Hunt&lt;/a&gt; writes about and uses Cloudflare, so I decided to give it a try.&lt;/p&gt;
&lt;p&gt;Migrating from GitHub pages to Cloudflare pages was as easy as configuring what GitHub repo to use in Cloudflare, picking Jekyll and then it just worked. Right after the page was built you see some basic statistics, such as the amount of request grouped by country. Below the first hours of traffic is shown in a map, as presented by Cloudflare.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>I&rsquo;ve been looking around on how to get some statistics from my blog, especially regarding the number of visitors. Sadly the current solution (GitHub pages) does not seem to natively support this kind of statistics without adding third party tracking. After looking around for different solutions Cloudflare caught my attention. I know that among others, <a href="https://www.troyhunt.com/">Troy Hunt</a> writes about and uses Cloudflare, so I decided to give it a try.</p>
<p>Migrating from GitHub pages to Cloudflare pages was as easy as configuring what GitHub repo to use in Cloudflare, picking Jekyll and then it just worked. Right after the page was built you see some basic statistics, such as the amount of request grouped by country. Below the first hours of traffic is shown in a map, as presented by Cloudflare.</p>
<p><img alt="Cloudflare map" loading="lazy" src="/images/2021/migrating-to-cloudflare/Cloudflare-map.png"></p>
<p>In addition to providing basic statistics, using Cloudflare gives a lot of additional benefits. This includes the use of their Content Delivery Network, protection from Denial of Service, and easy HTTPS. I have not dug deep into which is best in these regards, but i find it difficult to believe that I have made a significant downgrade.</p>
<p>So in conclusion to gain some basic statistics of the usage of my blog, I&rsquo;ve migrated it to Cloudflare. The solution will not track any personal data, only basic statistics to gain some insight in how many readers are  using/enjoying my blog.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Building a Webpage</title>
      <link>https://edbro.net/posts/building-a-webpage/</link>
      <pubDate>Wed, 19 Aug 2020 00:00:00 +0100</pubDate>
      <guid>https://edbro.net/posts/building-a-webpage/</guid>
      <description>&lt;p&gt;So here we go, I finally got around to building a blog, and after looking around at different options i ended up using Jekyll and github pages. In addition to getting me this webpage, it allowed me to get some basic insight into ruby, making this a case of two birds one stone.&lt;/p&gt;
&lt;p&gt;Getting things to work have been quite a fiddle, so lets walk through how I got things up and running.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>So here we go, I finally got around to building a blog, and after looking around at different options i ended up using Jekyll and github pages. In addition to getting me this webpage, it allowed me to get some basic insight into ruby, making this a case of two birds one stone.</p>
<p>Getting things to work have been quite a fiddle, so lets walk through how I got things up and running.</p>
<p>The first step was to get ruby and jekyll installed on my local machine for testing. After trying with wsl I lost my patience and to my surprise it was easier to install directly in windows. Jekyll has a great guide on how to install ruby, jekyll and all dependencies at <a href="https://jekyllrb.com/docs/installation/windows/">https://jekyllrb.com/docs/installation/windows/</a>.</p>
<p>The next step was to create my github repository. To be able to host github pages you have to name the repository <code>&lt;username&gt;.github.io</code> where you replace <code>&lt;username&gt;</code> with your github username. After that I cloned my repository to my local machine and initiated jekyll by running <code>jekyll new .</code> in my repository.</p>
<p>At this point I got a basic blog. By using <code>bundle exec jekyll serve</code> the webpage is built and hosted locally for testing. It works, but now it&rsquo;s time to pretty the page up a bit. After looking around on different themes for a while I ended up choosing <a href="https://github.com/ngzhio/jekyll-theme-hamilton">Hamilton</a>, it fits my needs nicely, and i really enjoy the look. Installing it was as easy as following the guide in the documentation, you just have to remember to change the theme in <code>_config.yml</code>, to ensure that you use the new theme. That took far to long to realise, but finally I made it.</p>
]]></content:encoded>
    </item>
  </channel>
</rss>
