Completed
Push — master ( 291ee9...9d841e )
by Matěj
20s queued 12s
created

ssg._constants   A

Complexity

Total Complexity 0

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 43
dl 0
loc 62
rs 10
c 0
b 0
f 0
wmc 0
1
import datetime
0 ignored issues
show
Coding Style introduced by
This module should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
2
import os.path
3
4
5
JINJA_MACROS_DEFINITIONS = os.path.join(os.path.dirname(os.path.dirname(
6
    __file__)), "shared", "macros.jinja")
7
8
xml_version = """<?xml version="1.0" encoding="UTF-8"?>"""
0 ignored issues
show
Coding Style Naming introduced by
The name xml_version does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
9
10
datastream_namespace = "http://scap.nist.gov/schema/scap/source/1.2"
0 ignored issues
show
Coding Style Naming introduced by
The name datastream_namespace does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
11
ocil_namespace = "http://scap.nist.gov/schema/ocil/2.0"
0 ignored issues
show
Coding Style Naming introduced by
The name ocil_namespace does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
12
oval_footer = "</oval_definitions>"
0 ignored issues
show
Coding Style Naming introduced by
The name oval_footer does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
13
oval_namespace = "http://oval.mitre.org/XMLSchema/oval-definitions-5"
0 ignored issues
show
Coding Style Naming introduced by
The name oval_namespace does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
14
ocil_cs = "http://scap.nist.gov/schema/ocil/2"
0 ignored issues
show
Coding Style Naming introduced by
The name ocil_cs does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
15
xccdf_header = xml_version + "<xccdf>"
0 ignored issues
show
Coding Style Naming introduced by
The name xccdf_header does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
16
xccdf_footer = "</xccdf>"
0 ignored issues
show
Coding Style Naming introduced by
The name xccdf_footer does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
17
bash_system = "urn:xccdf:fix:script:sh"
0 ignored issues
show
Coding Style Naming introduced by
The name bash_system does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
18
ansible_system = "urn:xccdf:fix:script:ansible"
0 ignored issues
show
Coding Style Naming introduced by
The name ansible_system does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
19
puppet_system = "urn:xccdf:fix:script:puppet"
0 ignored issues
show
Coding Style Naming introduced by
The name puppet_system does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
20
anaconda_system = "urn:redhat:anaconda:pre"
0 ignored issues
show
Coding Style Naming introduced by
The name anaconda_system does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
21
cce_uri = "https://nvd.nist.gov/cce/index.cfm"
0 ignored issues
show
Coding Style Naming introduced by
The name cce_uri does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
22
stig_ns = "http://iase.disa.mil/stigs/Pages/stig-viewing-guidance.aspx"
0 ignored issues
show
Coding Style Naming introduced by
The name stig_ns does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
23
disa_cciuri = "http://iase.disa.mil/stigs/cci/Pages/index.aspx"
0 ignored issues
show
Coding Style Naming introduced by
The name disa_cciuri does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
24
disa_srguri = "http://iase.disa.mil/stigs/srgs/Pages/index.aspx"
0 ignored issues
show
Coding Style Naming introduced by
The name disa_srguri does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
25
ssg_version_uri = \
0 ignored issues
show
Coding Style Naming introduced by
The name ssg_version_uri does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
26
    "https://github.com/OpenSCAP/scap-security-guide/releases/latest"
27
OSCAP_VENDOR = "org.ssgproject"
28
OSCAP_DS_STRING = "xccdf_%s.content_benchmark_" % OSCAP_VENDOR
29
OSCAP_GROUP = "xccdf_%s.content_group_" % OSCAP_VENDOR
30
OSCAP_GROUP_PCIDSS = "xccdf_%s.content_group_pcidss-req" % OSCAP_VENDOR
31
OSCAP_GROUP_VAL = "xccdf_%s.content_group_values" % OSCAP_VENDOR
32
OSCAP_GROUP_NON_PCI = "xccdf_%s.content_group_non-pci-dss" % OSCAP_VENDOR
33
XCCDF11_NS = "http://checklists.nist.gov/xccdf/1.1"
34
XCCDF12_NS = "http://checklists.nist.gov/xccdf/1.2"
35
min_ansible_version = "2.3"
0 ignored issues
show
Coding Style Naming introduced by
The name min_ansible_version does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
36
ansible_version_requirement_pre_task_name = \
0 ignored issues
show
Coding Style Naming introduced by
The name ansible_version_requirement_pre_task_name does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
37
    "Verify Ansible meets SCAP-Security-Guide version requirements."
38
39
oval_header = (
0 ignored issues
show
Coding Style Naming introduced by
The name oval_header does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
40
    """
41
<oval_definitions
42
    xmlns="{0}"
43
    xmlns:oval="http://oval.mitre.org/XMLSchema/oval-common-5"
44
    xmlns:ind="{0}#independent"
45
    xmlns:unix="{0}#unix"
46
    xmlns:linux="{0}#linux"
47
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
48
    xsi:schemaLocation="http://oval.mitre.org/XMLSchema/oval-common-5 oval-common-schema.xsd
49
        {0} oval-definitions-schema.xsd
50
        {0}#independent independent-definitions-schema.xsd
51
        {0}#unix unix-definitions-schema.xsd
52
        {0}#linux linux-definitions-schema.xsd">"""
53
    .format(oval_namespace))
54
55
timestamp = datetime.datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S")
0 ignored issues
show
Coding Style Naming introduced by
The name timestamp does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
56
57
PKG_MANAGER_TO_SYSTEM = {
58
    "yum": "rpm",
59
    "zypper": "rpm",
60
    "dnf": "rpm",
61
    "apt_get": "dpkg",
62
}
63