On 8/5/13 4:24 PM, Kordell, Luke T wrote:
I am new to SCAP and trying to determine how to modify a rule. I have downloaded
the source code and have located an OVAL test I would like to change to suite my purposes.
The file is selinux_policytype.xml. I have chosen this file because I am trying to make
the SELinux enforcement rule pass for an MLS enforcement rather than targeted. My
questions are as follows:
The OVAL document references an object, test, state and variable but does not
define them (as far as I can tell) within the OVAL file. Rather, it appears to be calling
them from somewhere else.
In particular I am referring to these lines.
13 test_ref = "test_selinux_policy"
21 object object_ref = obj_selinux_policy
22 state state_ref = state_selinux_policy
Sooo...... yeaahh. OVAL can be a hot mess. Welcome to the project though!
The first part of the OVAL check is the <definition>, giving various
metadata fields such as the OVAL ID name, affected platforms, etc. Of
note you'll see the <criteria> tag, which defines "what rule must be ran
for this OVAL id?"
| <definition class="compliance"
<platform>Red Hat Enterprise Linux 6</platform>
<description>The SELinux policy should be set
<criterion test_ref="test_selinux_policy" />
The actual test, "test_selinux_policy," calls out an object to perform a
command upon ("obj_selinux_policy") and the state/value of which it
should be set to ("state_selinux_policy"):
| <ind:textfilecontent54_test check="all"
comment="Tests the value of the ^[\s]*SELINUXTYPE[\s]*=[\s]*([^#]*) expression in
the /etc/selinux/config file"
*<ind:object object_ref="obj_selinux_policy" />
<ind:state state_ref="state_selinux_policy" />*
The obj_selinux_policy is a regex pattern against /etc/selinux/config:
And that pattern must match the value of state_selinux_policy:
<ind:subexpression operation="equals" var_check="all"
As you can see, that state calls out a var_ref of
"var_selinux_policy_name" which leads us to your questions:
Finally I think this is the variable I am going to need to change.
var_ref = var_selinux_policy_name
My question are:
1) where are these objects defined, and if it is possible how can I modify them?
Because each baseline (STIG, FISMA, etc) may have different requirements
of SELinux, those variable definitions are found within XCCDF profiles,
such as "CS2" and "stig-rhel6-server." For example, within the common
profile (which is inherited by the STIG) you'll find the lines:
|<!-- SELinux state -->
|(ref line 262/263:
In your case, you'd want to change "targeted" to "mls"
2) Other than the OVAL website are there any other resources anyone
can recommend that can help me learn this material?
The OVAL specification is online
Personally, I had to jump in and ask a bunch of questions. And get a ton
of patches nacked for silly mistakes (.... and of course I no longer
make *any* mistakes...). We've started on a "into to SSG" workbook,
which you can find on the wiki page:
The workbook mostly focuses on your first scan, and very basic
familiarity with the code. It'd be great to receive patches to the
workbook, or just ideas on how to make it better! SCAP content authoring
is still fairly new... if you do find good resources, please share URLs
and perhaps we can create a "getting started with SCAP" link list off