<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Christopher Elce on Medium]]></title>
        <description><![CDATA[Stories by Christopher Elce on Medium]]></description>
        <link>https://medium.com/@christoff.elce?source=rss-af92d117091e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_WJJ7ZjPe2S9ZTHKS0OWCA.jpeg</url>
            <title>Stories by Christopher Elce on Medium</title>
            <link>https://medium.com/@christoff.elce?source=rss-af92d117091e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 07:45:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@christoff.elce/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Setting Up a Home Lab for Elastic SIEM: A Step-by-Step Guide]]></title>
            <link>https://medium.com/@christoff.elce/setting-up-a-home-lab-for-elastic-siem-a-step-by-step-guide-e85f3750eb25?source=rss-af92d117091e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e85f3750eb25</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Christopher Elce]]></dc:creator>
            <pubDate>Sun, 15 Oct 2023 07:15:48 GMT</pubDate>
            <atom:updated>2023-10-15T07:53:56.193Z</atom:updated>
            <content:encoded><![CDATA[<p>In this comprehensive guide, I’ll walk you through the process of creating your own Elastic Stack Security Information and Event Management (SIEM) home lab using the Elastic Web portal and a Kali Linux virtual machine (VM). By the end of this project, you’ll be able to generate and analyze security events, set up agents for log forwarding, create dashboards, and establish security alerts. This hands-on experience is not only a great addition to your cyber security skillsets but also a valuable talking point for job interviews.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mRkx2HwrgnIjIv7E" /><figcaption>(Photo by <a href="https://unsplash.com/@christinhumephoto?utm_source=medium&amp;utm_medium=referral">Christin Hume</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a>)</figcaption></figure><p>Before getting started, it’s important to understand structurally <em>what</em> Elastic Stack is and <em>why</em> it’s important when compared to <a href="https://www.gartner.com/reviews/market/security-information-event-management/compare/product/elastic-elk-stack-vs-splunk-enterprise">similar alternative tools</a>, like Splunk. (At the end of the day, you and your employer will use whatever tool(s) are required based on business use cases).</p><p>The Elastic Stack, previously known as <a href="https://www.elastic.co/elastic-stack">ELK</a>, comprises four integral elements:</p><ul><li>Elasticsearch, the search engine and analytics platform</li><li>Logstash, the data processing conduit</li><li>Kibana, the data visualization tool</li><li><a href="https://www.elastic.co/guide/en/beats/libbeat/current/beats-reference.html">Beats</a>, a recent integration (this post won’t go over beats, but worth checking out)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZdESRUULxdZI9eEBCeow3w.png" /><figcaption>The Elastic Stack architecture</figcaption></figure><p>When implemented effectively, these elements create a formidable framework tailored for navigating and managing scalable datasets in real-time. The business world frequently adopts the Elastic/ELK stack to:</p><ul><li>Conduct thorough log analysis</li><li>Perform live analytics</li><li>Tackle challenges that demand exploration, analysis, and visualizations of boatloads of data.</li></ul><h3><strong>Roll Up Your InfoSec Sleeves &amp; Let’s Get Started…</strong></h3><p><strong>Prerequisites:</strong></p><ul><li>VirtualBox or VMware (note that VMware is used in this guide)</li><li>Basic knowledge of Linux and virtualization software</li></ul><p><strong>Step 1: Set up a free trial Elastic Account</strong></p><ul><li><a href="https://cloud.elastic.co/registration">Create a free Elastic account</a>.</li><li><a href="https://cloud.elastic.co/">Log in to the Elastic Cloud console</a>.</li><li>Start a free trial, create an Elasticsearch deployment, and choose your region and deployment size.</li><li><a href="https://www.elastic.co/guide/en/security/current/prebuilt-rules-management.html#load-prebuilt-rules">Install and enable Elastic prebuilt rules</a></li></ul><p><strong>Step 2: Setting up the Linux VM</strong></p><ul><li>Download the Kali Linux VM from the official website.</li><li><a href="https://www.kali.org/get-kali/#kali-virtual-machines">Set up a new VM with the Kali VM</a> file using your preferred virtualization platform (e.g., VirtualBox or VMware). If you’re stuck on how to do this, read the Kali Linux documentation and look on Google or YouTube.</li><li>Complete the Kali Linux installation and log in with both the default username and default password as <em>kali</em></li></ul><p><strong>Step 3: Setting up the Agent to Collect Logs</strong></p><ul><li><a href="https://www.elastic.co/guide/en/fleet/current/fleet-overview.html">Learn about the role of agents in Elastic SIEM</a>.</li><li><a href="https://www.elastic.co/guide/en/security/current/install-endpoint.html">Install the agent on your Kali VM by following steps provided on Elastic’s blog post</a>. Here’s some helpful visuals…</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KPTn9OZai2JALGoEx2zdWw.png" /><figcaption>Elastic Deployment successfully setup</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*xmtLyolN8_JKR_EE034Uew.png" /><figcaption>Click on “Add integrations” on the bottom left.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*32WakV5FzyZN2n5cwSoVbQ.png" /><figcaption>Click on “Elastic Defend” and follow the instructions to install the Elastic agent on your Kali VM in your Kali terminal.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*bVq06Mu2_jYVWKgh3E3Zng.png" /><figcaption>Verify that the agent successfully downloaded with the terminal command <strong>sudo systemctl status elastic-agent.service</strong></figcaption></figure><p><strong>Step 4: Generating Security Events on the Kali VM using Nmap</strong></p><ul><li>Install Nmap on the Linux VM (if not using Kali).</li><li><strong>Important Note: Use Nmap responsibly and know what that fully means before proceeding further</strong>. If you are unfamiliar with Nmap and its legal implications, <a href="https://nmap.org/book/legal-issues.html">here is a good place start</a>. Remember, with great cyber power comes great responsibility.</li><li>Run some Nmap scans on your Kali VM’s IP address to generate security events in Elastic.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*0GO1GHqYrL0Z9mwC3VxNvw.png" /><figcaption>Remember, make sure to run Nmap scans on <strong>your Kali VM’s IP address</strong>.</figcaption></figure><p><strong>Step 5: Querying for Security Events in the Elastic SIEM</strong></p><ul><li>Learn how to query and analyze logs in Elastic SIEM.</li><li>Search for specific security events using Elastic’s web interface.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*7E1M1gmmfXgZ41GCF79H7w.png" /><figcaption>Within your Elastic Deployment, click the menu icon (three horizontal lines at the top left) and then click on “Logs” tab under “Observability”.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g7W3I2KLTyl3P2HVH-hybA.png" /><figcaption>You should now see log events from you Kali VM. In the search bar under “Stream” type in <strong>process.args: “nmap”</strong> to display the Nmap events created on your Kali VM. Congratulations, you are now learning how to use <a href="https://www.elastic.co/guide/en/kibana/current/kuery-query.html">KQL</a> to filter data in your SIEM!</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2CTsPjsjeOkPAtEaBOVfEA.png" /><figcaption>Hover over any of your listed Nmap events. Click on the three dots to the right of the event to view the event’s details. In this particular example, an Nmap UDP scan was detected. Your Nmap event details will most likely differ and that’s OK!</figcaption></figure><p>Analyzing diverse security events in Elastic SIEM provides valuable insights into real-world security incident detection, investigation, and response procedures. Try opening different applications or create other events on your Kali VM and see if you can spot them in Elastic. Doing this will reinforce your understanding of Kali, Linux terminal commands, and how to better spot true positive and false positive security events in your SIEM.</p><p><strong>Step 6: Create a Dashboard to Visualize the Events</strong></p><ul><li>Explore how to use visualizations and dashboards to analyze event logs.</li><li>Create a simple dashboard to visualize the count of security events over time. Knowing how to do this is a very important skill to have for communicating cyber security to decision makers and stakeholders in your company! A lot of your daily tasks will involve composing reports along with using communication and collaboration soft skills.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*Li0vJ_58lNUWCk66GIpxiQ.png" /><figcaption>Click on “Dashboard” under “Analytics” in the menu. Next, click on “Create dashboard” at the top right to create a new dashboard. Then, click on “Create Visualization” to add a new visualization to the dashboard.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*np-1zNSRGQJIojOyQT_rRQ.png" /><figcaption>Pick a visualization display type by choosing “Area”, “Line”, or “Bar vertical” (the author picked this one). Doing so will create a chart that shows the count of events over time.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lLlGiiwM2qQbB7iyBHIecQ.png" /><figcaption>Setup the parameters for the visualization with those indicated on the right in this example. Click on the “Save” button at the top right.</figcaption></figure><p><strong>Step 7: Create an Alert</strong></p><ul><li>Discover the importance of alerts in SIEM.</li><li>Create an alert in Elastic SIEM to detect Nmap scans based on custom queries.</li></ul><p>Alerts serve as a vital component in a SIEM system, ensuring the prompt detection and response to security incidents. These alerts are crafted based on predefined rules or customized queries, tailored to trigger precise actions when specific conditions are met. The focus here is to walk you through the process of setting up an alert within Elastic SIEM, designed to detect specified events (in this case, Nmap scans). By adhering to these steps, you’ll establish an alert system that actively monitors your logs for predefined activities that promptly informs you upon their detection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*FoszDxgvpM5QmrWUafhqMw.png" /><figcaption>Click on “Alerts” in the menu at the top left.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*55AqpSQiOyyVzXC2pdEh-A.png" /><figcaption>Select “Manage rules” in the box at the top right.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VIHcB7EThVw4lEH0gu2Yhw.png" /><figcaption>Select “Create new rule” in the box at the top right.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZxW1oKmiTt7zNcNlnAMyFA.png" /><figcaption>Select the “Custom query” Rule type.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N8VkBHra3OfobM-LuzeUhA.png" /><figcaption>Under “Custom query,” type <strong>event.action: “nmap_scan”</strong> which is the condition for the rule and will match all events with the action “nmap_scan.” Next, click “Continue.”</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rf89kNmK9pg1ieNPzz8gyw.png" /><figcaption>Fill in the “About rule” section however you prefer. In this example, the Default severity level is set to High with a Default risk score of 85. Click “Continue”.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6TcJC-SzQBgvrL1wHmTwPg.png" /><figcaption>Runtime for rules can be adjusted under “Schedule rule”. In this example, the default values were used. Click “Continue”.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IZIbmb8FGbiEcJkyJlZd_A.png" /><figcaption>In the “Rule actions” section, pick the action to take when the rule is triggered. Notice that these actions can range from email, Jira or Slack alerts depending on which tools your business units/teams prefer to use. Click the “Create and enable rule” button to create the alert.</figcaption></figure><h3><strong>Conclusion:</strong></h3><p>In this guide, you’ve set up a home lab to practice Elastic SIEM and gain hands-on experience in security monitoring and incident response. You’ve learned how to forward data, generate and analyze security events, create dashboards, and set up alerts. This practical experience will enhance your skills and prepare you for a career as a security analyst or engineer.</p><p>I would like to extend a sincere thank you to Abdullahi Ali for providing inspiration and encouragement for this blog post. You can find Abdullahi’s blog post about using Elastic SIEM, here: <a href="https://medium.com/@aali23/a-simple-elastic-siem-lab-6765159ee2b2">https://medium.com/@aali23/a-simple-elastic-siem-lab-6765159ee2b2</a></p><p><strong>Next Steps:</strong></p><ul><li>Experiment with different security and non-security events on your Kali VM and test the alert. Doing this will help reinforce your Linux and threat hunting skills at the same time.</li><li>Explore more features of Elastic!</li><li>Setup your own Elastic project based on a specific simulated business use case.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e85f3750eb25" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Supercharge Learning Cybersecurity with Cisco Packet Tracer]]></title>
            <link>https://medium.com/@christoff.elce/how-i-supercharge-learning-cybersecurity-with-cisco-packet-tracer-20fce8350105?source=rss-af92d117091e------2</link>
            <guid isPermaLink="false">https://medium.com/p/20fce8350105</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[college]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[network-security]]></category>
            <dc:creator><![CDATA[Christopher Elce]]></dc:creator>
            <pubDate>Sat, 12 Aug 2023 06:05:25 GMT</pubDate>
            <atom:updated>2023-08-15T01:44:32.477Z</atom:updated>
            <content:encoded><![CDATA[<p><em>“Whatever, I’m getting cheese fries.”</em> (Regina George, <em>Mean Girls</em>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P74ZfjonMc7GAk7yZMVSQw.jpeg" /><figcaption><a href="https://unsplash.com/photos/M5tzZtFCOfs?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditShareLink">Photo Credit: Taylor Vick</a></figcaption></figure><p><strong>I encountered a hurdle while learning networking for my cybersecurity classes. You may have encountered this hurdle too. Here’s the story of how I overcame that hurdle and how you can overcome it…</strong></p><p>When learning about computer networks through school, or independently, sometimes the material and overall experience can feel… <em>dry</em>. For example, we’re often told to memorize the layers of the OSI and TCP/IP models by simply re-reading the text and diagrams about them over and over again.</p><p>I would rather watch paint dry.</p><p>This was “the hurdle”.</p><p>That’s <em>not</em> an indictment against schools or instructors teaching about computer networks and cybersecurity. At the time of this blog post, I’m enrolled in a cybersecurity masters degree program. I enjoy reading the textbooks. I enjoy attending the lectures. I enjoy being in college again. At heart, I’m probably an (informal) academic and greatly empathize with the struggles that educators have to go through each day.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*ru-1JDwM0pczXmLrKkG3RQ.jpeg" /><figcaption>A model of the college student development lifecycle. Remember, even Goku had to train and study a lot to learn his “instant transmission” technique from the Yardrats. If you’re not familiar with anime or manga and still reading this, I’m trying to encourage the reader to not skip class.</figcaption></figure><p>More often than not, the <strong>default algorithm for institutional education </strong>is something like this: start with a huge data damp based on constraints imposed by deadlines (welcome to the joys of adulthood!), then pass a certification exam (Network+, CCNA, etc…), and then attempt to land a cybersecruity job without demonstrating significant time invested into hands-on experiences (i.e. time invested into consistently completing cybersecurity projects and putting them in your portfolio).</p><p>Nope. Do not pass Go. Do not collect $200.</p><p>Instead, I prefer to undergo the above default algorithm… but in reverse.</p><p>This is how I overcame “the hurdle”.</p><p>I learn stuff best, and fastest, when getting hands-on with the subject matter <em>first</em>. Then, I integrate the course material in tandem while reading the textbook. After that, the data dump step happens organically (much like a <a href="https://en.wikipedia.org/wiki/Daemon_(computing)">daemon</a>), with the result allowing me to get into <em>a learning flow</em>. Yes, this learning approach does require some time investment into <a href="https://hbr.org/2016/03/learning-to-learn"><em>learning</em> <em>what to learn</em></a> and what specific tools to get hands-on with. The investment of going above and beyond is worth it, in my opinion, and pays long term dividends.</p><p>My pedagogical bias comes from having been a <a href="https://www.youtube.com/@catnipandchives/featured">chef</a> in a past life. Learning to be a chef was entirely hands-on learning with some frequent reading. I did not go to culinary school and learned by working in restaurants. My dad was a chef and taught me some cooking fundamentals while growing up too (a privilege that gave me a small advantage, I admit).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*wwhTTulE4Mv_vBEIGioN7A.gif" /><figcaption>It’s all about learning how to learn and getting into a flow.</figcaption></figure><p>Ok, so the story so far has presented the hurdle (the challenge) and a learning mindset to approach that hurdle with (a way to learn). But what specific hands-on tool, combined with the mindset, did I incorporate into the whole process to overcome the hurdle?</p><p><a href="https://learningnetwork.cisco.com/s/packet-tracer-alternative-lab-solutions">Cisco Packet Tracer</a>. That’s the tool I used (and still use) to design simulated cybersecurity networking home labs.</p><p>Cisco Packet Tracer was easy to install and it’s free. Cisco also provides <a href="https://skillsforall.com/course/getting-started-cisco-packet-tracer?courseLang=en-US">free introductory online learning videos for Packet Tracer</a>. Free is good when you’re a student; especially when you’re learning while on the job hunt.</p><p>Sure, other free tools exist such as <a href="https://www.gns3.com/">GNS3</a> and <a href="https://www.eve-ng.net/">EVE-NG</a> (Community version) which are actually emulators, but I find it’s best to keep things simple when diving into computing networking for the first time. After first gaining proficiency with Cisco Packet Tracer (which is just a visual simulator tool, not an emulator), taking the leap later into GNS3 and EVE-NG makes logical sense more often than not if you want to dive deeper into networking.</p><p>The goal is to plug and play right away with the least friction possible with a simple download. We don’t want the feeling of discouragement at the beginning of our learning journey due to needing to tweak software configurations.</p><p>Below is a very brief simplified overview of what it’s like to use Packet Tracer. Don’t worry if you don’t understand everything shown or any of the technical networking terminology. You will learn those things gradually over time due to the hands-on learning experience using Packet Tracer combined with your cybersecurity studies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8x1V_RGLlxgQNNlrmuHR9w.png" /><figcaption>Click and drop to design a <a href="https://en.wikipedia.org/wiki/Network_topology">network topology </a>and simulate computer networking hardware in Cisco Packet Tracer. The Event List on the top right lists <a href="https://en.wikipedia.org/wiki/Protocol_data_unit">PDU</a> events. In this example, events were filtered to show only <a href="https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol">ICMP</a> events.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xf_rd3d39S7OBeHElMAThQ.png" /><figcaption>Use the Config feature to configure simulated devices in your network design (in this case, Laptop0). Notice that a <a href="https://en.wikipedia.org/wiki/MAC_address">MAC address</a> is assigned by default to the simulated laptop. We are also assigning a static <a href="https://en.wikipedia.org/wiki/Internet_Protocol_version_4#Addressing">IPv4 address</a> and s<a href="https://en.wikipedia.org/wiki/Subnet">ubnet mask</a>.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9kjTQryLykzWSg1H1xirsw.png" /><figcaption>The built-in terminal feature can be used to used to <a href="https://en.wikipedia.org/wiki/Ping_(networking_utility)">ping</a> devices on the simulated network.</figcaption></figure><p>Remember when I mentioned earlier about needing to memorize the layers of the OSI model? Well, it’s easier to learn the OSI model now because we get more context when using Packet Tracer. It tells us what parts of the OSI model are being used based on the simulated networks we design! Textbooks are great passive learning resources when using tools but textbooks alone cannot provide this additional level of active hands-on learning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ySSWPLaO1Au3WUcETdr-8g.png" /><figcaption>Learning the OSI model hands-on with much more context from building a simulated network.</figcaption></figure><p>Ever get stuck figuring out what all the bytes and bits inside PDU’s are about when reading your textbook? Packet Tracer features those too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Lw5T_6RRaUWF0qMEvndwQ.png" /><figcaption>Inbound PDU info for a simulated laptop within a network design in Packet Tracer.</figcaption></figure><p>These are just a handful of the many features within Cisco Packet Tracer and how they can help you learn computer networking. Having a strong fundamental knowledge of computer networking is a must when learning and working in cybersecurity. Sure, you’ll still have to use your search engine of choice to figure some things out along the way, but I hope this post and pedagogical perspective helps you along your learning journey.</p><p>If you enjoyed reading this post or want to tag along while I learn cybersecurity, follow me on <a href="http://www.linkedin.com/in/chris-elce-675b22208">LinkedIn</a> and/or here on Medium.</p><p><em>“The beautiful thing about learning is that nobody can take it away from you.” <br>— B.B. King</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d7C3Jof_qfdHIRUBoGmNaA.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20fce8350105" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn Cybersecurity with Minecraft and Docker]]></title>
            <link>https://medium.com/@christoff.elce/learn-cybersecurity-with-minecraft-and-docker-part-1-6275f528ec8c?source=rss-af92d117091e------2</link>
            <guid isPermaLink="false">https://medium.com/p/6275f528ec8c</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[devsecops]]></category>
            <category><![CDATA[minecraft]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Christopher Elce]]></dc:creator>
            <pubDate>Tue, 08 Aug 2023 08:47:34 GMT</pubDate>
            <atom:updated>2023-10-05T01:23:03.351Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>“Imagination is the only weapon in the war with reality.”</em></strong></p><p>— Cheshire Cat, <em>Alice in Wonderland</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*_qMF3qP3LiWxGKZtvmsDIw.png" /><figcaption>Sir John Tenniel’s hand-coloured proof of <a href="https://en.wikipedia.org/wiki/Cheshire_Cat">Cheshire Cat</a> in the Tree Above Alice for The Nursery “Alice”</figcaption></figure><p>Cybersecurity is a real concern in software development and application production environments. All too often these days, a cybersecurity breach occurs because a company or organization did not implement sufficient, or any, <a href="https://owasp.org/www-project-devsecops-guideline/latest/index">DevSecOps</a>. A good attribute of a tech company’s culture is one that prioritizes excellent product design principles (i.e. puts the users first) and cybersecurity principles <em>at the same time</em>. In other words, cybersecurity should be a forethought with every product design and production decision: never an afterthought.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*zE_RwJNHUIva9Id1zbNdww.png" /><figcaption>Nobody cared… until the dinosaurs breached the fences of the multibillion dollar amusement park. Thankfully, there was <a href="https://www.wired.com/2015/06/tech-time-warp-time-unix-saved-day-jurassic-park/">a hero who knew how to use Unix</a>.</figcaption></figure><p>But enough about dinosaurs, tech business and Hollywood inspired memes… you’re (probably, hopefully?) here to learn about cybersecurity and have some fun with Minecraft! Hands-on learning is the best way to understand cybersecurity concepts, and fortunately, <a href="https://youtu.be/NUlUk6hc-mQ">The_Sudo has created an awesome YouTube series to follow</a>.</p><p>So get comfy, check the vending machines (<a href="https://www.youtube.com/watch?v=q48sBgjIhwQ">see what I did there?</a>), and get your computer ready because we’re going to learn a lot…</p><h3><strong>OK, So What Are We Gonna Learn?</strong></h3><p>Here is the overview of what we’ll be learning:</p><ul><li>Using Docker Desktop to setup and run a Minecraft server</li><li>Building, running, and managing containers (services or microservices) with Docker</li><li>Assigning host ports, volumes, and environment variables to containers</li><li>Reading container logs and using Docker CLI to troubleshoot containers that won’t run</li><li>Passing variables into Docker containers based on Docker Hub image documentation</li><li>Inspecting container environment variables and data mounts an ports</li><li>Passing port mappings using Docker CLI</li><li>Making Minecraft data persistent with Docker Volumes and mapping it to a host</li><li>The differences between virtual machines (VMs) and containers</li><li>Creating and editing a Docker Compose file (YAML) in Visual Studio Code</li><li>Implementing restart policies to Docker Compose files</li></ul><h3><strong>Let’s Get Our Digital “Mise en Place” Ready</strong></h3><p>Prior to deep diving into cybersecurity, I worked as a chef, and the concept of “<a href="https://www.npr.org/sections/thesalt/2014/08/11/338850091/for-a-more-ordered-life-organize-like-a-chef">mise en place</a>” is something I carry over into my digital workflow. It’s an example of <a href="https://www.thebalancemoney.com/transferable-skills-list-525490">transferable skills</a> I learned from one career (cooking in restaurants) and can apply to a career in the tech industry. You, dear reader, have transferable skills… regardless if you’re just starting out in learning cybersecurity or have been in the tech industry for decades. (Job Searching Tip: Tactfully include your transferable skills in your resume to better communicate your story and unique worth as a cool person).</p><p>Anyway, we’ve got some software to download…</p><p><a href="https://docs.docker.com/desktop/install/windows-install/">Install Docker Desktop</a> on your Windows machine and read the software and hardware requirements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*gL5ImvTxdB2iOAxww1O2Qg.png" /><figcaption>Windows is used for this tutorial. If you’re using a Mac or Linux as your operating system, you’re on your own and will have to troubleshoot any issues by Googling them.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_bm3Sbj06n9O3Vm__45YnQ.png" /><figcaption>This is the user interface for Docker Desktop</figcaption></figure><p><a href="https://learn.microsoft.com/en-us/windows/wsl/install">Install WSL</a> on your Windows machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*K45EplSqgHRVKbbG-m0GVg.png" /><figcaption>Before or after installation, check to see if WSL is installed on your machine with <strong>wsl -l -v</strong> in PowerShell. Notice how WSL runs Ubuntu Linux by default.</figcaption></figure><h3><strong>So… What Exactly Is Docker?</strong></h3><p>I’m glad you (hopefully) asked! The_Sudo <a href="https://youtu.be/NUlUk6hc-mQ?t=355">gives a great explanation in his video</a> and I’ll include a brief one here: Docker puts software into “containers” and those containers include <em>all</em> the stuff that the software needs to run (stuff like the code, libraries, tools, etc…). Containers break up software (an application, for example) into much smaller related parts that are consistent and isolated. <a href="https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html">When implemented with best practices</a>, using containers for software development and production can reduce the attack surface from potential cybersecurity threat actors.</p><p>A lot of today’s applications run on Docker.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p2KXHhm-le_eVObRWZZBtw.png" /><figcaption>Docker’s client-server architecture. Source: <a href="https://docs.docker.com/get-started/overview/">https://docs.docker.com/get-started/overview/</a></figcaption></figure><h3><strong>Let’s Run a Minecraft Container In Docker</strong></h3><p>Before running a container in Docker, we need to get a Minecraft container “image”. A Docker image is a read-only immutable template which has all the files inside of it that define how a Docker container will run. A Docker container is just a runtime instance of a Docker image. <a href="https://hub.docker.com/">Docker Hub</a> has many images that you can check out if you’re curious what’s out there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_F5uwcke9neLax0BJvrw8w.png" /><figcaption>There are literally over 100,000 Docker images that have been made by both private companies and open source projects.</figcaption></figure><p>Let’s find a Minecraft image in Docker Desktop by using the Search feature and look for itzg/minecraft-server. Then, we’ll click the blue “Run” button which will pull the image and run it on our local computer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eQ9L9gtq5y0DZITublvACg.png" /><figcaption>Using Docker Desktop’s search feature to find a Minecraft server image. Notice the Tag, Pull, and Run features to the right of the image.</figcaption></figure><p>We can then name the Docker container and assign it a host port number.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*2yTbzyCNprL8VDKRsErvXw.png" /><figcaption>Naming a Docker container “minecraft” and assigning a host port of 25565… <a href="https://docs.datadoghq.com/security/default_rules/cis-docker-1.2.0-5.7/">(almost) any port number</a> could be used. Notice that we cannot change the container port (:25565/tcp) and it will be exposed. As a good cybersecurity remediation practice when assigning host ports, don’t map any TCP/IP port numbers below 1024 to containers since those are <a href="https://www.w3.org/Daemon/User/Installation/PrivilegedPorts.html">privileged ports</a>. In application development, exceptions do exist when assigning privileged ports to get an application to work outside of a container, but a good DevSecOps team will know when to apply those exceptions properly and document them.</figcaption></figure><p>We then click the blue “Run” button to run our Docker Minecraft server container. We encounter a problem…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EH7EJLH8MNC5wIrazOa14Q.png" /><figcaption>Container info in the Logs section in Docker of the Minecraft container server.</figcaption></figure><p>…Our container won’t run (our container Exited). The root cause is because we need to accept the Minecraft EULA (end user license agreement). How do we do that? We first need to read the <a href="https://hub.docker.com/r/itzg/minecraft-server">documentation on Docker Hub</a> from the image creator of the Minecraft server to find out what commands to pass. Here’s the documentation, below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NEE6OHF2Q9TIYkTDhFFGzA.png" /><figcaption><a href="https://hub.docker.com/r/itzg/minecraft-server">Documentation for the Minecraft server</a> image found on Docker Hub. Notice the command and variable (EULA=TRUE) we need to pass to accept the EULA.</figcaption></figure><p>Let’s create the new container in Docker Desktop and fill in the Variable and Value fields. Then, click Run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*1UG_4UgtcrVN3utn7ofnQA.png" /><figcaption>Specifying the EULA agreement by indicating EULA as a Variable with Value of “true” in Docker Desktop. (Due to eye strain, I switched to dark mode in Docker at this point)</figcaption></figure><p>When I clicked Run, I ran into a problem with Java on my computer that you may, or may not, experience. It prevented my container from running. Specifically, I got a “JNI error”. This error occurred because the latest Minecraft update (at the time of this blog post) is not compatible with older versions of Java. There are two steps that can be taken to fix this issue: update to the most recent JDK Development Kit (Java) and/or delete a corrupted system variable path for Java.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/1*zN0ZMa2VxRehT3R4h47zsQ.png" /><figcaption>The struggle was real with this JNI error but some quick Googling helped me find a solution.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/1*xwqJc8GWT8cvx76rPAznmw.png" /><figcaption>Deleting the corrupted Java system variable path on Windows to remove the JNI error.</figcaption></figure><p>Now with the JNI issue out of the way, let’s Run the container and check out if it’s running on Docker CLI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dBilXLQn3XJbWGwhaKjjsw.png" /><figcaption>Using <strong>docker ps</strong> command in Docker CLI to get a list of our running containers. Our Minecraft container shows up! We then use <strong>docker logs mc</strong> to see our Docker Desktop logs in PowerShell.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aP3M_E283K5NCAuyyZJALw.png" /><figcaption>Watching logs in real time using <strong>docker logs mc -f</strong> command in Docker CLI.</figcaption></figure><p>We can inspect our container in Docker Desktop by clicking the “Inspect” tab. This shows us our environment variables, Volume (data) mounts, and ports.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bWKlNPlhgIHwhogfB2CbIA.png" /><figcaption>Using the Inspect feature in Docker Desktop to look at environment variables on the Minecraft server container.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HYPKyWlPA8IXRdGyDIJ5Vw.png" /><figcaption>Using the Inspect feature in Docker Desktop to look at Mounts and Port.</figcaption></figure><p>We can also use the Terminal to access the Minecraft server container and do things like limit access to our container to specific IP addresses: a practice of DevSecOps and cybersecurity called “whitelisting”. Whitelisting can be challenging to execute in practice, but is important for application security. In a nutshell, the goal of whitelisting is to declare what we want to allow to access an application, reduce the amount of noise in a production environment, and quickly identify odd configuration changes (or worst case scenario, a possible cyberattack) if we notice a container change that the developers didn’t push.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HQdx0eIbdDTiL9Pw4cRosg.png" /><figcaption>Using <strong>rcon-cli</strong> command in Docker Desktop’s Terminal to whitelist.</figcaption></figure><p>We can view files within our container using the Files feature tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j2n0grsuWws09CXhcPl_Nw.png" /><figcaption>Using the Files feature tab in Docker Desktop</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fmo8jw6I86qM3oG9Dkx1Sw.png" /><figcaption>Using the Stats feature tab in Docker Desktop</figcaption></figure><p>Once we see <strong>RCON running</strong> in our container Logs, we can <em>connect</em> to the Minecraft server. What the heck does RCON running even mean? It’s an interesting network protocol used for Minecraft (RCON is short for “Remote Console”) and some other game servers. Info about it can be found, <a href="https://wiki.vg/RCON">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FH5QSk_VbzhZooE-48U0Pw.png" /><figcaption><strong>RCON running</strong> appearing in Docker Desktop Logs. Time to connect to the Minecraft server!</figcaption></figure><p>Let’s spin up Minecraft. Note that the version of your Minecraft Launcher needs to match the version of your Minecraft server container in Docker. In this case, I’m using version 1.20.1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PU7H138s4Q9nGg2F59Dkng.png" /><figcaption>Opening Minecraft Launcher and using version 1.20.1</figcaption></figure><p>We’ll select Multiplayer from the game menu, add our server, and click the Done button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*pDYDJFC-kOsncoMZoUcPxA.png" /><figcaption>Clicking Add Server in Minecraft Multiplayer menu.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*3v-JySK7BG1JzwYcHFMawQ.png" /><figcaption>Creating our Server Name and adding our Server Address</figcaption></figure><p>We are now connected successfully to the the Minecraft server using our Docker container!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*jKAnZGbYTVBuu2rZS5rabQ.png" /><figcaption>Lucky day for me because I happened to spawn into a map that has sunflowers. I like sunflowers.</figcaption></figure><p>In the Minecraft server logs on Docker, you can see when I joined the game and that I was slain by a zombie while taking the above screenshot. That zombie and I are now sworn enemies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iAG01droKpnvGygBc0aICA.png" /><figcaption>My game activity appearing in the Minecraft server logs for the Docker container. That zombie and I still have some unfinished business…</figcaption></figure><p>If we wanted to run a Docker container using Docker CLI, we would enter the following command indicated in the screenshot below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JUnJta9VifbWqTeoz19ROA.png" /></figure><p>What’s going on here with this command? Let’s break it down. <strong>docker run</strong> will run the container. We then <a href="https://docs.lug.oregonstate.edu/Linux/basic-commands/">pass the flag</a> <strong>-d </strong>(which means “detached”)<strong> </strong>so we can run our container in the background and not in the current session (your terminal will be flooded continuously with logs if you don’t use -d). <strong>— — name</strong> is the name of the container which we call <strong>mc2 </strong>(because container names have to be unique… no repeats!). <strong>-p</strong> is used to pass the port mapping, which is 25564 (the port on your computer that will map to the container) and 25565 (the port that the Minecraft container is exposed to). <strong>-e</strong> is for the environment variables, and in particular, our EULA=TRUE variable. We then pass the <a href="https://docs.docker.com/engine/security/userns-remap/">namespace</a> and container image name from Docker Hub followed by the Docker tag of the image (“latest”), which is <strong>itzg/minecraft-server:latest</strong>.</p><p>Now, our mc2 container from the Docker CLI command appears in Docker Desktop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Dtzps96t_3q2igQequZAg.png" /><figcaption>The mc2 container ran from Docker CLI appearing in Docker Desktop</figcaption></figure><p>We’ll delete the mc2 container since we won’t be needing it going forward.</p><h3><strong>Docker Volumes &amp; How To Make Application Data Persistent</strong></h3><p>Let’s check out the Volume for our Minecraft container in Docker Desktop. If we clicked on the link under Name, we would be brought to a page with Image, Port, and Target columns. I forgot to take a screenshot of that, but in the spirit of self-discovery, you can easily explore that for yourself. In any case, under Target, you will see /data indicated below it. What this means is that there’s a directory in the Minecraft server container named /data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RLYcUnrQokdWTNcpoiEosg.png" /><figcaption>Volumes feature in Docker Desktop.</figcaption></figure><p>We can go into the container Terminal in Docker Desktop and run the following commands to see more of what’s under the hood…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gB9XumiT_nqoFtlEQW5ZaQ.png" /><figcaption>Discovering that /data is a directory and contains all the Minecraft server data.</figcaption></figure><p>So what would happen to our Minecraft server data if our Docker container was deleted, got corrupted, or was replaced? All of our Minecraft data and hours of gameplay building cool stuff, presumably with our friends, would be gone forever!</p><p>The above hypothetical set of scenarios is why making data persistent in application development and operations is important. It’s important from a <a href="https://www.securitymagazine.com/articles/93085-persistent-data-exposure-is-a-much-riskier-problem-in-todays-remote-world">cybersecurity standpoint</a> too. In Docker, we use Volumes to make our data persistent.</p><p>A hallmark of any good software developer(s) is that a developer(s) will provide solid documentation (yes, I’m an optimist at heart just as much as I am a realist). Fortunately, we can lookup <a href="https://docker-minecraft-server.readthedocs.io/en/latest/data-directory/">documentation for the Minecraft container on Docker Hub</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r870Z3DmvIwsQMv0rFkcCw.png" /><figcaption>Documentation for the Minecraft server container on Docker Hub. It explains how the data in the data directory is setup.</figcaption></figure><p>In the Data directory documentation, we see that we need to attach /data/ to our host directory on our computer. Instructions are provided on how to attach the data using the <strong>-v</strong> flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-fgKwVeBziXDgGQpvhDdeg.png" /><figcaption>Instructions for how to attach data directory for Minecraft server container in Docker to our computer’s filesystem.</figcaption></figure><p>We then make an empty folder named “mcdata” on our computer’s hard drive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LC3is8X63agDMIl1O77ehw.png" /><figcaption>Making an empty folder named “mcdata” on host machine’s hard drive.</figcaption></figure><p>Remember the file path of the mcdata folder just made.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*GjtbuqaljEZtFOh11-pwng.png" /><figcaption>File path for mcdata folder.</figcaption></figure><p>Let’s get rid of our previous Docker container and run a new one. This time, we will be including info for the Volumes fields. Then we click on Run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*VVZN183ArcOw25wn78v7sg.png" /><figcaption>New Docker container with the the mcdata folder host path name and container path name (/data) from the Docker Hub documentation for the Minecraft container. Note that the host port is still 25565 even though it reads “Host port”.</figcaption></figure><p>The mcdata folder will now populate with with our Minecraft files. What this means is that no matter what happens to our Docker container, our Minecraft data will not be lost (unless we lose our host computer or the hard drive fails). We have achieved data persistence! Data persistence will also allow us stress less about making Minecraft mods (stay tuned for Part 2 of this blog series about mods… or just <a href="https://www.youtube.com/watch?v=iP8dyO7Y1Zg&amp;list=PLZlXrZGK4hBiJx_NasfmFEuLVB4oLKIul&amp;index=2">watch The_Sudo’s video about it</a>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TeKOiJXUQdSLl1R37aReBA.png" /><figcaption>Data persistence with Minecraft data in Docker</figcaption></figure><p>Let’s test to see if our Minecraft player data is actually persistent by connecting to our Docker container and collect 5 blocks in our inventory before exiting the game.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*Px_yYkXJgUbuiMlvtxZ5fQ.png" /><figcaption>Digging a ditch in the name of data persistence. That zombie better not show up again…</figcaption></figure><p>We then delete our Minecraft server… forever…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iL36v9BKBoh44AvGEUHDqQ.png" /><figcaption>Bye bye Minecraft server!</figcaption></figure><p>However, our data is still safe on our host computer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QeQBvLVkXbrnaky8xixdQw.png" /><figcaption>Data is safe. I wonder if I’ll get to see more sunflowers again?</figcaption></figure><p>To finish our test, let’s run another new Docker container of the Minecraft server…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*-b2Yo8R6IvGhtAkQbhzbmQ.png" /><figcaption>Here we go again!</figcaption></figure><p>…and our five blocks are still in our inventory! The test was a success.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*oXBnsCix4Qw-fn8FurHv6Q.png" /><figcaption>No lost data and still have five blocks. I hear a zombie approaching…</figcaption></figure><p>So far, everything we’ve done has been fun but it’s been rather tedious and repetitive. It’s not efficient. How do we make our operations and overall movements more efficient with Docker? We’re going to use Docker Compose.</p><h3><strong>Using Docker Compose with Minecraft</strong></h3><p>Docker compose comes with Docker Desktop on Windows. If using Mac or Linux, you’ll have to install the appropriate packages.</p><p>To check to see if Docker Compose is already on your computer, run the <strong>docker compose </strong>command to see if it’s installed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*NFN-leVLbNplV3S-gweS7w.png" /><figcaption>Yup, Docker Compose is installed.</figcaption></figure><p>I’ll be using Visual Studio Code (VS Code) which <a href="https://code.visualstudio.com/">you can download for free</a>. For those of you out there that prefer a different IDE (integrated development environment), go for it.</p><p>On our computer let’s make an empty folder named “mc-docker”, click Explorer in VS Code, and select that folder. In that folder, create a file named “docker-compose.yml”. In case you’re wondering what the “.yml” extension is in the file name, it’s to indicate a <a href="https://en.wikipedia.org/wiki/YAML">YAML file</a>. So, our docker-compose.yml file is a YAML file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ki5ShWB-Y3mi_UGtzzN2xw.png" /><figcaption>Creating a YAML file named docker-compose-yml within our mc-docker folder in VS Code.</figcaption></figure><p>The creator of the Minecraft server Docker container indicates in the container documentation on Docker Hub what we can use for our YAML file. Nice!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WLxJCnMJ4Qt99PqxNDsHeg.png" /><figcaption>Docker Compose documentation for the Minecraft server container.</figcaption></figure><p>Let’s copy-paste that YAML into our VS Code file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k98uY_XevhywTQJyiKvAtg.png" /><figcaption>Making a YAML file in VS Code based on Docker Compose documentation.</figcaption></figure><p>Let’s update volumes (line 14) to indicate the Volume on our computer we want to map to the source data directory inside the container. This is exactly what we were doing when configuring with Docker Desktop and Docker CLI earlier. However, in this case, we’ve written the configuration into a YAML file. Notice how this process is much more efficient and less repetitive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*irxOJtoqqDTve7RYuYg7aQ.png" /><figcaption>Editing the YAML file in VS Code to map data from our computer to the Minecraft server container.</figcaption></figure><p>Open a terminal in VS Code which appears below our code so we don’t have click between separate windows like before. Much more efficient, isn’t it?</p><p>In the terminal to check that you’re in the right directory, run the <strong>ls</strong> command. Next, run the command <strong>docker compose up -d</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3CZxN6M00254m3V2UE_Kpg.png" /><figcaption>Don’t forget to include the <strong>-d f</strong>lag in<strong> </strong>the command! Or, be a rebel and don’t include it to see what happens…</figcaption></figure><p>We can then run the command <strong>docker ps</strong> to make sure the container is running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*8HSUTR7N2akeCHQmaNcVCg.png" /><figcaption>So far so good. The container is running.</figcaption></figure><p>Meanwhile, in Docker Desktop, here’s what has happened. We are now running a Docker Compose <em>stack</em> (notice the “stacked paper” icon to the left of “mc-docker” for the visual cue). A stack allows multiple containers (containers are also called “services” or “microservices”) to be ran simultaneously, even though in our example we’re only using one container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ldVhmJhYAE_jdyVJlXU_1A.png" /><figcaption>Running a Docker Compose stack with the Minecraft server container in it.</figcaption></figure><p>Let’s double check our container to make sure our data is mounted properly. The data is mounted properly to C:\mcdata.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pSL73E3mNYXQlCp3uVXzqw.png" /><figcaption>Inspecting the container to make sure our data is mounted properly.</figcaption></figure><p>(Spoiler Alert: later in this series, we’ll be using Docker Compose to launch analytics and metrics functionality with <a href="https://en.wikipedia.org/wiki/Grafana">Grafana</a> and <a href="https://hub.docker.com/r/prom/prometheus">Prometheus</a> containers along with our Minecraft containers).</p><h3><strong>Game Over Man, Game Over. Let’s Restart!</strong></h3><p>What would happen to our container if something happened to it causing it to shut down while our friends were playing on our Minecraft server? Sure, the game data is protected due to us enabling data persistence, but most likely, our friends would ask us to restart the server right away. However, what if we’re on the road or away from our computer for a couple weeks? It would be a sad couple of weeks on that Minecraft server. What solution can we come up with so we don’t have to feel shackled to our computer everyday?</p><p>Use a <a href="https://docs.docker.com/config/containers/start-containers-automatically/">Docker restart policy</a>. That’s the solution.</p><p>Let’s stop our Docker stack by running the command <strong>docker compose down </strong>in our VS Code terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*ucrk6xupITFIGyPiXU2v_Q.png" /><figcaption>Stoping a Docker stack using Docker Compose</figcaption></figure><p>We include a restart policy by adding another line to our YAML file (line 15). This line indicates that if our container fails, then restart three times before giving up. If you don’t specify the number of restart times, <em>it will keep restarting indefinitely</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*cGbAHkOdsldo6FGVnxl7zg.png" /><figcaption>Third time’s a charm, right?</figcaption></figure><p>Run the command docker compose -d in the VS Code terminal to get the stack back up and running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*vwDvN5v9z5D536WDaAZUSg.png" /><figcaption>Running the stack again.</figcaption></figure><p>To test our restart policy, let’s comment out our EULA policy by adding a # symbol at the beginning of lines 10 and 11. This will cause the container to exit (not start) and trigger our restart policy since the EULA file is required for running the Minecraft server container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/1*TAoa0f3V-3JX5hqAHTGz8g.png" /><figcaption>Commenting out environment and EULA with # to cause the Docker container to not start, triggering our restart policy (line 15).</figcaption></figure><p>Because our data is persistent, we need to delete the actual EULA file for our test to work, which is the eula.txt file located in the mcdata folder on our computer’s hard drive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SDtGGVd51tK4FnGYBPwMBw.png" /><figcaption>Bye bye EULA policy!</figcaption></figure><p>The restart policy was triggered, which we can see in the Logs of the container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GZ-7RUcO6Zrs_VGkRRNeVQ.png" /><figcaption>Restart policy test is now complete!</figcaption></figure><p>Stay Tuned For More Minecraft &amp; Docker Fun…</p><p>In Part 2 of this series, we will learn from <a href="https://www.youtube.com/@TheSudo">The_Sudo</a> how to install mods in our Minecraft container to run a modern Minecraft server on Docker.</p><p>Until then, I’ve got some sunflowers to look at and a zombie to deal with…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*syKiOpa0GLNhX_v42y2s0Q.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6275f528ec8c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Operating a SOC Analyst Home Lab]]></title>
            <link>https://medium.com/@christoff.elce/operating-a-soc-analyst-home-lab-ffba27f8b022?source=rss-af92d117091e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ffba27f8b022</guid>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Christopher Elce]]></dc:creator>
            <pubDate>Sat, 29 Jul 2023 08:46:17 GMT</pubDate>
            <atom:updated>2023-09-18T02:35:58.968Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>… “Find Evil — Know Normal.”</em></strong><em> (SANS DFIR slogan)</em></p><p>The cybersecurity industry is vast and entails many specialized topics. No one person can learn or know everything and the breadth of concepts to learn can seem overwhelming. Admittedly, I spent a considerable amount of time looking at the different types of cybersecurity career paths out there.</p><p>Anyway, after much thought, I decided my long term goal will be to become a cloud security engineer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*46vIcp25VK0qMnrjuRxkug.jpeg" /><figcaption>Tell me you work in business development in tech without telling me you work in business development in tech…</figcaption></figure><p>Ok, so I need to learn some cloud stuff and some security stuff. That’s a lot of stuff! However, every journey starts with a first step and one piece of consistent feedback I’ve heard from cybersecurity professionals was this: <strong>start a home lab</strong>. Well, that sounded straightforward but <em>what type</em> of home lab should I setup?</p><p>There are more ways to setup a cybersecurity home lab than there are Pokemon. And since I can only remember the first 150 Pokémon created, I went with my gut, took out my metaphorical Poké Ball, and said to myself, “SOC Analyst Home Lab, I choose you!”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*coc4bTT2BE3GhWjS0LvkLQ.jpeg" /><figcaption>Yeah, I know it’s a weird InfoSec metaphor but let’s just roll with it for now…</figcaption></figure><p>Specifically, I chose to follow the SOC Analyst home lab instructions from Eric Capuano’s blog series which can be found <a href="https://blog.ecapuano.com/p/so-you-want-to-be-a-soc-analyst-intro">here</a>. (A fantastic video walkthrough of the entire home lab is also on <a href="https://www.youtube.com/@SimplyCyber">Gerald Auger’s YouTube channel</a>, here: <a href="https://youtu.be/oOzihldLz7U">https://youtu.be/oOzihldLz7U</a> )</p><p>Eric’s blog series was easy to follow and it taught many hands-on practical cybersecurity skills used in the field, including:</p><ul><li>Simulating the role of both a cybersecurity attacker and defender</li><li>Setting up a virtualized environment in VMware Workstation</li><li>Deploying Windows and Linux VMs</li><li>Windows Registry and System Configurations</li><li>Command Prompt, PowerShell, and Linux CLIs</li><li>Using SSH to to access VMs</li><li>Setting up a C2 (command and control) server using Sliver and dropping a C2 payload on a victim machine (i.e. the Windows VM)</li><li>Analyzing telemetry and EDR (endpoint detection response) using Sysmon and <a href="https://limacharlie.io/">LimaCharlie</a> to detect (and defend) against Sliver.</li><li>Some best practices for SOC Analysts</li></ul><p>Below, I will summarize my steps with the SOC Analyst home lab. Much of it mirrors Eric’s blog series but I figure it would be best to provide documentation to show that I did the work…</p><h3><strong>Let’s Setup Our Defenses Against The Dark Arts</strong></h3><p>I setup a virtualized environment of a Windows Server VM and a Linux (Ubuntu) VM. Setting up the Linux VM involved editing the ens33 IPv4 configuration with the subnet and gateway IP. After disabling some functions in Windows Registry, Sysmon was installed in the Windows VM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JL4OuF67WC3IAgF1td1KWg.png" /><figcaption>Sysmon System Monitor (Sysmon) helps with monitoring the system activity of Windows event logs. That includes granular info about when processes start, network activity, and file changes.</figcaption></figure><p>Next, LimaCharlie EDR was installed on the Windows VM. I then setup LimaCharlie to install a sensor on an endpoint (the Windows VM).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VYnVJbxugX_RIMljRtStOg.png" /><figcaption>When using VMs, it’s good practice to take Snapshots!</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hFSpvvXvKTMzBgfSfPYivg.png" /><figcaption>Installing LimaCharlie EDR using Invoke-WebRequest in PowerShell. Apparently, the ERROR message after installation is normal and can be disregarded.</figcaption></figure><p>Then, I configured LimaCharlie to ship the Sysmon event logs with its EDR telemetry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gw3TzttyWB_W8mdu95q_Kg.png" /><figcaption>The web UI for LimaCharlie EDR</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Ty_BQ2P1mJ3AU6mQS3Jmg.png" /><figcaption>Getting Sysmon logs to flow into LimaCharlie. Now Sysmon logs and LimaCharlie logs can both be viewed for security analysis.</figcaption></figure><p>This lab also taught the importance of taking snapshot of VMs, which I also did. Coincidentally, my computer actually did crash right afterwards which was OK because I had the snapshot and could easily revert back to a good machine state!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VYnVJbxugX_RIMljRtStOg.png" /></figure><h3><strong>Let’s (Responsibly &amp; Safely) Use The Dark Arts On Our Defenses</strong></h3><p>I used SSH to access the Ubuntu VM to turn it into an attacker C2 server by installing and downloading <a href="https://github.com/BishopFox/sliver/wiki">Sliver</a>. Sliver is an open source post-exploitation C2 framework which is an <a href="https://www.darkreading.com/vulnerabilities-threats/-sliver-cobalt-strike-alternative-malicious-c2">alternative (or used in tandem with)</a> to other C2 frameworks such as Cobalt Strike and Merlin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z_BiRqow2N3IOUnZGevBWw.png" /><figcaption>Setting up Sliver C2 as our attack system to later detect and defend against using LimaCharlie</figcaption></figure><p>Next, I generated a C2 session payload within the Sliver shell. Notice that the payload is an executable named READY_SOURCE. Sliver will randomly assign names for payloads. Out of curiosity, I created several other payloads (not shown) and realized some of random names would make excellent metal rock band names, but I digress…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K3rEtTkuVhPB7oqfclFanQ.png" /><figcaption>C2 payload generation using Sliver</figcaption></figure><p>I then downloaded the C2 payload from the Ubuntu VM (the attack machine) to the Windows VM by starting up a temporary server using a cool Python technique I learned from Eric’s instructions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*bKBiQKlT9mZEGPFIsZkOjA.png" /><figcaption>Downloading the C2 payload from the Ubuntu VM to the Windows VM</figcaption></figure><p>Then, I initiated the command and control session to do some reconnaissance on the victim host (the Windows VM):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*YSCEauNgBldOBdHlWi5nXA.png" /><figcaption>Preparing the C2 session</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OwtejGbLey4Uw4FUuEJZaQ.png" /><figcaption>Interacting directly with the C2 session on the Windows VM.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SVTP_M_PJle6imP6xDldEw.png" /><figcaption>Using <strong>info </strong>to get info about the session.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*XZu8OyB6nrxAxQLMRGO24w.png" /><figcaption>Using <strong>whoami </strong>to to see what user my implant is running as.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*yyrHA4Gn-NRTGgSCHAjUFg.png" /><figcaption>Using <strong>getprivs</strong> to see what administrative privileges I have. For example, “SeDebugPrivilege” allows further attacks to be implemented. “SeImpersonatePrivilege” was an interesting privilege to learn about and more detailed info about it can be found <a href="https://learn.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/impersonate-a-client-after-authentication">here</a>.</figcaption></figure><p>I then identified the implant’s working directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*77ygYrDhRlNP9swWu4fY3A.png" /></figure><p>And examined network connections occurring on the remote system…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VlWI9gfA7T59QT-vs2f0-g.png" /><figcaption>Using <strong>netstat</strong> to examine network connections. Note that rphcp.exe is for the LimaCharlie EDR service.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RtL_lKj2_Fn54SLp3xafVw.png" /><figcaption>Sliver will notate its own processes in green. That’s good UI/UX design thinking!</figcaption></figure><h3><strong>Let’s Now Detect &amp; Defend Against Sliver with LimaCharlie</strong></h3><p>I used LimaCharlie’s Sensors to analyze EDR telemetry by going to Processes. While using the Search tool would have been faster, I decided to scroll through the Processes to become more familiar with them. If a process has a green checkmark to the left of it, that meant it was signed. Processes without a green checkmark are <em>not</em> signed. After enough scrolling, I found my unsigned Sliver C2 implant (READY_SOURCE) and it was active on the network. I then viewed the network connection find the destination IP this process was communicating with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XkFtodOyaQ49iNzKOoXojQ.png" /><figcaption>Detecting the Sliver C2 implant in LimaCharlie.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*li5XFJfX0mlypvuBwCFAwQ.png" /><figcaption>More detection of Sliver C2 implant in LimaCharlie.</figcaption></figure><p>Here, I learned how important it is for a SOC analyst to be familiar with the normal processes that are on a given system. (The blog series author, Eric Capuano, is a <a href="https://www.sans.org/">SANS</a> instructor and I’m grateful he took the time to highlight this concept and provide a link to <a href="https://www.sans.org/posters/hunt-evil/">SANS’ “Hunt Evil” poster</a>. Eric also mentioned how signed processes that can appear innocent can still be used to launch malware, including <a href="https://lolbas-project.github.io/">LOLBINS</a>).</p><p>The next step was to check out the File System in LimaCharlie and search the location where Sliver C2 implant was running from. Once located, the hash of the implant executable was inspected with <a href="https://www.virustotal.com/gui/home/upload">VirusTotal</a> which can be accessed in LimaCharlie’s UI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mwuitoJC81Zo93pMbYYYgw.png" /><figcaption>Locating Sliver C2 implant in File System.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hCti2pRqIl3i9bESos9wEg.png" /><figcaption>Inspecting the hash of Sliver C2 implant executable.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qKKchizo2yspGvTwhdmbYA.png" /><figcaption>Item not found? What kind of dark digital sorcery is this???</figcaption></figure><p>When I saw the VirusTotal output (screenshot above), I was shocked. There is a very good, and very educational, reason for it that <a href="https://blog.ecapuano.com/p/so-you-want-to-be-a-soc-analyst-part-ea2">Eric explains in his blog series</a> in such a concise way, I will quote it verbatim, below:</p><ol><li><em>Pro Tip: While it says “Scan with VirusTotal,” what it’s actually doing is querying VirusTotal for the hash of the EXE. If the file is a common/well-known malware sample, you will know it right away. However, “Item not found” on VT </em><strong><em>does not mean that this file is innocent</em></strong><em>, just that it’s never been seen before by VirusTotal. This makes sense because we just generated this payload ourselves, so of course it’s not likely to be seen by VirusTotal before. This is an important lesson for any analyst to learn — if you already suspect a file to be possible malware, but VirusTotal has never seen it before, trust your gut. This actually makes a file even more suspicious because nearly everything has been seen by VirusTotal, so your sample may have been custom-crafted/targeted which ups the ante a bit. In a mature SOC, this would likely affect the </em><a href="https://www.cisa.gov/news-events/news/traffic-light-protocol-tlp-definitions-and-usage"><em>TLP</em></a><em> of the IOC and/or case itself.</em></li></ol><p>What is quoted above was one of the most impactful lessons I learned while conducting this SOC Analyst home lab. It raised my level of awareness, never assume anything just because a software tool’s output says everything is OK, and to “trust my gut” more.</p><p>I then viewed the EDR telemetry and events logs using LimaCharlie’s Timeline feature. I was able to filter and find when the implant occurred.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p37qST6nw_mycd-eEt8Bag.png" /><figcaption>Finding when the Sliver C2 implant occurred using LimaCharlie’s Timeline feature.</figcaption></figure><h3><strong>Let’s Use Even More Dark Arts on Our Defenses…</strong></h3><p>Next, I decided to simulate attempted credential stealing by dumping the remote process from memory to save it on the Sliver C2 server (the Ubuntu VM). The specific technique I used was LSASS credential dumping since it can be used to store both a current user’s and domain admin’s OS credentials. When implemented successfully, LSASS can be used to laterally attack an entire network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*chKkHWDe5nkUeaC756PcrQ.png" /></figure><p>But there was no need to worry in the case of this home lab because invoking LSASS credential dumping was only used to generate telemetry data :) I didn’t actually simulate the actual stealing of OS credentials.</p><p>Sure enough, I was able to detect the LSASS attempt through telemetry data in LimaCharlie. Even better, LimaCharlie provided info about the LSASS event. This event info allowed me to created a detection and response (D&amp;R) rule that would alert me whenever the LSASS activity occurred.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p6Vyf3PNKEo4jaHrkt3B0g.png" /><figcaption>lsass.exe is a known in LimaCharlie as a “sensitive process”. Here, the Event Type Filters feature was used to filter for “SENSITIVE_PROCESS_ACCESS” events.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kp72v40OhfyYfadykkJY3Q.png" /><figcaption>Creating a detection and response (D&amp;R) rule in LimaCharlie to alert whenever LSASS activity occurs.</figcaption></figure><p>Next, I tested the rule against the event to verify that the detection worked against the event and saved it as a new rule called “LSASS Accessed.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*6kxHM93xF9vTLN9dfa6I2g.png" /><figcaption>Testing events with rules in LimaCharlie to provide alerts when LSASS occurs.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*PwxHRmVHhG6rbqvIhACaDw.png" /><figcaption>Saving the new rule in LimaCharlie.</figcaption></figure><p>Then, I was able to detect the threat (LSASS executable) using my own detection rule (signature) created in the previous step. Nice!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G_FnhhkpCB5vSO5Mizh0dQ.png" /><figcaption>Detection of cyber threats (LSAS executable) using detection rules in LimaCharlie.</figcaption></figure><h3><strong>More Defense Against The Dark Arts…</strong></h3><p>Setting up alerts in LimaCharlie for cyber threats like LSASS executables was fun but <em>blocking</em> threats was even more fun.</p><p>(At this point in the home lab blog series, Eric mentioned the importance of a SOC analyst skillset called “baselining”. Baselining is the approach used when creating alert-only detection rules. In a nutshell, analysts will have their detection rules run for days or weeks, optimizing them to reduce, or get rid of, false positives but be able to detect high threat activity. At the end of the baselining process, the SOC analyst will then implement the blocking version of that rule.)</p><p>Instead of blocking an LSASS executable threat with LimaCharlie, I blocked a simulated ransomware attack created with Sliver. Specifically, I blocked an attack that attempted to <a href="https://redcanary.com/blog/its-all-fun-and-games-until-ransomware-deletes-the-shadow-copies/">delete Volume Shadow Copies</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RcRU6JAPf1-3KnDsv1pKWA.png" /><figcaption>Deleting Volume Shadow Copies on the Windows VM. There were no Volume Shadow Copies in this home lab but running <strong>vssadmin delete shadows /all</strong> command created the telemetry needed for LimaCharlie to detect it.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/1*yb3sOs6zY_FjD53urGVt5Q.png" /><figcaption>Used <strong>whoami </strong>command to verify the shell is active.</figcaption></figure><p>Next, I went to LimaCharlie to see if it detected the attempt to delete Volume Shadow Copies. It indeed detected it as an event. Metadata was contained within the detection itself due to <a href="https://doc.limacharlie.io/docs/documentation/3fe7a9490ebd5-using-the-sigma-rule-set#:~:text=The%20Sigma%20rule%20set%20is,any%20type%20of%20log%20file.">LimaCharlies Sigma rules</a>. Sigma rules in LimaCharlie contain references to better understand the “why” behind detection rules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zpu8gz5raZW9ne4nwL2dcg.png" /><figcaption>Using LimaCharlies Sigma rules to better understand detection rules.</figcaption></figure><p>The threat event (the delete Volume Shadow Copies) was then viewed in LimaCharlie’s Timeline feature to see what generated the event. This step was important because it allowed the creation of a Detection &amp; Response (D&amp;R) rule from the event so I could block it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pucTqc-h2x3i7ChhbHkXLw.png" /><figcaption>Viewing the Volume Shadow Copies deletion attempt event in LimaCharlie to create a D&amp;R rule.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oBEIFnUAYx06wGEFtMOYdA.png" /><figcaption>Creating the D&amp;R rule to block the event.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/321/1*cxVb8iDKqhydUrmZPNSx5A.png" /><figcaption>Saving the D&amp;R rule that blocks the event with the title “vss_deletion_kill_it”.</figcaption></figure><h3><strong>Defend Against The Dark Arts by Blocking Them…</strong></h3><p>To test to see if the D&amp;R rule above works, I ran the <strong>vssadmin delete shadows /all </strong>command again in Sliver. Running this command triggered the D&amp;R rule and blocked the attempt: the shell was unable to return anything from <strong>whoami</strong> because the parent process was terminated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*9YHjfYFdBB_Pr83r1kIVtA.png" /><figcaption>“Shell exited” = “No shenanigans today threat actors!”</figcaption></figure><p>The process above worked well for cyber defense since, in the real world, the parent process is usually a ransomware payload or some other nefarious threat actor tool.</p><h3><strong>Final Thoughts &amp; Inspiration</strong></h3><p>I learned that tinkering with home labs is essential to developing practical InfoSec skills. I am grateful that Eric Capuano took the time to create an awesome SOC Analyst home lab blog series that I could follow. Along the way, there were some struggles I encountered due to this being my first home lab but those struggles proved to be valuable learning experiences. The direct and indirect learning that occurred during those challenging moments was more than I could have initially imagined.</p><p>My goal going forward to is to work on one unique cybersecurity home lab project every week. I will do my best to post about them regularly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ha78_UzGFKt6V1xL5Ewykw.jpeg" /></figure><p>In proper symmetric fashion, since I started this post with a quote that inspired me, I will end it with a quote that I hope will inspire you (the reader) along your learning journey… just make sure to be safe, responsible, and respectful of others along the way.</p><p><strong>“Attack is the secret of defense; defense is the planning of an attack.”</strong></p><p>-Sun Tzu</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffba27f8b022" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>