inspec_tools 2.0.4 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +25 -17
- data/Rakefile +82 -8
- data/lib/data/cis_to_nist_critical_controls +0 -0
- data/lib/data/cis_to_nist_mapping +0 -0
- data/lib/happy_mapper_tools/benchmark.rb +83 -0
- data/lib/happy_mapper_tools/stig_attributes.rb +68 -48
- data/lib/inspec_tools/csv.rb +42 -39
- data/lib/inspec_tools/generate_map.rb +35 -0
- data/lib/inspec_tools/inspec.rb +19 -91
- data/lib/inspec_tools/pdf.rb +2 -13
- data/lib/inspec_tools/plugin_cli.rb +22 -53
- data/lib/inspec_tools/summary.rb +108 -76
- data/lib/inspec_tools/xccdf.rb +1 -0
- data/lib/inspec_tools/xlsx_tool.rb +4 -16
- data/lib/utilities/cci_xml.rb +13 -0
- data/lib/utilities/cis_to_nist.rb +11 -0
- data/lib/utilities/inspec_util.rb +10 -74
- data/lib/utilities/mapping_validator.rb +10 -0
- data/lib/utilities/xccdf/from_inspec.rb +89 -0
- data/lib/utilities/xccdf/to_xccdf.rb +388 -0
- data/lib/utilities/xccdf/xccdf_score.rb +116 -0
- metadata +48 -29
- data/CHANGELOG.md +0 -714
- data/lib/data/NIST_Map_02052020_CIS_Controls_Version_7.1_Implementation_Groups_1.2.xlsx +0 -0
- data/lib/data/NIST_Map_09212017B_CSC-CIS_Critical_Security_Controls_VER_6.1_Excel_9.1.2016.xlsx +0 -0
- data/lib/utilities/extract_nist_cis_mapping.rb +0 -57
Binary file
|
data/lib/data/NIST_Map_09212017B_CSC-CIS_Critical_Security_Controls_VER_6.1_Excel_9.1.2016.xlsx
DELETED
Binary file
|
@@ -1,57 +0,0 @@
|
|
1
|
-
require 'roo'
|
2
|
-
|
3
|
-
module Util
|
4
|
-
class ExtractNistMappings
|
5
|
-
def initialize(file)
|
6
|
-
@file = file
|
7
|
-
@full_excel = []
|
8
|
-
@headers = {}
|
9
|
-
|
10
|
-
open_excel
|
11
|
-
set_working_sheet
|
12
|
-
map_headers
|
13
|
-
retrieve_mappings
|
14
|
-
end
|
15
|
-
|
16
|
-
def open_excel
|
17
|
-
@xlsx = Roo::Excelx.new(@file)
|
18
|
-
end
|
19
|
-
|
20
|
-
def full_excl
|
21
|
-
@full_excel
|
22
|
-
end
|
23
|
-
|
24
|
-
def set_working_sheet
|
25
|
-
@xlsx.default_sheet = 'VER 6.1 Controls'
|
26
|
-
end
|
27
|
-
|
28
|
-
def map_headers
|
29
|
-
@xlsx.row(3).each_with_index { |header, i|
|
30
|
-
@headers[header] = i
|
31
|
-
}
|
32
|
-
end
|
33
|
-
|
34
|
-
def retrieve_mappings
|
35
|
-
nist_ver = 4
|
36
|
-
cis_ver = @xlsx.row(2)[4].split(' ')[-1]
|
37
|
-
ctrl_count = 1
|
38
|
-
((@xlsx.first_row + 3)..@xlsx.last_row).each do |row_value|
|
39
|
-
current_row = {}
|
40
|
-
if @xlsx.row(row_value)[@headers['NIST SP 800-53 Control #']].to_s != ''
|
41
|
-
current_row[:nist] = @xlsx.row(row_value)[@headers['NIST SP 800-53 Control #']].to_s
|
42
|
-
else
|
43
|
-
current_row[:nist] = 'Not Mapped'
|
44
|
-
end
|
45
|
-
current_row[:nist_ver] = nist_ver
|
46
|
-
if @xlsx.row(row_value)[@headers['Control']].to_s == ''
|
47
|
-
current_row[:cis] = ctrl_count.to_s
|
48
|
-
ctrl_count += 1
|
49
|
-
else
|
50
|
-
current_row[:cis] = @xlsx.row(row_value)[@headers['Control']].to_s
|
51
|
-
end
|
52
|
-
current_row[:cis_ver] = cis_ver
|
53
|
-
@full_excel << current_row
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|