heimdall_tools 1.3.43 → 1.3.48
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +203 -166
- data/lib/data/scoutsuite-nist-mapping.csv +140 -0
- data/lib/heimdall_tools.rb +3 -0
- data/lib/heimdall_tools/aws_config_mapper.rb +5 -6
- data/lib/heimdall_tools/burpsuite_mapper.rb +1 -2
- data/lib/heimdall_tools/cli.rb +32 -11
- data/lib/heimdall_tools/dbprotect_mapper.rb +5 -9
- data/lib/heimdall_tools/fortify_mapper.rb +3 -2
- data/lib/heimdall_tools/help/sarif_mapper.md +12 -0
- data/lib/heimdall_tools/help/scoutsuite_mapper.md +7 -0
- data/lib/heimdall_tools/jfrog_xray_mapper.rb +1 -2
- data/lib/heimdall_tools/nessus_mapper.rb +7 -5
- data/lib/heimdall_tools/netsparker_mapper.rb +9 -13
- data/lib/heimdall_tools/nikto_mapper.rb +1 -2
- data/lib/heimdall_tools/sarif_mapper.rb +198 -0
- data/lib/heimdall_tools/scoutsuite_mapper.rb +180 -0
- data/lib/heimdall_tools/snyk_mapper.rb +1 -2
- data/lib/heimdall_tools/sonarqube_mapper.rb +5 -1
- data/lib/heimdall_tools/xccdf_results_mapper.rb +161 -0
- data/lib/heimdall_tools/zap_mapper.rb +1 -4
- metadata +10 -4
@@ -0,0 +1,140 @@
|
|
1
|
+
rule,nistid
|
2
|
+
acm-certificate-with-close-expiration-date,SC-12
|
3
|
+
acm-certificate-with-transparency-logging-disabled,SC-12
|
4
|
+
cloudformation-stack-with-role,AC-6
|
5
|
+
cloudtrail-duplicated-global-services-logging,AU-6
|
6
|
+
cloudtrail-no-cloudwatch-integration,AU-12|SI-4(2)
|
7
|
+
cloudtrail-no-data-logging,AU-12
|
8
|
+
cloudtrail-no-encryption-with-kms,AU-6
|
9
|
+
cloudtrail-no-global-services-logging,AU-12
|
10
|
+
cloudtrail-no-log-file-validation,AU-6
|
11
|
+
cloudtrail-no-logging,AU-12
|
12
|
+
cloudtrail-not-configured,AU-12
|
13
|
+
cloudwatch-alarm-without-actions,AU-12
|
14
|
+
config-recorder-not-configured,CM-8|CM-8(2)|CM-8(6)
|
15
|
+
ec2-ami-public,AC-3
|
16
|
+
ec2-default-security-group-in-use,AC-3(3)
|
17
|
+
ec2-default-security-group-with-rules,AC-3(3)
|
18
|
+
ec2-ebs-snapshot-not-encrypted,SC-28
|
19
|
+
ec2-ebs-snapshot-public,AC-3
|
20
|
+
ec2-ebs-volume-not-encrypted,SC-28
|
21
|
+
ec2-instance-in-security-group,CM-7(1)
|
22
|
+
ec2-instance-type,CM-2
|
23
|
+
ec2-instance-types,CM-2
|
24
|
+
ec2-instance-with-public-ip,AC-3
|
25
|
+
ec2-instance-with-user-data-secrets,AC-3
|
26
|
+
ec2-security-group-opens-all-ports,CM-7(1)
|
27
|
+
ec2-security-group-opens-all-ports-to-all,CM-7(1)
|
28
|
+
ec2-security-group-opens-all-ports-to-self,CM-7(1)
|
29
|
+
ec2-security-group-opens-icmp-to-all,CM-7(1)
|
30
|
+
ec2-security-group-opens-known-port-to-all,CM-7(1)
|
31
|
+
ec2-security-group-opens-plaintext-port,CM-7(1)
|
32
|
+
ec2-security-group-opens-port-range,CM-7(1)
|
33
|
+
ec2-security-group-opens-port-to-all,CM-7(1)
|
34
|
+
ec2-security-group-whitelists-aws,CM-7(1)
|
35
|
+
ec2-security-group-whitelists-aws-ip-from-banned-region,CM-7(1)
|
36
|
+
ec2-security-group-whitelists-non-elastic-ips,CM-7(1)
|
37
|
+
ec2-security-group-whitelists-unknown-aws,CM-7(1)
|
38
|
+
ec2-security-group-whitelists-unknown-cidrs,CM-7(1)
|
39
|
+
ec2-unused-security-group,CM-7(1)
|
40
|
+
elb-listener-allowing-cleartext,SC-8
|
41
|
+
elb-no-access-logs,AU-12
|
42
|
+
elb-older-ssl-policy,SC-8
|
43
|
+
elbv2-http-request-smuggling,SC-8
|
44
|
+
elbv2-listener-allowing-cleartext,SC-8
|
45
|
+
elbv2-no-access-logs,AU-12
|
46
|
+
elbv2-no-deletion-protection,SI-7
|
47
|
+
elbv2-older-ssl-policy,SC-8
|
48
|
+
iam-assume-role-lacks-external-id-and-mfa,AC-17
|
49
|
+
iam-assume-role-no-mfa,AC-6
|
50
|
+
iam-assume-role-policy-allows-all,AC-6
|
51
|
+
iam-ec2-role-without-instances,AC-6
|
52
|
+
iam-group-with-inline-policies,AC-6
|
53
|
+
iam-group-with-no-users,AC-6
|
54
|
+
iam-human-user-with-policies,AC-6
|
55
|
+
iam-inline-policy-allows-non-sts-action,AC-6
|
56
|
+
iam-inline-policy-allows-NotActions,AC-6
|
57
|
+
iam-inline-policy-for-role,AC-6
|
58
|
+
iam-managed-policy-allows-full-privileges,AC-6
|
59
|
+
iam-managed-policy-allows-non-sts-action,AC-6
|
60
|
+
iam-managed-policy-allows-NotActions,AC-6
|
61
|
+
iam-managed-policy-for-role,AC-6
|
62
|
+
iam-managed-policy-no-attachments,AC-6
|
63
|
+
iam-no-support-role,IR-7
|
64
|
+
iam-password-policy-expiration-threshold,AC-2
|
65
|
+
iam-password-policy-minimum-length,AC-2
|
66
|
+
iam-password-policy-no-expiration,AC-2
|
67
|
+
iam-password-policy-no-lowercase-required,AC-2
|
68
|
+
iam-password-policy-no-number-required,AC-2
|
69
|
+
iam-password-policy-no-symbol-required,AC-2
|
70
|
+
iam-password-policy-no-uppercase-required,AC-2
|
71
|
+
iam-password-policy-reuse-enabled,IA-5(1)
|
72
|
+
iam-role-with-inline-policies,AC-6
|
73
|
+
iam-root-account-no-hardware-mfa,IA-2(1)
|
74
|
+
iam-root-account-no-mfa,IA-2(1)
|
75
|
+
iam-root-account-used-recently,AC-6(9)
|
76
|
+
iam-root-account-with-active-certs,AC-6(9)
|
77
|
+
iam-root-account-with-active-keys,AC-6(9)
|
78
|
+
iam-service-user-with-password,AC-2
|
79
|
+
iam-unused-credentials-not-disabled,AC-2
|
80
|
+
iam-user-no-key-rotation,AC-2
|
81
|
+
iam-user-not-in-category-group,AC-2
|
82
|
+
iam-user-not-in-common-group,AC-2
|
83
|
+
iam-user-unused-access-key-initial-setup,AC-2
|
84
|
+
iam-user-with-multiple-access-keys,IA-2
|
85
|
+
iam-user-without-mfa,IA-2(1)
|
86
|
+
iam-user-with-password-and-key,IA-2
|
87
|
+
iam-user-with-policies,AC-2
|
88
|
+
kms-cmk-rotation-disabled,SC-12
|
89
|
+
logs-no-alarm-aws-configuration-changes,CM-8|CM-8(2)|CM-8(6)
|
90
|
+
logs-no-alarm-cloudtrail-configuration-changes,AU-6
|
91
|
+
logs-no-alarm-cmk-deletion,AC-2
|
92
|
+
logs-no-alarm-console-authentication-failures,AC-2
|
93
|
+
logs-no-alarm-iam-policy-changes,AC-2
|
94
|
+
logs-no-alarm-nacl-changes,CM-6(2)
|
95
|
+
logs-no-alarm-network-gateways-changes,AU-12|CM-6(2)
|
96
|
+
logs-no-alarm-root-usage,AU-2
|
97
|
+
logs-no-alarm-route-table-changes,AU-12|CM-6(2)
|
98
|
+
logs-no-alarm-s3-policy-changes,AC-6|AU-12
|
99
|
+
logs-no-alarm-security-group-changes,AC-2(4)
|
100
|
+
logs-no-alarm-signin-without-mfa,AC-2
|
101
|
+
logs-no-alarm-unauthorized-api-calls,AU-6|SI-4(2)
|
102
|
+
logs-no-alarm-vpc-changes,CM-6(1)
|
103
|
+
rds-instance-backup-disabled,CP-9
|
104
|
+
rds-instance-ca-certificate-deprecated,SC-12
|
105
|
+
rds-instance-no-minor-upgrade,SI-2
|
106
|
+
rds-instance-short-backup-retention-period,CP-9
|
107
|
+
rds-instance-single-az,CP-7
|
108
|
+
rds-instance-storage-not-encrypted,SC-28
|
109
|
+
rds-postgres-instance-with-invalid-certificate,SC-12
|
110
|
+
rds-security-group-allows-all,CM-7(1)
|
111
|
+
rds-snapshot-public,SC-28
|
112
|
+
redshift-cluster-database-not-encrypted,SC-28
|
113
|
+
redshift-cluster-no-version-upgrade,SI-2
|
114
|
+
redshift-cluster-publicly-accessible,AC-3
|
115
|
+
redshift-parameter-group-logging-disabled,AU-12
|
116
|
+
redshift-parameter-group-ssl-not-required,SC-8
|
117
|
+
redshift-security-group-whitelists-all,CM-7(1)
|
118
|
+
route53-domain-no-autorenew,SC-2
|
119
|
+
route53-domain-no-transferlock,SC-2
|
120
|
+
route53-domain-transferlock-not-authorized,SC-2
|
121
|
+
s3-bucket-allowing-cleartext,SC-28
|
122
|
+
s3-bucket-no-default-encryption,SC-28
|
123
|
+
s3-bucket-no-logging,AU-2|AU-12
|
124
|
+
s3-bucket-no-mfa-delete,SI-7
|
125
|
+
s3-bucket-no-versioning,SI-7
|
126
|
+
s3-bucket-world-acl,AC-3(3)
|
127
|
+
s3-bucket-world-policy-arg,AC-3(3)
|
128
|
+
s3-bucket-world-policy-star,AC-3(3)
|
129
|
+
ses-identity-dkim-not-enabled,SC-23
|
130
|
+
ses-identity-dkim-not-verified,SC-23
|
131
|
+
ses-identity-world-policy,AC-6
|
132
|
+
sns-topic-world-policy,AC-6
|
133
|
+
sqs-queue-world-policy,AC-6
|
134
|
+
vpc-custom-network-acls-allow-all,SC-7
|
135
|
+
vpc-default-network-acls-allow-all,SC-7
|
136
|
+
vpc-network-acl-not-used,SC-7
|
137
|
+
vpc-routing-tables-with-peering,AC-3(3)
|
138
|
+
vpc-subnet-with-bad-acls,SC-7
|
139
|
+
vpc-subnet-with-default-acls,SC-7
|
140
|
+
vpc-subnet-without-flow-log,AU-12
|
data/lib/heimdall_tools.rb
CHANGED
@@ -16,4 +16,7 @@ module HeimdallTools
|
|
16
16
|
autoload :DBProtectMapper, 'heimdall_tools/dbprotect_mapper'
|
17
17
|
autoload :AwsConfigMapper, 'heimdall_tools/aws_config_mapper'
|
18
18
|
autoload :NetsparkerMapper, 'heimdall_tools/netsparker_mapper'
|
19
|
+
autoload :SarifMapper, 'heimdall_tools/sarif_mapper'
|
20
|
+
autoload :ScoutSuiteMapper, 'heimdall_tools/scoutsuite_mapper'
|
21
|
+
autoload :XCCDFResultsMapper, 'heimdall_tools/xccdf_results_mapper'
|
19
22
|
end
|
@@ -18,8 +18,7 @@ INSUFFICIENT_DATA_MSG = 'Not enough data has been collectd to determine complian
|
|
18
18
|
#
|
19
19
|
module HeimdallTools
|
20
20
|
class AwsConfigMapper
|
21
|
-
def initialize(custom_mapping, endpoint = nil
|
22
|
-
@verbose = verbose
|
21
|
+
def initialize(custom_mapping, endpoint = nil)
|
23
22
|
@default_mapping = get_rule_mapping(AWS_CONFIG_MAPPING_FILE)
|
24
23
|
@custom_mapping = custom_mapping.nil? ? {} : get_rule_mapping(custom_mapping)
|
25
24
|
if endpoint.nil?
|
@@ -58,10 +57,10 @@ module HeimdallTools
|
|
58
57
|
|
59
58
|
results = HeimdallDataFormat.new(
|
60
59
|
profile_name: 'AWS Config',
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
60
|
+
title: 'AWS Config',
|
61
|
+
summary: 'AWS Config',
|
62
|
+
controls: controls,
|
63
|
+
statistics: { aws_config_sdk_version: Aws::ConfigService::GEM_VERSION },
|
65
64
|
)
|
66
65
|
results.to_hdf
|
67
66
|
end
|
@@ -20,9 +20,8 @@ DEFAULT_NIST_TAG = %w{SA-11 RA-5 Rev_4}.freeze
|
|
20
20
|
|
21
21
|
module HeimdallTools
|
22
22
|
class BurpSuiteMapper
|
23
|
-
def initialize(burps_xml, _name = nil
|
23
|
+
def initialize(burps_xml, _name = nil)
|
24
24
|
@burps_xml = burps_xml
|
25
|
-
@verbose = verbose
|
26
25
|
|
27
26
|
begin
|
28
27
|
@cwe_nist_mapping = parse_mapper
|
data/lib/heimdall_tools/cli.rb
CHANGED
@@ -6,7 +6,6 @@ module HeimdallTools
|
|
6
6
|
long_desc Help.text(:fortify_mapper)
|
7
7
|
option :fvdl, required: true, aliases: '-f'
|
8
8
|
option :output, required: true, aliases: '-o'
|
9
|
-
option :verbose, type: :boolean, aliases: '-V'
|
10
9
|
def fortify_mapper
|
11
10
|
hdf = HeimdallTools::FortifyMapper.new(File.read(options[:fvdl])).to_hdf
|
12
11
|
File.write(options[:output], hdf)
|
@@ -17,7 +16,6 @@ module HeimdallTools
|
|
17
16
|
option :json, required: true, aliases: '-j'
|
18
17
|
option :name, required: true, aliases: '-n'
|
19
18
|
option :output, required: true, aliases: '-o'
|
20
|
-
option :verbose, type: :boolean, aliases: '-V'
|
21
19
|
def zap_mapper
|
22
20
|
hdf = HeimdallTools::ZapMapper.new(File.read(options[:json]), options[:name]).to_hdf
|
23
21
|
File.write(options[:output], hdf)
|
@@ -29,7 +27,6 @@ module HeimdallTools
|
|
29
27
|
option :api_url, required: true, aliases: '-u'
|
30
28
|
option :auth, type: :string, required: false
|
31
29
|
option :output, required: true, aliases: '-o'
|
32
|
-
option :verbose, type: :boolean, aliases: '-V'
|
33
30
|
def sonarqube_mapper
|
34
31
|
hdf = HeimdallTools::SonarQubeMapper.new(options[:name], options[:api_url], options[:auth]).to_hdf
|
35
32
|
File.write(options[:output], hdf)
|
@@ -39,17 +36,24 @@ module HeimdallTools
|
|
39
36
|
long_desc Help.text(:burpsuite_mapper)
|
40
37
|
option :xml, required: true, aliases: '-x'
|
41
38
|
option :output, required: true, aliases: '-o'
|
42
|
-
option :verbose, type: :boolean, aliases: '-V'
|
43
39
|
def burpsuite_mapper
|
44
40
|
hdf = HeimdallTools::BurpSuiteMapper.new(File.read(options[:xml])).to_hdf
|
45
41
|
File.write(options[:output], hdf)
|
46
42
|
end
|
47
43
|
|
44
|
+
desc 'xccdf_results_mapper', 'xccdf_results_mapper translates SCAP client XCCDF-Results XML report to HDF format Json be viewed on Heimdall'
|
45
|
+
long_desc Help.text(:xccdf_results_mapper)
|
46
|
+
option :xml, required: true, aliases: '-x'
|
47
|
+
option :output, required: true, aliases: '-o'
|
48
|
+
def xccdf_results_mapper
|
49
|
+
hdf = HeimdallTools::XCCDFResultsMapper.new(File.read(options[:xml])).to_hdf
|
50
|
+
File.write(options[:output], hdf)
|
51
|
+
end
|
52
|
+
|
48
53
|
desc 'nessus_mapper', 'nessus_mapper translates nessus xml report to HDF format Json be viewed on Heimdall'
|
49
54
|
long_desc Help.text(:nessus_mapper)
|
50
55
|
option :xml, required: true, aliases: '-x'
|
51
56
|
option :output_prefix, required: true, aliases: '-o'
|
52
|
-
option :verbose, type: :boolean, aliases: '-V'
|
53
57
|
def nessus_mapper
|
54
58
|
hdfs = HeimdallTools::NessusMapper.new(File.read(options[:xml])).to_hdf
|
55
59
|
|
@@ -64,7 +68,6 @@ module HeimdallTools
|
|
64
68
|
long_desc Help.text(:snyk_mapper)
|
65
69
|
option :json, required: true, aliases: '-j'
|
66
70
|
option :output_prefix, required: true, aliases: '-o'
|
67
|
-
option :verbose, type: :boolean, aliases: '-V'
|
68
71
|
def snyk_mapper
|
69
72
|
hdfs = HeimdallTools::SnykMapper.new(File.read(options[:json]), options[:name]).to_hdf
|
70
73
|
puts "\r\HDF Generated:\n"
|
@@ -78,7 +81,6 @@ module HeimdallTools
|
|
78
81
|
long_desc Help.text(:nikto_mapper)
|
79
82
|
option :json, required: true, aliases: '-j'
|
80
83
|
option :output, required: true, aliases: '-o'
|
81
|
-
option :verbose, type: :boolean, aliases: '-V'
|
82
84
|
def nikto_mapper
|
83
85
|
hdf = HeimdallTools::NiktoMapper.new(File.read(options[:json])).to_hdf
|
84
86
|
File.write(options[:output], hdf)
|
@@ -90,7 +92,6 @@ module HeimdallTools
|
|
90
92
|
long_desc Help.text(:jfrog_xray_mapper)
|
91
93
|
option :json, required: true, aliases: '-j'
|
92
94
|
option :output, required: true, aliases: '-o'
|
93
|
-
option :verbose, type: :boolean, aliases: '-V'
|
94
95
|
def jfrog_xray_mapper
|
95
96
|
hdf = HeimdallTools::JfrogXrayMapper.new(File.read(options[:json])).to_hdf
|
96
97
|
File.write(options[:output], hdf)
|
@@ -102,7 +103,6 @@ module HeimdallTools
|
|
102
103
|
long_desc Help.text(:dbprotect_mapper)
|
103
104
|
option :xml, required: true, aliases: '-x'
|
104
105
|
option :output, required: true, aliases: '-o'
|
105
|
-
option :verbose, type: :boolean, aliases: '-V'
|
106
106
|
def dbprotect_mapper
|
107
107
|
hdf = HeimdallTools::DBProtectMapper.new(File.read(options[:xml])).to_hdf
|
108
108
|
File.write(options[:output], hdf)
|
@@ -114,7 +114,6 @@ module HeimdallTools
|
|
114
114
|
long_desc Help.text(:aws_config_mapper)
|
115
115
|
# option :custom_mapping, required: false, aliases: '-m'
|
116
116
|
option :output, required: true, aliases: '-o'
|
117
|
-
option :verbose, type: :boolean, aliases: '-V'
|
118
117
|
def aws_config_mapper
|
119
118
|
hdf = HeimdallTools::AwsConfigMapper.new(options[:custom_mapping]).to_hdf
|
120
119
|
File.write(options[:output], hdf)
|
@@ -126,7 +125,6 @@ module HeimdallTools
|
|
126
125
|
long_desc Help.text(:netsparker_mapper)
|
127
126
|
option :xml, required: true, aliases: '-x'
|
128
127
|
option :output, required: true, aliases: '-o'
|
129
|
-
option :verbose, type: :boolean, aliases: '-V'
|
130
128
|
def netsparker_mapper
|
131
129
|
hdf = HeimdallTools::NetsparkerMapper.new(File.read(options[:xml])).to_hdf
|
132
130
|
File.write(options[:output], hdf)
|
@@ -134,6 +132,29 @@ module HeimdallTools
|
|
134
132
|
puts options[:output].to_s
|
135
133
|
end
|
136
134
|
|
135
|
+
desc 'sarif_mapper', 'sarif_mapper translates a SARIF JSON file into HDF format JSON to be viewable in Heimdall'
|
136
|
+
long_desc Help.text(:sarif_mapper)
|
137
|
+
option :json, required: true, aliases: '-j'
|
138
|
+
option :output, required: true, aliases: '-o'
|
139
|
+
option :verbose, type: :boolean, aliases: '-V'
|
140
|
+
def sarif_mapper
|
141
|
+
hdf = HeimdallTools::SarifMapper.new(File.read(options[:json])).to_hdf
|
142
|
+
File.write(options[:output], hdf)
|
143
|
+
puts "\r\HDF Generated:\n"
|
144
|
+
puts options[:output].to_s
|
145
|
+
end
|
146
|
+
|
147
|
+
desc 'scoutsuite_mapper', 'scoutsuite_mapper translates Scout Suite results from Javascript to HDF-formatted JSON so as to be viewable on Heimdall'
|
148
|
+
long_desc Help.text(:scoutsuite_mapper)
|
149
|
+
option :javascript, required: true, banner: 'SCOUTSUITE-RESULTS-JS', aliases: ['-i', '--input', '-j']
|
150
|
+
option :output, required: true, banner: 'HDF-SCAN-RESULTS-JSON', aliases: '-o'
|
151
|
+
def scoutsuite_mapper
|
152
|
+
hdf = HeimdallTools::ScoutSuiteMapper.new(File.read(options[:javascript])).to_hdf
|
153
|
+
File.write(options[:output], hdf)
|
154
|
+
puts "\rHDF Generated:\n"
|
155
|
+
puts options[:output].to_s
|
156
|
+
end
|
157
|
+
|
137
158
|
desc 'version', 'prints version'
|
138
159
|
def version
|
139
160
|
puts VERSION
|
@@ -12,15 +12,11 @@ IMPACT_MAPPING = {
|
|
12
12
|
|
13
13
|
module HeimdallTools
|
14
14
|
class DBProtectMapper
|
15
|
-
def initialize(xml, _name = nil
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
@entries = compile_findings(dataset['dataset'])
|
21
|
-
rescue StandardError => e
|
22
|
-
raise "Invalid DBProtect XML file provided Exception: #{e};\nNote that XML must be of kind `Check Results Details`."
|
23
|
-
end
|
15
|
+
def initialize(xml, _name = nil)
|
16
|
+
dataset = xml_to_hash(xml)
|
17
|
+
@entries = compile_findings(dataset['dataset'])
|
18
|
+
rescue StandardError => e
|
19
|
+
raise "Invalid DBProtect XML file provided Exception: #{e};\nNote that XML must be of kind `Check Results Details`."
|
24
20
|
end
|
25
21
|
|
26
22
|
def to_hdf
|
@@ -7,9 +7,8 @@ DEFAULT_NIST_TAG = %w{SA-11 RA-5}.freeze
|
|
7
7
|
|
8
8
|
module HeimdallTools
|
9
9
|
class FortifyMapper
|
10
|
-
def initialize(fvdl
|
10
|
+
def initialize(fvdl)
|
11
11
|
@fvdl = fvdl
|
12
|
-
@verbose = verbose
|
13
12
|
|
14
13
|
begin
|
15
14
|
data = xml_to_hash(fvdl)
|
@@ -56,6 +55,7 @@ module HeimdallTools
|
|
56
55
|
findings.uniq
|
57
56
|
end
|
58
57
|
|
58
|
+
# rubocop:disable Layout/LineEndStringConcatenationIndentation
|
59
59
|
def snippet(snippetid)
|
60
60
|
snippet = @snippets.select { |x| x['id'].eql?(snippetid) }.first
|
61
61
|
"\nPath: #{snippet['File']}\n" \
|
@@ -63,6 +63,7 @@ module HeimdallTools
|
|
63
63
|
"EndLine: #{snippet['EndLine']}\n" \
|
64
64
|
"Code:\n#{snippet['Text']['#cdata-section'].strip}" \
|
65
65
|
end
|
66
|
+
# rubocop:enable Layout/LineEndStringConcatenationIndentation
|
66
67
|
|
67
68
|
def nist_tag(rule)
|
68
69
|
references = rule['References']['Reference']
|
@@ -0,0 +1,12 @@
|
|
1
|
+
sarif_mapper translates a SARIF JSON file into HDF format JSON to be viewable in Heimdall
|
2
|
+
|
3
|
+
SARIF level to HDF impact Mapping:
|
4
|
+
SARIF level error -> HDF impact 0.7
|
5
|
+
SARIF level warning -> HDF impact 0.5
|
6
|
+
SARIF level note -> HDF impact 0.3
|
7
|
+
SARIF level none -> HDF impact 0.1
|
8
|
+
SARIF level not provided -> HDF impact 0.1 as default
|
9
|
+
|
10
|
+
Examples:
|
11
|
+
|
12
|
+
heimdall_tools sarif_mapper [OPTIONS] -j <sarif-results-json> -o <hdf-scan-results.json>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
scoutsuite_mapper translates Scout Suite results from Javascript to HDF-formatted JSON so as to be viewable on Heimdall
|
2
|
+
|
3
|
+
Note: Currently this mapper only supports AWS.
|
4
|
+
|
5
|
+
Examples:
|
6
|
+
|
7
|
+
heimdall_tools scoutsuite_mapper -i <scoutsuite-results-js> -o <hdf-scan-results-json>
|
@@ -25,8 +25,6 @@ DEFAULT_NIST_REV = 'Rev_4'.freeze
|
|
25
25
|
|
26
26
|
NA_PLUGIN_OUTPUT = 'This Nessus Plugin does not provide output message.'.freeze
|
27
27
|
|
28
|
-
# rubocop:disable Metrics/AbcSize
|
29
|
-
|
30
28
|
# Loading spinner sign
|
31
29
|
$spinner = Enumerator.new do |e|
|
32
30
|
loop do
|
@@ -39,9 +37,8 @@ end
|
|
39
37
|
|
40
38
|
module HeimdallTools
|
41
39
|
class NessusMapper
|
42
|
-
def initialize(nessus_xml
|
40
|
+
def initialize(nessus_xml)
|
43
41
|
@nessus_xml = nessus_xml
|
44
|
-
@verbose = verbose
|
45
42
|
read_cci_xml
|
46
43
|
begin
|
47
44
|
@cwe_nist_mapping = parse_mapper
|
@@ -72,7 +69,8 @@ module HeimdallTools
|
|
72
69
|
info = {}
|
73
70
|
|
74
71
|
info['policyName'] = policy['policyName']
|
75
|
-
|
72
|
+
scanner_version = policy['Preferences']['ServerPreferences']['preference'].select { |x| x['name'].eql? 'sc_version' }
|
73
|
+
info['version'] = scanner_version.empty? ? NA_STRING : scanner_version.first['value']
|
76
74
|
info
|
77
75
|
rescue StandardError => e
|
78
76
|
raise "Invalid Nessus XML file provided Exception: #{e}"
|
@@ -221,8 +219,12 @@ module HeimdallTools
|
|
221
219
|
end
|
222
220
|
if item['compliance-reference']
|
223
221
|
@item['tags']['nist'] = cci_nist_tag(parse_refs(item['compliance-reference'], 'CCI'))
|
222
|
+
@item['tags']['cci'] = parse_refs(item['compliance-reference'], 'CCI')
|
223
|
+
@item['tags']['rid'] = parse_refs(item['compliance-reference'], 'Rule-ID').join(',')
|
224
|
+
@item['tags']['stig_id'] = parse_refs(item['compliance-reference'], 'STIG-ID').join(',')
|
224
225
|
else
|
225
226
|
@item['tags']['nist'] = plugin_nist_tag(item['pluginFamily'], item['pluginID'])
|
227
|
+
@item['tags']['rid'] = item['pluginID'].to_s
|
226
228
|
end
|
227
229
|
if item['compliance-solution']
|
228
230
|
@item['descriptions'] << desc_tags(item['compliance-solution'], 'check')
|
@@ -21,19 +21,15 @@ DEFAULT_NIST_TAG = %w{SA-11 RA-5}.freeze
|
|
21
21
|
|
22
22
|
module HeimdallTools
|
23
23
|
class NetsparkerMapper
|
24
|
-
def initialize(xml, _name = nil
|
25
|
-
@
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
@scan_info = data['netsparker-enterprise']['target']
|
34
|
-
rescue StandardError => e
|
35
|
-
raise "Invalid Netsparker XML file provided Exception: #{e}"
|
36
|
-
end
|
24
|
+
def initialize(xml, _name = nil)
|
25
|
+
@cwe_nist_mapping = parse_mapper(CWE_NIST_MAPPING_FILE)
|
26
|
+
@owasp_nist_mapping = parse_mapper(OWASP_NIST_MAPPING_FILE)
|
27
|
+
data = xml_to_hash(xml)
|
28
|
+
|
29
|
+
@vulnerabilities = data['netsparker-enterprise']['vulnerabilities']['vulnerability']
|
30
|
+
@scan_info = data['netsparker-enterprise']['target']
|
31
|
+
rescue StandardError => e
|
32
|
+
raise "Invalid Netsparker XML file provided Exception: #{e}"
|
37
33
|
end
|
38
34
|
|
39
35
|
def to_hdf
|