{"id":392,"date":"2025-02-28T18:32:59","date_gmt":"2025-02-28T18:32:59","guid":{"rendered":"https:\/\/blog.lottabytes.com\/?p=392"},"modified":"2025-02-28T18:47:28","modified_gmt":"2025-02-28T18:47:28","slug":"application-of-stig-baseline-to-vmware-photon","status":"publish","type":"post","link":"https:\/\/blog.lottabytes.com\/index.php\/2025\/02\/28\/application-of-stig-baseline-to-vmware-photon\/","title":{"rendered":"Application of STIG Baseline to VMware Photon"},"content":{"rendered":"\n<p>There has been a lot of great work done to generate STIG baselines for the various VMware products.  This content is publicly-available on Github under the <a href=\"https:\/\/github.com\/vmware\/dod-compliance-and-automation\">vmware\/dod-compliance-and-automation repository<\/a>.  As I&#8217;m currently focused on using VMware Photon 5, I&#8217;m going to explore that process with you now.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Initial Testing<\/h2>\n\n\n\n<p>Before applying your STIG, you&#8217;ll probably want to run the CINC auditor (think Chef InSpec) to check and see what the current state of your Photon 5 device is.  You can install the auditor using the below command, or, from <a href=\"https:\/\/cinc.sh\/start\/auditor\/\">their website<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#https:\/\/cinc.sh\/download\/\ncurl -L https:\/\/omnitruck.cinc.sh\/install.sh | sudo bash -s -- -P cinc-auditor -v 6<\/code><\/pre>\n\n\n\n<p>Once installed, navigate to the applicable directory from the Github repo and run the inspec command.  You&#8217;ll want to modify the input-file to match your environment, but I&#8217;m reusing the sample here.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd dod-compliance-and-automation\/photon\/5.0\/v2r1-srg\/inspec\/vmware-photon-5.0-stig-baseline &amp;&amp;\ninspec exec . -t ssh:\/\/root@192.168.1.211 --show-progress --input-file inputs-example.yml -i ~\/.ssh\/id_rsa\n<\/code><\/pre>\n\n\n\n<p>This scan will run and then give you a detailed, as well as summarized view for the machine&#8217;s current state when compared to the STIG rules.  In this case, my instance has a significant number of deviations.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"652\" height=\"59\" src=\"https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2025\/02\/image-14.png\" alt=\"\" class=\"wp-image-393\" srcset=\"https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2025\/02\/image-14.png 652w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2025\/02\/image-14-300x27.png 300w\" sizes=\"auto, (max-width: 652px) 100vw, 652px\" \/><\/figure>\n\n\n\n<p>That same Github repository also contains applicable Ansible playbooks for the application or <span style=\"text-decoration: underline;\">all or some<\/span> of the applicable settings.  See the <a href=\"https:\/\/github.com\/vmware\/dod-compliance-and-automation\/tree\/master\/photon\/5.0\/v2r1-srg\/ansible\/vmware-photon-5.0-stig-ansible-hardening\">Readme in the top level<\/a> to determine the best approach for you.  For this example, I&#8217;m just going to apply the all the defaults that don&#8217;t require extra-vars.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"413\" src=\"https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2025\/02\/image-15-1024x413.png\" alt=\"\" class=\"wp-image-394\" srcset=\"https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2025\/02\/image-15-1024x413.png 1024w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2025\/02\/image-15-300x121.png 300w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2025\/02\/image-15-768x310.png 768w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2025\/02\/image-15-1536x619.png 1536w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2025\/02\/image-15.png 1583w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Once the Ansible Playbook has completed it&#8217;s application, you can now re-run the CINC Auditor to validate a successful application.  As you can see below, the delta is now significantly smaller.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"913\" height=\"534\" src=\"https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2025\/02\/image-18.png\" alt=\"\" class=\"wp-image-398\" srcset=\"https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2025\/02\/image-18.png 913w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2025\/02\/image-18-300x175.png 300w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2025\/02\/image-18-768x449.png 768w\" sizes=\"auto, (max-width: 913px) 100vw, 913px\" \/><\/figure>\n\n\n\n<p>It&#8217;s important to note that I discovered once this activity was completed some logs from<em> \/var\/log\/messages<\/em> no longer ingest correctly using the configuration specified in <a href=\"https:\/\/blog.lottabytes.com\/index.php\/2025\/02\/12\/different-logging-approaches\/\" data-type=\"post\" data-id=\"351\">Different Logging Approaches<\/a>.  I noticed that almost immediately new logging failures appeared in the Fluentd log.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"86\" src=\"https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2025\/02\/image-19-1024x86.png\" alt=\"\" class=\"wp-image-400\" srcset=\"https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2025\/02\/image-19-1024x86.png 1024w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2025\/02\/image-19-300x25.png 300w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2025\/02\/image-19-768x64.png 768w, https:\/\/blog.lottabytes.com\/wp-content\/uploads\/2025\/02\/image-19.png 1305w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>After doing some analysis, the log events have a pretty wide variety of syntaxes, with some (but not all) including the PID, and some (but not all) placing the process name in parenthesis.   Some examples are shown below.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>2025-02-27T22:03:16.190527+00:00 photon-test-5 audit: BPF prog-id=27 op=UNLOAD\n\n2025-02-28T17:19:50.996789+00:00 photon-test-5 env<strong>&#91;675]<\/strong>: Starting Wazuh v4.10.1...\n\n2025-02-28T17:19:44.501078+00:00 photon-test-5<strong> (<\/strong>udev-worker<strong>)&#91;534]: <\/strong>Network interface NamePolicy= disabled on kernel command line.\n\n2025-02-28T17:19:43.981900+00:00 photon-test-5 <strong>(<\/strong>systemd<strong>)<\/strong>: pam_warn(systemd-user:setcred): function=&#91;pam_sm_setcred] flags=0x8002 service=&#91;systemd-user] terminal=&#91;&lt;unknown&gt;] user=&#91;root] ruser=&#91;&lt;unknown&gt;] rhost=&#91;&lt;unknown&gt;]\"\n<\/code><\/pre>\n\n\n\n<p>Because of these variances, you can no longer use the native Syslog parser.  Instead, I have created a regular expression that allows for all the variances to be detected and correctly classified.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;source>\n  @type tail\n  path \/host-var-log\/messages\n  pos_file \/var\/log\/td-agent\/messages.pos\n  tag system.log\n  &lt;parse>\n    @type regexp\n    expression \/(?&lt;timestamp>\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{1,6}\\+\\d{2}:\\d{2}) (?&lt;host>&#91;\\w|\\-|_|\\d]*) (?&lt;proc>\\(?&#91;\\w|_|-]*\\)?)\\&#91;?(?&lt;pid>&#91;\\d]*)?\\]?:(?&lt;message>.*)\/\n  &lt;\/parse>\n&lt;\/source><\/code><\/pre>\n\n\n\n<p>Using this, you should now have a successfully hardened device, as well as continued logging capabilities if you&#8217;re using Fluentd.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There has been a lot of great work done to generate STIG baselines for the various VMware products. This content is publicly-available on Github under the vmware\/dod-compliance-and-automation repository. As I&#8217;m currently focused on using VMware Photon 5, I&#8217;m going to explore that process with you now. Initial Testing Before applying your STIG, you&#8217;ll probably want &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.lottabytes.com\/index.php\/2025\/02\/28\/application-of-stig-baseline-to-vmware-photon\/\" class=\"more-link\">Read more<span class=\"screen-reader-text\"> &#8220;Application of STIG Baseline to VMware Photon&#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":[98,97,84,96,93,92,95,94],"class_list":["post-392","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-ansible","tag-cinc-auditor","tag-fluentd","tag-inspec","tag-srg","tag-stig","tag-syslog-parser","tag-vmware-photon"],"_links":{"self":[{"href":"https:\/\/blog.lottabytes.com\/index.php\/wp-json\/wp\/v2\/posts\/392","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=392"}],"version-history":[{"count":7,"href":"https:\/\/blog.lottabytes.com\/index.php\/wp-json\/wp\/v2\/posts\/392\/revisions"}],"predecessor-version":[{"id":406,"href":"https:\/\/blog.lottabytes.com\/index.php\/wp-json\/wp\/v2\/posts\/392\/revisions\/406"}],"wp:attachment":[{"href":"https:\/\/blog.lottabytes.com\/index.php\/wp-json\/wp\/v2\/media?parent=392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.lottabytes.com\/index.php\/wp-json\/wp\/v2\/categories?post=392"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.lottabytes.com\/index.php\/wp-json\/wp\/v2\/tags?post=392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}