ssg.rules module
- ssg.rules.applies_to_product(file_name, product)[source]
A OVAL or fix is filtered by product iff product is Falsy, file_name is “shared”, or file_name is product. Note that this does not filter by contents of the fix or check, only by the name of the file.
- ssg.rules.find_rule_dirs(base_dir)[source]
Generator which yields all rule directories within a given base_dir, recursively
- ssg.rules.find_rule_dirs_in_paths(base_dirs)[source]
Generator which yields all rule directories within a given directories list, recursively
- ssg.rules.get_rule_dir_id(path)[source]
Returns the ID of a rule directory; correctly handles being passed either the directory path or the yaml metadata path.
- ssg.rules.get_rule_dir_ovals(dir_path, product=None)[source]
Gets a list of OVALs contained in a rule directory. If product is None, returns all OVALs. If product is not None, returns applicable OVALs in order of priority:
{{{ product }}}.xml -> shared.xml
Only returns OVALs which exist.
- ssg.rules.get_rule_dir_sces(dir_path, product=None)[source]
Get a list of SCEs contained in a rule directory. If product is None, returns all SCEs. If product is not None, returns applicable SCEs in order of priority:
{{{ product }}}.{{{ ext }}} -> shared.{{{ ext }}}
Only returns SCEs which exist.