ssg.build_yaml module
- class ssg.build_yaml.Benchmark(id_)[source]
Bases:
XCCDFEntity
Represents XCCDF Benchmark
- GENERIC_FILENAME = 'benchmark.yml'
- KEYS = {'cpes': <function Benchmark.<lambda>>, 'definition_location': <function XCCDFEntity.<lambda>>, 'description': <function Benchmark.<lambda>>, 'front_matter': <function Benchmark.<lambda>>, 'groups': <function Benchmark.<lambda>>, 'id_': <function XCCDFEntity.<lambda>>, 'notice_description': <function Benchmark.<lambda>>, 'notice_id': <function Benchmark.<lambda>>, 'platforms': <function Benchmark.<lambda>>, 'product_cpe_names': <function Benchmark.<lambda>>, 'profiles': <function Benchmark.<lambda>>, 'rear_matter': <function Benchmark.<lambda>>, 'rules': <function Benchmark.<lambda>>, 'status': <function Benchmark.<lambda>>, 'title': <function XCCDFEntity.<lambda>>, 'values': <function Benchmark.<lambda>>, 'version': <function Benchmark.<lambda>>}
- MANDATORY_KEYS = {'description', 'front_matter', 'rear_matter', 'status', 'title'}
- classmethod process_input_dict(input_contents, env_yaml, product_cpes)[source]
Take the contents of the definition as a dictionary, and add defaults or raise errors if a required member is not present.
Extend this if you want to add, remove or alter the result that will constitute the new instance.
- represent_as_dict()[source]
Produce a dict representation of the class.
Extend this method if you need the representation to be different from the object.
- class ssg.build_yaml.BuildLoader(profiles_dir, env_yaml, product_cpes, sce_metadata_path=None)[source]
Bases:
DirectoryLoader
- class ssg.build_yaml.DirectoryLoader(profiles_dir, env_yaml, product_cpes)[source]
Bases:
object
- class ssg.build_yaml.Group(id_)[source]
Bases:
XCCDFEntity
Represents XCCDF Group
- GENERIC_FILENAME = 'group.yml'
- KEYS = {'conflicts': <function Group.<lambda>>, 'cpe_platform_names': <function Group.<lambda>>, 'definition_location': <function XCCDFEntity.<lambda>>, 'description': <function Group.<lambda>>, 'groups': <function Group.<lambda>>, 'id_': <function XCCDFEntity.<lambda>>, 'inherited_platforms': <function Group.<lambda>>, 'platform': <function Group.<lambda>>, 'platforms': <function Group.<lambda>>, 'requires': <function Group.<lambda>>, 'rules': <function Group.<lambda>>, 'title': <function XCCDFEntity.<lambda>>, 'values': <function Group.<lambda>>, 'warnings': <function Group.<lambda>>}
- MANDATORY_KEYS = {'description', 'front_matter', 'rear_matter', 'status', 'title'}
- classmethod process_input_dict(input_contents, env_yaml, product_cpes=None)[source]
Take the contents of the definition as a dictionary, and add defaults or raise errors if a required member is not present.
Extend this if you want to add, remove or alter the result that will constitute the new instance.
- class ssg.build_yaml.Platform(id_)[source]
Bases:
XCCDFEntity
- KEYS = {'ansible_conditional': <function Platform.<lambda>>, 'bash_conditional': <function Platform.<lambda>>, 'definition_location': <function XCCDFEntity.<lambda>>, 'id_': <function XCCDFEntity.<lambda>>, 'name': <function Platform.<lambda>>, 'original_expression': <function Platform.<lambda>>, 'title': <function XCCDFEntity.<lambda>>, 'xml_content': <function Platform.<lambda>>}
- MANDATORY_KEYS = ['name', 'xml_content', 'original_expression', 'bash_conditional', 'ansible_conditional']
- ns = 'http://cpe.mitre.org/language/2.0'
- prefix = 'cpe-lang'
- class ssg.build_yaml.Rule(id_)[source]
Bases:
XCCDFEntity
,Templatable
Represents XCCDF Rule
- GENERIC_FILENAME = 'rule.yml'
- ID_LABEL = 'rule_id'
- KEYS = {'bash_conditional': <function Rule.<lambda>>, 'checktext': <function Rule.<lambda>>, 'components': <function Rule.<lambda>>, 'conflicts': <function Rule.<lambda>>, 'cpe_platform_names': <function Rule.<lambda>>, 'definition_location': <function XCCDFEntity.<lambda>>, 'description': <function Rule.<lambda>>, 'fixes': <function Rule.<lambda>>, 'fixtext': <function Rule.<lambda>>, 'id_': <function XCCDFEntity.<lambda>>, 'identifiers': <function Rule.<lambda>>, 'inherited_cpe_platform_names': <function Rule.<lambda>>, 'inherited_platforms': <function Rule.<lambda>>, 'ocil': <function Rule.<lambda>>, 'ocil_clause': <function Rule.<lambda>>, 'oval_external_content': <function Rule.<lambda>>, 'platform': <function Rule.<lambda>>, 'platforms': <function Rule.<lambda>>, 'policy_specific_content': <function Rule.<lambda>>, 'rationale': <function Rule.<lambda>>, 'references': <function Rule.<lambda>>, 'requires': <function Rule.<lambda>>, 'sce_metadata': <function Rule.<lambda>>, 'severity': <function Rule.<lambda>>, 'srg_requirement': <function Rule.<lambda>>, 'template': <function Templatable.<lambda>>, 'title': <function XCCDFEntity.<lambda>>, 'vuldiscussion': <function Rule.<lambda>>, 'warnings': <function Rule.<lambda>>}
- MANDATORY_KEYS = {'description', 'rationale', 'severity', 'title'}
- PRODUCT_REFERENCES = ('stigid', 'cis')
- class ssg.build_yaml.Value(id_)[source]
Bases:
XCCDFEntity
Represents XCCDF Value
- KEYS = {'definition_location': <function XCCDFEntity.<lambda>>, 'description': <function Value.<lambda>>, 'id_': <function XCCDFEntity.<lambda>>, 'interactive': <function Value.<lambda>>, 'operator': <function Value.<lambda>>, 'options': <function Value.<lambda>>, 'title': <function XCCDFEntity.<lambda>>, 'type': <function Value.<lambda>>, 'warnings': <function Value.<lambda>>}
- MANDATORY_KEYS = {'description', 'title', 'type'}
- classmethod process_input_dict(input_contents, env_yaml, product_cpes=None)[source]
Take the contents of the definition as a dictionary, and add defaults or raise errors if a required member is not present.
Extend this if you want to add, remove or alter the result that will constitute the new instance.