<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Posts on Alan Abbott</title>
        <link>/posts/</link>
        <description>Recent content in Posts on Alan Abbott</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en-us</language>
        <copyright>&lt;a href=&#34;https://creativecommons.org/licenses/by-nc/4.0/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;CC BY-NC 4.0&lt;/a&gt;</copyright>
        <lastBuildDate>Fri, 12 Jul 2024 12:22:38 -0500</lastBuildDate>
        <atom:link href="/posts/index.xml" rel="self" type="application/rss+xml" />
        
        <item>
            <title>Home Network Project</title>
            <link>/posts/2022/08/home-network-project/</link>
            <pubDate>Wed, 10 Aug 2022 00:00:00 +0000</pubDate>
            
            <guid>/posts/2022/08/home-network-project/</guid>
            <description>I recently moved into a new apartment and decided I needed to upgrade my home network. I still had a router that I got in college but I knew the technology had moved forward since then. I was also frustrated by my previous roommate’s wifi situation. I had dead spots in my room that made streaming difficult and I heard about it frequently.
We also qualify for fiber internet at the new apartment, and I could get near gigabit speeds for $55/month through RCN.</description>
            <content type="html"><![CDATA[<p>I recently moved into a new apartment and decided I needed to upgrade my home network. I still had a router that I got in college but I knew the technology had moved forward since then. I was also frustrated by my previous roommate’s wifi situation. I had dead spots in my room that made streaming difficult and I heard about it frequently.</p>
<p>We also qualify for fiber internet at the new apartment, and I could get near gigabit speeds for $55/month through RCN. I wanted to be able get that internet speed and come close to taking advantage of it on my network. Therefore, my requirements became a gigabit ethernet network for the home, plus wifi that is as reasonably fast as possible with good coverage of the whole apartment, including the back patio.</p>
<p>I also wanted to be able to VLAN segment my network and have separate wifi networks or SSIDs for each VLAN. I wanted to keep my smart devices from communicating with my personal devices, unless they needed to to perform a smart function. This requirement basically bumped me into small business / prosumer hardware, unfortunately.</p>
<p>I started looking at wifi, because this is really the only place I knew to look. I quickly decided I needed a Wifi 6 router, the latest and greatest protocol for the fastest speeds and most clients. Functionally this meant faster connection to my laptop and phone, since I was planning to hardwire the TV for streaming. The next questions were mesh or not? And do I want a separate router and access point (AP)?</p>
<p>I initially decided not to go for a mesh system, instead going for the cheapest Wifi 6 router I could find, this ASUS router. I planned to put it in AP mode and use a separate router for my VLANs and other traffic routing. This was a great plan until I realized you needed multi-SSID and VLAN support in the AP in order to have wifi devices on different networks. This meant to keep my light bulbs from hacking into my laptop, I needed an AP with VLAN and multi-SSID support. This directed me to the Orbi Pro Mini Wifi 6. This router was on sale I think at Micro Center because it had all the features I wanted, plus a mesh satellite, for only $40 more than the cheap ASUS. So this got me my AP for the network.</p>
<p>Next was the router / switches. I had decided in deciding my wifi AP that I would use a separate gigabit router for my network. This was motivated by getting a cheap Wifi 6 router and getting the rest of the required features from the router. When I upgraded to the Orbi, I didn’t reconsider my router choice. My system is working well for me, but I think I could maybe have used the Orbi for everything and skipped the separate router. Anyway. My router handles the most of the work for the network, and the Orbi APs give me multiple SSIDs to keep my devices separate.</p>
<p>I also used CAT6 cabling for all the runs between devices the the router. This lets me get gigabit speeds, fully capable of taking advantage of my fiber internet, anywhere with an ethernet cable. Currently I have a direct line to my home server, the Apple TV, and one under the couch for working in front of the TV. I also have my docking station hardwired in. This keeps me covered with fast internet most of the time, and the wifi is good and speedy everywhere else as well.</p>
<p>Overall probably not necessary, but it was a good learning exercise in setting up and managing a network. I also setup a Pi-hole DNS service so I am doing some basic ad-blocking and tracking prevention at a network level, but I’ll write about that later. It’s nice having fast internet all over the house. My nerdy inner child is so happy.</p>
]]></content>
        </item>
        
        <item>
            <title>New Garden!</title>
            <link>/posts/2022/08/new-garden/</link>
            <pubDate>Wed, 10 Aug 2022 00:00:00 +0000</pubDate>
            
            <guid>/posts/2022/08/new-garden/</guid>
            <description>My fiancé and I recently moved into a place with a good sized outdoor space, at least for Chicago. I decided to use the space to plant a vegetable garden, set up a grill and lights and hang my hammock. I was pretty overwhelmed at first, I had gardened with my dad before but that was years ago and I wasn’t taking thoughtful notes about the whole process. As a result I felt like I was starting from zero but luckily I was able to put together and revise a plan pretty quickly.</description>
            <content type="html"><![CDATA[<p>My fiancé and I recently moved into a place with a good sized outdoor space, at least for Chicago. I decided to use the space to plant a vegetable garden, set up a grill and lights and hang my hammock. I was pretty overwhelmed at first, I had gardened with my dad before but that was years ago and I wasn’t taking thoughtful notes about the whole process. As a result I felt like I was starting from zero but luckily I was able to put together and revise a plan pretty quickly.</p>
<h2 id="plan-a---hydroponic-dutch-buckets">Plan A - Hydroponic Dutch Buckets</h2>
<p>Initially I wanted to try out hydroponic gardening. Essentially hydroponic gardening is growing plants without soil, using some other media to hold water and nutrients near the roots of the plants. This can help conserve space, get more nutrients to plants, and allow for growing in places or configurations that wouldn’t be possible with soil.</p>
<p>The simplest (active) hydroponic garden, in my opinion, is a basic dutch bucket system. This consists of a 5-gallon or similar sized bucket, some means of getting water in the top, and a drain near the bottom. Ideally the drain should be 2-3 inches above the bottom of the bucket to allow some water to collect. The soil is commonly replaced with materials like perlite or coco coil. The water is treated with soluble fertilizers to create a nutrient solution. The nutrient solution and be collected and reused or drained to waste. This system is simple because it just involves getting the nutrient solution pumped into the top of the bucket and gravity to collect and reuse the nutrient solution.</p>
<p>Note: There are actually more simple, passive hydroponic systems, but these didn’t scratch the itch of building something enough for me, I had to go more complex.</p>
<p>After reviewing various setups, I decided several dutch buckets would be the way to go. I’d use 5-gallon buckets for the pots, PVC pipe for the drains and collection, a 55-gallon drum for the water reservoir, and a pump + host + dripper irrigation fittings to do the circulation.</p>
<p>I was able to source the 55-gallon drum from Facebook marketplace for $10. I was surprised by how many were listed for free/cheap, they seemed easy enough to find! I found some free scrap wood on Craigslist for street pickup. Initially I planned to get the lumber new but after seeing the prices I opted for a more economical and eco-friendly solution.</p>
<p>I found a fountain pump at Harbor Freight that met my height and flow rate needs. Pumps are typically rated for a certain height relative to the pump AT a certain flow rate. As the pump lifts water higher relative to itself, the flow rate will slow and eventually stop. Be sure that the pump you choose will give you the flow you need and the height you want.</p>
<p>Note: Flow rate is important to consider for some systems like Nutrient Film Technique (NFT) channels, but not for others that don’t run continuously, like flood-and-drain systems.</p>
<p>I planned to construct a short platform to set the buckets on and bury the 55-gallon drum deep enough to allow the solution to drain back into the reservoir. However, I never made it to construction because I was confronted by Plan B.</p>
<h2 id="plan-b---just-use-the-dirt">Plan B - Just use the dirt</h2>
<p>After explaining all the benefits of hydroponic gardens and why I wanted to try it, my fiancé made the fair point that it’s rare to have a patch of dirt in Chicago, so why cover the dirt with plastic buckets. This was ultimately the way we decided to go. The point that swayed me was she said she would spend more time outside with me if there was a nice garden. So, dirt garden it was.</p>
<p>I realize I don’t know much about gardening, so I venture to the local library. I haven’t been in a library in so long, it felt nice to feel like a kid in a candy store with books again. I find a few books on local plants and gardening and get checked out. After getting home and reviewing the gardening books. I decided to try and identify what plants I had in the garden and what condition the soil was in.</p>
<p>I used the app iNaturalist to take photos of the plants in the garden and it suggested classifications for them. It was helpful when other locals would comment and confirm or refine one of the AI’s suggestions. I used a few soil tests from the books to assess the dirt. I would grab a fistful of dirt and squeeze and judge it based on how it crumbled as I let go.</p>
<p>After some consideration I decided that mostly the garden was full of weeds and local grasses and the dirt was in okay, but not great condition. I decided I needed to weed the garden and turn the dirt over to get ready for any new plants. This is where the fun and hard work began. I cleared the top layer of dirt and weeds, along with lots of trash and rocks from previous tenants. I also loosened the dirt to get ready for additional soil.</p>
<p>I thought the soil needed more sand, since it seemed to cling together a little too well. I decided to go with some of the cheapest stuff from Lowe’s that still had any nutrient content. I got 10 bags, hopefully enough to add a couple inches across the area I wanted to plant. I got the bags of dirt home and worked them into the existing soil. This was by far the hardest work but also the most enjoyable.</p>
<p>Once I had got the garden ready, we made a trip to a local nursery to get some plants for the space. We went to the Urhausen Greenhouses and found all the plants we could want. We got several varieties of peppers and tomatoes, as well as some cucumber and watermelon, and some Salvia and Marigold flowers. I planted them when we got home, gave everything a good water and have hoped for the best!</p>
<h3 id="plan-b---a-bonus-nft-system">Plan B+ - A bonus NFT system</h3>
<p>I also had all this free wood and PVC so I decided to construct a four channel NFT setup in the back of the dirt patch. This area doesn’t get a ton of sun anyway so it seemed like a decent gamble on the space. I used the wood to build A-frame supports for the PVC channels and screwed them in place. I buried the 55-gallon drum to be the reservoir and the channels will drain back into the drum. It’s a simple enough setup and hopefully will grow several small plants.</p>
<p>Overall it seems to be growing well and it has made the back space a much more enjoyable place to hang out! We’ve eaten several meals out here and I’ve started hammocking over the plants. I also enjoy fast wi-fi while doing this because of my overkill home network setup, which I will write about soon.</p>
]]></content>
        </item>
        
        <item>
            <title>Pwnagotchi: A Cute Way to Learn About Wi-Fi</title>
            <link>/posts/2024/07/pwnagotchi-a-cute-way-to-learn-about-wi-fi/</link>
            <pubDate>Fri, 12 Jul 2024 12:22:38 -0500</pubDate>
            
            <guid>/posts/2024/07/pwnagotchi-a-cute-way-to-learn-about-wi-fi/</guid>
            <description>As I&amp;rsquo;ve learned more about tech, cybersecurity, and small electronics I&amp;rsquo;ve come across a number of little devices, projects, and &amp;ldquo;hacking&amp;rdquo; tools such as the Flipper Zero and Rubber Duckies. For an ethical hacker or penetration tester, these can be valuable tools to help audit the security of businesses, identifying weak spots and helping to improve them before someone with ill will comes along. For me, they&amp;rsquo;re a great way to get hands on experience and learn about topics such as Wi-Fi security.</description>
            <content type="html"><![CDATA[<p>As I&rsquo;ve learned more about tech, cybersecurity, and small electronics I&rsquo;ve come across a number of little devices, projects, and &ldquo;hacking&rdquo; tools such as the Flipper Zero and Rubber Duckies. For an ethical hacker or penetration tester, these can be valuable tools to help audit the security of businesses, identifying weak spots and helping to improve them before someone with ill will comes along. For me, they&rsquo;re a great way to get hands on experience and learn about topics such as Wi-Fi security.</p>
<p>One of these projects I found is the Pwnagotchi.</p>
<h2 id="what-is-a-pwnagotchi">What is a Pwnagotchi?</h2>
<p>Pwnagotchi is a project created in 2019 by <a href="https://github.com/evilsocket">evilsocket</a>, designed to resemble a cute little electronic pet, the Tamagotchi, only instead of feeding it cartoon food, you feed it Wi-Fi handshakes. Handshakes, specifically the 4-way handshake, are part of the process Wi-Fi access points and clients use to turn a wi-fi password into the set of cryptographic keys used for communication between devices.</p>
<p>The Pwnagotchi also features a neural network, designed to learn from the environment around it and get better at collecting handshakes over time. From the documentation: &ldquo;Pwnagotchi is an A2C-based “AI” powered by bettercap and running on a Raspberry Pi Zero W that learns from its surrounding WiFi environment in order to maximize the crackable WPA key material it captures.&rdquo; This makes it a good project not only for learning about wi-fi security, but also touches on AI and is built in Python, which are two other areas that I have been digging into lately.</p>
<h2 id="so-this-hacks-wi-fi-networks">So this hacks Wi-Fi networks?</h2>
<p>The Pwnagotchi doesn&rsquo;t hack networks and won&rsquo;t give you the password for the neighbors wi-fi. While the handshakes that it captures in theory could be used to crack the passwords, doing so would be unethical and is likely illegal in most places. What the Pwnagotchi captures are the encrypted keys that are exchanged to allow secure communication between an access point and client. Using a tool like Hashcat in conjunction with a word-list could in theory provide the password to the network, but again, not a very neighborly thing to do.</p>
<p>The intention of the Pwnagotchi, and many projects like it, is to teach people about wi-fi security and emphasize the importance of selecting a secure password. Something like &ldquo;password123&rdquo; might be easy to remember and share with your friends, but it&rsquo;s also among the most commonly used passwords (1,085th most common to be exact) and almost certainly would appear on the word-list a hacker would use to crack these handshakes and gain access to your network. By making people aware of the tools and techniques used by hackers, everyone can be more aware of their vulnerabilities and implement better security practices overall.</p>
<h2 id="what-can-you-do-with-these-handshakes">What can you do with these handshakes?</h2>
<p>I&rsquo;m planning to write a more detailed explanation of the differences in wi-fi security protocols, a detailed overview of the handshake process, and go over cracking a password with Hashcat for a test network that I own.</p>
<p>For me, the handshakes represent wi-fi networks that I&rsquo;ve been around and kept my little Pwnagotchi happy. As I&rsquo;ve started carrying my Pwnagotchi with me on walks and bike rides, I&rsquo;ve collected more and more handshakes. It&rsquo;s fun to see the number go up as I&rsquo;ve explored more places. It&rsquo;s almost like Pokemon Go, but somehow nerdier.</p>
<h2 id="opwngrid">oPwngrid</h2>
<p>There also exists a network of Pwnagotchis, oPwngrid, created by the maintainers of the project, where you can track stats and see who has collected the most handshakes. The Pwnagotchis can become friends and even be used to send messages between owners. You can find mine on the network here: <a href="https://opwngrid.xyz/search/3d26d06bd4a0a63264506e8809d3b9b6e38cf884ea03b886e37913693b1b58f4">joeypwns | ( ⚆_⚆)</a></p>
<p>I named my device &ldquo;joeypwns&rdquo; in honor of <a href="https://en.wikipedia.org/wiki/Joey_Chestnut">Joey Chestnut</a>, the famous competitive eater.</p>
<h2 id="build-your-own">Build your own</h2>
<p>It&rsquo;s relatively straightforward to build your own Pwnagotchi. You just need a Raspberry Pi Zero 2 W, an e-ink display, and optionally a battery to take the little guy on the go. I also 3D printed a case to protect everything.</p>
<h3 id="hardware">Hardware</h3>
<ul>
<li><a href="https://www.pishop.us/product/raspberry-pi-zero-2-w/?src=raspberrypi">Raspberry Pi Zero 2 W</a>
<ul>
<li>You will also need <a href="https://www.pishop.us/product/break-away-0-1-2x20-pin-strip-dual-male-header/">headers</a> and a way to solder them on</li>
<li>Some stores will sell Raspberry Pis with pre-soldered headers, totally worth it in my opinion</li>
<li>Some mobile phone repair shops will solder them on for a few bucks</li>
</ul>
</li>
<li><a href="https://www.waveshare.com/product/displays/e-paper/2.13inch-e-paper-hat-plus.htm">Waveshare 2.13 inch E-Ink Display</a>
<ul>
<li>MicroCenter sells a knockoff but go for the Waveshare, it will make things much easier</li>
</ul>
</li>
<li><a href="https://www.tindie.com/products/pisugar/pisugar-3-battery-for-raspberry-pi-zero/">PiSugar Battery</a>
<ul>
<li>It&rsquo;s possible to use other power sources or an external battery pack, but the form factor of the PiSugar is perfect</li>
</ul>
</li>
<li>MicroSD Card
<ul>
<li>UHS-I class or higher is recommended, see more <a href="https://www.kingston.com/en/blog/personal-storage/memory-card-speed-classes">here</a></li>
</ul>
</li>
</ul>
<p>If all this seems like too much hassle and you can&rsquo;t live without a Pwnagotchi, you can buy them pre-assembled with a case <a href="https://www.tindie.com/products/pisugar/pwnagotchi-complete-pack-pi0w-eink-battery-case/">here</a>.</p>
<h3 id="cases">Cases</h3>
<p>Several options for cases are available here: <a href="https://pwnagotchi.org/3d-printable-cases/index.html">3D Printable Cases</a>.</p>
<p>I used <a href="https://www.thingiverse.com/thing:5899809">this case</a> from gimzmoe on Thingaverse because I liked the clip-loop.</p>
<p>If you don&rsquo;t have a 3D printer you can purchase a case on Etsy, or ask nicely and I&rsquo;d probably send you one.</p>
<h3 id="software">Software</h3>
<p>While the original project was created and released by <a href="https://github.com/evilsocket">evilsocket</a>, several forks have branched off and continued development. The one with the largest community seems to be Jayofelony&rsquo;s version here: <a href="https://github.com/jayofelony/pwnagotchi">jayofelony/pwnagotchi</a></p>
<p>Download the latest release here: <a href="https://github.com/jayofelony/pwnagotchi/releases">releases</a>.</p>
<p>Flash the image to your MicroSD card using a tool such as <a href="https://etcher.balena.io/">Balena Etcher</a> or the <a href="https://www.raspberrypi.com/software/">Raspberry Pi Imager</a>.</p>
<p>Once the flash is complete and you have your hardware assembled, insert the MicroSD into the Raspberry Pi and power it on. It will take a few minutes the first time it boots so be patient, cutting power before setup is complete could corrupt files and require you to re-flash the SD card.</p>
<p>Now you should be up and running! Take your Pwnagotchi out into the wild and see what you can catch!</p>
<p>More detailed instructions exist at <a href="https://pwnagotchi.org/">pwnagotchi.org</a> for putting your own device together. I would recommend giving the documentation a read as there are several configuration options and cool things you can do that I haven&rsquo;t covered here.</p>
<p>Let me know if your build your own, I&rsquo;d love to see what you create! If you have any feedback or questions I would be happy to get in touch via <a href="mailto:alan.l.abbott@gmail.com">email</a>.</p>
]]></content>
        </item>
        
        <item>
            <title>My DIY Data Center: How I Built Enterprise IT Skills at Home</title>
            <link>/posts/2024/07/my-diy-data-center-how-i-built-enterprise-it-skills-at-home/</link>
            <pubDate>Thu, 11 Jul 2024 17:51:10 -0500</pubDate>
            
            <guid>/posts/2024/07/my-diy-data-center-how-i-built-enterprise-it-skills-at-home/</guid>
            <description>I have hosted home servers on and off (and been a huge nerd) since I was 12 years old. I started off running a LAMP (Linux, Apache, MySQL, PHP) server on a tower PC my dad pulled out of the trash. I wanted to publish the websites I was building to show off to my friends and family but my allowance didn&amp;rsquo;t go very far when it came to paying for web hosting.</description>
            <content type="html"><![CDATA[<p>I have hosted home servers on and off (and been a huge nerd) since I was 12 years old. I started off running a LAMP (Linux, Apache, MySQL, PHP) server on a tower PC my dad pulled out of the trash. I wanted to publish the websites I was building to show off to my friends and family but my allowance didn&rsquo;t go very far when it came to paying for web hosting. Thus began my journey into the world of tech and IT, building and hosting servers at home.</p>
<p>While things are a little more complicated now than simple HTML sites and CI/CD consisting solely of FileZilla, some things, like my hosting budget, stay the same. How much does a Standard_D4_v4 on Azure cost nowadays anyway?</p>
<p>Building and hosting a server at home has been a great way to learn new skills and host some small services on a budget. In this post, I&rsquo;m detailing my homelab journey, from a single server to a multi-node cluster, as well as the skills I have learned along the way.</p>
<h2 id="why-build-a-homelab">Why build a homelab?</h2>
<p>I have found building a homelab to be a great way to build relevant IT skills and put things into practice, beyond simply learning the theory. Taking an action oriented approach forces me to consider the real world implications of different technologies rather than only understanding how something is <em>supposed</em> to work, or situations where I <em>might</em> use them.</p>
<p>Building a homelab has also taught me some important lessons, such the importance of reliability when my &ldquo;users&rdquo; (my wife) couldn&rsquo;t access my &ldquo;services&rdquo; (turning on our smart lights) or the impact certain choices have on total cost of ownership, eg: my cloud budget and electricity bill.</p>
<h2 id="first-iteration---starting-small">First Iteration - Starting Small</h2>
<p>My first server was a single small form factor Dell OptiPlex PC. These small tower PCs make a great choice for the beginner homelabber as they are small, quiet, energy efficient, and can be found secondhand for under $100, often as low as $50-$60.</p>
<p>While it may seem like a good idea to pick up a rack mounted option like a used Dell PowerEdge or HP ProLiant, consider the size, noise, and power consumption of such a system. These enterprise grade servers are large, loud, and power hungry, potentially costing over $200/year to run 24/7. Not very living room friendly. The skills and concepts apply to small servers just as much as big ones.</p>
<h3 id="hardware">Hardware</h3>
<ul>
<li>Intel Core i5-6500 (4 Cores)</li>
<li>8 GB RAM</li>
<li>256 GB SSD, 1 TB HDD</li>
<li>Onboard Intel I219-V 1GbE NIC</li>
</ul>
<p>Power consumption at idle: 15-20 watts</p>
<h3 id="network">Network</h3>
<p>I connected my single server into my router and assigned it a static IP address on the existing 192.168.x.x subnet. I had some sense and kept the static IP out of the DHCP range, but otherwise had very little networking know-how, which was fine to start out.</p>
<h3 id="software---vmware-esxi">Software - VMWare ESXi</h3>
<p>I started with a free version of VMWare&rsquo;s ESXi hypervisor; this let me practice using a similar system to the one I was using at work, without the pressure of breaking anything critical. I never got past a couple VMs, as my hardware wasn&rsquo;t really cut out for it, but it let me practice the concepts.</p>
<h3 id="total-costs">Total Costs</h3>
<ul>
<li>Hardware: $40 on Facebook Marketplace</li>
<li>Power Consumption: ~$20/year</li>
<li>Licensing: Free</li>
</ul>
<p>For under $50 I was up and running, learning new things, and growing my skills rapidly.</p>
<h3 id="skills-learned">Skills Learned</h3>
<ul>
<li>Choosing the right hardware for the job</li>
<li>Installing an OS on bare metal</li>
<li>Working with VMWare ESXi</li>
<li>Creating and using virtual machines</li>
<li>Some basic networking, like setting static IPs and avoiding clashes with DHCP</li>
</ul>
<p>Overall, this first iteration of my homelab was a huge success. I was rapidly building skills and learning new concepts that would help me every day at work. Most importantly, it took me out of theory and into the real world, giving me a practical foundation on which I could continue to build.</p>
<h2 id="second-iteration---move-to-proxmox-adding-nodes">Second Iteration - Move to Proxmox, Adding Nodes</h2>
<p>I quickly ran into two bottlenecks — my server wasn&rsquo;t very powerful, and free ESXi has a lot of limitations. This led me to explore other options and discover <a href="https://www.proxmox.com/en/">Proxmox</a>, a free open-source hypervisor based on Debian Linux. It also led to me purchasing another SFF PC to add resources to my homelab.</p>
<p>These additions let me begin to learn about high-availability and implement automatic backups and shared storage. I also began to host useful services such as <a href="https://joplinapp.org/">Joplin</a> for synchronizing my notes and <a href="https://pi-hole.net/">Pihole</a> for network level ad-blocking and DNS.</p>
<h3 id="skills-learned-1">Skills Learned</h3>
<ul>
<li>Linux administration, managing Proxmox</li>
<li>Automatic Backups</li>
<li>Network File System (NFS) and shared storage</li>
<li>DNS Filtering</li>
</ul>
<p>As my homelab continued to grow, I continued to grow and develop my skill set and started to get some personal benefits as well. I had some momentum and felt like this was a platform with which I could scale and grow.</p>
<h2 id="third-iteration---clustering">Third Iteration - Clustering</h2>
<p>I consider this a third iteration because, well, I broke things pretty thoroughly in the process. Thank God this wasn&rsquo;t a production system.</p>
<p>I purchased another SFF PC, this time an HP EliteDesk, which gave me a sufficient number of servers to create a Proxmox cluster. This allowed for central management of all servers, easily migrating VMs between servers, and high availability VMs.</p>
<p>Adding the third server also prompted me to reconsider my network. Not only was I using up more IP addresses, I was running out of physical ports, and wanted to be able to separate server network traffic from personal network traffic.</p>
<p>It was during the migration from my 192.168.x.x subnet to a 10.x.x.x subnet that I broke the cluster. This led me down several rabbit holes and I began to learn the intricacies of distributed systems. I was finally able to restore the cluster and not lose any data in the process, gaining a real appreciation for the challenges presented by complex systems.</p>
<p>I added a switch and used VLANs to segment my network, allowing me to control the flow of traffic between devices. It certainly isn&rsquo;t an enterprise data center, but it gave me a taste of configuring a more complex network, and thinking about the flow of traffic through the system.</p>
<p>All of a sudden, tools like Ansible and Terraform made much more sense. Not just in a theoretical way but in a &ldquo;I can&rsquo;t believe I have to update this in so many places&rdquo; way. I started using automation and Infrastructure-as-Code tools to help me manage everything.</p>
<h3 id="skills-learned-2">Skills Learned</h3>
<ul>
<li>Setting up and managing a Proxmox cluster</li>
<li>High availability VM configuration</li>
<li>Network segmentation, configuring VLANs</li>
<li>Subnet design, implementing a new addressing scheme</li>
<li>Distributed systems, understanding the complexity of multi-node setups</li>
<li>Data preservation, not losing any information as I managed major system changes</li>
<li>Using tools like Ansible to make server administration easier</li>
</ul>
<p>This has been the system on which I have continued to build. It has presented me with several challenges and opportunities. I&rsquo;m really proud of the homelab I&rsquo;ve built and the skills I&rsquo;ve learned along the way. With this server cluster and network configuration I feel like I have something worthy of the title of &ldquo;homelab&rdquo;. It has served as my DIY data center and I use it to host several services today.</p>
<h2 id="final-state-for-now">Final State, for now&hellip;</h2>
<p>Currently, I still have three nodes in my cluster, plus a Raspberry Pi for backup DNS and VPN access. After a thoughtless reboot where I locked myself out of my network while on vacation, I decided I needed some redundancy for these key functions. I&rsquo;ve added some RAM, some SSDs, and a networking card for a future OpnSense project, but the bones are the same.</p>
<h4 id="physical-servers">Physical Servers:</h4>
<ul>
<li>Dell OptiPlex 7050 SFF: i7-7700, 8 cores, 16 GB RAM</li>
<li>Dell OptiPlex 5040 SFF: i5-6600, 4 cores, 16 GB RAM</li>
<li>HP EliteDesk 800 G2 SFF: i5-6500, 4 cores, 8 GB RAM</li>
<li>Raspberry Pi 4 8 GB</li>
</ul>
<h4 id="network-1">Network:</h4>
<ul>
<li>Layer 3: TP-Link ER605</li>
<li>Layer 2: TP-Link TL-SG105</li>
<li>APs: Netgear Orbi Pro WiFi 6 SXR/S30 in AP mode</li>
</ul>
<h4 id="vlans">VLANs:</h4>
<ul>
<li>Personal: PCs, phones, tablets, Apple TV</li>
<li>Servers: Proxmox nodes, VMs</li>
<li>IoT Devices: Light bulbs, smart plugs, ESP32s</li>
<li>Sus: Sketchy IoT devices, anything untrusted</li>
<li>Guest: Guest Wi-fi</li>
</ul>
<h3 id="total-costs-1">Total Costs</h3>
<h4 id="hardware-1">Hardware</h4>
<ul>
<li>$220 - SFF PCs</li>
<li>$40 - SSDs: 1 TB from MicroCenter, 1 TB for Christmas (Thanks Mom and Dad!)</li>
<li>$40 - Intel I350-T2 Dual Port 1GbE Card for OpnSense</li>
<li>$75 - Router/Switch - not including APs</li>
<li>$75 - Raspberry Pi</li>
</ul>
<p><strong>Total Hardware Cost: $450</strong></p>
<h4 id="electricity">Electricity</h4>
<p>I would estimate the total consumption to average around 90 watts, incl.</p>
<p>90 Watts / 1000 W/kW x 24 hours/day x $0.1621/kWh * 365 days = $127.79</p>
<p><strong>Total Electricity Cost: ~$130/year</strong></p>
<h3 id="all-in-for-3-years-of-homelabbing-831">All in for 3 years of Homelabbing: $831</h3>
<p>If you&rsquo;re reading this and thinking this might benefit you, I highly encourage you to take the leap. I started with a single Dell SFF PC purchased secondhand for $40. Generally I have taken the &ldquo;do more with less&rdquo; approach in an attempt to save money and get creative with solutions. While it&rsquo;s the dream of many an IT professional to have a full rack in their closet, starting where you can is far better than not starting at all.</p>
<p>If you have any feedback or input I would be happy to get in touch via <a href="mailto:alan.l.abbott@gmail.com">email</a>. Let me know what you would do different or ask any questions about getting started!</p>
]]></content>
        </item>
        
        <item>
            <title>SSL/TLS Guide Part Three: Tools for Working with Certificates</title>
            <link>/posts/2024/06/ssl/tls-guide-part-three-tools-for-working-with-certificates/</link>
            <pubDate>Mon, 17 Jun 2024 15:47:45 -0500</pubDate>
            
            <guid>/posts/2024/06/ssl/tls-guide-part-three-tools-for-working-with-certificates/</guid>
            <description>In parts one and two we covered the concepts of public key infrastructure (PKI) and X.509 certificates, certificate authorities, certificate chains, and self-signed certificates. In part three, we will go over some more practical information for working with certificates, such as common file types, encodings, and tools for working with certificates on various platforms.
Contents Part One: Public/Private Keys Part Two: Certificates Part Three: Tools for Working with Certificates Windows and Java File Types Windows and Java platforms utilize different file formats to store and manage TLS certificates.</description>
            <content type="html"><![CDATA[<p>In parts one and two we covered the concepts of public key infrastructure (PKI) and X.509 certificates, certificate authorities, certificate chains, and self-signed certificates. In part three, we will go over some more practical information for working with certificates, such as common file types, encodings, and tools for working with certificates on various platforms.</p>
<h3 id="contents">Contents</h3>
<ol>
<li><a href="/posts/2024/06/ssl/tls-guide-part-one-public/private-keys/">Part One: Public/Private Keys</a></li>
<li><a href="/posts/2024/06/ssl/tls-guide-part-two-certificates/">Part Two: Certificates</a></li>
<li><a href="/posts/2024/06/ssl/tls-guide-part-three-tools-for-working-with-certificates/"><strong>Part Three: Tools for Working with Certificates</strong></a></li>
</ol>
<h2 id="windows-and-java-file-types">Windows and Java File Types</h2>
<p>Windows and Java platforms utilize different file formats to store and manage TLS certificates. Understanding these file types is essential for proper certificate handling, installation, and configuration in various applications and systems. The following are some common file formats used for TLS certificates on Windows and Java platforms:</p>
<h3 id="1-personal-information-exchange-pfx-or-pkcs12">1. Personal Information Exchange (PFX) or PKCS#12:</h3>
<p>Windows systems often use the .pfx file format to store a certificate and its corresponding private key in a single, password-protected file. This format is useful for importing and exporting certificates with their associated private keys, simplifying certificate deployment and management. The PKCS#12 standard defines the .pfx file format, and these files are often used in Microsoft products, such as IIS and Exchange Server.</p>
<h3 id="2-der-distinguished-encoding-rules">2. DER (Distinguished Encoding Rules):</h3>
<p>Both Windows and Java platforms can use the .der file format, which is a binary encoding of a certificate. DER files typically contain only a single certificate without its associated private key. These files can be used for various purposes, such as installing root and intermediate certificates into the trusted certificate store.</p>
<h3 id="3-pem-privacy-enhanced-mail">3. PEM (Privacy-Enhanced Mail):</h3>
<p>The .pem file format is a widely-used format for storing certificates and keys in plain-text, base64-encoded form. PEM files can include certificates, private keys, or both, and can be used across different platforms, including Windows and Java. They are often utilized in open-source applications, such as OpenSSL and Apache HTTP Server.</p>
<h3 id="4-java-keystore-jks">4. Java KeyStore (JKS):</h3>
<p>Java applications use the Java KeyStore format to store certificates, private keys, and other cryptographic materials in a single, password-protected file. The .jks file format is specific to Java and is used by default in Java applications for managing keys and certificates. Java KeyStores can hold multiple entries, allowing for the storage of several certificates and keys in a single file.</p>
<h3 id="5-java-truststore">5. Java TrustStore:</h3>
<p>Similar to the Java KeyStore, the Java TrustStore is used to store trusted certificate authorities&rsquo; certificates. It is often used to store root and intermediate certificates that establish a chain of trust for validating end entity certificates. TrustStores use the same .jks file format as Java KeyStores but serve a distinct purpose in the certificate management process.</p>
<h2 id="a-note-on-encoding">A note on encoding</h2>
<p>When working with certificates, you&rsquo;ll encounter two primary encoding methods: DER (Distinguished Encoding Rules) and PEM (Privacy-Enhanced Mail). Understanding these encoding methods is crucial for handling and managing certificates effectively.</p>
<p><strong>DER (Distinguished Encoding Rules):</strong> DER is a binary encoding method used for certificates, keys, and other cryptographic data. It is a strict, compact, and unambiguous representation based on the ASN.1 (Abstract Syntax Notation One) standard. DER-encoded files are typically smaller than their PEM counterparts and are often used in situations where space and performance are critical. DER files usually have extensions like .der, .cer, or .crt.</p>
<p><strong>PEM (Privacy-Enhanced Mail):</strong> PEM is a text-based encoding method that uses base64 encoding to represent binary data as ASCII text. PEM-encoded files include a header and footer to mark the beginning and end of the certificate or key data. This format is widely used across different platforms and applications due to its human-readable nature and compatibility with various tools. PEM files typically have extensions like .pem, .crt, .cer, or .key.</p>
<p>In summary, DER and PEM are the two primary encoding methods used for certificates and cryptographic data. DER is a compact binary format, while PEM is a more human-readable text-based format. Understanding these encoding methods will help you manage and work with certificates effectively across various platforms and applications.</p>
<h2 id="guide-to-file-types">Guide to File Types</h2>
<ul>
<li>
<p><strong>.pem (Privacy-Enhanced Mail):</strong> A text-based, base64-encoded file used for storing certificates, private keys, or both; compatible with various platforms and applications.</p>
</li>
<li>
<p><strong>.crt (Certificate):</strong> A file format used for storing certificates, which can be either DER-encoded (binary) or PEM-encoded (base64 text); primarily associated with public key certificates.</p>
</li>
<li>
<p><strong>.cer (Certificate):</strong> Similar to .crt, a file format used for storing certificates, which can be either DER-encoded (binary) or PEM-encoded (base64 text).</p>
</li>
<li>
<p><strong>.der (Distinguished Encoding Rules):</strong> A binary-encoded file format used for storing certificates and other cryptographic data; compact and unambiguous representation based on ASN.1 standard.</p>
</li>
<li>
<p><strong>.key (Key):</strong> A file format used for storing private keys, typically in PEM-encoded (base64 text) format.</p>
</li>
<li>
<p><strong>.pfx (Personal Information Exchange) or .p12 (PKCS#12):</strong> A binary file format used for storing a certificate and its associated private key in a single, password-protected file; commonly used on Windows systems for importing and exporting  - certificates and keys.</p>
</li>
<li>
<p><strong>.jks (Java KeyStore):</strong> A binary file format used by Java applications for storing certificates, private keys, and other cryptographic materials in a single, password-protected file.</p>
</li>
<li>
<p><strong>.csr (Certificate Signing Request):</strong> A file format used for sending a public key and identifying information to a Certificate Authority (CA) to request a signed certificate.</p>
</li>
<li>
<p><strong>.crl (Certificate Revocation List):</strong> A file format used for listing revoked certificates, typically published and maintained by Certificate Authorities (CAs).</p>
</li>
</ul>
<p>These file types are commonly used for managing and configuring certificates and cryptographic data across various systems, platforms, and applications.</p>
<h2 id="tools-for-working-with-certificates">Tools for working with certificates</h2>
<h3 id="openssl">OpenSSL</h3>
<p>OpenSSL is a widely-used, open-source toolkit that implements the SSL (Secure Sockets Layer) and TLS (Transport Layer Security) protocols, as well as a robust cryptography library. It provides a versatile command-line interface for creating, managing, and converting certificates, keys, and other cryptographic data. OpenSSL supports a variety of operations, such as generating certificate signing requests (CSRs), signing certificates, creating and managing private keys, and validating certificate chains.</p>
<p>While OpenSSL can be really useful, using a command line tool can be intimidating when first starting out.</p>
<p>The OpenSSL source code can be downloaded here: <a href="https://www.openssl.org/source/">OpenSSL Source Downloads</a></p>
<p>Probably more practical for most folks will be the Windows installer made available by Shining Light Productions here: <a href="https://slproweb.com/products/Win32OpenSSL.html">Windows OpenSSL Installer</a></p>
<h3 id="java-keytool">Java Keytool</h3>
<p>Java Keytool is a command-line utility bundled with the Java Development Kit (JDK) and Java Runtime Environment (JRE) for managing key pairs, certificates, and keystores. It supports operations such as creating and importing certificates, generating key pairs, exporting certificates, and listing the contents of a keystore. Java Keytool is particularly useful for managing certificates in Java-based applications and environments.</p>
<h3 id="certmgr">CertMgr</h3>
<p>CertMgr is a Microsoft Windows command-line utility for managing certificates in the Windows Certificate Store. It allows users to perform various tasks, such as adding, deleting, or viewing certificates, as well as managing certificate revocation lists (CRLs) and certificate trust lists (CTLs). CertMgr is a convenient tool for Windows administrators and developers who need to manage certificates on their local machines or in a Windows-based environment.</p>
<h3 id="keystore-explorer">KeyStore Explorer</h3>
<p>KeyStore Explorer is a free, open-source, graphical tool for managing Java keystores and PKCS #12 files. It provides a user-friendly interface for creating, importing, and exporting certificates, as well as generating key pairs and converting between different keystore formats. KeyStore Explorer supports various operations, including signing and verifying certificates, editing certificate properties, and examining certificate chains. This tool is particularly useful for users who prefer a graphical interface over command-line utilities for managing certificates and cryptographic data.</p>
<p>KeyStore Explorer can be downloaded here: <a href="https://keystore-explorer.org/downloads.html">KeyStore Explorer</a></p>
<h2 id="common-issues-and-how-to-fix-them">Common Issues and How to fix them</h2>
<h3 id="warning-for-self-signed-certificates">Warning for Self-Signed Certificates</h3>
<p>A warning for self-signed certificates might appear because self-signed certificates lack the endorsement of a trusted Certificate Authority (CA). A CA acts as an independent, trusted third party that verifies the identity of a certificate owner. When a certificate is self-signed, the issuer and the subject of the certificate are the same entity, meaning the certificate owner is vouching for their own identity. This raises concerns about the authenticity and integrity of the certificate, as there is no external validation from a trusted CA.</p>
<p>Often, browsers will let you continue with a self-signed certificate, but will show the connection as Not Secure and have a red warning where the lock icon would be in the address bar. Some browsers and devices, such as iPads and iPhones, will not access sites with self-signed certificates at all without additional configuration.</p>
<p>To eliminate the warning for a self-signed certificate, you can add the certificate to the Trusted Root Certificates store on Windows. This action tells the system to trust the certificate, effectively treating it as if it were issued by a trusted CA. Here&rsquo;s how to add a self-signed certificate to the Trusted Root Certificates store:</p>
<ol>
<li>
<p>Locate the self-signed certificate file (usually in .cer or .crt format).</p>
</li>
<li>
<p>Double-click the certificate file to open the Certificate dialog box.</p>
</li>
<li>
<p>Click on the &ldquo;Install Certificate&rdquo; button to launch the Certificate Import Wizard.</p>
</li>
<li>
<p>Select &ldquo;Local Machine&rdquo; as the store location and click &ldquo;Next.&rdquo;</p>
</li>
<li>
<p>Choose &ldquo;Place all certificates in the following store&rdquo; and click &ldquo;Browse.&rdquo;</p>
</li>
<li>
<p>In the &ldquo;Select Certificate Store&rdquo; dialog, select &ldquo;Trusted Root Certification Authorities&rdquo; and click &ldquo;OK.&rdquo;</p>
</li>
<li>
<p>Click &ldquo;Next&rdquo; and then &ldquo;Finish&rdquo; to complete the import process.</p>
</li>
</ol>
<p>After completing these steps, the self-signed certificate will be added to the Trusted Root Certificates store on your Windows machine, and the warning should no longer appear when accessing the resource secured by the certificate. Keep in mind that this process should be done cautiously, as adding a self-signed certificate to the Trusted Root store may expose the system to security risks if the certificate owner is not trustworthy.</p>
<p>I only recommend this solution for demonstration systems or development environments. For any production use case you should get a real certificate issued by a trusted CA. Nowadays, this can be done easily, often automatically, and free with tools from <a href="https://letsencrypt.org/">Let&rsquo;s Encrypt</a>. In future articles, I will go over setting up a reverse proxy like Traefik to handle all of this automatically for you, eliminating a lot of the hassle of dealing with certificates.</p>
<h3 id="expired-certificate">Expired Certificate</h3>
<ol>
<li>
<p>KeyStore Explorer is a graphical tool for managing Java keystores and cryptographic data. To create a new self-signed certificate using KeyStore Explorer, follow these steps:</p>
</li>
<li>
<p>Download and install KeyStore Explorer from the official website (<a href="http://keystore-explorer.org/">http://keystore-explorer.org/</a>) if you haven&rsquo;t done so already.</p>
</li>
<li>
<p>Launch KeyStore Explorer.</p>
</li>
<li>
<p>In the main menu, click on &ldquo;Create a new KeyStore.&rdquo; Select the type of KeyStore you want to create (e.g., JKS, PKCS #12, BKS, UBER, etc.). For most purposes, JKS (Java KeyStore) is a common choice.</p>
</li>
<li>
<p>Once the new KeyStore is created, right-click on the empty space in the main window and select &ldquo;Generate Key Pair.&rdquo;</p>
</li>
<li>
<p>Choose the key pair algorithm (e.g., RSA, DSA, EC) and the key size (e.g., 2048 bits for RSA), then click &ldquo;OK.&rdquo;</p>
</li>
<li>
<p>In the &ldquo;Generate Key Pair - Enter Details&rdquo; window, fill in the required information for the new self-signed certificate. This information typically includes fields such as Common Name (CN), Organization (O), Organizational Unit (OU), Locality (L), State (ST), and Country (C). Make sure to enter the correct information, as it will be used to identify the certificate owner.</p>
</li>
<li>
<p>Set the validity period for the certificate (usually specified in days). A longer validity period is generally more convenient but may pose security risks if the private key is compromised. Click &ldquo;OK&rdquo; to proceed.</p>
</li>
<li>
<p>Enter an alias for the key pair entry in the KeyStore. This is a unique identifier for the key pair and certificate within the KeyStore. Click &ldquo;OK.&rdquo;</p>
</li>
<li>
<p>You&rsquo;ll be prompted to set a password for the key pair entry. Enter a strong password and click &ldquo;OK.&rdquo;</p>
</li>
<li>
<p>The new self-signed certificate and its corresponding key pair are now created and added to the KeyStore. You can view the details of the certificate by double-clicking on the entry.</p>
</li>
<li>
<p>To save the KeyStore, go to the main menu and click &ldquo;File&rdquo; &gt; &ldquo;Save KeyStore.&rdquo; Choose the location to save the KeyStore file and set a password to protect its contents.</p>
</li>
</ol>
<p>With these steps, you have successfully created a new self-signed certificate using KeyStore Explorer. Remember that self-signed certificates might cause trust warnings in browsers and other applications, as they lack a trusted Certificate Authority&rsquo;s endorsement.</p>
<p>Again, this solution should only be done for demonstration systems or development environments. For any production use case you should get a real certificate issued by a trusted CA. Nowadays, this can be done easily, often automatically, and free with tools from <a href="https://letsencrypt.org/">Let&rsquo;s Encrypt</a>.</p>
<h3 id="cn-mismatch">CN Mismatch</h3>
<p>A Common Name (CN) mismatch error occurs when the domain name in a website&rsquo;s SSL/TLS certificate does not match the domain name in the browser&rsquo;s address bar. To fix a CN name mismatch error, follow these steps:</p>
<p>Verify the domain name: Double-check the domain name in the browser&rsquo;s address bar and ensure it matches the domain name specified in the SSL/TLS certificate. If there&rsquo;s a typo or mistake in the address, correct it and reload the page.</p>
<p>Check for Subject Alternative Names (SANs): If you expect the certificate to work for multiple domain names, ensure that all necessary domain names are listed as SANs in the certificate. If they are missing, you&rsquo;ll need to reissue the certificate and include the missing domain names as SANs.</p>
<p>Reissue the certificate: If the domain name in the certificate is incorrect, you&rsquo;ll need to obtain a new SSL/TLS certificate for the correct domain name. Contact your Certificate Authority (CA) to reissue the certificate with the correct CN, or create a new Certificate Signing Request (CSR) with the correct CN and submit it to the CA.</p>
<p>Install the corrected certificate: Once you have the new certificate with the correct CN or updated SANs, install it on your web server according to the server&rsquo;s documentation. Make sure to replace the old certificate with the new one, and ensure the server is properly configured to use the updated certificate.</p>
<p>Test the connection: After installing the new certificate, clear your browser&rsquo;s cache, and restart the browser. Navigate to your website using the correct domain name, and check if the CN mismatch error is resolved.</p>
<p>By following these steps, you should be able to fix a CN name mismatch error and ensure secure communication between the website and its visitors.</p>
<p>This concludes the SSL/TLS guide, I hope it will be a good resource for anyone looking to better understand this fundamental part of security that is found nearly everywhere nowadays. I know writing this guide really helped solidify the concpets and has helped me in professioanl and personal projects alike.</p>
<p>If you found this helpful feel free to <a href="https://buymeacoffee.com/alabbott">buy me a coffee</a>, and if you have any feedback or corrections I would be happy to get in touch via <a href="mailto:alan.l.abbott@gmail.com">email</a>.</p>
<p>Thanks for reading!</p>
]]></content>
        </item>
        
        <item>
            <title>SSL/TLS Guide Part Two: Certificates</title>
            <link>/posts/2024/06/ssl/tls-guide-part-two-certificates/</link>
            <pubDate>Mon, 10 Jun 2024 14:26:30 -0500</pubDate>
            
            <guid>/posts/2024/06/ssl/tls-guide-part-two-certificates/</guid>
            <description>In Part One we discussed public key infrastructure (PKI) and how it enables privacy and integrity of communications between two parties. However, we still have the issue of trust, and deciding whether to trust the holder of a given private key or not. In Part Two of my TLS guide we will see how X.509 certificates enable us to rely on central sources of trust to weed out bad actors.</description>
            <content type="html"><![CDATA[<p>In <a href="/posts/2024/06/ssl/tls-guide-part-one-public/private-keys/">Part One</a> we discussed public key infrastructure (PKI) and how it enables privacy and integrity of communications between two parties. However, we still have the issue of trust, and deciding whether to trust the holder of a given private key or not. In Part Two of my TLS guide we will see how X.509 certificates enable us to rely on central sources of trust to weed out bad actors.</p>
<h3 id="contents">Contents</h3>
<ol>
<li><a href="/posts/2024/06/ssl/tls-guide-part-one-public/private-keys/">Part One: Public/Private Keys</a></li>
<li><a href="/posts/2024/06/ssl/tls-guide-part-two-certificates/"><strong>Part Two: Certificates</strong></a></li>
<li><a href="/posts/2024/06/ssl/tls-guide-part-three-tools-for-working-with-certificates/">Part Three: Tools for Working with Certificates</a></li>
</ol>
<h2 id="certificates">Certificates</h2>
<p>This is where our public keys become certificates. Certificates are how clients verify servers are who they claim to be. Certificates provide this verification by including a signed message from a trusted company, known as a <strong>Certificate Authority (CA)</strong>, who verifies the domain name and company information listed on the certificate is correct and true.</p>
<p>A certificate is obtained from a Certificate Authority by first creating a keypair, then sending the public key along with all the information associated with the owner of the public key. The combination of public key and identifying information is called a <strong>Certificate Signing Request (CSR)</strong> and is the file (.csr) sent to the CA to request a certificate. The signed certificate is then sent back, which includes the public key and identifying information of the requestor, but also the signature of the CA verifying the validity of the information.</p>
<h3 id="common-name-and-san-name">Common Name and SAN Name</h3>
<p>One of the fields for information is the <strong>Common Name (CN)</strong> which refers to the <strong>fully qualified domain name (FQDN)</strong> for the server. The FQDN simply refers to the complete URL without any protocol or port information. For example: <a href="https://alanabbott.me/"><em>alanabbott.me</em></a>, <em>mail.google.com</em>, or <em>pmox-node01</em>. It is important to match the FQDN to the address you will use to reach the server, as the browser will use this to verify the certificate is valid.</p>
<p>If a server needs to be reached from multiple addresses a <strong>Subject Alternate Name (SAN)</strong> can be specified which provides alternate names from which the server can reached.</p>
<p>The other information fields should be completed if sending a CSR to a CA but otherwise don&rsquo;t matter.</p>
<h3 id="types-of-certificates">Types of Certificates</h3>
<p>There are three types of certificates to be aware of:</p>
<h4 id="root-certificate">Root Certificate</h4>
<p>This is used by the CA to sign either intermediate or end entity certificates.
Typically have very long expiration dates.
These are what make up the Trusted Root Certificate Authorities.</p>
<h4 id="intermediate-certificate">Intermediate Certificate</h4>
<p>This is a certificate that has been signed by a root certificate, but may be used to sign more certificates.
Can sign either end entity certificates or other intermediate certificates.
Shorter expiration dates and rotated more often.</p>
<h4 id="end-entity-certificate">End Entity Certificate</h4>
<p>These are certificates assigned to individual servers.
They can not be used to sign more certificates.</p>
<p>It&rsquo;s good to know that individual certificates can also have restrictions placed on what they can be used for when they are created, which can sometimes cause headaches.</p>
<h3 id="certificate-chains">Certificate Chains</h3>
<p>A certificate chain is a series of certificates that originate from a trusted root certificate and extend through any number of intermediate certificates, ultimately leading to the end entity certificate. The purpose of a certificate chain is to establish a chain of trust from the end entity certificate back to the root certificate, verifying the identity and authenticity of the server or client involved in the communication.</p>
<p>The process of validating a certificate chain involves verifying the digital signatures of each certificate in the chain, starting with the end entity certificate and moving up the chain towards the root certificate. Each certificate in the chain is signed by the issuing authority of the next certificate in the chain. The chain is considered valid if the root certificate is found in the client&rsquo;s trusted root certificate store.</p>
<p>In summary, a certificate chain consists of:</p>
<ul>
<li>End Entity Certificate - assigned to the server or client that needs to be authenticated.</li>
<li>Intermediate Certificates (if any) - signed by the root or another intermediate certificate and used to sign end entity certificates.</li>
<li>Root Certificate - the top-level certificate, trusted by clients and used to sign intermediate certificates.</li>
</ul>
<h3 id="certificate-bundles">Certificate Bundles</h3>
<p>A certificate bundle is a collection of multiple certificates combined into a single file. Bundles are used to simplify certificate management and distribution, particularly when dealing with certificate chains or multiple certificates for different domains or services. Bundles can be provided in various file formats, such as .pem, .pfx, or .crt, depending on the platform and application requirements.</p>
<h3 id="expiration-dates">Expiration Dates</h3>
<p>Both CA signed and self-signed certificates have an expiration date, requiring companies to confirm they still control the domain name and private key associated with the certificate every so often. In production it is good practice to set expiration dates conservatively and rotate certificates often. In a demo environment, I usually set them for as long as I expect the demo to live. If a company loses control of a production private key, they should get new certificates immediately, as they could be impersonated by anyone with the private key.</p>
<h3 id="self-signed-certificates">Self-Signed Certificates</h3>
<p>A self-signed certificate is represented by one of the above scenarios, where we must accept Person A&rsquo;s identity because they say so. A self-signed certificate provides a public key without a signed message verifying the identity of the key holder. Browsers by default show an error and don&rsquo;t visit sites with self-signed certificates, for good reason, I don&rsquo;t want anyone claiming to be my bank without signed verification.</p>
<p>To bypass this, we can add our self-signed certificate to the Trusted Root Certificate Authorities. Most operating systems have a default group of Trusted Root Certificate Authorities. Java has a separate group of default trusted CAs, known as cacerts. By adding our self-signed certificate to the Trusted Root CAs group, browsers will recognize our self-signed certificate and will not show errors, provided our certificate isn&rsquo;t expired and matches the FQDN used to reach the server.</p>
<h3 id="self-signed-certificate-authority">Self-Signed Certificate Authority</h3>
<p>If you need to generate certificates for several servers, you can create a self-signed Certificate Authority, which can then be used to sign multiple certificates for all of the servers, while only requiring the self-signed CA to be added to the Trusted Root Certificate Authorities.</p>
<h3 id="getting-ca-signed-certificates-for-free">Getting CA Signed Certificates for Free</h3>
<p>Services such as <a href="https://letsencrypt.org/">Let&rsquo;s Encrypt</a>, a free certificate authority created and run by the <a href="https://www.abetterinternet.org/">Internet Security Research Group (ISRG)</a>, have made getting certificates significantly easier. Their work as made implementing TLS much simpler and helped proliferate secure HTTPS as the default in most places. I plan to write more about using Let&rsquo;s Encrypt in the future, and integrating with tools like Traefik, but for now check out their <a href="https://letsencrypt.org/getting-started/">Getting Started</a> page.</p>
<p>Continue reading <a href="/posts/2024/06/ssl/tls-guide-part-three-tools-for-working-with-certificates/">Part Three</a> to learn about some common tools used for working with certificates, or go back to <a href="/posts/2024/06/ssl/tls-guide-part-one-public/private-keys/">Part One</a> to learn about public / private keys as the foundation for X.509 certificates.</p>
<p>If you found this helpful feel free to <a href="https://buymeacoffee.com/alabbott">buy me a coffee</a>, and if you have any feedback or corrections I would be happy to get in touch via <a href="mailto:alan.l.abbott@gmail.com">email</a>.</p>
]]></content>
        </item>
        
        <item>
            <title>SSL/TLS Guide Part One: Public/Private Keys</title>
            <link>/posts/2024/06/ssl/tls-guide-part-one-public/private-keys/</link>
            <pubDate>Mon, 03 Jun 2024 18:26:20 -0500</pubDate>
            
            <guid>/posts/2024/06/ssl/tls-guide-part-one-public/private-keys/</guid>
            <description>Transport Layer Security (TLS) or Secure Sockets Layer (SSL) protocols are the primary method for securing communications between servers and clients on the internet or other networks such as a plant floor or enterprise network. TLS is the successor to SSL, however the terms are used interchangeably, both referring to the newer TLS protocol. Without using TLS to encrypt the communication between servers and clients, their communications could be exposed to 3rd parties intercepting and possibly spoofing messages.</description>
            <content type="html"><![CDATA[<p>Transport Layer Security (TLS) or Secure Sockets Layer (SSL) protocols are the primary method for securing communications between servers and clients on the internet or other networks such as a plant floor or enterprise network. TLS is the successor to SSL, however the terms are used interchangeably, both referring to the newer TLS protocol. Without using TLS to encrypt the communication between servers and clients, their communications could be exposed to 3rd parties intercepting and possibly spoofing messages. With cyber-attacks on industrial manufacturers increasing, securing all production and development networks becomes increasingly important everyone from Controls Engineers and Developers to CEOs and CISOs.</p>
<p>Managing TLS and certificates can be a huge pain as well, especially in environments that can go long stretches between use and be shared by many users. We&rsquo;re probably all too familiar with the security warnings about certificate errors, either showing as insecure or worse, not loading at all.</p>
<p>In this guide, I will break down the pieces that come together to form the TLS protocol and go over some tips for working with certificates. Understanding the basics helps make sense of errors and makes the whole ordeal a little less daunting.</p>
<h3 id="contents">Contents</h3>
<ol>
<li><a href="/posts/2024/06/ssl/tls-guide-part-one-public/private-keys/"><strong>Part One: Public/Private Keys</strong></a></li>
<li><a href="/posts/2024/06/ssl/tls-guide-part-two-certificates/">Part Two: Certificates</a></li>
<li><a href="/posts/2024/06/ssl/tls-guide-part-three-tools-for-working-with-certificates/">Part Three: Tools for Working with Certificates</a></li>
</ol>
<h2 id="a-precursor-identity-privacy-trust-and-security">A precursor: Identity, Privacy, Trust, and Security</h2>
<p>If two people want to send messages to each other they can pass notes using a messenger. This would not be very private however, because the messenger could easily read a message before delivering it. It would also not be very secure because the messenger could alter the message before delivery. There is no way to ensure or trust that the message is really from the sender or that it hasn&rsquo;t been changed. The identity of the sender can&rsquo;t be verified by the recipient.</p>
<p>The two people could implement a code, where they shift A to B, C to D, and so on. However, this would require them to agree upon this code via an outside channel. It would not be possible to establish trusted communication without meeting in person, or using an existing outside channel.  This is sometimes referred to as a shared secret.</p>
<p>If two people need to exchange information securely without meeting previously, such as webservers and a new client, they can use public and private keys to accomplish this. The use of public and private keys has many advantages, such as private communication without a shared secret, as well as verifying identity and providing trust through things like signatures and certificate chains.</p>
<p>It helped me to understand the various pieces of TLS certificates when I broke out the ideas of privacy, identity, and trust.</p>
<ul>
<li>Privacy - Communication between parties can&rsquo;t be read by outside listeners</li>
<li>Identity - Can you verify who sent you that message and that it wasn&rsquo;t modified?</li>
<li>Trust - Can I verify that you are who you say you are?</li>
</ul>
<p>In my mind, these are the core concepts behind &ldquo;secure&rdquo; communication. When we say we have a secure connection to a server or device, we mean we can verify the identity of the sender, the integrity of the message, and not worry that 3rd parties can read what we&rsquo;re sending. Hopefully by the end of this guide you will feel comfortable with the way TLS certificates provide privacy, identity, and trust which will make using them, and fixing them, much easier.</p>
<h2 id="public-keys-and-private-keys">Public Keys and Private Keys</h2>
<p>The most important concept in the TLS protocol is public keys and private keys, which make up <strong>public key infrastructure (PKI)</strong>. In reality these keys are just very, very large numbers used in cryptography algorithms, stored in certain specific formats. These keys enable everything in TLS with two functions.</p>
<h3 id="two-important-functions">Two important functions:</h3>
<ul>
<li>Messages encrypted with the <em>public key</em> can only be decrypted with the <em>private key</em></li>
<li>Messages encrypted with the <em>private key</em> can only be decrypted with the <em>public key</em></li>
</ul>
<p>If <em>Person A</em> wants to send a message to <em>Person B</em>, they would each generate a keypair (public and private key) and exchange <strong>public keys</strong>, keeping their <strong>private keys</strong> secret. It doesn&rsquo;t matter if the public keys are intercepted, as they are public information and only represent the identity of the private key holder.</p>
<h4 id="the-process-for-conversation-would-be-as-follows">The process for conversation would be as follows:</h4>
<ol>
<li>
<p>For <em>Person A</em> to send a message to <em>Person B</em>, they would use <em>Person B</em>&rsquo;s <strong>public key</strong> to encrypt the message</p>
</li>
<li>
<p><em>Person B</em> would use their secret <strong>private key</strong> to decrypt the message, only readable to them</p>
</li>
</ol>
<h4 id="to-respond">To respond:</h4>
<ol>
<li>
<p>When <em>Person B</em> sends a message to <em>Person A</em>, they would use <em>Person A</em>&rsquo;s <strong>public key</strong> to encrypt the message</p>
</li>
<li>
<p><em>Person A</em> would use their secret <strong>private key</strong> to decrypt the message, only readable to them</p>
</li>
</ol>
<p>This system is great for ensuring privacy, as only the intended recipient can decrypt and read the message. It is not, however, a great system for verifying identity and providing trust. We must talk about signing and verification to understand the other side of public key infrastructure.</p>
<p>Remember, private keys can also encrypt messages that can only be decrypted by the public key, and the public key is widely available and tied to the key holder&rsquo;s identity. To verify their identity, the private key holder can use their secret key to encrypt a message, only decryptable by their public key. This process is known as signing the message.</p>
<p>When the recipient gets that message, they will use the sender&rsquo;s public key to confirm they are the one who encrypted it, in a process called verification. Because the public key is tied to the identity of the private key holder, the recipient can be certain the message is from the sender and hasn&rsquo;t been changed in transit.</p>
<h4 id="the-process-for-signing-a-message-would-be-as-follows">The process for signing a message would be as follows:</h4>
<ol>
<li>
<p><em>Person A</em> uses their <strong>private key</strong> to encrypt a message, and sends it to <em>Person B</em></p>
</li>
<li>
<p><em>Person B</em> uses <em>Person A</em>&rsquo;s <strong>public key</strong> to decrypt the message, confirming it is from <em>Person A</em></p>
</li>
</ol>
<h4 id="the-process-for-verifying-a-message">The process for verifying a message:</h4>
<ol>
<li>
<p><em>Person B</em> receives an encrypted message from <em>Person A</em>, who claims to have signed it using their <strong>private key</strong></p>
</li>
<li>
<p><em>Person B</em> successfully decrypts the message using <em>Person A</em>&rsquo;s <strong>public key</strong>, confirming it was sent by <em>Person A</em></p>
</li>
</ol>
<p>This system may seem to check all of our boxes, allowing for two-way, private communication where the identity and integrity of each message can be verified. However, we are required to trust that Person A and Person B are who they claim to be. How can we be sure it is indeed Person A and Person B who hold those private keys? If we had a signed message from someone we trusted, we could verify that Person A&rsquo;s public key (and private key) belong to them.</p>
<h3 id="cryptography-nerd-moment">Cryptography Nerd Moment</h3>
<p>The above system roughly represents PGP (Pretty Good Privacy) which has been around for over 30 years and is pretty much the standard for encrypting or verifying communications. Beyond just messaging, PGP can be used to sign and verify blocks of code or even entire pieces of software. A developer can sign a package, and provide the signature. Using their public key and cryptography software, you can verify that the program is not corrupted, either accidentally or maliciously.</p>
<p>A limit of PGP is that it relies on a &ldquo;web of trust&rdquo; where individuals will endorse each other&rsquo;s public keys, confirming they belong to the claimed owner. While this decentralized model may work well in some situations, a system was needed for a more streamlined method of trust management, leading to X.509 certificates, which are described in the <a href="/posts/2024/06/ssl/tls-guide-part-two-certificates/">Part Two</a> of this guide.</p>
<p>There are several algorithms that can be used to generate the key pairs, such as RSA or IDEA, but they all use incredibly large numbers and mathematical processes that would be practically impossible to undo using modern computers. A description of the math behind creating keys can be found here: <a href="https://en.wikipedia.org/wiki/RSA_(cryptosystem)">RSA (cryptosystem) - Wikipedia</a></p>
<p>There is the possibility that quantum computers could very quickly break the encryption used in PGP and TLS communication. This would mean that virtually all information encrypted in the last 30 years could be decrypted and read. It&rsquo;s speculated that some people may collect encrypted information with the hope of decrypting it in the future using quantum algorithms. In light of this, work is being spent developing new cryptography algorithms, that rely on different principles and would make them resistant to future decryption using quantum computing.</p>
<p>Continue reading <a href="/posts/2024/06/ssl/tls-guide-part-two-certificates/">Part Two</a> to learn about how X.509 certificates enable TLS communication and keep the modern internet secure.</p>
<p>If you found this helpful feel free to <a href="https://buymeacoffee.com/alabbott">buy me a coffee</a>, and if you have any feedback or corrections I would be happy to get in touch via <a href="mailto:alan.l.abbott@gmail.com">email</a>.</p>
]]></content>
        </item>
        
    </channel>
</rss>
