openscap_report.scap_results_parser.data_structures package

Submodules

openscap_report.scap_results_parser.data_structures.cpe_logical_test module

class openscap_report.scap_results_parser.data_structures.cpe_logical_test.LogicalTest(node_type: str, value: str = '', oval_tree: openscap_report.scap_results_parser.data_structures.oval_node.OvalNode = None, negation: bool = False, children: List[ForwardRef('LogicalTest')] = <factory>)

Bases: object

as_dict()
children: List[LogicalTest]
evaluate_tree()
negation: bool = False
node_type: str
oval_tree: OvalNode = None
value: str = ''

openscap_report.scap_results_parser.data_structures.cpe_platform module

class openscap_report.scap_results_parser.data_structures.cpe_platform.Platform(platform_id: str, logical_test: openscap_report.scap_results_parser.data_structures.cpe_logical_test.LogicalTest, title: str = '', result: str = '')

Bases: object

as_dict()
logical_test: LogicalTest
platform_id: str
result: str = ''
title: str = ''

openscap_report.scap_results_parser.data_structures.cpe_result_eval module

class openscap_report.scap_results_parser.data_structures.cpe_result_eval.CpeResult(number_of_true, number_of_false, number_of_error)

Bases: NamedTuple

eval_operator_and()
eval_operator_or()
number_of_error: int

Alias for field number 2

number_of_false: int

Alias for field number 1

number_of_true: int

Alias for field number 0

openscap_report.scap_results_parser.data_structures.group module

class openscap_report.scap_results_parser.data_structures.group.Group(group_id: str, title: str = '', description: str = '', platforms: List[str] = <factory>, rules_ids: List[str] = <factory>, sub_groups: List[ForwardRef('Group')] = <factory>)

Bases: object

as_dict()
description: str = ''
group_id: str
platforms: List[str]
rules_ids: List[str]
sub_groups: List[Group]
title: str = ''

openscap_report.scap_results_parser.data_structures.identifier module

class openscap_report.scap_results_parser.data_structures.identifier.Identifier(system: str, text: str)

Bases: object

as_dict()
system: str
text: str

openscap_report.scap_results_parser.data_structures.json_transformation module

openscap_report.scap_results_parser.data_structures.json_transformation.is_not_empty(val)
openscap_report.scap_results_parser.data_structures.json_transformation.rearrange_identifiers(dictionary_json)
openscap_report.scap_results_parser.data_structures.json_transformation.rearrange_references(dictionary_json)
openscap_report.scap_results_parser.data_structures.json_transformation.remove_empty_values(dictionary_json)
openscap_report.scap_results_parser.data_structures.json_transformation.remove_not_selected_rules(dictionary_json, ids_of_selected_rules)

openscap_report.scap_results_parser.data_structures.oval_definition module

class openscap_report.scap_results_parser.data_structures.oval_definition.OvalDefinition(definition_id: str, title: str, description: str = '', version: str = '', references: List[openscap_report.scap_results_parser.data_structures.oval_reference.OvalReference] = <factory>, oval_tree: openscap_report.scap_results_parser.data_structures.oval_node.OvalNode = None)

Bases: object

as_dict()
definition_id: str
description: str = ''
oval_tree: OvalNode = None
references: List[OvalReference]
title: str
version: str = ''

openscap_report.scap_results_parser.data_structures.oval_node module

class openscap_report.scap_results_parser.data_structures.oval_node.OvalNode(node_id: str, node_type: str, value: str, negation: bool = False, comment: str = '', tag: str = '', children: List[ForwardRef('OvalNode')] = <factory>, test_info: openscap_report.scap_results_parser.data_structures.oval_test.OvalTest = None)

Bases: object

as_dict()
as_json()
children: List[OvalNode]
comment: str = ''
evaluate_tree()
log_oval_tree(level=0)
negation: bool = False
node_id: str
node_type: str
tag: str = ''
test_info: OvalTest = None
value: str

openscap_report.scap_results_parser.data_structures.oval_object module

class openscap_report.scap_results_parser.data_structures.oval_object.OvalObject(object_id: str, flag: str = '', message: openscap_report.scap_results_parser.data_structures.oval_object.OvalObjectMessage = None, comment: str = '', object_type: str = '', object_data: Dict[str, str] = <factory>, collected_items: openscap_report.scap_results_parser.data_structures.oval_items.OVALItems = None)

Bases: object

as_dict()
collected_items: OVALItems = None
comment: str = ''
flag: str = ''
message: OvalObjectMessage = None
object_data: Dict[str, str]
object_id: str
object_type: str = ''
class openscap_report.scap_results_parser.data_structures.oval_object.OvalObjectMessage(level: str, text: str)

Bases: object

level: str
text: str

openscap_report.scap_results_parser.data_structures.oval_reference module

class openscap_report.scap_results_parser.data_structures.oval_reference.OvalReference(source: str, ref_id: str)

Bases: object

as_dict()
ref_id: str
source: str

openscap_report.scap_results_parser.data_structures.oval_result_eval module

class openscap_report.scap_results_parser.data_structures.oval_result_eval.OvalResult(number_of_true, number_of_false, number_of_error, number_of_unknown, number_of_noteval, number_of_notappl, number_of_None)

Bases: NamedTuple

eval_operator_and()

The AND operator produces a true result if every argument is true. If one or more arguments are false, the result of the AND is false. If one or more of the arguments are unknown, and if none of the arguments are false, then the AND operator produces a result of unknown.

Returns:
str. return values::

true false error unknown noteval

eval_operator_one()

The ONE operator produces a true result if one and only one argument is true. If there are more than argument is true (or if there are no true arguments), the result of the ONE is false. If one or more of the arguments are unknown, then the ONE operator produces a result of unknown.

Returns:
str. return values::

true false error unknown noteval

eval_operator_or()

The OR operator produces a true result if one or more arguments is true. If every argument is false, the result of the OR is false. If one or more of the arguments are unknown and if none of arguments are true, then the OR operator produces a result of unknown.

Returns:
str. return values::

true false error unknown noteval

eval_operator_xor()

XOR is defined to be true if an odd number of its arguments are true, and false otherwise. If any of the arguments are unknown, then the XOR operator produces a result of unknown.

Returns:
str. return values::

true false error unknown noteval

is_notapp_result()

Evaluates if the counts of values in the result matches the notapp result.

Returns:

bool.

number_of_None: int

Alias for field number 6

number_of_error: int

Alias for field number 2

number_of_false: int

Alias for field number 1

number_of_notappl: int

Alias for field number 5

number_of_noteval: int

Alias for field number 4

number_of_true: int

Alias for field number 0

number_of_unknown: int

Alias for field number 3

openscap_report.scap_results_parser.data_structures.oval_state module

class openscap_report.scap_results_parser.data_structures.oval_state.OvalState(state_id: str, comment: str = '', state_type: str = '', state_data: Dict[str, str] = <factory>)

Bases: object

as_dict()
comment: str = ''
state_data: Dict[str, str]
state_id: str
state_type: str = ''

openscap_report.scap_results_parser.data_structures.oval_test module

class openscap_report.scap_results_parser.data_structures.oval_test.OvalTest(test_id: str, check_existence: str = '', check: str = '', test_type: str = '', comment: str = '', oval_object: openscap_report.scap_results_parser.data_structures.oval_object.OvalObject = None, oval_states: List[openscap_report.scap_results_parser.data_structures.oval_state.OvalState] = <factory>, referenced_oval_endpoints: Dict[str, Union[openscap_report.scap_results_parser.data_structures.oval_object.OvalObject, openscap_report.scap_results_parser.data_structures.oval_state.OvalState, openscap_report.scap_results_parser.data_structures.oval_variable.OvalVariable]] = <factory>, map_referenced_oval_endpoints: Dict[str, list] = <factory>)

Bases: object

as_dict()
check: str = ''
check_existence: str = ''
comment: str = ''
map_referenced_oval_endpoints: Dict[str, list]
oval_object: OvalObject = None
oval_states: List[OvalState]
referenced_oval_endpoints: Dict[str, OvalObject | OvalState | OvalVariable]
test_id: str
test_type: str = ''

openscap_report.scap_results_parser.data_structures.profile_info module

class openscap_report.scap_results_parser.data_structures.profile_info.ProfileInfo(profile_id: str, description: str, title: str, extends: str = None, cpe_platforms_for_profile: Dict[str, bool] = <factory>, selected_rules_ids: List[str] = <factory>, selected_groups_ids: List[str] = <factory>)

Bases: object

as_dict()
cpe_platforms_for_profile: Dict[str, bool]
description: str
deselect_rules(rule_ids)
extends: str = None
get_applicable_cpe_platforms_for_profile()
get_cpe_platforms_that_satisfy_evaluation_target()
get_list_of_cpe_platforms_that_satisfy_evaluation_target()
profile_id: str
select_rules(rule_ids)
selected_groups_ids: List[str]
selected_rules_ids: List[str]
title: str

openscap_report.scap_results_parser.data_structures.reference module

class openscap_report.scap_results_parser.data_structures.reference.Reference(name: str, href: str, ref_ids: List[str])

Bases: object

as_dict()
href: str
name: str
ref_ids: List[str]

openscap_report.scap_results_parser.data_structures.remediation module

class openscap_report.scap_results_parser.data_structures.remediation.Remediation(remediation_id: str, system: str = '', complexity: str = '', disruption: str = '', strategy: str = '', fix: str = '')

Bases: object

as_dict()
complexity: str = ''
disruption: str = ''
fix: str = ''
get_type()
remediation_id: str
strategy: str = ''
system: str = ''

openscap_report.scap_results_parser.data_structures.report module

class openscap_report.scap_results_parser.data_structures.report.Report(profile_info: openscap_report.scap_results_parser.data_structures.profile_info.ProfileInfo = <factory>, scan_result: openscap_report.scap_results_parser.data_structures.result_of_scan.ResultOfScan = <factory>, rules: Dict[str, openscap_report.scap_results_parser.data_structures.rule.Rule] = <factory>, groups: Dict[str, openscap_report.scap_results_parser.data_structures.group.Group] = <factory>)

Bases: object

as_dict()
as_dict_for_default_json()
static default_json_filter(dictionary)
get_failed_rules()
get_rule_results_stats()
get_selected_rules()
get_severity_of_failed_rules_stats()
groups: Dict[str, Group]
profile_info: ProfileInfo
rules: Dict[str, Rule]
scan_result: ResultOfScan

openscap_report.scap_results_parser.data_structures.result_of_scan module

class openscap_report.scap_results_parser.data_structures.result_of_scan.ResultOfScan(title: str = '', identity: str = '', profile_id: str = '', target: str = '', cpe_platforms: List[str] = <factory>, scanner: str = '', scanner_version: str = '', benchmark_url: str = '', benchmark_id: str = '', benchmark_version: str = '', start_time: str = '', end_time: str = '', test_system: str = '', score_system: str = '', score: float = 0.0, score_max: float = 0.0, target_addresses: Dict[str, list] = <factory>)

Bases: object

as_dict()
benchmark_id: str = ''
benchmark_url: str = ''
benchmark_version: str = ''
cpe_platforms: List[str]
end_time: str = ''
get_explanation_of_score_computation()
identity: str = ''
profile_id: str = ''
scanner: str = ''
scanner_version: str = ''
score: float = 0.0
score_max: float = 0.0
score_system: str = ''
start_time: str = ''
target: str = ''
target_addresses: Dict[str, list]
test_system: str = ''
title: str = ''

openscap_report.scap_results_parser.data_structures.rule module

class openscap_report.scap_results_parser.data_structures.rule.Rule(rule_id: str, title: str = '', result: str = '', multi_check: bool = False, time: str = '', severity: str = '', weight: float = 0.0, identifiers: List[openscap_report.scap_results_parser.data_structures.identifier.Identifier] = <factory>, references: List[openscap_report.scap_results_parser.data_structures.reference.Reference] = <factory>, description: str = '', rationale: str = '', warnings: List[openscap_report.scap_results_parser.data_structures.warning.RuleWarning] = <factory>, platforms: List[str] = <factory>, oval_definition_id: str = None, oval_reference: str = None, oval_definition: openscap_report.scap_results_parser.data_structures.oval_definition.OvalDefinition = None, messages: List[str] = <factory>, remediations: List[openscap_report.scap_results_parser.data_structures.remediation.Remediation] = <factory>, cpe_oval_dict: Dict[str, Dict[str, openscap_report.scap_results_parser.data_structures.oval_node.OvalNode]] = <factory>, cpe_al: Dict[str, Dict[str, openscap_report.scap_results_parser.data_structures.cpe_platform.Platform]] = <factory>)

Bases: object

as_dict()
cpe_al: Dict[str, Dict[str, Platform]]
cpe_oval_dict: Dict[str, Dict[str, OvalNode]]
description: str = ''
get_reference_search_string()
identifiers: List[Identifier]
messages: List[str]
multi_check: bool = False
oval_definition: OvalDefinition = None
oval_definition_id: str = None
oval_reference: str = None
platforms: List[str]
rationale: str = ''
references: List[Reference]
remediations: List[Remediation]
result: str = ''
rule_id: str
severity: str = ''
time: str = ''
title: str = ''
warnings: List[RuleWarning]
weight: float = 0.0

openscap_report.scap_results_parser.data_structures.warning module

class openscap_report.scap_results_parser.data_structures.warning.RuleWarning(text: str, category: str = '')

Bases: object

as_dict()
category: str = ''
text: str

Module contents