odle-m 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 800485a35d15ab752e25eb7674789d55d5088b426b81d8ade19e9208d9ad5f96
4
- data.tar.gz: 5a6c62f31f4b151915d0956664af7266d8f027ed52343b26109936f3f449013d
3
+ metadata.gz: a7e86213bf7d8acd6a1975b7f9a6cad94a85d163b84b7afa2868a71a634f5a6a
4
+ data.tar.gz: 9f0651e828cd3079c0026d97348867abb42b2b455f6e5effada3e6b36ec68574
5
5
  SHA512:
6
- metadata.gz: bdd83324fd4da125739552100bcb71711aec892ac7aef948d8a3817075090eaea9921adb7fccf3db38efd0761d7c6b4dc554dd294bc59e2c593555ca5339cd1d
7
- data.tar.gz: 63fd19799c46cc92643b877454104cf2e1eb21b509bc7bc3a4820bf2db00165c6ca8bc337baf115b54a32dcf4e597a3ea666b57bce1299ff8f2cd47ab48d78e7
6
+ metadata.gz: 1615fca488b0050b9eec145da4a1542e8359ce0065eb33df54e01d0940a86ff8a36ffc91dd1ef3993ee356230370449bfb36d1e493dc7eaa1ca2dd5b192a3b01
7
+ data.tar.gz: 896e598e3a122ba82ad4aa798387d0fa16674088ca5c506cf382f73aea698de6c7ed1afd2f1b6b28a23648eb0e964398bc1b27dc19a489e5066506ebdae5c95f
data/bin/odle-m CHANGED
@@ -2,7 +2,7 @@
2
2
  require 'odle-m'
3
3
 
4
4
  def list_types()
5
- return ["","--burp","--burp2","--nessus","--msf","--nmap"].join("\n")
5
+ return ["","--burp","--burp2","--nessus","--msf","--nmap","--prowler"].join("\n")
6
6
  end
7
7
 
8
8
  # data flags are required
@@ -29,6 +29,8 @@ elsif type.downcase == "burp2"
29
29
  puts Burp2.new().parse(ARGF.read,"0")
30
30
  elsif type.downcase == "nessus"
31
31
  puts Nessus.new().parse(ARGF.read,"0")
32
+ elsif type.downcase == "prowler"
33
+ puts Prowler.new().parse(ARGF.read,"0")
32
34
  elsif type.downcase == "msf"
33
35
  puts Metasploit.new().parse(ARGF.read,"0")
34
36
  elsif type.downcase == "nmap"
data/lib/parsers/burp.rb CHANGED
@@ -13,7 +13,6 @@ require 'json'
13
13
  # create a temporary finding object
14
14
  finding = Finding.new()
15
15
  finding.title = issue.css('name').text.to_s()
16
- puts "#{finding.title}"
17
16
  finding.overview = issue.css('issueBackground').text.to_s()+issue.css('issueDetail').text.to_s()
18
17
  finding.remediation = issue.css('remediationBackground').text.to_s() + issue.css('remediationDetail').text.to_s()
19
18
  finding.references=issue.css('references').text.to_s() + issue.css('vulnerabilityClassifications').text.to_s()
@@ -0,0 +1,58 @@
1
+ require 'json'
2
+
3
+ class Prowler
4
+ def parse(file,threshold)
5
+ grouped_data = {}
6
+ data = JSON.parse(file)
7
+
8
+ data.each do |item|
9
+ title = item['CheckTitle']
10
+
11
+ if grouped_data[title].nil?
12
+ grouped_data[title] = []
13
+ end
14
+
15
+ grouped_data[title] << item
16
+ end
17
+
18
+ merged_data = {}
19
+
20
+ grouped_data.each do |title, items|
21
+ fail_items = items.select { |item| item['Status'] == 'FAIL' }
22
+
23
+ if fail_items.length > 0
24
+ merged_data[title] = {
25
+ 'AccountId' =>fail_items[0]['AccountId'],
26
+ 'ServiceName' => fail_items[0]['ServiceName'],
27
+ 'SubServiceName' =>fail_items[0]['SubServiceName'],
28
+ 'StatusExtended' => fail_items.map { |item| item['StatusExtended'] }.join("\r\n"),
29
+ 'Severity' => fail_items[0]['Severity'],
30
+ 'Risk' => fail_items[0]['Risk'],
31
+ 'Region' => fail_items.map { |item| item['Region'] }.join("\r\n"),
32
+ 'ResourceId' => fail_items.map { |item| item['ResourceId'] }.join("\r\n"),
33
+ 'Remediation' => fail_items[0]['Remediation']['Code'],
34
+ 'Recommendation' => fail_items[0]['Remediation']['Recommendation'],
35
+ 'Scale' => if fail_items[0]['Severity'] == 'critical'
36
+ 10.to_i
37
+ elsif fail_items[0]['Severity'] == 'high'
38
+ 8.to_i
39
+ elsif fail_items[0]['Severity'] == 'medium'
40
+ 6.to_i
41
+ elsif fail_items[0]['Severity'] == 'low'
42
+ 3.to_i
43
+ end
44
+ }
45
+ end
46
+ end
47
+
48
+ merged_data.transform_values! do |value|
49
+ value['ServiceName'] = value['ServiceName'].upcase if value['ServiceName']
50
+ value['Severity'] = value['Severity'].upcase if value['Severity']
51
+ value
52
+ end
53
+
54
+ data = merged_data.sort_by { |_, value| value["Scale"] }
55
+
56
+ return data.to_json
57
+ end
58
+ end
metadata CHANGED
@@ -1,17 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: odle-m
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shyam Ganesh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-05 00:00:00.000000000 Z
11
+ date: 2023-03-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: An easy to use security data parsing tool. Takes in data from different
14
- tools and outputs standardized JSON with extra parsing
14
+ tools and outputs standardized JSON with extra parsing, modified from original gem
15
+ odle
15
16
  email: ''
16
17
  executables:
17
18
  - odle-m
@@ -26,6 +27,7 @@ files:
26
27
  - lib/parsers/msfv5.rb
27
28
  - lib/parsers/nessus.rb
28
29
  - lib/parsers/nmap.rb
30
+ - lib/parsers/prowler.rb
29
31
  homepage: http://rubygems.org/gems/odle
30
32
  licenses:
31
33
  - BSD-3-Clause-Attribution
@@ -50,5 +52,6 @@ requirements: []
50
52
  rubygems_version: 3.1.6
51
53
  signing_key:
52
54
  specification_version: 4
53
- summary: odle-m
55
+ summary: Take in nessus, burp, nmap output xml, prowler outpu and convert them into
56
+ json
54
57
  test_files: []