inspec_tools 2.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.md +15 -0
- data/README.md +373 -0
- data/Rakefile +96 -0
- data/exe/inspec_tools +14 -0
- data/lib/data/README.TXT +25 -0
- data/lib/data/U_CCI_List.xml +38403 -0
- data/lib/data/attributes.yml +23 -0
- data/lib/data/cci2html.xsl +136 -0
- data/lib/data/cis_to_nist_critical_controls +0 -0
- data/lib/data/cis_to_nist_mapping +0 -0
- data/lib/data/mapping.yml +17 -0
- data/lib/data/rubocop.yml +4 -0
- data/lib/data/stig.csv +1 -0
- data/lib/data/threshold.yaml +83 -0
- data/lib/exceptions/impact_input_error.rb +6 -0
- data/lib/exceptions/severity_input_error.rb +6 -0
- data/lib/happy_mapper_tools/benchmark.rb +161 -0
- data/lib/happy_mapper_tools/cci_attributes.rb +66 -0
- data/lib/happy_mapper_tools/stig_attributes.rb +216 -0
- data/lib/happy_mapper_tools/stig_checklist.rb +99 -0
- data/lib/inspec_tools.rb +17 -0
- data/lib/inspec_tools/ckl.rb +20 -0
- data/lib/inspec_tools/cli.rb +31 -0
- data/lib/inspec_tools/csv.rb +101 -0
- data/lib/inspec_tools/help.rb +9 -0
- data/lib/inspec_tools/help/compliance.md +7 -0
- data/lib/inspec_tools/help/csv2inspec.md +5 -0
- data/lib/inspec_tools/help/inspec2ckl.md +5 -0
- data/lib/inspec_tools/help/inspec2csv.md +5 -0
- data/lib/inspec_tools/help/inspec2xccdf.md +5 -0
- data/lib/inspec_tools/help/pdf2inspec.md +6 -0
- data/lib/inspec_tools/help/summary.md +5 -0
- data/lib/inspec_tools/help/xccdf2inspec.md +5 -0
- data/lib/inspec_tools/inspec.rb +331 -0
- data/lib/inspec_tools/pdf.rb +125 -0
- data/lib/inspec_tools/plugin.rb +15 -0
- data/lib/inspec_tools/plugin_cli.rb +275 -0
- data/lib/inspec_tools/summary.rb +126 -0
- data/lib/inspec_tools/version.rb +8 -0
- data/lib/inspec_tools/xccdf.rb +156 -0
- data/lib/inspec_tools/xlsx_tool.rb +135 -0
- data/lib/inspec_tools_plugin.rb +7 -0
- data/lib/overrides/false_class.rb +5 -0
- data/lib/overrides/nil_class.rb +5 -0
- data/lib/overrides/object.rb +5 -0
- data/lib/overrides/string.rb +5 -0
- data/lib/overrides/true_class.rb +5 -0
- data/lib/utilities/cis_to_nist.rb +11 -0
- data/lib/utilities/csv_util.rb +14 -0
- data/lib/utilities/extract_pdf_text.rb +20 -0
- data/lib/utilities/inspec_util.rb +441 -0
- data/lib/utilities/parser.rb +373 -0
- data/lib/utilities/text_cleaner.rb +69 -0
- metadata +359 -0
@@ -0,0 +1,23 @@
|
|
1
|
+
---
|
2
|
+
benchmark.title: PostgreSQL 9.x Security Technical Implementation Guide
|
3
|
+
benchmark.id: PostgreSQL_9-x_STIG
|
4
|
+
benchmark.description: 'This Security Technical Implementation Guide is published
|
5
|
+
as a tool to improve the security of Department of Defense (DoD) information systems.
|
6
|
+
The requirements are derived from the National Institute of Standards and Technology
|
7
|
+
(NIST) 800-53 and related documents. Comments or proposed revisions to this document
|
8
|
+
should be sent via email to the following address: disa.stig_spt@mail.mil.'
|
9
|
+
benchmark.version: '1'
|
10
|
+
benchmark.status: accepted
|
11
|
+
benchmark.status.date: '2017-01-20'
|
12
|
+
benchmark.notice.id: terms-of-use
|
13
|
+
benchmark.plaintext: 'Release: 1 Benchmark Date: 20 Jan 2017'
|
14
|
+
benchmark.plaintext.id: release-info
|
15
|
+
reference.href: http://iase.disa.mil
|
16
|
+
reference.dc.publisher: DISA
|
17
|
+
reference.dc.source: STIG.DOD.MIL
|
18
|
+
reference.dc.title: DPMS Target PostgreSQL 9.x
|
19
|
+
reference.dc.subject: PostgreSQL 9.x
|
20
|
+
reference.dc.type: DPMS Target
|
21
|
+
reference.dc.identifier: '3087'
|
22
|
+
content_ref.name: M
|
23
|
+
content_ref.href: DPMS_XCCDF_Benchmark_PostgreSQL_9-x_STIG.xml
|
@@ -0,0 +1,136 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
2
|
+
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cci="http://iase.disa.mil/cci">
|
3
|
+
|
4
|
+
<xsl:decimal-format NaN=""/>
|
5
|
+
|
6
|
+
<xsl:variable name="apos">'</xsl:variable>
|
7
|
+
|
8
|
+
<!-- default search order -->
|
9
|
+
<xsl:param name="sortorder" select="'800-53'"/>
|
10
|
+
|
11
|
+
<xsl:template match="/">
|
12
|
+
<html>
|
13
|
+
<head>
|
14
|
+
<style type="text/css">
|
15
|
+
BODY { font-family: sans-serif; }
|
16
|
+
TD { border: none; font-size: 12pt; vertical-align: top; }
|
17
|
+
TR.header, TD.header { font-weight: bold; }
|
18
|
+
</style>
|
19
|
+
<title>CCI List</title>
|
20
|
+
</head>
|
21
|
+
<body>
|
22
|
+
<xsl:apply-templates select="cci:cci_list"/>
|
23
|
+
</body>
|
24
|
+
</html>
|
25
|
+
</xsl:template>
|
26
|
+
|
27
|
+
<xsl:template match="cci:cci_list">
|
28
|
+
<b>CCI List</b><br />
|
29
|
+
<b>Version <xsl:value-of select="cci:metadata/cci:version"/></b><br />
|
30
|
+
<b>Date <xsl:value-of select="cci:metadata/cci:publishdate"/></b>
|
31
|
+
<hr/>
|
32
|
+
<xsl:choose>
|
33
|
+
<xsl:when test="$sortorder = 'publishdate'">
|
34
|
+
<xsl:apply-templates select="cci:cci_items/cci:cci_item">
|
35
|
+
<xsl:sort data-type="text" select="publishdate"/>
|
36
|
+
</xsl:apply-templates>
|
37
|
+
</xsl:when>
|
38
|
+
<xsl:when test="$sortorder = '800-53'">
|
39
|
+
<xsl:apply-templates select="cci:cci_items/cci:cci_item">
|
40
|
+
<xsl:sort data-type="text" select="concat(substring(cci:references/cci:reference[@title = 'NIST SP 800-53 Revision 4']/@index, 1, 2), 'Z', format-number(substring-before(substring-after(cci:references/cci:reference[@title = 'NIST SP 800-53 Revision 4']/@index, '-'), ' '), '000'), format-number(substring-after(cci:references/cci:reference[@title = 'NIST SP 800-53 Revision 4']/@index, '-'), '000'), translate(substring(substring-after(cci:references/cci:reference[@title = 'NIST SP 800-53 Revision 4']/@index, ' '), 1, 1), '(abcdefghijklmnopqrstuvwxyz', '-//////////////////////////'), translate(substring(substring-after(cci:references/cci:reference[@title = 'NIST SP 800-53 Revision 4']/@index, ' '), 1, 1), 'abcdefghijklmnopqrstuvwxyz(', 'abcdefghijklmnopqrstuvwxyz'), format-number(substring-before(substring-after(cci:references/cci:reference[@title = 'NIST SP 800-53 Revision 4']/@index, '('), ')'), '000'), translate(substring(substring-after(substring-after(cci:references/cci:reference[@title = 'NIST SP 800-53 Revision 4']/@index, '('), '('), 1, 1), '0123456789abcdefghijklmnopqrstuvwxyz', '----------//////////////////////////'), translate(substring(substring-after(substring-after(cci:references/cci:reference[@title = 'NIST SP 800-53 Revision 4']/@index, '('), '('), 1, 1), 'abcdefghijklmnopqrstuvwxyz', 'abcdefghijklmnopqrstuvwxyz'), format-number(substring-before(substring-after(substring-after(cci:references/cci:reference[@title = 'NIST SP 800-53 Revision 4']/@index, '('), '('), ')'), '000'))"/>
|
41
|
+
</xsl:apply-templates>
|
42
|
+
</xsl:when>
|
43
|
+
<xsl:when test="$sortorder = 'type'">
|
44
|
+
<xsl:apply-templates select="cci:cci_items/cci:cci_item">
|
45
|
+
<xsl:sort data-type="text" select="cci:type"/>
|
46
|
+
</xsl:apply-templates>
|
47
|
+
</xsl:when>
|
48
|
+
<xsl:when test="$sortorder = 'status'">
|
49
|
+
<xsl:apply-templates select="cci:cci_items/cci:cci_item">
|
50
|
+
<xsl:sort data-type="text" select="cci:status"/>
|
51
|
+
</xsl:apply-templates>
|
52
|
+
</xsl:when>
|
53
|
+
<xsl:otherwise>
|
54
|
+
<xsl:apply-templates select="cci:cci_items/cci:cci_item">
|
55
|
+
<xsl:sort data-type="text" select="@id"/>
|
56
|
+
</xsl:apply-templates>
|
57
|
+
</xsl:otherwise>
|
58
|
+
</xsl:choose>
|
59
|
+
</xsl:template>
|
60
|
+
|
61
|
+
<xsl:template match="cci:cci_item">
|
62
|
+
<table width="100%">
|
63
|
+
<tr>
|
64
|
+
<td width="15%" class="header"><xsl:value-of select="'CCI:'"/></td>
|
65
|
+
<td width="35%"><xsl:value-of select="@id"/></td>
|
66
|
+
<td width="15%" class="header"><xsl:value-of select="'Status:'"/></td>
|
67
|
+
<td width="35%"><xsl:value-of select="cci:status"/></td>
|
68
|
+
</tr>
|
69
|
+
<tr>
|
70
|
+
<td class="header"><xsl:value-of select="'Contributor:'"/></td>
|
71
|
+
<td><xsl:value-of select="cci:contributor"/></td>
|
72
|
+
<td class="header"><xsl:value-of select="'Published Date:'"/></td>
|
73
|
+
<td><xsl:value-of select="cci:publishdate"/></td>
|
74
|
+
</tr>
|
75
|
+
<tr>
|
76
|
+
<td class="header"><xsl:value-of select="'Definition:'"/></td>
|
77
|
+
<td colspan="3"><xsl:value-of select="translate(cci:definition,'^',$apos)"/></td>
|
78
|
+
</tr>
|
79
|
+
<xsl:if test="cci:type != ''">
|
80
|
+
<tr>
|
81
|
+
<td class="header"><xsl:value-of select="'Type:'"/></td>
|
82
|
+
<td colspan="3">
|
83
|
+
<xsl:for-each select="cci:type">
|
84
|
+
<xsl:value-of select="."/>
|
85
|
+
<xsl:if test="position() < count(../cci:type)">, </xsl:if>
|
86
|
+
</xsl:for-each>
|
87
|
+
</td>
|
88
|
+
</tr>
|
89
|
+
</xsl:if>
|
90
|
+
<xsl:if test="cci:note != ''">
|
91
|
+
<tr>
|
92
|
+
<td class="header"><xsl:value-of select="'Note:'"/></td>
|
93
|
+
<td colspan="3"><xsl:value-of select="cci:note"/></td>
|
94
|
+
</tr>
|
95
|
+
</xsl:if>
|
96
|
+
<xsl:if test="cci:parameter != ''">
|
97
|
+
<tr>
|
98
|
+
<td class="header"><xsl:value-of select="'Parameter:'"/></td>
|
99
|
+
<td colspan="3"><xsl:value-of select="cci:parameter"/></td>
|
100
|
+
</tr>
|
101
|
+
</xsl:if>
|
102
|
+
<xsl:apply-templates select="cci:references/cci:reference">
|
103
|
+
<xsl:sort select="@creator"/>
|
104
|
+
<xsl:sort select="@title"/>
|
105
|
+
<xsl:sort select="@version"/>
|
106
|
+
</xsl:apply-templates>
|
107
|
+
</table>
|
108
|
+
<hr />
|
109
|
+
</xsl:template>
|
110
|
+
|
111
|
+
<xsl:template match="cci:reference">
|
112
|
+
<tr>
|
113
|
+
<td class="header">
|
114
|
+
<xsl:if test="position() = 1">
|
115
|
+
References:
|
116
|
+
</xsl:if>
|
117
|
+
</td>
|
118
|
+
<td colspan="3">
|
119
|
+
<xsl:value-of select="@creator"/>
|
120
|
+
<xsl:value-of select="': '"/>
|
121
|
+
<a>
|
122
|
+
<xsl:attribute name="href">
|
123
|
+
<xsl:value-of select="@location"/>
|
124
|
+
</xsl:attribute>
|
125
|
+
<xsl:value-of select="@title"/>
|
126
|
+
<xsl:value-of select="' (v'"/>
|
127
|
+
<xsl:value-of select="@version"/>
|
128
|
+
<xsl:value-of select="')'"/>
|
129
|
+
</a>
|
130
|
+
<xsl:value-of select="': '"/>
|
131
|
+
<xsl:value-of select="@index"/>
|
132
|
+
</td>
|
133
|
+
</tr>
|
134
|
+
</xsl:template>
|
135
|
+
|
136
|
+
</xsl:stylesheet>
|
Binary file
|
Binary file
|
@@ -0,0 +1,17 @@
|
|
1
|
+
|
2
|
+
# Setting csv_header to true will skip the csv file header
|
3
|
+
skip_csv_header: true
|
4
|
+
width : 80
|
5
|
+
|
6
|
+
|
7
|
+
control.id: 0
|
8
|
+
control.title: 15
|
9
|
+
control.desc: 16
|
10
|
+
control.tags:
|
11
|
+
severity: 1
|
12
|
+
rid: 8
|
13
|
+
stig_id: 3
|
14
|
+
cci: 2
|
15
|
+
check: 12
|
16
|
+
fix: 10
|
17
|
+
|
data/lib/data/stig.csv
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
V_ID,Severity,CCI,Version,Title,Description,Service,IA Controls,ruleID,fixid,fixtext,checkid,checktext,,Response,Title,Description
|
2
|
|
1
3
|
|
2
4
|
|
3
5
|
|
4
6
|
|
5
7
|
|
6
8
|
|
7
9
|
|
8
10
|
If the current settings do not provide enough information regarding the content of the event, this is a finding.",,,Generate Audits to assist monitoring and alerting of activities on the system,"Utilize perimeter, application, centralized authentication, and repository audit controls to audit the use of systems in real time with sufficient context. X-Pack Security audit controls should be enabled to audit the defaults of all HTTP/S based access to Elasticsearch. All applications should use HTTP/S rather than Elasticsearch transport protocol."
|
9
11
|
xpack.security.http.filter.enabled: true
|
10
12
|
xpack.security.http.filter.allow: ""Managed access control points""
|
11
13
|
xpack.security.http.filter.deny: _all
|
12
14
|
|
13
15
|
|
14
16
|
|
15
17
|
|
16
18
|
|
17
19
|
|
18
20
|
If the current settings do not provide enough information regarding the content of the event, this is a finding.",,,Generate Audits to assist monitoring and alerting of activities on the system,"Utilize perimeter, application, centralized authentication, and repository audit controls to audit the use of systems in real time with sufficient context. X-Pack Security audit controls should be enabled to audit the defaults of all HTTP/S based access to Elasticsearch. All applications should use HTTP/S rather than Elasticsearch transport protocol."
|
19
21
|
|
20
22
|
|
21
23
|
|
22
24
|
|
23
25
|
If the current settings do not provide enough information regarding the content of the event, this is a finding.",,,Generate Audits to assist monitoring and alerting of activities on the system,"Utilize perimeter, application, centralized authentication, and repository audit controls to audit the use of systems in real time with sufficient context. X-Pack Security audit controls should be enabled to audit the defaults of all HTTP/S based access to Elasticsearch. All applications should use HTTP/S rather than Elasticsearch transport protocol."
|
24
26
|
security:
|
25
27
|
authc:
|
26
28
|
realms:
|
27
29
|
active_directory:
|
28
30
|
type: active_directory
|
29
31
|
order: 0
|
30
32
|
domain_name: ad.example.com
|
31
33
|
url: ldaps://ad.example.com:636
|
32
34
|
unmapped_groups_as_roles: true ",,Guidance - System accounts cannot be disabled and elasticsearch does not enforce password complexity rules.,Ensure Elasticsearch passwords and credentials meet organizational requirements.,"Configure the centralized authentication service to enforce organization policies such as password strength, lockout, expiration, notification, and screen obfuscation."
|
33
35
|
|
34
36
|
See the official documentation for the complete guide on establishing SSL configuration: https://www.elastic.co/guide/en/x-pack/current/ssl-tls.html",None,"Application must utilize approved cryptography to protect passwords in transmission.
|
35
37
|
|
36
38
|
|
37
39
|
|
38
40
|
|
39
41
|
|
40
42
|
|
41
43
|
|
42
44
|
|
43
45
|
|
44
46
|
|
45
47
|
|
46
48
|
|
47
49
|
|
48
50
|
If the current settings do not provide enough information regarding the content of the event, this is a finding.",,,Generate Audits to assist monitoring and alerting of activities on the system,"Utilize perimeter, application, centralized authentication, and repository audit controls to audit the use of systems in real time with sufficient context. X-Pack Security audit controls should be enabled to audit the defaults of all HTTP/S based access to Elasticsearch. All applications should use HTTP/S rather than Elasticsearch transport protocol."
|
49
51
|
|
50
52
|
See the official documentation for the complete guide on establishing SSL configuration: https://www.elastic.co/guide/en/x-pack/current/ssl-tls.html",None,"Application must utilize approved cryptography to protect the communication path between entities.
|
51
53
|
|
52
54
|
|
53
55
|
|
54
56
|
|
55
57
|
|
56
58
|
If the current settings do not provide enough information regarding the content of the event, this is a finding.",,,Generate Audits to assist monitoring and alerting of activities on the system,"Utilize perimeter, application, centralized authentication, and repository audit controls to audit the use of systems in real time with sufficient context. X-Pack Security audit controls should be enabled to audit the defaults of all HTTP/S based access to Elasticsearch. All applications should use HTTP/S rather than Elasticsearch transport protocol."
|
57
59
|
|
58
60
|
|
59
61
|
|
60
62
|
|
61
63
|
If the current settings do not provide enough information regarding the content of the event, this is a finding.",,,Generate Audits to assist monitoring and alerting of activities on the system,"Utilize perimeter, application, centralized authentication, and repository audit controls to audit the use of systems in real time with sufficient context. X-Pack Security audit controls should be enabled to audit the defaults of all HTTP/S based access to Elasticsearch. All applications should use HTTP/S rather than Elasticsearch transport protocol."
|
62
64
|
|
63
65
|
|
64
66
|
|
65
67
|
|
66
68
|
If the current settings do not provide enough information regarding the content of the event, this is a finding.",,,Generate Audits to assist monitoring and alerting of activities on the system,"Utilize perimeter, application, centralized authentication, and repository audit controls to audit the use of systems in real time with sufficient context. X-Pack Security audit controls should be enabled to audit the defaults of all HTTP/S based access to Elasticsearch. All applications should use HTTP/S rather than Elasticsearch transport protocol."
|
67
69
|
|
68
70
|
|
69
71
|
|
70
72
|
|
71
73
|
If the current settings do not provide enough information regarding the content of the event, this is a finding.",,,Generate Audits to assist monitoring and alerting of activities on the system,"Utilize perimeter, application, centralized authentication, and repository audit controls to audit the use of systems in real time with sufficient context. X-Pack Security audit controls should be enabled to audit the defaults of all HTTP/S based access to Elasticsearch. All applications should use HTTP/S rather than Elasticsearch transport protocol."
|
72
74
|
|
73
75
|
See the official documentation for the complete guide on establishing SSL configuration: https://www.elastic.co/guide/en/x-pack/current/ssl-tls.html",None,"Application must utilize approved cryptography to protect data transmission.
|
74
76
|
|
75
77
|
|
76
78
|
See the official documentation for the complete guide on establishing SSL configuration: https://www.elastic.co/guide/en/x-pack/current/ssl-tls.html",None,"Application must utilize approved cryptography to protect data transmission.
|
77
79
|
|
78
80
|
|
79
81
|
See the official documentation for the complete guide on establishing SSL configuration: https://www.elastic.co/guide/en/x-pack/current/ssl-tls.html",None,"Application must utilize approved cryptography to establish confidentiality of transmitted data.
|
80
82
|
|
81
83
|
|
82
84
|
|
83
85
|
|
84
86
|
|
85
87
|
If the current settings do not provide enough information regarding the content of the event, this is a finding.",,,Generate Audits to assist monitoring and alerting of activities on the system,"Utilize perimeter, application, centralized authentication, and repository audit controls to audit the use of systems in real time with sufficient context. X-Pack Security audit controls should be enabled to audit the defaults of all HTTP/S based access to Elasticsearch. All applications should use HTTP/S rather than Elasticsearch transport protocol."
|
86
88
|
|
87
89
|
See the official documentation for the complete guide on establishing SSL configuration: https://www.elastic.co/guide/en/x-pack/current/ssl-tls.html",None,"Application must utilize approved cryptography to establish integrity during preparation of data transmission.
|
88
90
|
|
89
91
|
|
90
92
|
|
91
93
|
|
92
94
|
|
93
95
|
If the current settings do not provide enough information regarding the content of the event, this is a finding.",,,Generate Audits to assist monitoring and alerting of activities on the system,"Utilize perimeter, application, centralized authentication, and repository audit controls to audit the use of systems in real time with sufficient context. X-Pack Security audit controls should be enabled to audit the defaults of all HTTP/S based access to Elasticsearch. All applications should use HTTP/S rather than Elasticsearch transport protocol."
|
94
96
|
|
95
97
|
See the official documentation for the complete guide on establishing SSL configuration: https://www.elastic.co/guide/en/x-pack/current/ssl-tls.html",None,"Application must utilize bidirectional authentication for cryptographic device communication.
|
96
98
|
|
97
99
|
|
98
100
|
|
99
101
|
|
100
102
|
|
101
103
|
If the current settings do not provide enough information regarding the content of the event, this is a finding.",,,Generate Audits to assist monitoring and alerting of activities on the system,"Utilize perimeter, application, centralized authentication, and repository audit controls to audit the use of systems in real time with sufficient context. X-Pack Security audit controls should be enabled to audit the defaults of all HTTP/S based access to Elasticsearch. All applications should use HTTP/S rather than Elasticsearch transport protocol."
|
@@ -0,0 +1,83 @@
|
|
1
|
+
compliance:
|
2
|
+
min: -1
|
3
|
+
max: -1
|
4
|
+
passed:
|
5
|
+
total:
|
6
|
+
min: -1
|
7
|
+
max: -1
|
8
|
+
critical:
|
9
|
+
min: -1
|
10
|
+
max: -1
|
11
|
+
high:
|
12
|
+
min: -1
|
13
|
+
max: -1
|
14
|
+
medium:
|
15
|
+
min: -1
|
16
|
+
max: -1
|
17
|
+
low:
|
18
|
+
min: -1
|
19
|
+
max: -1
|
20
|
+
failed:
|
21
|
+
total:
|
22
|
+
min: -1
|
23
|
+
max: -1
|
24
|
+
critical:
|
25
|
+
min: -1
|
26
|
+
max: -1
|
27
|
+
high:
|
28
|
+
min: -1
|
29
|
+
max: -1
|
30
|
+
medium:
|
31
|
+
min: -1
|
32
|
+
max: -1
|
33
|
+
low:
|
34
|
+
min: -1
|
35
|
+
max: -1
|
36
|
+
skipped:
|
37
|
+
total:
|
38
|
+
min: -1
|
39
|
+
max: -1
|
40
|
+
critical:
|
41
|
+
min: -1
|
42
|
+
max: -1
|
43
|
+
high:
|
44
|
+
min: -1
|
45
|
+
max: -1
|
46
|
+
medium:
|
47
|
+
min: -1
|
48
|
+
max: -1
|
49
|
+
low:
|
50
|
+
min: -1
|
51
|
+
max: -1
|
52
|
+
no_impact:
|
53
|
+
total:
|
54
|
+
min: -1
|
55
|
+
max: -1
|
56
|
+
critical:
|
57
|
+
min: -1
|
58
|
+
max: -1
|
59
|
+
high:
|
60
|
+
min: -1
|
61
|
+
max: -1
|
62
|
+
medium:
|
63
|
+
min: -1
|
64
|
+
max: -1
|
65
|
+
low:
|
66
|
+
min: -1
|
67
|
+
max: -1
|
68
|
+
error:
|
69
|
+
total:
|
70
|
+
min: -1
|
71
|
+
max: -1
|
72
|
+
critical:
|
73
|
+
min: -1
|
74
|
+
max: -1
|
75
|
+
high:
|
76
|
+
min: -1
|
77
|
+
max: -1
|
78
|
+
medium:
|
79
|
+
min: -1
|
80
|
+
max: -1
|
81
|
+
low:
|
82
|
+
min: -1
|
83
|
+
max: -1
|
@@ -0,0 +1,161 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'happymapper'
|
4
|
+
require 'nokogiri'
|
5
|
+
|
6
|
+
# see: https://github.com/dam5s/happymapper
|
7
|
+
# Class Status maps from the 'status' from Benchmark XML file using HappyMapper
|
8
|
+
module HappyMapperTools
|
9
|
+
module Benchmark
|
10
|
+
class Status
|
11
|
+
include HappyMapper
|
12
|
+
tag 'status'
|
13
|
+
attribute :date, String, tag: 'date'
|
14
|
+
content :status, String, tag: 'status'
|
15
|
+
end
|
16
|
+
|
17
|
+
# Class Notice maps from the 'notice' from Benchmark XML file using HappyMapper
|
18
|
+
class Notice
|
19
|
+
include HappyMapper
|
20
|
+
tag 'notice'
|
21
|
+
attribute :id, String, tag: 'id'
|
22
|
+
attribute :xml_lang, String, namespace: 'xml', tag: 'lang'
|
23
|
+
content :notice, String, tag: 'notice'
|
24
|
+
end
|
25
|
+
|
26
|
+
# Class ReferenceBenchmark maps from the 'reference' from Benchmark XML file using HappyMapper
|
27
|
+
class ReferenceBenchmark
|
28
|
+
include HappyMapper
|
29
|
+
tag 'reference'
|
30
|
+
attribute :href, String, tag: 'href'
|
31
|
+
element :dc_publisher, String, namespace: 'dc', tag: 'publisher'
|
32
|
+
element :dc_source, String, namespace: 'dc', tag: 'source'
|
33
|
+
end
|
34
|
+
|
35
|
+
# Class ReferenceGroup maps from the 'reference' from Benchmark XML file using HappyMapper
|
36
|
+
class ReferenceGroup
|
37
|
+
include HappyMapper
|
38
|
+
tag 'reference'
|
39
|
+
element :dc_title, String, namespace: 'dc', tag: 'title'
|
40
|
+
element :dc_publisher, String, namespace: 'dc', tag: 'publisher'
|
41
|
+
element :dc_type, String, namespace: 'dc', tag: 'type'
|
42
|
+
element :dc_subject, String, namespace: 'dc', tag: 'subject'
|
43
|
+
element :dc_identifier, String, namespace: 'dc', tag: 'identifier'
|
44
|
+
end
|
45
|
+
|
46
|
+
# Class Plaintext maps from the 'plain-text' from Benchmark XML file using HappyMapper
|
47
|
+
class Plaintext
|
48
|
+
include HappyMapper
|
49
|
+
tag 'plain-text'
|
50
|
+
attribute :id, String, tag: 'id'
|
51
|
+
content :plaintext, String
|
52
|
+
end
|
53
|
+
|
54
|
+
# Class Select maps from the 'Select' from Benchmark XML file using HappyMapper
|
55
|
+
class Select
|
56
|
+
include HappyMapper
|
57
|
+
tag 'Select'
|
58
|
+
attribute :idref, String, tag: 'idref'
|
59
|
+
attribute :selected, String, tag: 'selected'
|
60
|
+
end
|
61
|
+
|
62
|
+
# Class Ident maps from the 'ident' from Benchmark XML file using HappyMapper
|
63
|
+
class Ident
|
64
|
+
include HappyMapper
|
65
|
+
tag 'ident'
|
66
|
+
attribute :system, String, tag: 'system'
|
67
|
+
content :ident, String
|
68
|
+
end
|
69
|
+
|
70
|
+
# Class Fixtext maps from the 'fixtext' from Benchmark XML file using HappyMapper
|
71
|
+
class Fixtext
|
72
|
+
include HappyMapper
|
73
|
+
tag 'fixtext'
|
74
|
+
attribute :fixref, String, tag: 'fixref'
|
75
|
+
content :fixtext, String
|
76
|
+
end
|
77
|
+
|
78
|
+
# Class Fix maps from the 'fixtext' from Benchmark XML file using HappyMapper
|
79
|
+
class Fix
|
80
|
+
include HappyMapper
|
81
|
+
tag 'fixtext'
|
82
|
+
attribute :id, String, tag: 'id'
|
83
|
+
end
|
84
|
+
|
85
|
+
# Class ContentRef maps from the 'check-content-ref' from Benchmark XML file using HappyMapper
|
86
|
+
class ContentRef
|
87
|
+
include HappyMapper
|
88
|
+
tag 'check-content-ref'
|
89
|
+
attribute :name, String, tag: 'name'
|
90
|
+
attribute :href, String, tag: 'href'
|
91
|
+
end
|
92
|
+
|
93
|
+
# Class Check maps from the 'Check' from Benchmark XML file using HappyMapper
|
94
|
+
class Check
|
95
|
+
include HappyMapper
|
96
|
+
tag 'check'
|
97
|
+
attribute :system, String, tag: 'system'
|
98
|
+
element :content_ref, ContentRef, tag: 'check-content-ref'
|
99
|
+
element :content, String, tag: 'check-content'
|
100
|
+
end
|
101
|
+
|
102
|
+
# Class Profile maps from the 'Profile' from Benchmark XML file using HappyMapper
|
103
|
+
class Profile
|
104
|
+
include HappyMapper
|
105
|
+
tag 'Profile'
|
106
|
+
attribute :id, String, tag: 'id'
|
107
|
+
element :title, String, tag: 'title'
|
108
|
+
element :description, String, tag: 'description'
|
109
|
+
has_many :select, Select, tag: 'select'
|
110
|
+
end
|
111
|
+
|
112
|
+
# Class Rule maps from the 'Rule' from Benchmark XML file using HappyMapper
|
113
|
+
class Rule
|
114
|
+
include HappyMapper
|
115
|
+
tag 'Rule'
|
116
|
+
attribute :id, String, tag: 'id'
|
117
|
+
attribute :severity, String, tag: 'severity'
|
118
|
+
attribute :weight, String, tag: 'weight'
|
119
|
+
element :version, String, tag: 'version'
|
120
|
+
element :title, String, tag: 'title'
|
121
|
+
element :description, String, tag: 'description'
|
122
|
+
element :reference, ReferenceGroup, tag: 'reference'
|
123
|
+
has_many :ident, Ident, tag: 'ident'
|
124
|
+
element :fixtext, Fixtext, tag: 'fixtext'
|
125
|
+
element :fix, Fix, tag: 'fix'
|
126
|
+
element :check, Check, tag: 'check'
|
127
|
+
end
|
128
|
+
|
129
|
+
# Class Group maps from the 'Group' from Benchmark XML file using HappyMapper
|
130
|
+
class Group
|
131
|
+
include HappyMapper
|
132
|
+
tag 'Group'
|
133
|
+
attribute :id, String, tag: 'id'
|
134
|
+
element :title, String, tag: 'title'
|
135
|
+
element :description, String, tag: 'description'
|
136
|
+
element :rule, Rule, tag: 'Rule'
|
137
|
+
end
|
138
|
+
|
139
|
+
# Class Benchmark maps from the 'Benchmark' from Benchmark XML file using HappyMapper
|
140
|
+
class Benchmark
|
141
|
+
include HappyMapper
|
142
|
+
tag 'Benchmark'
|
143
|
+
register_namespace 'dsig', 'http://www.w3.org/2000/09/xmldsig#'
|
144
|
+
register_namespace 'xsi', 'http://www.w3.org/2001/XMLSchema-instance'
|
145
|
+
register_namespace 'cpe', 'http://cpe.mitre.org/language/2.0'
|
146
|
+
register_namespace 'xhtml', 'http://www.w3.org/1999/xhtml'
|
147
|
+
register_namespace 'dc', 'http://purl.org/dc/elements/1.1/'
|
148
|
+
attribute :id, String, tag: 'id'
|
149
|
+
attribute :xmlns, String, tag: 'xmlns'
|
150
|
+
element :status, Status, tag: 'status'
|
151
|
+
element :title, String, tag: 'title'
|
152
|
+
element :description, String, tag: 'description'
|
153
|
+
element :notice, Notice, tag: 'notice'
|
154
|
+
element :reference, ReferenceBenchmark, tag: 'reference'
|
155
|
+
element :plaintext, Plaintext, tag: 'plain-text'
|
156
|
+
element :version, String, tag: 'version'
|
157
|
+
has_many :profile, Profile, tag: 'Profile'
|
158
|
+
has_many :group, Group, tag: 'Group'
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|