dradis-brakeman 4.10.0 → 4.12.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82df79572c46b37ad3d63fc5413ccd336ad5c328c5758f330c072f0a0e2b33a4
4
- data.tar.gz: 89ee79edf303aa19be9e893723e5e6ff4cdd8fa63ff68cfe305c5e1a8df47950
3
+ metadata.gz: 90577962578040e2c8d19cec0705f99785452159956c0e2506126f6ca10465c8
4
+ data.tar.gz: 5044fa833abc2ed6b717a7ea17ca6d33bbb41c0f6ff94a4cb70bbe4320b97da9
5
5
  SHA512:
6
- metadata.gz: 8a8510874b6958f3ef7695304fa75a42f75e604ede99244d7cc7e018d1590077bc701b7b9d72fb488ac1dcfce02712de96418fa40febc038d7352e312e6b3911
7
- data.tar.gz: a9bce79b3a0f537d3bd4acc541da7450496fbb19cca81782159dde6f4b2c6f276d5ed479ae567c739f99b3d67bdb13b56131bc7b184440374b18396ac6e30522
6
+ metadata.gz: a786098b366dc4763a0321055194c1a99d8d3d29a3ed0f089f29c2948de1c969752d6a8538b80386e01326d774487bb8a50bd6fb24de5475ca63a3d3e7cad9c6
7
+ data.tar.gz: e65f3b2576730843a3b138fba4de28e5a9bacec25d1a7927fb1bddc1f038a64a9ee74d7c45b95ec2fa13f94e307428ba55376722fcee6bfe9fa81e5a783411d7
@@ -1,3 +1,5 @@
1
+ Please review [CONTRIBUTING.md](https://github.com/dradis/dradis-ce/blob/develop/CONTRIBUTING.md) and remove this line.
2
+
1
3
  ### Summary
2
4
 
3
5
  Provide a general description of the code changes in your pull
@@ -6,6 +8,11 @@ these bugs have open GitHub issues, be sure to tag them here as well,
6
8
  to keep the conversation linked together.
7
9
 
8
10
 
11
+ ### Testing Steps
12
+
13
+ Provide steps to test functionality, described in detail for someone not familiar with this part of the application / code base
14
+
15
+
9
16
  ### Other Information
10
17
 
11
18
  If there's anything else that's important and relevant to your pull
@@ -26,11 +33,13 @@ products, we must have the copyright associated with the entire
26
33
  codebase. Any code you create which is merged must be owned by us.
27
34
  That's not us trying to be a jerks, that's just the way it works.
28
35
 
29
- Please review the [CONTRIBUTING.md](https://github.com/dradis/dradis-ce/blob/master/CONTRIBUTING.md)
30
- file for the details.
31
-
32
36
  You can delete this section, but the following sentence needs to
33
37
  remain in the PR's description:
34
38
 
35
39
  > I assign all rights, including copyright, to any future Dradis
36
40
  > work by myself to Security Roots.
41
+
42
+ ### Check List
43
+
44
+ - [ ] Added a CHANGELOG entry
45
+ - [ ] Added specs
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ v4.12.0 (May 2024)
2
+ - Migrate integration to use Mappings Manager
3
+ - Update Dradis links in README
4
+
5
+ v4.11.0 (January 2024)
6
+ - No changes
7
+
1
8
  v4.10.0 (September 2023)
2
9
  - Update gemspec links
3
10
 
data/README.md CHANGED
@@ -4,17 +4,16 @@
4
4
 
5
5
  Upload [Brakeman](http://brakemanscanner.org/) Rails security scanner JSON output into Dradis.
6
6
 
7
- The add-on requires [Dradis CE](https://dradisframework.com/ce/) > 3.0, or [Dradis Pro](https://dradisframework.com/pro/).
8
-
7
+ The add-on requires [Dradis CE](https://dradis.com/ce/) > 3.0, or [Dradis Pro](https://dradis.com/).
9
8
 
10
9
  ## More information
11
10
 
12
- See the Dradis Framework's [README.md](https://github.com/dradis/dradisframework/blob/master/README.md)
11
+ See the Dradis Framework's [README.md](https://github.com/dradis/dradis-ce/blob/develop/README.md)
13
12
 
14
13
 
15
14
  ## Contributing
16
15
 
17
- See the Dradis Framework's [CONTRIBUTING.md](https://github.com/dradis/dradisframework/blob/master/CONTRIBUTING.md)
16
+ See the Dradis Framework's [CONTRIBUTING.md](https://github.com/dradis/dradis-ce/blob/develop/CONTRIBUTING.md)
18
17
 
19
18
 
20
19
  ## License
@@ -8,7 +8,7 @@ module Dradis
8
8
 
9
9
  module VERSION
10
10
  MAJOR = 4
11
- MINOR = 10
11
+ MINOR = 12
12
12
  TINY = 0
13
13
  PRE = nil
14
14
 
@@ -24,7 +24,7 @@ module Dradis::Plugins::Brakeman
24
24
  end
25
25
 
26
26
  # choose a different parent based on the application path?
27
- scan_info = template_service.process_template(template: 'scan_info', data: data['scan_info'])
27
+ scan_info = mapping_service.apply_mapping(source: 'scan_info', data: data['scan_info'])
28
28
  content_service.create_note text: scan_info
29
29
 
30
30
  logger.info { "#{data['warnings'].count} Warnings\n===========" }
@@ -32,7 +32,7 @@ module Dradis::Plugins::Brakeman
32
32
  data['warnings'].each do |warning|
33
33
  logger.info { "* [#{warning['warning_type']}] #{warning['message']}" }
34
34
 
35
- warning_info = template_service.process_template(template: 'warning', data: warning)
35
+ warning_info = mapping_service.apply_mapping(source: 'warning', data: warning)
36
36
  content_service.create_issue text: warning_info, id: warning['warning_code']
37
37
  end
38
38
 
@@ -0,0 +1,53 @@
1
+ module Dradis::Plugins::Brakeman
2
+ module Mapping
3
+ DEFAULT_MAPPING = {
4
+ scan_info: {
5
+ 'Title' => 'Brakeman scan information',
6
+ 'Application' => '{{ brakeman[scan_info.app_path] }}',
7
+ 'BrakemanVersion' => '{{ brakeman[scan_info.brakeman_version] }}',
8
+ 'RailsVersion' => '{{ brakeman[scan_info.rails_version] }}',
9
+ 'WarningCount' => '{{ brakeman[scan_info.security_warnings] }}'
10
+ },
11
+ warning: {
12
+ 'Title' => '{{ brakeman[warning.message] }}',
13
+ 'Type' => '{{ brakeman[warning.warning_type] }}',
14
+ 'Confidence' => '{{ brakeman[warning.confidence] }}',
15
+ 'Path' => '{{ brakeman[warning.file] }}#{{ brakeman[warning.line] }}',
16
+ 'Code' => 'bc.. {{ brakeman[warning.code] }}',
17
+ 'References' => '{{ brakeman[warning.link] }}'
18
+ }
19
+ }.freeze
20
+
21
+ SOURCE_FIELDS = {
22
+ scan_info: [
23
+ 'scan_info.app_path',
24
+ 'scan_info.rails_version',
25
+ 'scan_info.security_warnings',
26
+ 'scan_info.start_time',
27
+ 'scan_info.end_time',
28
+ 'scan_info.duration',
29
+ 'scan_info.number_of_controllers',
30
+ 'scan_info.number_of_models',
31
+ 'scan_info.number_of_templates',
32
+ 'scan_info.ruby_version',
33
+ 'scan_info.brakeman_version'
34
+ ],
35
+ warning: [
36
+ 'warning.warning_type',
37
+ 'warning.warning_code',
38
+ 'warning.fingerprint',
39
+ 'warning.message',
40
+ 'warning.file',
41
+ 'warning.line',
42
+ 'warning.link',
43
+ 'warning.code',
44
+ 'warning.render_path',
45
+ 'warning.location_type',
46
+ 'warning.location_class',
47
+ 'warning.location_method',
48
+ 'warning.user_input',
49
+ 'warning.confidence'
50
+ ]
51
+ }.freeze
52
+ end
53
+ end
@@ -7,5 +7,6 @@ end
7
7
 
8
8
  require 'dradis/plugins/brakeman/engine'
9
9
  require 'dradis/plugins/brakeman/field_processor'
10
+ require 'dradis/plugins/brakeman/mapping'
10
11
  require 'dradis/plugins/brakeman/importer'
11
12
  require 'dradis/plugins/brakeman/version'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dradis-brakeman
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.10.0
4
+ version: 4.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Martin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-07 00:00:00.000000000 Z
11
+ date: 2024-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dradis-plugins
@@ -105,16 +105,13 @@ files:
105
105
  - lib/dradis/plugins/brakeman/field_processor.rb
106
106
  - lib/dradis/plugins/brakeman/gem_version.rb
107
107
  - lib/dradis/plugins/brakeman/importer.rb
108
+ - lib/dradis/plugins/brakeman/mapping.rb
108
109
  - lib/dradis/plugins/brakeman/version.rb
109
110
  - lib/tasks/thorfile.rb
110
111
  - spec/brakeman_upload_spec.rb
111
112
  - spec/spec_helper.rb
112
- - templates/scan_info.fields
113
113
  - templates/scan_info.sample
114
- - templates/scan_info.template
115
- - templates/warning.fields
116
114
  - templates/warning.sample
117
- - templates/warning.template
118
115
  homepage: https://dradis.com/integrations/brakeman.html
119
116
  licenses:
120
117
  - GPL-2
@@ -1,11 +0,0 @@
1
- scan_info.app_path
2
- scan_info.rails_version
3
- scan_info.security_warnings
4
- scan_info.start_time
5
- scan_info.end_time
6
- scan_info.duration
7
- scan_info.number_of_controllers
8
- scan_info.number_of_models
9
- scan_info.number_of_templates
10
- scan_info.ruby_version
11
- scan_info.brakeman_version
@@ -1,18 +0,0 @@
1
- #[Title]#
2
- Brakeman scan information
3
-
4
-
5
- #[Application]#
6
- %scan_info.app_path%
7
-
8
-
9
- #[BrakemanVersion]#
10
- %scan_info.brakeman_version%
11
-
12
-
13
- #[RailsVersion]#
14
- %scan_info.rails_version%
15
-
16
-
17
- #[WarningCount]#
18
- %scan_info.security_warnings%
@@ -1,14 +0,0 @@
1
- warning.warning_type
2
- warning.warning_code
3
- warning.fingerprint
4
- warning.message
5
- warning.file
6
- warning.line
7
- warning.link
8
- warning.code
9
- warning.render_path
10
- warning.location_type
11
- warning.location_class
12
- warning.location_method
13
- warning.user_input
14
- warning.confidence
@@ -1,22 +0,0 @@
1
- #[Title]#
2
- %warning.message%
3
-
4
-
5
- #[Type]#
6
- %warning.warning_type%
7
-
8
-
9
- #[Confidence]#
10
- %warning.confidence%
11
-
12
-
13
- #[Path]#
14
- %warning.file%#%warning.line%
15
-
16
-
17
- #[Code]#
18
- bc.. %warning.code%
19
-
20
-
21
- #[References]#
22
- %warning.link%