<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://www.brookscunningham.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://www.brookscunningham.com/" rel="alternate" type="text/html" /><updated>2026-06-02T19:07:16+00:00</updated><id>https://www.brookscunningham.com/feed.xml</id><title type="html">Bad news does not get better with age</title><subtitle>Just another IT blog.</subtitle><author><name>Brooks Cunningham</name></author><entry><title type="html">Considerations on MSS when using a GRE tunnel from a CDN to a CDN origin</title><link href="https://www.brookscunningham.com/2024/01/considerations-on-mss-when-using-gre.html" rel="alternate" type="text/html" title="Considerations on MSS when using a GRE tunnel from a CDN to a CDN origin" /><published>2024-01-18T22:22:00+00:00</published><updated>2024-01-18T22:22:00+00:00</updated><id>https://www.brookscunningham.com/2024/01/considerations-on-mss-when-using-gre</id><content type="html" xml:base="https://www.brookscunningham.com/2024/01/considerations-on-mss-when-using-gre.html"><![CDATA[<p>When a GRE (Generic Routing Encapsulation) tunnel is used between the CDN and the CDN origin, it can impact the Maximum Segment Size (MSS) of the TCP connections due to the additional overhead introduced by the GRE encapsulation.</p>

<h2 id="gre-tunnel-overhead">GRE Tunnel Overhead</h2>

<p>GRE encapsulation adds additional headers to packets being transmitted. A GRE header typically adds 24 bytes (20 bytes for the GRE header and 4 bytes for the GRE key, if used). This extra overhead reduces the amount of space available in each packet for the actual payload data.</p>

<h2 id="impact-on-mss">Impact on MSS</h2>

<p>The MSS in a TCP connection signifies the largest amount of data, in bytes, that a computer or communications device can receive in a single TCP segment. It does not include the TCP header or IP header.</p>

<p>Under normal circumstances without a GRE tunnel, the MSS is calculated based on the Maximum Transmission Unit (MTU) of the network path, typically 1500 bytes for Ethernet networks. From this, the IP header (20 bytes) and TCP header (typically 20 bytes) are subtracted, resulting in a default MSS of 1460 bytes.</p>

<p>With a GRE tunnel, the additional GRE header needs to be accounted for. If the network path’s MTU remains at 1500 bytes, the MSS must be reduced accordingly to accommodate the GRE header. For example, with a 24-byte GRE header, the MSS would need to be reduced to 1436 bytes (1500 - 20 for IP header - 20 for TCP header - 24 for GRE header).</p>

<h2 id="consequences">Consequences</h2>

<p><strong>1. Fragmentation:</strong>
If the MSS is not adjusted for the GRE overhead, packets might exceed the MTU, leading to fragmentation. Fragmentation can reduce performance and increase the likelihood of packet loss.</p>

<p><strong>2. Reduced Efficiency:</strong>
A smaller MSS means that more packets are required to send the same amount of data. This can lead to increased overhead and reduced efficiency in data transmission.</p>

<p><strong>3. TCP Performance:</strong>
TCP performance might be impacted due to the reduced MSS. TCP throughput can be less efficient with smaller packet sizes, especially over long-distance links where latency is a factor.</p>

<h2 id="adjusting-mss">Adjusting MSS</h2>

<p>Network administrators can adjust the MSS using TCP MSS clamping, a technique used in routers and firewalls to modify the MSS value within the TCP SYN packets. This ensures that the end devices establish connections using an MSS that takes into account the GRE overhead, preventing issues like fragmentation.</p>

<h2 id="summary">Summary</h2>

<p>Using a GRE tunnel between the CDN and CDN origin impacts the MSS due to the additional header overhead of the GRE encapsulation. This necessitates an adjustment of the MSS to avoid fragmentation and maintain efficient TCP performance. Proper network configuration, including MSS clamping, is essential to handle this change effectively.</p>]]></content><author><name>Brooks Cunningham</name></author><summary type="html"><![CDATA[When a GRE (Generic Routing Encapsulation) tunnel is used between the CDN and the CDN origin, it can impact the Maximum Segment Size (MSS) of the TCP connections due to the additional overhead introduced by the GRE encapsulation.]]></summary></entry><entry><title type="html">Staying logged into a web site when using puppeteer</title><link href="https://www.brookscunningham.com/2022/07/staying-logged-into-web-site-when-using.html" rel="alternate" type="text/html" title="Staying logged into a web site when using puppeteer" /><published>2022-07-02T18:00:00+00:00</published><updated>2022-07-02T18:00:00+00:00</updated><id>https://www.brookscunningham.com/2022/07/staying-logged-into-web-site-when-using</id><content type="html" xml:base="https://www.brookscunningham.com/2022/07/staying-logged-into-web-site-when-using.html"><![CDATA[<p>Do you want to stay logged into a site after manually logging in with puppeteer?</p>

<p>This task is not as easy as just specifying the user data directory based on feedback from the following Github thread.</p>

<p><a href="https://github.com/puppeteer/puppeteer/issues/921">https://github.com/puppeteer/puppeteer/issues/921</a></p>

<p>The work around is to save cookies after logging in and then load those cookies in subsequent sessions. Here is the answer from Github.</p>

<p><a href="https://stackoverflow.com/questions/56514877/how-to-save-cookies-and-load-it-in-another-puppeteer-session#56515357">https://stackoverflow.com/questions/56514877/how-to-save-cookies-and-load-it-in-another-puppeteer-session#56515357</a></p>]]></content><author><name>Brooks Cunningham</name></author><summary type="html"><![CDATA[Do you want to stay logged into a site after manually logging in with puppeteer?]]></summary></entry><entry><title type="html">What is trust in cyber security?</title><link href="https://www.brookscunningham.com/2022/06/what-is-trust-in-cyber-security.html" rel="alternate" type="text/html" title="What is trust in cyber security?" /><published>2022-06-25T16:26:00+00:00</published><updated>2022-06-25T16:26:00+00:00</updated><id>https://www.brookscunningham.com/2022/06/what-is-trust-in-cyber-security</id><content type="html" xml:base="https://www.brookscunningham.com/2022/06/what-is-trust-in-cyber-security.html"><![CDATA[<p><strong>What is trust?</strong> The philosophy of trust is fascinating. The definition of trust is “Assured reliance on the character, ability, strength, or truth of someone or something.”</p>

<p>Where does the trustor’s belief come from? My point of view is that the trustor must have a past experience or foundational belief on behalf of the trustor to inform the level of trust or distrust the trustor will have in the trustee. Without some prior knowledge to an interaction, there is likely to be no foundation for trust or distrust. Every adult human on the face of the earth will have a weighted perspective on how much they believe a trustee will act in a way that is beneficial to the trustor.</p>

<p>So far this post has been a very philosophical discussion. Why am I even talking about the concept of trust? In information security, trust is the bedrock for nearly every interaction (or at least it should be). When a person attempts to redeem a gift card online, the web application owner assumes that if valid card details are entered, then that must be the owner of the gift card. The online shop will then add the balance of the gift card to the person’s account. It would be amazing if the world was this simple, but online fraudsters will take advantage of this inherent trust. Fraudsters can brute force gift card validation endpoints using automation (aka bots) to redeem balances on gift cards.</p>

<h2 id="how-can-a-website-owner-distinguish-between-legitimate-users-and-fraudsters-for-these-cases">How can a website owner distinguish between legitimate users and fraudsters for these cases?</h2>

<p>There are a number of identifiers that are available with a given request including:</p>

<ul>
  <li>Source of the traffic. (IP and Geo IP)</li>
  <li>Owner of the source traffic. IP ASN Owner and OrgName.</li>
  <li>HTTP request headers</li>
  <li>Rate of traffic</li>
</ul>

<p>This is not an exhaustive list and there are many sub categories of these different fields that could be utilized as well. This is especially true with rate of traffic. If there are a million requests being sent within a 5 minute time frame from a single user, then that would likely be considered abusive or fraudulent by most web applications. These 5 million requests would not be considered trustworthy since it vastly exceeds the normal user usage. However, there are applications where this may be acceptable behavior. What qualifies as “normal” requires some prior knowledge or definition to define what “normal” really is.</p>

<p>We cannot infer trust in a vacuum. We must rely on prior knowledge to guide if something or someone is trustworthy. As we continue to progress in cyber security to fight fraud, it will be interesting to see how an individual’s history is recorded for good or bad behavior.</p>

<h2 id="questions-for-a-later-post">Questions for a later post</h2>

<p>If my online persona violates the ToS for a site, then does that get recorded somewhere? Should it? When should it be a requirement for my real or true identity to be used for interacting with a site instead of having the ability to use a persona?</p>]]></content><author><name>Brooks Cunningham</name></author><summary type="html"><![CDATA[What is trust? The philosophy of trust is fascinating. The definition of trust is “Assured reliance on the character, ability, strength, or truth of someone or something.”]]></summary></entry><entry><title type="html">Risk of incorrectly classifying people as bots</title><link href="https://www.brookscunningham.com/2021/12/risk-of-incorrectly-classifying-people.html" rel="alternate" type="text/html" title="Risk of incorrectly classifying people as bots" /><published>2021-12-20T18:00:00+00:00</published><updated>2021-12-20T18:00:00+00:00</updated><id>https://www.brookscunningham.com/2021/12/risk-of-incorrectly-classifying-people</id><content type="html" xml:base="https://www.brookscunningham.com/2021/12/risk-of-incorrectly-classifying-people.html"><![CDATA[<p>I really like two different shows. The Netflix show Black Mirror illustrates various dystopian futures and Reply All is usually an upbeat show that reports on a wide spectrum of topics.</p>

<p>Recently Reply All put out the show State of Panic where the critics of a Florida politician were the recipients of varying degrees of unwanted attention to put it lightly. The large volume of unwanted attention came in the form of undesirable direct messages (DMs) and tweets directed at the critic. The large volume of messages had very focused messaging which could give the impression that the communication was being driven by a small set of individuals with a large number of bot operator managed Twitter accounts. However, after doing some investigation by the good folks at Reply All, it was identified that there were actually a number of very zealous Twitter followers of the politician. The Florida politician, while having some controversial beliefs, had deeply connected with many people online.</p>

<p>Below is the short synopsis the Men on Fire episode of Black Mirror from Wikipedia.</p>

<blockquote>
  <p>“The episode follows Stripe (Malachi Kirby), a soldier who hunts humanoid mutants known as roaches. After a malfunctioning of his MASS, a neural implant, he discovers that these ‘roaches’ are ordinary human beings” and learns his perception has been altered.</p>
</blockquote>

<p>For the soldier, it is much easier to eliminate the “roaches” than to eliminate real people. Once the soldier becomes aware that his actions are impacting people instead of “roaches”, he starts to empathize and question his overall mission. In the case for Reply All’s State of Panic episode, the recipient of the harassment viewed the messages as originating from bot managed accounts since it was difficult to believe that so many real people would have the specific set of beliefs. While harassment is certainly not helpful, we still have to acknowledge that these are real people’s voices. When we incorrectly classify public web discourse as bot traffic, we are minimizing the view points of those individuals. The view points may be misguided or factually incorrect, but they still are the perspectives of those people.</p>

<p>Large numbers of fake accounts that are managed by a small set of individuals can absolutely be a problem. Platforms should take steps to reduce the influence of fake accounts where possible. However, we should also avoid the knee jerk reaction of classifying controversial opinions as originating from “bots”. Otherwise, we will not understanding the view points of a large population of individuals.</p>]]></content><author><name>Brooks Cunningham</name></author><summary type="html"><![CDATA[I really like two different shows. The Netflix show Black Mirror illustrates various dystopian futures and Reply All is usually an upbeat show that reports on a wide spectrum of topics.]]></summary></entry><entry><title type="html">E-commerce Bot Economics</title><link href="https://www.brookscunningham.com/2021/08/e-commerce-bot-economics.html" rel="alternate" type="text/html" title="E-commerce Bot Economics" /><published>2021-08-30T18:00:00+00:00</published><updated>2021-08-30T18:00:00+00:00</updated><id>https://www.brookscunningham.com/2021/08/e-commerce-bot-economics</id><content type="html" xml:base="https://www.brookscunningham.com/2021/08/e-commerce-bot-economics.html"><![CDATA[<h2 id="what-does-supply-and-demand-have-to-do-with-bots">What does supply and demand have to do with bots?</h2>

<p>For this post, I am not talking about bots that are performing attacks such as SQLi or Account Takeover (ATO). This post will strictly explore the grey area of web scrapping and cart checkout based bots. For folks that have studied economics, you are likely familiar with tried and true supply and demand curve. A quick refresher can be found on <a href="https://en.wikipedia.org/wiki/Supply_and_demand">wikipedia</a>.</p>

<h2 id="xbox-and-ps5-bots">Xbox and PS5 bots</h2>

<p>There are a number of tools that exist for going through a checkout process to buy products. The bot operators typically fall into a few different buckets:</p>

<ul>
  <li>An organization that is trying to buy up as much inventory as possible to resell the product at a mark-up. See, <a href="https://screenrant.com/ps5-stockx-resell-scalper-units-sold-2021/">PS5 resell scalper units sold 2021</a></li>
  <li>An individual or organization that sells the tooling to go through a checkout process very quickly. See, <a href="https://mostadvancedbot.com/products/target-bot">mostadvancedbot.com</a></li>
</ul>

<p>The motivation for an organization to buy thousands or even hundreds of thousands of PS5s is because… drumroll…. MONEY! There is an enormous opportunity to buy low and sell high for this highly sought after product.</p>

<h2 id="into-the-economics">Into the economics</h2>

<p>There is a substantial delta between what customers are willing to pay for a product and what the product is initially sold for. In a free marketplace, the high demand would be a signal to charge more to customers for the product. Charging a higher sticker price allows demand to go down to meet supply and ultimately result in higher profits for a business. More importantly, this removes the profit margin that can exist in secondary markets. A bot management solution can be a helpful tool for raising the barrier to entry for a bot operator. However, if there is enough of a margin between the price of the product that the primary seller and the price that the end consumer is willing to pay, then bot operators will find a way around any bot management solution. The ultimate solution is to close the gap between the primary market and any secondary or end consumer tooling markets.</p>

<h2 id="primary-market-sellers-cannot-always-raise-prices">Primary market sellers cannot always raise prices</h2>

<p>There are a number of marketplaces where the primary sellers cannot raise prices. For example, with ticketing platforms the ticket prices are often set by the artists that will be performing. This results in many artists that will set ticket prices substantially below market value with the hope that “real fans” will be able to buy the tickets. When scalpers purchase the tickets and then sell them at the actual market value, then the fans get frustrated with the ticket selling vendor. The bot operators then resell the tickets at a market rate on a secondary market with a healthy profit. The artists are then able to deflect any criticism about ticket prices onto the ticket selling vendor for not implementing sufficient ticket scalping measures.</p>

<h2 id="what-is-the-solution">What is the solution?</h2>

<p>The real solution to this problem is an economics solution. There are 2 options. Either increase supply or reduce demand. To continue with the venue ticketing example, increasing supply is a simple concept. If artists do substantially more shows so that more seats are available, then supply goes up. This is a simple concept, but not easy or desirable to implement since it requires much more work for the artists and supporting staff for less of a return. This is the approach that Kid Rock took. I would encourage everyone to listen to <a href="https://www.npr.org/transcripts/671583061">this podcast for details on that use-case</a>. The other approach is to reduce demand, which is also an easy concept. Taylor Swift did this by raising her ticket prices. The following link contains those details: <a href="https://econlife.com/2019/12/higher-concert-ticket-prices/">Higher Concert Ticket Prices</a>.</p>

<p>These solutions are great if the seller has the ability and will to make these changes, but often the seller has a deficit in one of these areas. As a consequence, sellers are forced to examine how to increase the barriers to entry to make it less profitable for secondary markets to operate. An effective bot management solution and identity management solution can be a critical piece in increasing the costs for secondary markets. However, if the gap between the price customers are willing to pay and the available supply remains wide, then secondary markets will remain profitable.</p>

<h2 id="where-can-this-mindset-be-applied">Where can this mindset be applied?</h2>

<p>I would argue that the true customer for companies that sell products at below market value is the supplier. The initial sellers need the ability to charge more for these high demand products, or they will be forced to add more friction in the buying process to try to combat the secondary market. This economics approach may be considered for really any highly sought after product. This includes physical products like shoes (sneaker bots), baby clothes, GPUs, airline tickets, and PS5.</p>

<h2 id="bot-operator-tooling">Bot Operator Tooling</h2>

<p>The tooling that is used to buy the product from the primary marketplace can vary from basic scripts using items like the following:</p>

<ul>
  <li>Browser plug-ins</li>
  <li>Python Requests and Beautiful Soup</li>
  <li>Selenium</li>
  <li>Anti-captcha solutions to defeat captchas</li>
  <li>Residential and mobile network proxies</li>
</ul>

<h2 id="appendix">Appendix</h2>

<ul>
  <li><a href="https://www.npr.org/transcripts/671583061">https://www.npr.org/transcripts/671583061</a></li>
  <li><a href="https://econlife.com/2019/12/higher-concert-ticket-prices/">https://econlife.com/2019/12/higher-concert-ticket-prices/</a></li>
  <li><a href="https://screenrant.com/ps5-stockx-resell-scalper-units-sold-2021/">https://screenrant.com/ps5-stockx-resell-scalper-units-sold-2021/</a></li>
  <li><a href="https://mostadvancedbot.com/products/target-bot">https://mostadvancedbot.com/products/target-bot</a></li>
  <li><a href="https://anti-captcha.com/">https://anti-captcha.com/</a></li>
  <li><a href="https://lp.brightdata.com/proxy-network">https://lp.brightdata.com/proxy-network</a></li>
  <li><a href="https://infare.com/products/data-feeds/">https://infare.com/products/data-feeds/</a></li>
</ul>]]></content><author><name>Brooks Cunningham</name></author><summary type="html"><![CDATA[What does supply and demand have to do with bots?]]></summary></entry><entry><title type="html">Why is referrer missing in Google Analytics?</title><link href="https://www.brookscunningham.com/2020/12/why-is-referrer-missing-in-google.html" rel="alternate" type="text/html" title="Why is referrer missing in Google Analytics?" /><published>2020-12-08T20:44:00+00:00</published><updated>2020-12-08T20:44:00+00:00</updated><id>https://www.brookscunningham.com/2020/12/why-is-referrer-missing-in-google</id><content type="html" xml:base="https://www.brookscunningham.com/2020/12/why-is-referrer-missing-in-google.html"><![CDATA[<p>Learn from my mistakes and save some time. I spent way more time on this than needed. If your referrer is missing from your Google Analytics and you use Google Tag Manager, then make sure you set the field <strong>alwaysSendReferrer</strong> to <strong>true</strong> per the screenshot below.</p>

<p><img src="/assets/images/why-is-referrer-missing-in-google/gtm_always_send_referrer.png" alt="Google Tag Manager alwaysSendReferrer setting" /></p>

<p>This field is necessary to always send the referrer as the <strong>dr</strong> parameter in web requests to Google Analytics. For more information on the referrer, see the following link.</p>

<p><a href="https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#referrer">Google Analytics Field Reference - Referrer</a></p>

<p>Have a great day!</p>

<p>Brooks</p>]]></content><author><name>Brooks Cunningham</name></author><summary type="html"><![CDATA[Learn from my mistakes and save some time. I spent way more time on this than needed. If your referrer is missing from your Google Analytics and you use Google Tag Manager, then make sure you set the field alwaysSendReferrer to true per the screenshot below.]]></summary></entry><entry><title type="html">Chromedriver really wants to use the default profile</title><link href="https://www.brookscunningham.com/2020/09/chromedriver-really-wants-to-use.html" rel="alternate" type="text/html" title="Chromedriver really wants to use the default profile" /><published>2020-09-28T18:00:00+00:00</published><updated>2020-09-28T18:00:00+00:00</updated><id>https://www.brookscunningham.com/2020/09/chromedriver-really-wants-to-use</id><content type="html" xml:base="https://www.brookscunningham.com/2020/09/chromedriver-really-wants-to-use.html"><![CDATA[<p>Today I learned that when using chromedriver and trying to use an existing Chrome Profile that the existing Selenium or chromedriver package will attempt do one of the following:</p>

<ol>
  <li>If “default” exists, then that directory will be used</li>
  <li>Selenium will create a “Default” directory unless a profile directory is specified.</li>
</ol>

<p>Take for example the following snippet:</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">from</span> <span class="nn">selenium</span> <span class="kn">import</span> <span class="n">webdriver</span>

<span class="n">chromeOptions</span> <span class="o">=</span> <span class="n">webdriver</span><span class="p">.</span><span class="n">ChromeOptions</span><span class="p">()</span>
<span class="n">chromeOptions</span><span class="p">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--user-data-dir=/Users/myuser/Library/Application Support/Google/Chrome/Profile 2"</span><span class="p">)</span>

<span class="n">browser</span> <span class="o">=</span> <span class="n">webdriver</span><span class="p">.</span><span class="n">Chrome</span><span class="p">(</span><span class="n">options</span><span class="o">=</span><span class="n">chromeOptions</span><span class="p">)</span>

<span class="n">browser</span><span class="p">.</span><span class="n">get</span><span class="p">(</span><span class="s">'https://brookscunningham.com/'</span><span class="p">)</span>
<span class="k">return</span> <span class="n">browser</span>
</code></pre></div></div>

<p>The first time you would run the above, it will not work. However, I did see that the new directory “/Users/myuser/Library/Application Support/Google/Chrome/Profile 2/default” did exist with all of the expected chrome settings of a brand new chrome profile. To make my profile work with Selenium, I needed to make a small update.</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">from</span> <span class="nn">selenium</span> <span class="kn">import</span> <span class="n">webdriver</span>

<span class="n">chromeOptions</span> <span class="o">=</span> <span class="n">webdriver</span><span class="p">.</span><span class="n">ChromeOptions</span><span class="p">()</span>
<span class="n">chromeOptions</span><span class="p">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--user-data-dir=/Users/myuser/Library/Application Support/Google/Chrome/"</span><span class="p">)</span>

<span class="n">chromeOptions</span><span class="p">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s">"--profile-directory=Profile 2"</span><span class="p">)</span>

<span class="n">browser</span> <span class="o">=</span> <span class="n">webdriver</span><span class="p">.</span><span class="n">Chrome</span><span class="p">(</span><span class="n">options</span><span class="o">=</span><span class="n">chromeOptions</span><span class="p">)</span>

<span class="n">browser</span><span class="p">.</span><span class="n">get</span><span class="p">(</span><span class="s">'https://brookscunningham.com/'</span><span class="p">)</span>
<span class="k">return</span> <span class="n">browser</span>
</code></pre></div></div>

<p>I had to specify the specific profile directory name using the “–profile-directory” argument. The correct profile starting working after I made the change.</p>

<p>Happy automating!</p>]]></content><author><name>Brooks Cunningham</name></author><summary type="html"><![CDATA[Today I learned that when using chromedriver and trying to use an existing Chrome Profile that the existing Selenium or chromedriver package will attempt do one of the following:]]></summary></entry><entry><title type="html">Why consistent tooling matters</title><link href="https://www.brookscunningham.com/2020/02/why-consistent-tooling-matters.html" rel="alternate" type="text/html" title="Why consistent tooling matters" /><published>2020-02-23T18:00:00+00:00</published><updated>2020-02-23T18:00:00+00:00</updated><id>https://www.brookscunningham.com/2020/02/why-consistent-tooling-matters</id><content type="html" xml:base="https://www.brookscunningham.com/2020/02/why-consistent-tooling-matters.html"><![CDATA[<p>I have always known that there is a lot of tribal knowledge within the team that I am a part of. I also understand that the silo’ed knowledge is undesirable, but until recently I did not really see the extent where this can be problematic. We become too comfortable with going through inefficient workflows to solve problems because that is what we are used to. Tooling could be built to make the workflows more efficient, but the cost in time to build out the tools compared to going through the sub-optimal workflows was not worth paying in the moment. It was much easier to just train people on the nuance of how the systems worked and then demonstrate the sub-optimal way to complete the task. However, this methodology fell apart and was not scalable as it became necessary to aggressively on-board new engineers.</p>

<p>Once it became a requirement to on-board product support engineers to the product that I was helping maintain, I was essentially starting from the ground up with a bunch of new hires for a geographically dispersed team. The existing product support team members are tech savvy, but the technology that I had been supporting works very different from anything that they had worked with previously. As I was doing some of the training and explaining how to troubleshoot cases I would often get the question “How do you know to look at x system when y problem happens?”. I was really bothered by these types of questions because these were largely undocumented Product quirks that the the existing Support team and myself would stumble upon and remember the pain of troubleshooting the low level mechanics of what could be causing x issue.</p>

<p>It is important for team members to all to use the same methodology when troubleshoot similar cases. The lack of tooling created a per-requisite to understand the low level details of systems before they could even begin to understand the approach to solving technical issues. Without consistent tooling there was a wide variety of process and methodology for solving cases. Everyone was left to their own devices to figure out the what they could see as the best way to solve cases. Useful tooling does a few things:</p>

<ol>
  <li>Provides mechanisms for troubleshooting specific issue</li>
  <li>Provides a shared language for how issues have been troubleshot and what troubleshooting to do next.</li>
  <li>Reduces on-boarding time</li>
</ol>

<p>I will go through each of the 3 items above since they require their own more in-depth explanation.</p>

<h2 id="provides-mechanisms-for-troubleshooting-specific-issue">Provides mechanisms for troubleshooting specific issue</h2>

<p>PKI is very large topic with many complex pieces. It is a common task for Support Engineers to check the validity of a certificate. My preferred way of checking the validity of a certificate is to use tooling in Openssl. Below is the function for reference:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">function </span>checkcert <span class="o">{</span>
<span class="nb">echo</span> <span class="s2">"---------------------------"</span>
<span class="nb">echo</span> <span class="s2">"Certificate Valid Dates"</span>
<span class="nb">echo</span> <span class="s2">"---------------------------"</span>
<span class="nb">true</span> | openssl s_client <span class="nt">-connect</span> <span class="nv">$1</span>:443 2&gt;/dev/null | openssl x509 <span class="nt">-noout</span> <span class="nt">-dates</span>
<span class="nb">echo</span> <span class="s2">"---------------------------"</span>
<span class="nb">echo</span> <span class="s2">"Certificate CN and DNS Info"</span>
<span class="nb">echo</span> <span class="s2">"---------------------------"</span>
<span class="nb">true</span> | openssl s_client <span class="nt">-connect</span> <span class="nv">$1</span>:443 2&gt;/dev/null | openssl x509 <span class="nt">-noout</span> <span class="nt">-text</span> | <span class="nb">grep </span>DNS:
<span class="nb">echo</span> <span class="s2">"Issuer"</span>
<span class="nb">echo</span> <span class="s2">"---------------------------"</span>
<span class="nb">true</span> | openssl s_client <span class="nt">-connect</span> <span class="nv">$1</span>:443 2&gt;/dev/null | openssl x509 <span class="nt">-noout</span> <span class="nt">-issuer</span>
<span class="nb">echo</span> <span class="s2">"---------------------------"</span>
<span class="nb">echo</span> <span class="s2">"Check Hostname Validity"</span>
<span class="nb">echo</span> <span class="s2">"---------------------------"</span>
<span class="nb">true</span> | openssl s_client <span class="nt">-connect</span> <span class="nv">$1</span>:443 2&gt;/dev/null | <span class="nb">grep</span> <span class="s1">'Verify return code'</span>
<span class="o">}</span>
</code></pre></div></div>

<p>If a support engineer has to validate a certificate, then it is as easy as running <strong>checkcert foo.bar</strong> from the command line to check the validity. I am assuming that SNI is not a factor for this example. There is no need to open a browser to grab a screenshot of text. The output of the command already provides the most relevant information for identifying the validity of a certificate in an easy to consume and share format. Having information formatted in a way that is easy to consume is a critical part to the next point.</p>

<h2 id="provides-a-shared-language">Provides a shared language</h2>

<p>IT systems are complex and the roles between organizations are highly specialized. Having a clear and consistent way of communicating between people will result in issues being fixed more quickly. Using similar tooling builds trust and confidence when transitioning work items from individual to another in a team. Also, there is less of a need to explain the steps that have been taken so far to troubleshoot a behavior when methodology that is followed is consistent among a team. Just like a real language, the shared and consistent follow through can feed into how well interaction go with external teams as well. For example, if it is expected that logs will be formatted a certain way when requests are sent to the Product team, then tooling can be built to accommodate this need. By building out the tooling to format logs in a more consumable way, this reduces the amount of time needed to manually do the formatting and also reduces the likelihood that the incorrect format will be used. This is especially important if using the incorrect format may cause delays by unnecessary back and forth on the tickets.</p>

<h2 id="reduces-on-boarding-time">Reduces on-boarding time</h2>

<p>The previous points really feed into this last item, which I believe is the most important. Turnover is a part of any company and no one should attempt to completely eliminate turnover. Instead, focus on creating a great on-boarding program and reduce the amount of time necessary for someone to become proficient at their key responsibilities. For example, if I told an entry level new hire “Openssl is the <strong>only</strong> acceptable way to do certificate validation and if you have questions then check out the ‘man’ page”, then I am failing as someone responsible for on-boarding. This is because the goal is to do certificate validation, not become an expert at Openssl (which is still a good skill to have). We have to think about how to abstract the low level details where it makes sense so that more time and energy may be spent on hire level tasks that add value to the company and customers.</p>

<p>I hope you enjoyed the post. Please leave questions and feedback in the comments below.</p>]]></content><author><name>Brooks Cunningham</name></author><summary type="html"><![CDATA[I have always known that there is a lot of tribal knowledge within the team that I am a part of. I also understand that the silo’ed knowledge is undesirable, but until recently I did not really see the extent where this can be problematic. We become too comfortable with going through inefficient workflows to solve problems because that is what we are used to. Tooling could be built to make the workflows more efficient, but the cost in time to build out the tools compared to going through the sub-optimal workflows was not worth paying in the moment. It was much easier to just train people on the nuance of how the systems worked and then demonstrate the sub-optimal way to complete the task. However, this methodology fell apart and was not scalable as it became necessary to aggressively on-board new engineers.]]></summary></entry><entry><title type="html">Grabbing AWS CloudFront IPs with curl and jq</title><link href="https://www.brookscunningham.com/2018/09/grabbing-aws-cloudfront-ips-with-curl.html" rel="alternate" type="text/html" title="Grabbing AWS CloudFront IPs with curl and jq" /><published>2018-09-15T18:40:00+00:00</published><updated>2018-09-15T18:40:00+00:00</updated><id>https://www.brookscunningham.com/2018/09/grabbing-aws-cloudfront-ips-with-curl</id><content type="html" xml:base="https://www.brookscunningham.com/2018/09/grabbing-aws-cloudfront-ips-with-curl.html"><![CDATA[<p>There are occasions when restricting infrastructure access behind CloudFront becomes necessary, ensuring requests route through the CDN rather than directly to the origin. AWS publishes public IP ranges in JSON format at <a href="https://ip-ranges.amazonaws.com/ip-ranges.json">https://ip-ranges.amazonaws.com/ip-ranges.json</a>.</p>

<p>Rather than manually parsing the complete JSON file to locate CloudFront IPs, combining curl and jq command-line utilities provides an efficient solution. The following command extracts only CloudFront IP ranges:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl https://ip-ranges.amazonaws.com/ip-ranges.json | jq <span class="s1">'.prefixes | .[] | select(.service == "CLOUDFRONT") | .ip_prefix'</span>
</code></pre></div></div>

<p>This approach filters the AWS IP ranges dataset to display exclusively CloudFront prefixes, enabling administrators to implement targeted access restrictions at their origin infrastructure.</p>]]></content><author><name>Brooks Cunningham</name></author><summary type="html"><![CDATA[There are occasions when restricting infrastructure access behind CloudFront becomes necessary, ensuring requests route through the CDN rather than directly to the origin. AWS publishes public IP ranges in JSON format at https://ip-ranges.amazonaws.com/ip-ranges.json.]]></summary></entry><entry><title type="html">Decrypt all PFX files in a directory</title><link href="https://www.brookscunningham.com/2018/09/decrypt-all-pfx-files-in-directory.html" rel="alternate" type="text/html" title="Decrypt all PFX files in a directory" /><published>2018-09-15T18:39:00+00:00</published><updated>2018-09-15T18:39:00+00:00</updated><id>https://www.brookscunningham.com/2018/09/decrypt-all-pfx-files-in-directory</id><content type="html" xml:base="https://www.brookscunningham.com/2018/09/decrypt-all-pfx-files-in-directory.html"><![CDATA[<p>I recently needed to decrypt multiple PFX files, extract their keys, and obtain server certificates. Below is a Bash script solution for batch processing PFX files in a directory.</p>

<p><strong>Key Requirements:</strong></p>

<ul>
  <li>All PFX files must share the same password</li>
  <li>Execute the script in the directory containing the PFX files</li>
  <li>Replace “somepass” with the actual password</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">for </span>f <span class="k">in</span> <span class="k">*</span>.pfx<span class="p">;</span>
<span class="k">do
 </span><span class="nv">pemout</span><span class="o">=</span><span class="s2">"</span><span class="k">${</span><span class="nv">f</span><span class="k">}</span><span class="s2">.pem"</span><span class="p">;</span>
 <span class="nv">keyout</span><span class="o">=</span><span class="s2">"</span><span class="k">${</span><span class="nv">pemout</span><span class="k">}</span><span class="s2">.key"</span><span class="p">;</span>
 <span class="nv">crtout</span><span class="o">=</span><span class="s2">"</span><span class="k">${</span><span class="nv">pemout</span><span class="k">}</span><span class="s2">.crt"</span><span class="p">;</span>
 openssl pkcs12 <span class="nt">-in</span> <span class="nv">$f</span> <span class="nt">-out</span> <span class="nv">$pemout</span> <span class="nt">-nodes</span> <span class="nt">-password</span> pass:somepass<span class="p">;</span>
 openssl rsa <span class="nt">-in</span> <span class="nv">$pemout</span> <span class="nt">-out</span> <span class="nv">$keyout</span><span class="p">;</span>
 openssl x509 <span class="nt">-in</span> <span class="nv">$pemout</span> <span class="nt">-out</span> <span class="nv">$crtout</span><span class="p">;</span>
<span class="k">done</span>
</code></pre></div></div>

<p><strong>What It Does:</strong></p>

<ul>
  <li>Converts each PFX file to PEM format</li>
  <li>Extracts the private key</li>
  <li>Extracts the certificate</li>
</ul>]]></content><author><name>Brooks Cunningham</name></author><summary type="html"><![CDATA[I recently needed to decrypt multiple PFX files, extract their keys, and obtain server certificates. Below is a Bash script solution for batch processing PFX files in a directory.]]></summary></entry></feed>