{"id":184,"date":"2022-10-25T19:59:13","date_gmt":"2022-10-25T19:59:13","guid":{"rendered":"https:\/\/blog.lottabytes.com\/?p=184"},"modified":"2022-10-26T15:41:00","modified_gmt":"2022-10-26T15:41:00","slug":"security-appliance-in-a-box-via-ansible","status":"publish","type":"post","link":"https:\/\/blog.lottabytes.com\/index.php\/2022\/10\/25\/security-appliance-in-a-box-via-ansible\/","title":{"rendered":"Security-Appliance-in-a-Box via Ansible"},"content":{"rendered":"\n<p>For my home network I&#8217;ve historically used an <a href=\"https:\/\/www.ipfire.org\/\">IPfire<\/a> firewall, running on a Raspberry Pi.  In general, it&#8217;s been a great little setup, however I&#8217;ve decided that I wanted to move to a beefier rig that contains both a <a href=\"https:\/\/www.pfsense.org\/\">pfSense Firewall,<\/a> and a NIDS tap that feeds into a Security Onion Server, all on the same, second-hand hardware.  We&#8217;re commanded to be faithful stewards of the earth, and part of that responsibility is reflected in how we deal with the resources we have.  In this case, a <a href=\"https:\/\/www.newegg.com\/dell-optiplex-7050-business-desktops-workstations\/p\/1VK-0001-0ZYJ4?Item=9SIADGYJ166460\">refurbished Dell Optiplex 7050 SFF <\/a>PC, with the fastest available Intel i7 (7700 &#8211; 3.6 GHz) CPU, 16 GB RAM, paired with a new, 2 TB Samsung QVO (intended for cheaper, long-term storage) and second NIC worked well, and is quite affordable.  For $503, (roughly $100 cheaper than the cost of the Netgate 4100 appliance) I now have not only the pfSense Firewall, but also the benefits of Security Onion (SoS), on a relatively small-form-factor solution.  <\/p>\n\n\n\n<p>The <a href=\"https:\/\/gitlab.com\/lottabytes\/public-security-appliance-in-a-box\">Ansible script located here<\/a>, requires that you have Ubuntu installed on the primary disk (VMs live on the 2 TB SSD), but will take care of all the rest for you.  From installing and configuring the hypervisor, to the network tap, it also downloads the pfSense and SoS ISOs and leaves you with two booted VMs ready to configure.  It&#8217;s also written to be safe for re-runs after completion, as it will leave completion markers on the filesystem as well as doing checks to prevent destructive operations during re-runs.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"963\" height=\"962\" src=\"https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/Screenshot-from-2022-10-24-20-18-12.png\" alt=\"\" class=\"wp-image-187\" srcset=\"https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/Screenshot-from-2022-10-24-20-18-12.png 963w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/Screenshot-from-2022-10-24-20-18-12-300x300.png 300w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/Screenshot-from-2022-10-24-20-18-12-150x150.png 150w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/Screenshot-from-2022-10-24-20-18-12-768x767.png 768w\" sizes=\"auto, (max-width: 963px) 100vw, 963px\" \/><\/figure>\n\n\n\n<p>Once completed (it can take about 40 minutes to run, depending on the download speed of the ISOs), you will be able to open Virtual Machine Manager from another device and see your VMs are ready for action.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"550\" height=\"244\" src=\"https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/Screenshot-from-2022-10-24-20-20-00.png\" alt=\"\" class=\"wp-image-188\" srcset=\"https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/Screenshot-from-2022-10-24-20-20-00.png 550w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/Screenshot-from-2022-10-24-20-20-00-300x133.png 300w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/figure>\n\n\n\n<p>The pfSense appliance should be booted and ready for installation.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1023\" height=\"877\" src=\"https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/Screenshot-from-2022-10-24-20-20-54.png\" alt=\"\" class=\"wp-image-189\" srcset=\"https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/Screenshot-from-2022-10-24-20-20-54.png 1023w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/Screenshot-from-2022-10-24-20-20-54-300x257.png 300w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/Screenshot-from-2022-10-24-20-20-54-768x658.png 768w\" sizes=\"auto, (max-width: 1023px) 100vw, 1023px\" \/><\/figure>\n\n\n\n<p>As well as the Security Onion Appliance<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"873\" src=\"https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/Screenshot-from-2022-10-24-20-21-33-1024x873.png\" alt=\"\" class=\"wp-image-190\" srcset=\"https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/Screenshot-from-2022-10-24-20-21-33-1024x873.png 1024w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/Screenshot-from-2022-10-24-20-21-33-300x256.png 300w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/Screenshot-from-2022-10-24-20-21-33-768x655.png 768w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/Screenshot-from-2022-10-24-20-21-33.png 1026w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Once you have installed both appliances you should reboot the VM host to ensure that everything autostarts, and that the network tap is functioning correctly.  In my case I have configured Security Onion as a Standalone Node.  When running a port scan against the VM host and Firewall VM, I can see that Suricata detects the activity and raises alerts for it. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"324\" src=\"https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/Screenshot-from-2022-10-26-09-34-42-1024x324.png\" alt=\"\" class=\"wp-image-195\" srcset=\"https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/Screenshot-from-2022-10-26-09-34-42-1024x324.png 1024w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/Screenshot-from-2022-10-26-09-34-42-300x95.png 300w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/Screenshot-from-2022-10-26-09-34-42-768x243.png 768w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/Screenshot-from-2022-10-26-09-34-42-1536x486.png 1536w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/Screenshot-from-2022-10-26-09-34-42.png 1692w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>From there, the rest of Security Onion&#8217;s functionality is opened up.  From event management, to the PCAP functionality, I can now view packet-level details of what this new security appliance is capturing and analyzing. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"554\" src=\"https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/image-1024x554.png\" alt=\"\" class=\"wp-image-196\" srcset=\"https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/image-1024x554.png 1024w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/image-300x162.png 300w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/image-768x415.png 768w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2022\/10\/image.png 1117w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For my home network I&#8217;ve historically used an IPfire firewall, running on a Raspberry Pi. In general, it&#8217;s been a great little setup, however I&#8217;ve decided that I wanted to move to a beefier rig that contains both a pfSense Firewall, and a NIDS tap that feeds into a Security Onion Server, all on the &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.lottabytes.com\/index.php\/2022\/10\/25\/security-appliance-in-a-box-via-ansible\/\" class=\"more-link\">Read more<span class=\"screen-reader-text\"> &#8220;Security-Appliance-in-a-Box via Ansible&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,55,57,59,52,53,54,51,56],"class_list":["post-184","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-lottabytes","tag-network-tap","tag-nids","tag-pcap","tag-pfsense","tag-security","tag-security-appliance","tag-security-onion","tag-suricata"],"_links":{"self":[{"href":"https:\/\/blog.lottabytes.com\/index.php\/wp-json\/wp\/v2\/posts\/184","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.lottabytes.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.lottabytes.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.lottabytes.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.lottabytes.com\/index.php\/wp-json\/wp\/v2\/comments?post=184"}],"version-history":[{"count":8,"href":"https:\/\/blog.lottabytes.com\/index.php\/wp-json\/wp\/v2\/posts\/184\/revisions"}],"predecessor-version":[{"id":198,"href":"https:\/\/blog.lottabytes.com\/index.php\/wp-json\/wp\/v2\/posts\/184\/revisions\/198"}],"wp:attachment":[{"href":"https:\/\/blog.lottabytes.com\/index.php\/wp-json\/wp\/v2\/media?parent=184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.lottabytes.com\/index.php\/wp-json\/wp\/v2\/categories?post=184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.lottabytes.com\/index.php\/wp-json\/wp\/v2\/tags?post=184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}