<HTML><body>
    <BR>
    <BR>
    Thanks Simon! That change does seem to provide the intended result.<BR>
<BR>
For some reason, I had interpreted var_check to mean checking all or at least one of the values within the variable array. In this case, I want to check all values obtained, so it seemed appropriate.<BR>
<BR>
Thank you for the clarification.<BR>
<BR>
Best regards,<BR>
 <BR>
<BR>
Trey Henefield, CISSP<BR>
Senior IAVA Engineer<BR>
<BR>
Ultra Electronics<BR>
Advanced Tactical Systems, Inc.<BR>
4101 Smith School Road<BR>
Building IV, Suite 100<BR>
Austin, TX 78744 USA<BR>
<BR>
<a href="mailto:Trey.Henefield@ultra-ats.com">Trey.Henefield@ultra-ats.com</a> <BR>
Tel: +1 512 327 6795 ext. 647<BR>
Fax: +1 512 327 8043<BR>
Mobile: +1 512 541 6450<BR>
<BR>
<a href="http://www.ultra-ats.com" target="_blank">www.ultra-ats.com</a> <BR>
<BR>
-----Original Message-----<BR>
From: Simon Lukasik [mailto:slukasik@redhat.com] <BR>
Sent: Wednesday, May 14, 2014 11:15 AM<BR>
To: Trey Henefield<BR>
Cc: <a href="mailto:open-scap-list@redhat.com">open-scap-list@redhat.com</a> <BR>
Subject: Re: [Open-scap] OpenSCAP 1.0.8 Issue ...<BR>
<BR>
On 05/13/2014 09:14 PM, Trey Henefield wrote:<BR>
><BR>
><BR>
> All,<BR>
><BR>
> I am testing the boundaries of SCAP content. I found numerous cases <BR>
> where there is a need to perform a check on files referenced in  a file.<BR>
><BR>
> For example, checking the group owner for all files referenced in <BR>
> /etc/shells.<BR>
><BR>
> Here is the example code I have created for this purpose:<BR>
><BR>
> #######################################<BR>
><BR>
> <def-group><BR>
><BR>
>    <definition class="compliance" id="file_groupowner_shell_files"<BR>
> version="1"><BR>
><BR>
>      <metadata><BR>
><BR>
>        <title>Test Rule</title><BR>
><BR>
>        <affected family="unix"><BR>
><BR>
>          <platform>Red Hat Enterprise Linux 6</platform><BR>
><BR>
>        </affected><BR>
><BR>
>        <description>Rule for testing.</description><BR>
><BR>
>      </metadata><BR>
><BR>
>      <criteria><BR>
><BR>
>        <criterion test_ref="test_file_groupowner_shell_files" /><BR>
><BR>
>      </criteria><BR>
><BR>
>    </definition><BR>
><BR>
>    <local_variable id="var_file_groupowner_shell_files_list"<BR>
> comment="List of files referenced in /etc/shells" datatype="string"<BR>
> version="1"><BR>
><BR>
>                                  <object_component <BR>
> item_field="subexpression"<BR>
> object_ref="object_file_groupowner_shell_files_list" /><BR>
><BR>
>    </local_variable><BR>
><BR>
>    <ind:textfilecontent54_object<BR>
> id="object_file_groupowner_shell_files_list" version="1"><BR>
><BR>
>      <ind:filepath>/etc/shells</ind:filepath><BR>
><BR>
>      <ind:pattern operation="pattern match">^(/.*)$</ind:pattern><BR>
><BR>
>      <ind:instance operation="greater than or equal"<BR>
> datatype="int">1</ind:instance><BR>
><BR>
>    </ind:textfilecontent54_object><BR>
><BR>
>    <unix:file_test check="all" check_existence="all_exist"<BR>
> comment="Testing group owner" id="test_file_groupowner_shell_files"<BR>
> version="1"><BR>
><BR>
>      <unix:object object_ref="object_file_groupowner_shell_files" /><BR>
><BR>
>      <unix:state state_ref="state_file_groupowner_shell_files" /><BR>
><BR>
>    </unix:file_test><BR>
><BR>
>    <unix:file_object comment="List of files referenced in /etc/shells"<BR>
> id="object_file_groupowner_shell_files" version="1"><BR>
><BR>
>      <unix:filepath var_ref="var_file_groupowner_shell_files_list"<BR>
> var_check="all" /><BR>
><BR>
>    </unix:file_object><BR>
><BR>
>    <unix:file_state id="state_file_groupowner_shell_files" <BR>
> version="1"><BR>
><BR>
>      <unix:group_id datatype="int">0</unix:group_id><BR>
><BR>
>    </unix:file_state><BR>
><BR>
> </def-group><BR>
><BR>
> #######################################<BR>
><BR>
> The above code works properly when used with SCC v3.1.2.<BR>
><BR>
> However when using OpenSCAP v1.0.8, it fails on validating the <BR>
> existence of the files referenced through the local_variable.<BR>
><BR>
> I have tested both pass and fail cases with SCC. I have also tried <BR>
> changing "all_exist" to "any_exist", but results in no files getting <BR>
> checked in OpenSCAP because it does not detect them as existing. I <BR>
> have enabled "--oval-results" and can see the local_variable getting <BR>
> properly populated as the following:<BR>
><BR>
>            <object id="oval:ssg:obj:121" version="1" flag="does not <BR>
> exist"><BR>
><BR>
>              <variable_value<BR>
> variable_id="oval:ssg:var:124">/bin/sh</variable_value><BR>
><BR>
>              <variable_value<BR>
> variable_id="oval:ssg:var:124">/bin/bash</variable_value><BR>
><BR>
>              <variable_value<BR>
> variable_id="oval:ssg:var:124">/sbin/nologin</variable_value><BR>
><BR>
>              <variable_value<BR>
> variable_id="oval:ssg:var:124">/bin/dash</variable_value><BR>
><BR>
>              <variable_value<BR>
> variable_id="oval:ssg:var:124">/bin/tcsh</variable_value><BR>
><BR>
>              <variable_value<BR>
> variable_id="oval:ssg:var:124">/bin/csh</variable_value><BR>
><BR>
>            </object><BR>
><BR>
> Is this a bug in 1.0.8?<BR>
><BR>
<BR>
Hello Trey,<BR>
<BR>
Thank you for checking with us. After a while of head scratching I can confirm that this is *not* a bug in OpenSCAP. This content should always evaluate to false. So the result=false is expected and correct behavior.<BR>
<BR>
If any other scanner evaluates this content to true, please file a bug against that particular scanner.<BR>
<BR>
The problem is in your content. Instead of clause<BR>
<BR>
     var_check="all"<BR>
<BR>
please make a use of<BR>
<BR>
     var_check="at least one"<BR>
<BR>
and you will get expected behavior. For more information please consult documentation regarding 'var_check' at<BR>
<BR>
 <BR>
<a href="http://oval.mitre.org/language/version5.10.1/ovaldefinition/documentation/oval-definitions-schema.html" target="_blank">http://oval.mitre.org/language/version5.10.1/ovaldefinition/documentation/oval-definitions-schema.html</a> <BR>
<BR>
Best regards,<BR>
<BR>
--<BR>
Simon Lukasik<BR>
Security Technologies, Red Hat, Inc.<BR>

    <BR>
    <BR>
 <p><font size="1"><b><font color="#666666" face="Verdana, Arial, Helvetica, sans-serif">Disclaimer</font></b><font color="#666666" face="Verdana, Arial, Helvetica, sans-serif"><br/>
        The information contained in this communication from </font></font><font color="#666666" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>
          trey.henefield@ultra-ats.com
          </b> sent at
          2014-05-14
          13:51:04
          is private and may be legally privileged or export controlled. It is intended solely for 
          use by <b>
            open-scap-list@redhat.com
            </b> and others 
          authorized to receive it. If you are not <b>
            open-scap-list@redhat.com
            </b> you are hereby notified that any disclosure, copying, distribution or 
          taking action in reliance of the contents of this information is strictly 
          prohibited and may be unlawful.</font><br>
          <br>
    </p></body></HTML>