ssg.build_ovals module

class ssg.build_ovals.OVALBuilder(env_yaml, product_yaml_path, shared_directories, build_ovals_dir)[source]

Bases: object

build_shorthand(include_benchmark)[source]
ssg.build_ovals.append(element, newchild)[source]

Append new child ONLY if it’s not a duplicate

ssg.build_ovals.check_oval_version(oval_version)[source]

Not necessary, but should help with typos

ssg.build_ovals.expand_shorthand(shorthand_path, oval_path, env_yaml)[source]
ssg.build_ovals.finalize_affected_platforms(xml_tree, env_yaml)[source]

Depending on your use-case of OVAL you may not need the <affected> element. Such use-cases including using OVAL as a check engine for XCCDF benchmarks. Since the XCCDF Benchmarks use cpe:platform with CPE IDs, the affected element in OVAL definitions is redundant and just bloats the files. This function removes all irrelevant affected platform elements from given OVAL tree. It then adds one platform of the product we are building.

ssg.build_ovals.oval_entities_are_identical(firstelem, secondelem)[source]

Check if OVAL entities represented by XML elements are identical Return: True if identical, False otherwise Based on: http://stackoverflow.com/a/24349916

ssg.build_ovals.oval_entity_is_extvar(elem)[source]

Check if OVAL entity represented by XML element is OVAL <external_variable> element Return: True if <external_variable>, False otherwise