<html><body><div style="font-family: tahoma,new york,times,serif; font-size: 12pt; color: #000000"><div>Hi SSG Team, <br></div><div><br></div><div>I'm making some progress here with code to check for non-RH progress (Huge thanks to Danny Hynes).&nbsp;&nbsp; Two questions:<br></div><div><br></div><div>1.&nbsp; The XCCDF rule (Rule id="non-rh_packages") is evaluating to True if there are non-RH packages.&nbsp; My understanding is a 'True' results in a Pass of the rule - is that correct?&nbsp; However, I want True to result in a fail.&nbsp; How to make that happen?<br></div><div>2.&nbsp; In order to get past this non-RH package check, the openscap* and scap* packages need to be ignored.&nbsp; I tried adding filter exclusion statements on the rpminfo_object; hoewever, can't get past an error so I must have something wrong.&nbsp; Suggestions? <br></div><div><br></div><div>......<br></div><div>&nbsp;&nbsp; &lt;linux:rpminfo_object id="oval:ssg:obj:10101" version="1" comment="Collect all rpms and exclude those signed by Red Hat and exclude those from scap and openscap."&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;linux:name operation="pattern match"&gt;.*&lt;/linux:name&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;filter action="exclude"&gt;oval:ssg:ste:10101&lt;/filter&gt;<br><span style="color: rgb(255, 0, 0);">&lt;!--&gt;Matt:&nbsp; Adding these exclude statements causes the OpenSCAP error below&lt;--&gt;&nbsp;</span> <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;filter action="exclude"&gt;oval:ssg:ste:10102&lt;/filter&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;filter action="exclude"&gt;oval:ssg:ste:10103&lt;/filter&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/linux:rpminfo_object&gt;</div><div>.....<br></div><div><br></div><div>[root@rhel6client ~]# ./run_rht_scap_new <br>Title&nbsp;&nbsp; Ensure /tmp Located On Separate Partition<br>Rule&nbsp;&nbsp;&nbsp; partition_for_tmp<br>Ident&nbsp;&nbsp; CCE-26435-8<br>Result&nbsp; fail<br><div><br></div>Title&nbsp;&nbsp; All packages should be RH signed package<br>Rule&nbsp;&nbsp;&nbsp; non-rh_packages<br>Ident&nbsp;&nbsp; (null)<br>Result&nbsp; unknown<br><div><br></div><span style="color: rgb(255, 0, 0);">OpenSCAP Error: No definition with ID: oval:ssg:def:10101 in result model. [oval_agent.c:180]</span><br><div><br></div></div><div><br></div><div>Attached are the full xccdf and oval I'm running, based on the RHEL6 ssg content, and a shortened version to show the relevant code additions I've added.&nbsp; <br></div><div>&gt; oscap xccdf eval --profile rht-ccp --cpe /usr/share/xml/scap/ssg/content/ssg-rhel6-cpe-dictionary.xml --results /root/rht-ccp-results.new.xml --report <br>/root/rht-ccp-report.new.html /usr/share/xml/scap/ssg/content/ssg-rhel6-xccdf.new_ccp.xml<br><div><br></div>Thanks in advance for any help. <br></div><div>-Matt<br></div><div><br></div><hr id="zwchr"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Matthew Mariani" &lt;mmariani@redhat.com&gt;<br><b>To: </b>scap-security-guide@lists.fedorahosted.org<br><b>Cc: </b>"Karl Stevens" &lt;kstevens@redhat.com&gt;<br><b>Sent: </b>Thursday, October 31, 2013 10:32:29 AM<br><b>Subject: </b>Re: Additional Checks for RH Cloud Provider Profile (rht-ccp)<br><div><br></div><div style="font-family: tahoma,new york,times,serif; font-size: 12pt; color: #000000"><div>+ the attachment for #2<br></div><div><br></div><hr id="zwchr"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Matthew Mariani" &lt;mmariani@redhat.com&gt;<br><b>To: </b>scap-security-guide@lists.fedorahosted.org<br><b>Cc: </b>"Karl Stevens" &lt;kstevens@redhat.com&gt;<br><b>Sent: </b>Thursday, October 31, 2013 10:30:37 AM<br><b>Subject: </b>Additional Checks for RH Cloud Provider Profile (rht-ccp)<br><div><br></div><div style="font-family: tahoma,new york,times,serif; font-size: 12pt; color: #000000"><div>Hi SSG team, <br></div><div><br></div><div>For the CCP profile recently added, I would like to add new RHEL6 checks for the bullets below.&nbsp; <br></div><div>&nbsp;&nbsp;&nbsp; 1. Cloud image disk checks - do these checks exist already? <br></div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a.)&nbsp; Minimum Disk - 6GB</div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b.) Available Disk - 4GB or more<br>&nbsp;&nbsp;&nbsp; 2. Non-RH packages installed on the RHEL system - ** For this one, on the open-scap-list, Danny Hynes provided the attached OVAL definition, but I'm not sure how to build that into the rht-ccp profile.&nbsp; Does anyone have an example?<br></div><div><br></div><div>Any guidance on how to proceed is appreciated.&nbsp; <br></div><div><br></div><div>Thanks,<br></div><div>-Matt<br></div><div><br></div><hr id="zwchr"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Matthew Mariani" &lt;mmariani@redhat.com&gt;<br><b>To: </b>scap-security-guide@lists.fedorahosted.org<br><b>Sent: </b>Tuesday, October 15, 2013 2:22:25 PM<br><b>Subject: </b>Fwd: [Open-scap] SCAP Newbie Questions for simple RHEL6 XCCDF example.<br><div><br></div><div style="font-family: tahoma,new york,times,serif; font-size: 12pt; color: #000000"><div>As recommended, moving this thread to the SSG mailing list.</div><div><br>Background:&nbsp; We are working on developing an<span style="font-family: tahoma,new york,times,serif;"> SSG profile definition for RH certified cloud providers.&nbsp; In addition to these XCCDF-based checks, I need to also detect any <span style="color: black;"> non-RedHat packages installed on the system.&nbsp; </span>The question to the group is:&nbsp; are there any recommendations or examples on how this may have been done previously.&nbsp; <span style="color: black;">As example, suppose a cloud image has a monitoring package or hypervisor para-virt rpms install, I want to be made aware and have those reported by the check.&nbsp; </span>An OVAL</span> path was suggested below.<br></div><div><br></div><div><span style="font-family: 'Tahoma','sans-serif'; color: black;"><span style="font-family: tahoma,new york,times,serif;">Does anyone have additional guidance on how/if I can do this with SCAP-related tools?</span> <br></span></div><div><br></div><div>Thanks, <br></div><div>-Matt<br></div><div><br></div><div><span></span>Matthew Mariani<br>Partner Solution Architect<br>M: +1-717-756-6834<br>mmariani@redhat.com<span></span><br></div><div><br></div><hr id="zwchr"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Shawn Wells" &lt;shawn@redhat.com&gt;<br><b>To: </b>open-scap-list@redhat.com<br><b>Sent: </b>Sunday, October 13, 2013 11:30:26 PM<br><b>Subject: </b>Re: [Open-scap] SCAP Newbie Questions for simple RHEL6 XCCDF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;example.<br><div><br></div><div class="moz-cite-prefix">On 10/10/13 4:44 PM, Matthew Mariani wrote:<br></div><blockquote cite="mid:1735616932.116228.1381437845637.JavaMail.root@redhat.com"><div class="moz-text-html" lang="x-unicode"><div style="font-family: tahoma,new york,times,serif; font-size:
          12pt; color: #000000"><div>Danny, <br></div><div>Thanks, very helpful.&nbsp; <br></div><div>-Matt<br></div><div><br></div><hr id="zwchr"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Dan Haynes" <a class="moz-txt-link-rfc2396E" href="mailto:dhaynes@mitre.org" target="_blank">&lt;dhaynes@mitre.org&gt;</a><br> <b>To: </b>"Matthew Mariani" <a class="moz-txt-link-rfc2396E" href="mailto:mmariani@redhat.com" target="_blank">&lt;mmariani@redhat.com&gt;</a>, <a class="moz-txt-link-abbreviated" href="mailto:open-scap-list@redhat.com" target="_blank">open-scap-list@redhat.com</a><br> <b>Sent: </b>Wednesday, October 9, 2013 2:45:35 PM<br> <b>Subject: </b>RE: SCAP Newbie Questions for simple RHEL6 XCCDF example.<br><div><br></div><div class="WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Hi Matthew,<br> <br> Comments inline below.&nbsp; Hope this helps.</span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">&nbsp;</span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Thanks,<br> <br> Danny</span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">&nbsp;</span></p><div style="border:none;border-left:solid blue
                1.5pt;padding:0in 0in 0in 4.0pt"><div><div style="border:none;border-top:solid #B5C4DF
                    1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> <a class="moz-txt-link-abbreviated" href="mailto:open-scap-list-bounces@redhat.com" target="_blank">open-scap-list-bounces@redhat.com</a> [<a class="moz-txt-link-freetext" href="mailto:open-scap-list-bounces@redhat.com" target="_blank">mailto:open-scap-list-bounces@redhat.com</a>] <b>On Behalf Of </b>Matthew Mariani<br> <b>Sent:</b> Wednesday, October 09, 2013 1:11 PM<br> <b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:open-scap-list@redhat.com" target="_blank">open-scap-list@redhat.com</a><br> <b>Subject:</b> [Open-scap] SCAP Newbie Questions for simple RHEL6 XCCDF example.</span></p></div></div><p class="MsoNormal">&nbsp;</p><div><div><p class="MsoNormal"><span style="font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:black">Hi list, </span></p></div><div><p class="MsoNormal"><span style="font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:black">'SCAP newbie here.&nbsp; I'm working with the attached XCCDF profile definition to be used with a RHEL6 system.&nbsp; The end goal is to define a standard RHEL cloud image security profile. &nbsp; I have two questions: </span></p></div><div><p class="MsoNormal"><span style="font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:black">&nbsp;</span></p></div><div><p class="MsoNormal"><strong><span style="font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:black">1.&nbsp;</span></strong><span style="font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:black"> I believe I need additional XML syntax in the file to have valid XCCDF content.&nbsp; When I try both testing with the 'info' function and running an 'eval', I get an Unknown document type error.&nbsp; </span></p></div><div><p class="MsoNormal"><span style="font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;[root@rhel6client ~]# oscap info rht-ccp.xml <br> &nbsp;&nbsp;&nbsp;&nbsp;OpenSCAP Error: Unknown document type: 'rht-ccp.xml' [oscapxml.c:554]</span></p></div><div><p class="MsoNormal"><span style="font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;[root@rhel6client ~]# oscap xccdf eval --profile rht-ccp --results /root/rht-ccp.results.xml --report /root/rht-ccp.report.html rht-ccp.xml <br> &nbsp;&nbsp;&nbsp;&nbsp;Profile "rht-ccp" was not found.</span></p></div><div><p class="MsoNormal"><span style="font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:black">&nbsp;</span></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:black">Looking at some of the xccdf examples referenced here <a href="http://www.open-scap.org/page/Documentation" target="_blank">http://www.open-scap.org/page/Documentation</a>, I'm thinking I need a &lt;Benchmark&gt; wrapper around my profile.&nbsp; Am I on the right track, and if so is there a basic &lt;Benchmark&gt; syntax example available?&nbsp; I'm finding it difficult to id what's required and what's not in examples referenced on the Documentation page.<br> <br> </span><span style="font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#1F497D"></span></p><p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">[Danny]: Yes, you will need to include the &lt;Benchmark&gt; component.&nbsp; You may want to look at the RHEL6 STIG SCAP content being developed in the scap-security-guide project (<a href="https://fedorahosted.org/scap-security-guide/" target="_blank">https://fedorahosted.org/scap-security-guide/</a>).&nbsp; It should serve as a good example and you may be able to reuse some of the content.&nbsp; They also have some tools that you could leverage to help generate the content. </span></p></div></div></div></div></div></div></div></blockquote><br> Matt pinged me offline re: the Red Hat CCP profile. I've now merged it into SSG:<br> <a class="moz-txt-link-freetext" href="https://git.fedorahosted.org/cgit/scap-security-guide.git/commit/?id=363324350a1c4efe4dceefa3e309865fc54913b6" target="_blank">https://git.fedorahosted.org/cgit/scap-security-guide.git/commit/?id=363324350a1c4efe4dceefa3e309865fc54913b6</a><br> <br> You should now be able to clone the source and run a scan:<br> <a class="moz-txt-link-freetext" href="https://fedorahosted.org/scap-security-guide/wiki/downloads" target="_blank">https://fedorahosted.org/scap-security-guide/wiki/downloads</a><br> <br> aka<br> $ sudo yum install git openscap-utils python-lxml<br> $ cd /tmp ; git clone git://git.fedorahosted.org/git/scap-security-guide.git ; cd scap-security-guide/RHEL6<br> $ make content <br> $ sudo oscap xccdf eval --profile rht-ccp \<br> --results /root/ssg-results-`date`.xml \<br> --report /root/ssg-results-`date`.html \<br> --cpe output/ssg-rhel6-cpe-dictionary.xml \<br> output/ssg-rhel6-xccdf.xml<br> <br> <br> <br><blockquote cite="mid:1735616932.116228.1381437845637.JavaMail.root@redhat.com"><div class="moz-text-html" lang="x-unicode"><div style="font-family: tahoma,new york,times,serif; font-size:
          12pt; color: #000000"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div class="WordSection1"><div style="border:none;border-left:solid blue
                1.5pt;padding:0in 0in 0in 4.0pt"><div><div><p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:black"><br> <strong><span style="font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">2.&nbsp;</span></strong> Looking forward, in addition to these XCCDF checks, I have the need to detect non-RedHat signed packaged installed on the system.&nbsp; Does anyone have guidance on how/if I can do that with SCAP tools.&nbsp; As example, suppose a cloud image has a monitoring package or hypervisor para-virt rpms install, I want to be made aware and have those reported by the check.&nbsp; </span></p></div><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">&nbsp;</span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">[Danny]: &nbsp;Yes, you should be able to check for any non-Red Hat signed packages using OVAL which is an language for checking the state of an endpoint.&nbsp; There is the linux-def:rpminfo_test (<a href="http://oval.mitre.org/language/version5.10.1/ovaldefinition/complete/linux-definitions-schema.xsd" target="_blank">http://oval.mitre.org/language/version5.10.1/ovaldefinition/complete/linux-definitions-schema.xsd</a>) which you can use to check various metadata about the packages installed on the system including the signature key ID.&nbsp; With that in mind, you should be able to collect all RPMs on the system and filter out any RPMs that are signed by Red Hat leaving only those that haven’t been signed by Red Hat.&nbsp; I have attached an OVAL definition which shows how you might do this.&nbsp; Of course, you may need to modify it to include the appropriate signature key IDs.</span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">&nbsp;</span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">&nbsp;</span></p><p class="MsoNormal"><span style="font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:black">Any help is appreciated.&nbsp; Thanks, </span></p></div><div><p class="MsoNormal"><span style="font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:black">-Matt</span></p></div><div><p class="MsoNormal"><span style="font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:black">&nbsp;</span></p></div></div></div></div></div></div></div></blockquote><br> Since this is largely content related, feel free to kick over the conversation to the SSG mailing list:<br> <a class="moz-txt-link-freetext" href="https://fedorahosted.org/scap-security-guide/" target="_blank">https://fedorahosted.org/scap-security-guide/</a><br> <a class="moz-txt-link-freetext" href="https://lists.fedorahosted.org/mailman/listinfo/scap-security-guide" target="_blank">https://lists.fedorahosted.org/mailman/listinfo/scap-security-guide</a><br> <br> Our friends and allies within the OpenSCAP tooling community let us content guys play here, but content questions (for SSG) should be kicked over to the SSG community list :)<br> <br>_______________________________________________<br>Open-scap-list mailing list<br>Open-scap-list@redhat.com<br>https://www.redhat.com/mailman/listinfo/open-scap-list</div><div><br></div></div></div><div><br></div></div></div><div><br></div></div><br>_______________________________________________<br>scap-security-guide mailing list<br>scap-security-guide@lists.fedorahosted.org<br>https://lists.fedorahosted.org/mailman/listinfo/scap-security-guide<br></div><div><br></div></div></body></html>