[PATCH 1/2] [*/transforms/idtranslate.py] Allow shorthand format to contain <ind:variable_object> definition

Jan Lieskovsky jlieskov at redhat.com
Thu Jul 3 10:23:46 UTC 2014


Currently it's not possible the shorthand form of OVAL definition to contain
<ind:variable_object> definition (based on previously defined 
<local_variable>).

The reason behind this limitation being that idtranslate.py script 
(which is internally
called by relabelids.py script, which is subsequently called during the 
benchmark
build process) is not currently able to properly handle <ind:var_ref> 
element.

When translating the OVAL ids idtranslate.py is able to correctly 
replace value of
'var_ref' attribute, but not able to translate the id when 'var_ref' 
isn't an attribute,
but rather an tag / element directly. The <variable_object> definition 
expects
the form of:

<ind:variable_object id="object_id" version="1">
<ind:var_ref>reference_to_previously_defined_variable_used_in_the_check</ind:var_ref>
</ind:variable_object>

Since (currently) value of <ind:var_ref> element isn't properly 
translated into
real ID, during the benchmark build process the error like the following 
is raised:

... [pattern] id 'variable_name' does not meet the expected pattern 
[oval:a-z...]

This results in unability to successfully build the benchmark, when 
variable_object
(containing by xsd required reference to var_ref) is used.

Since I need the capability to define variable_objects (see the patch 
[2/2]), update
idtranslate.py script (in RHEL/6 and also across the content) to be able 
to properly
handle variable_objects (properly translate var_ref ids even in case 
it's listed as tag / element).

The function / proper work of proposed change is confirmed by successful 
work
of subsequent patch (see patch [2/2] for further details).

Please review.

Thank you && Regards, Jan.
--
Jan iankko Lieskovsky / Red Hat Security Technologies Team

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-transforms-idtranslate.py-Allow-shorthand-format-to-.patch
Type: text/x-patch
Size: 4129 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/scap-security-guide/attachments/20140703/24ca8548/attachment.bin>


More information about the scap-security-guide mailing list