danger-brakeman_scanner 0.1.0.pre.preview
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.circleci/config.yml +38 -0
- data/.gitignore +12 -0
- data/.rspec +1 -0
- data/.rubocop.yml +10 -0
- data/CHANGELOG.md +1 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +109 -0
- data/LICENSE +21 -0
- data/Makefile +16 -0
- data/README.md +93 -0
- data/bin/console +31 -0
- data/bin/setup +6 -0
- data/danger-brakeman_scanner.gemspec +51 -0
- data/lib/danger_plugin.rb +27 -0
- data/lib/version.rb +5 -0
- metadata +146 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0fbfd5ee304ec4be6876f559fb554b741853f21e176c25295fea97708a036388
|
4
|
+
data.tar.gz: 2194c26064a82df51f6743ec568b9ec529b858b93be8814052ca29a469eedb1f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 88df0e5755614f0b06dcb03842dbc6d881ba5cdb596ac34f88b3479e28620897529c38cfb34d1cf99fda9feace4afc41fcf5dae8c179fe8eb4b9913cda1b46f4
|
7
|
+
data.tar.gz: 0b299aa41039120ccd1d92ef925a5034756b44b08c54ce07168784a1dfd04fa9abb3c495bab2208bc723a12dd1517af194314b67c5f21c2ad507ed3d1a823df9
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# Ruby CircleCI 2.0 configuration file
|
2
|
+
#
|
3
|
+
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
|
4
|
+
#
|
5
|
+
version: 2
|
6
|
+
jobs:
|
7
|
+
build:
|
8
|
+
docker:
|
9
|
+
- image: circleci/ruby:2.6
|
10
|
+
environment:
|
11
|
+
- BUNDLE_JOBS: 4
|
12
|
+
- BUNDLE_RETRY: 3
|
13
|
+
- BUNDLE_PATH: vendor/bundle
|
14
|
+
steps:
|
15
|
+
- checkout
|
16
|
+
- run:
|
17
|
+
name: Configuring Bundler
|
18
|
+
command: |
|
19
|
+
echo 'export BUNDLER_VERSION=$(tail -1 Gemfile.lock | xargs)' >> $BASH_ENV
|
20
|
+
source $BASH_ENV
|
21
|
+
gem install bundler -v $BUNDLER_VERSION
|
22
|
+
- restore_cache:
|
23
|
+
keys:
|
24
|
+
- v1-dependencies-{{ arch }}-{{ checksum "Gemfile.lock" }}
|
25
|
+
# fallback to using the latest cache if no exact match is found
|
26
|
+
- v1-dependencies-{{ arch }}-
|
27
|
+
- run:
|
28
|
+
name: Install dependencies
|
29
|
+
command: |
|
30
|
+
bundle check || bundle install --jobs=4 --retry=3
|
31
|
+
- save_cache:
|
32
|
+
key: v1-dependencies-{{ arch }}-{{ checksum "Gemfile.lock" }}
|
33
|
+
paths:
|
34
|
+
- vendor/bundle
|
35
|
+
|
36
|
+
- run:
|
37
|
+
name: Run tests
|
38
|
+
command: make
|
data/.gitignore
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--require spec_helper
|
data/.rubocop.yml
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# Changelog
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at dev@klaxit.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [https://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: https://contributor-covenant.org
|
74
|
+
[version]: https://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,109 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
danger-brakeman_scanner (0.1.0.pre.preview)
|
5
|
+
brakeman
|
6
|
+
danger
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
addressable (2.7.0)
|
12
|
+
public_suffix (>= 2.0.2, < 5.0)
|
13
|
+
ast (2.4.0)
|
14
|
+
brakeman (4.8.0)
|
15
|
+
claide (1.0.3)
|
16
|
+
claide-plugins (0.9.2)
|
17
|
+
cork
|
18
|
+
nap
|
19
|
+
open4 (~> 1.3)
|
20
|
+
coderay (1.1.2)
|
21
|
+
colored2 (3.1.2)
|
22
|
+
cork (0.3.0)
|
23
|
+
colored2 (~> 3.1)
|
24
|
+
danger (6.3.1)
|
25
|
+
claide (~> 1.0)
|
26
|
+
claide-plugins (>= 0.9.2)
|
27
|
+
colored2 (~> 3.1)
|
28
|
+
cork (~> 0.1)
|
29
|
+
faraday (~> 0.9)
|
30
|
+
faraday-http-cache (~> 2.0)
|
31
|
+
git (~> 1.6)
|
32
|
+
kramdown (~> 2.0)
|
33
|
+
kramdown-parser-gfm (~> 1.0)
|
34
|
+
no_proxy_fix
|
35
|
+
octokit (~> 4.7)
|
36
|
+
terminal-table (~> 1)
|
37
|
+
diff-lcs (1.3)
|
38
|
+
faraday (0.17.3)
|
39
|
+
multipart-post (>= 1.2, < 3)
|
40
|
+
faraday-http-cache (2.0.0)
|
41
|
+
faraday (~> 0.8)
|
42
|
+
git (1.6.0)
|
43
|
+
rchardet (~> 1.8)
|
44
|
+
jaro_winkler (1.5.4)
|
45
|
+
kramdown (2.1.0)
|
46
|
+
kramdown-parser-gfm (1.1.0)
|
47
|
+
kramdown (~> 2.0)
|
48
|
+
method_source (1.0.0)
|
49
|
+
multipart-post (2.1.1)
|
50
|
+
nap (1.1.0)
|
51
|
+
no_proxy_fix (0.1.2)
|
52
|
+
octokit (4.18.0)
|
53
|
+
faraday (>= 0.9)
|
54
|
+
sawyer (~> 0.8.0, >= 0.5.3)
|
55
|
+
open4 (1.3.4)
|
56
|
+
parallel (1.19.1)
|
57
|
+
parser (2.7.0.5)
|
58
|
+
ast (~> 2.4.0)
|
59
|
+
pry (0.13.0)
|
60
|
+
coderay (~> 1.1)
|
61
|
+
method_source (~> 1.0)
|
62
|
+
public_suffix (4.0.3)
|
63
|
+
rainbow (3.0.0)
|
64
|
+
rake (12.3.3)
|
65
|
+
rchardet (1.8.0)
|
66
|
+
rexml (3.2.4)
|
67
|
+
rspec (3.9.0)
|
68
|
+
rspec-core (~> 3.9.0)
|
69
|
+
rspec-expectations (~> 3.9.0)
|
70
|
+
rspec-mocks (~> 3.9.0)
|
71
|
+
rspec-core (3.9.1)
|
72
|
+
rspec-support (~> 3.9.1)
|
73
|
+
rspec-expectations (3.9.1)
|
74
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
75
|
+
rspec-support (~> 3.9.0)
|
76
|
+
rspec-mocks (3.9.1)
|
77
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
78
|
+
rspec-support (~> 3.9.0)
|
79
|
+
rspec-support (3.9.2)
|
80
|
+
rubocop (0.79.0)
|
81
|
+
jaro_winkler (~> 1.5.1)
|
82
|
+
parallel (~> 1.10)
|
83
|
+
parser (>= 2.7.0.1)
|
84
|
+
rainbow (>= 2.2.2, < 4.0)
|
85
|
+
rexml
|
86
|
+
ruby-progressbar (~> 1.7)
|
87
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
88
|
+
ruby-progressbar (1.10.1)
|
89
|
+
sawyer (0.8.2)
|
90
|
+
addressable (>= 2.3.5)
|
91
|
+
faraday (> 0.8, < 2.0)
|
92
|
+
terminal-table (1.8.0)
|
93
|
+
unicode-display_width (~> 1.1, >= 1.1.1)
|
94
|
+
unicode-display_width (1.6.1)
|
95
|
+
yard (0.9.24)
|
96
|
+
|
97
|
+
PLATFORMS
|
98
|
+
ruby
|
99
|
+
|
100
|
+
DEPENDENCIES
|
101
|
+
danger-brakeman_scanner!
|
102
|
+
pry
|
103
|
+
rake (~> 12.0)
|
104
|
+
rspec (~> 3.0)
|
105
|
+
rubocop
|
106
|
+
yard
|
107
|
+
|
108
|
+
BUNDLED WITH
|
109
|
+
2.1.4
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020-present Klaxit SAS
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/Makefile
ADDED
data/README.md
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
# Danger Brakeman Plugin [![CircleCI](https://circleci.com/gh/klaxit/danger-brakeman_scanner.svg?style=svg)](https://circleci.com/gh/klaxit/danger-brakeman_scanner)
|
2
|
+
|
3
|
+
A [Danger] plugin for [Brakeman] security static analysis.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem "danger-brakeman_scanner"
|
11
|
+
```
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
Run Ruby files through Brakeman. A markdown table will be shown as result.
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
brakeman.run("my_app_path")
|
19
|
+
```
|
20
|
+
|
21
|
+
You can pass a list of options as well, thoses will be given as-is to brakeman
|
22
|
+
scanner.
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
brakeman.run(app_path: "my_app_path", github_repo: "klaxit/fast-polylines")
|
26
|
+
```
|
27
|
+
|
28
|
+
The list of all options is available below, but not that some of those won't make sense here:
|
29
|
+
|
30
|
+
<details>
|
31
|
+
<summary>
|
32
|
+
https://github.com/presidentbeef/brakeman/blob/1eef0997f2a8a01f885d3f4908447ab20bfd0b7d/lib/brakeman.rb#L32-L67
|
33
|
+
</summary>
|
34
|
+
|
35
|
+
- `:app_path` - path to root of Rails app (required)
|
36
|
+
- `:additional_checks_path` - array of additional directories containing additional out-of-tree checks to run
|
37
|
+
- `:additional_libs_path` - array of additional application relative lib directories (ex. app/mailers) to process
|
38
|
+
- `:assume_all_routes` - assume all methods are routes (default: true)
|
39
|
+
- `:check_arguments` - check arguments of methods (default: true)
|
40
|
+
- `:collapse_mass_assignment` - report unprotected models in single warning (default: false)
|
41
|
+
- `:combine_locations` - combine warning locations (default: true)
|
42
|
+
- `:config_file` - configuration file
|
43
|
+
- `:escape_html` - escape HTML by default (automatic)
|
44
|
+
- `:exit_on_error` - only affects Commandline module (default: true)
|
45
|
+
- `:exit_on_warn` - only affects Commandline module (default: true)
|
46
|
+
- `:github_repo` - github repo to use for file links (user/repo[/path][@ref])
|
47
|
+
- `:highlight_user_input` - highlight user input in reported warnings (default: true)
|
48
|
+
- `:html_style` - path to CSS file
|
49
|
+
- `:ignore_model_output` - consider models safe (default: false)
|
50
|
+
- `:index_libs` - add libraries to call index (default: true)
|
51
|
+
- `:interprocedural` - limited interprocedural processing of method calls (default: false)
|
52
|
+
- `:message_limit` - limit length of messages
|
53
|
+
- `:min_confidence` - minimum confidence (0-2, 0 is highest)
|
54
|
+
- `:output_files` - files for output
|
55
|
+
- `:output_formats` - formats for output (:to_s, :to_tabs, :to_csv, :to_html)
|
56
|
+
- `:parallel_checks` - run checks in parallel (default: true)
|
57
|
+
- `:parser_timeout` - set timeout for parsing an individual file (default: 10 seconds)
|
58
|
+
- `:print_report` - if no output file specified, print to stdout (default: false)
|
59
|
+
- `:quiet` - suppress most messages (default: true)
|
60
|
+
- `:rails3` - force Rails 3 mode (automatic)
|
61
|
+
- `:rails4` - force Rails 4 mode (automatic)
|
62
|
+
- `:rails5` - force Rails 5 mode (automatic)
|
63
|
+
- `:rails6` - force Rails 6 mode (automatic)
|
64
|
+
- `:report_routes` - show found routes on controllers (default: false)
|
65
|
+
- `:run_checks` - array of checks to run (run all if not specified)
|
66
|
+
- `:safe_methods` - array of methods to consider safe
|
67
|
+
- `:skip_libs` - do not process lib/ directory (default: false)
|
68
|
+
- `:skip_checks` - checks not to run (run all if not specified)
|
69
|
+
- `:absolute_paths` - show absolute path of each file (default: false)
|
70
|
+
- `:summary_only` - only output summary section of report for plain/table (:summary_only, :no_summary, true)
|
71
|
+
|
72
|
+
</details>
|
73
|
+
|
74
|
+
## Development
|
75
|
+
|
76
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `make` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
77
|
+
|
78
|
+
## Contributing
|
79
|
+
|
80
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/klaxit/danger-brakeman_scanner. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct].
|
81
|
+
|
82
|
+
|
83
|
+
## License
|
84
|
+
|
85
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
86
|
+
|
87
|
+
## Code of Conduct
|
88
|
+
|
89
|
+
Everyone interacting in the Danger::Brakeman project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct].
|
90
|
+
|
91
|
+
[code of conduct]: https://github.com/klaxit/danger-brakeman_scanner/blob/master/CODE_OF_CONDUCT.md
|
92
|
+
[brakeman]: https://brakemanscanner.org/
|
93
|
+
[danger]: https://danger.systems/ruby/
|
data/bin/console
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
|
6
|
+
require "brakeman"
|
7
|
+
|
8
|
+
# Print methods of an object with some filtering.
|
9
|
+
def m(instance)
|
10
|
+
noizy_methods = Object.instance_methods + Object.methods + Enumerable.methods
|
11
|
+
puts((instance.methods - noizy_methods).sort)
|
12
|
+
end
|
13
|
+
|
14
|
+
# A safe app to run Brakeman through
|
15
|
+
#
|
16
|
+
# @example
|
17
|
+
# Brakeman.run(safe_rails_app_path)
|
18
|
+
def safe_rails_app_path
|
19
|
+
File.expand_path("../spec/fixtures/safe_rails_app", __dir__)
|
20
|
+
end
|
21
|
+
|
22
|
+
# A dangerous app to run Brakeman through
|
23
|
+
#
|
24
|
+
# @example
|
25
|
+
# Brakeman.run(dangerous_rails_app_path)
|
26
|
+
def dangerous_rails_app_path
|
27
|
+
File.expand_path("../spec/fixtures/dangerous_rails_app", __dir__)
|
28
|
+
end
|
29
|
+
|
30
|
+
require "irb"
|
31
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "danger-brakeman_scanner"
|
7
|
+
spec.version = DangerBrakemanScanner::VERSION
|
8
|
+
spec.authors = ["Ulysse Buonomo"]
|
9
|
+
spec.email = ["dev@klaxit.com"]
|
10
|
+
|
11
|
+
github_url = "https://github.com/klaxit/#{spec.name}"
|
12
|
+
|
13
|
+
spec.summary = "A Danger plugin for running Ruby files through Brakeman."
|
14
|
+
spec.homepage = github_url
|
15
|
+
spec.license = "MIT"
|
16
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
17
|
+
|
18
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
19
|
+
spec.metadata["source_code_uri"] = github_url
|
20
|
+
spec.metadata["changelog_uri"] = "#{github_url}/blob/master/CHANGELOG.md"
|
21
|
+
|
22
|
+
# Specify which files should be added to the gem when it is released.
|
23
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added
|
24
|
+
# into git.
|
25
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
26
|
+
`git ls-files -z`.split("\x0").reject { |file| file.match(%r(^spec/)) }
|
27
|
+
end
|
28
|
+
spec.bindir = "exe"
|
29
|
+
spec.executables = spec.files.grep(%r(^exe/), &File.method(:basename))
|
30
|
+
spec.require_paths = ["lib"]
|
31
|
+
|
32
|
+
# Main dependencies
|
33
|
+
spec.add_dependency "brakeman"
|
34
|
+
spec.add_dependency "danger"
|
35
|
+
|
36
|
+
# Testing support
|
37
|
+
spec.add_development_dependency "rspec"
|
38
|
+
|
39
|
+
# Linting code and docs
|
40
|
+
spec.add_development_dependency "rubocop"
|
41
|
+
spec.add_development_dependency "yard"
|
42
|
+
|
43
|
+
# This gives you the chance to run a REPL inside your tests
|
44
|
+
# via:
|
45
|
+
#
|
46
|
+
# require "pry"
|
47
|
+
# binding.pry
|
48
|
+
#
|
49
|
+
# This will stop test execution and let you inspect the results
|
50
|
+
spec.add_development_dependency "pry"
|
51
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Run ruby files through Brakeman
|
4
|
+
#
|
5
|
+
# @example Run with default configuration in application directory
|
6
|
+
#
|
7
|
+
# brakeman.run
|
8
|
+
#
|
9
|
+
# @see https://github.com/presidentbeef/brakeman
|
10
|
+
# @tags brakeman, security, ruby
|
11
|
+
class Danger::DangerBrakeman < Danger::Plugin
|
12
|
+
require "brakeman"
|
13
|
+
|
14
|
+
# Run a Brakeman scan over current application.
|
15
|
+
#
|
16
|
+
# @param options (see {Brakeman.run})
|
17
|
+
# @return [void]
|
18
|
+
def run(options = File.dirname(Kernel.caller_locations.first.absolute_path))
|
19
|
+
tracker = Brakeman.run(options)
|
20
|
+
return if tracker.warnings.empty? && tracker.errors.empty?
|
21
|
+
|
22
|
+
markdown tracker.report.to_markdown
|
23
|
+
failure "Brakeman static analysis detected issues in the code. " \
|
24
|
+
"If this is a false positive, [mark it as such]" \
|
25
|
+
"(https://brakemanscanner.org/docs/ignoring_false_positives/)."
|
26
|
+
end
|
27
|
+
end
|
data/lib/version.rb
ADDED
metadata
ADDED
@@ -0,0 +1,146 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: danger-brakeman_scanner
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0.pre.preview
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ulysse Buonomo
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-03-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: brakeman
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: danger
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: yard
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
description:
|
98
|
+
email:
|
99
|
+
- dev@klaxit.com
|
100
|
+
executables: []
|
101
|
+
extensions: []
|
102
|
+
extra_rdoc_files: []
|
103
|
+
files:
|
104
|
+
- ".circleci/config.yml"
|
105
|
+
- ".gitignore"
|
106
|
+
- ".rspec"
|
107
|
+
- ".rubocop.yml"
|
108
|
+
- CHANGELOG.md
|
109
|
+
- CODE_OF_CONDUCT.md
|
110
|
+
- Gemfile
|
111
|
+
- Gemfile.lock
|
112
|
+
- LICENSE
|
113
|
+
- Makefile
|
114
|
+
- README.md
|
115
|
+
- bin/console
|
116
|
+
- bin/setup
|
117
|
+
- danger-brakeman_scanner.gemspec
|
118
|
+
- lib/danger_plugin.rb
|
119
|
+
- lib/version.rb
|
120
|
+
homepage: https://github.com/klaxit/danger-brakeman_scanner
|
121
|
+
licenses:
|
122
|
+
- MIT
|
123
|
+
metadata:
|
124
|
+
homepage_uri: https://github.com/klaxit/danger-brakeman_scanner
|
125
|
+
source_code_uri: https://github.com/klaxit/danger-brakeman_scanner
|
126
|
+
changelog_uri: https://github.com/klaxit/danger-brakeman_scanner/blob/master/CHANGELOG.md
|
127
|
+
post_install_message:
|
128
|
+
rdoc_options: []
|
129
|
+
require_paths:
|
130
|
+
- lib
|
131
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: 2.3.0
|
136
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ">"
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: 1.3.1
|
141
|
+
requirements: []
|
142
|
+
rubygems_version: 3.1.0.pre3
|
143
|
+
signing_key:
|
144
|
+
specification_version: 4
|
145
|
+
summary: A Danger plugin for running Ruby files through Brakeman.
|
146
|
+
test_files: []
|