bundler-leak 0.1.0 → 0.1.1
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 +4 -4
- data/ChangeLog.md +6 -121
- data/README.md +6 -6
- data/Rakefile +2 -2
- data/bin/setup +4 -0
- data/data/ruby-mem-advisory-db.ts +1 -1
- data/data/ruby-mem-advisory-db/gems/celluloid/670.yml +3 -0
- data/data/ruby-mem-advisory-db/gems/grape/301.yml +2 -0
- data/data/ruby-mem-advisory-db/gems/oj/229.yml +2 -0
- data/data/ruby-mem-advisory-db/gems/redcarpet/516.yml +2 -0
- data/data/ruby-mem-advisory-db/gems/redis/612.yml +4 -1
- data/data/ruby-mem-advisory-db/gems/sidekiq/2598.yml +2 -0
- data/lib/bundler/plumber/advisory.rb +3 -3
- data/lib/bundler/plumber/cli.rb +6 -6
- data/lib/bundler/plumber/database.rb +6 -5
- data/lib/bundler/plumber/version.rb +1 -1
- data/spec/advisory_spec.rb +5 -5
- data/spec/database_spec.rb +3 -2
- data/spec/integration_spec.rb +5 -18
- data/spec/scanner_spec.rb +1 -13
- data/spec/spec_helper.rb +1 -1
- metadata +4 -4
- data/spec/bundle/insecure_sources/Gemfile +0 -39
- data/spec/bundle/secure/Gemfile +0 -38
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d7c920e493d02e31ba834c6997c45e488e8deb494fdc4a99447372f8ee7fb5ca
|
|
4
|
+
data.tar.gz: f93ad32dc249b544123d383a6fcde59ab76b8f2db4cf681120a8eac1e397366b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: be78021ea400192744e91cddf7de982bdd47fec4154dcd6ab7df47445045069a9c49c95ea46e85b0b33d92d300b6db493cb58ed49acd4e3b25fa66d2b1d61daa
|
|
7
|
+
data.tar.gz: f0931d5cfb7d8219679e67ec45f061f2381874ff6bf4731a949a09b5bbdf9e16783eb54c5e78d244108b683a32c5e21752c05c18f61436de2cff954d661a7363
|
data/ChangeLog.md
CHANGED
|
@@ -1,125 +1,10 @@
|
|
|
1
|
-
### 0.
|
|
1
|
+
### 0.1.0 / 2019-08-28
|
|
2
2
|
|
|
3
|
-
*
|
|
4
|
-
* Added `bin/bundler-audit` which will be executed when `bundle audit` is ran
|
|
5
|
-
(@vassilevsky).
|
|
3
|
+
* Improve database update logic
|
|
6
4
|
|
|
7
|
-
### 0.
|
|
5
|
+
### 0.0.0 / 2019-08-26
|
|
8
6
|
|
|
9
|
-
*
|
|
10
|
-
* Added {Bundler::Audit::Advisory#date}.
|
|
11
|
-
* Added {Bundler::Audit::Advisory#cve_id}.
|
|
12
|
-
* Added {Bundler::Audit::Advisory#osvdb_id}.
|
|
13
|
-
* Allow insecure gem sources (`http://` and `git://`), if they are hosted on a
|
|
14
|
-
private network.
|
|
7
|
+
* Initial release
|
|
15
8
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* Added the `--update` option to `bundle-audit check`.
|
|
19
|
-
* `bundle-audit update` now returns a non-zero exit status on error.
|
|
20
|
-
* `bundle-audit update` only updates `~/.local/share/ruby-advisory-db`, if it is a git
|
|
21
|
-
repository.
|
|
22
|
-
|
|
23
|
-
### 0.4.0 / 2015-06-30
|
|
24
|
-
|
|
25
|
-
* Require ruby >= 1.9.3 due to i18n gem deprecating < 1.9.3.
|
|
26
|
-
* Added {Bundler::Audit::Advisory#osvdb}.
|
|
27
|
-
* Resolve the IP addresses of gem sources and ignore intranet gem sources.
|
|
28
|
-
(PR #90)
|
|
29
|
-
* Use ISO8601 date format when querying the git timestamp of ruby-advisory-db.
|
|
30
|
-
(PR #92)
|
|
31
|
-
|
|
32
|
-
#### CLI
|
|
33
|
-
|
|
34
|
-
* Print the CVE or OSVDB id.
|
|
35
|
-
* No longer print "Unpatched versions found!" when an insecure gem source
|
|
36
|
-
is detected. (PR #84)
|
|
37
|
-
|
|
38
|
-
### 0.3.1 / 2014-04-20
|
|
39
|
-
|
|
40
|
-
* Added thor ~> 0.18 as a dependency.
|
|
41
|
-
* No longer rely on the vendored version of thor within bundler.
|
|
42
|
-
* Store the timestamp of when `data/ruby-advisory-db` was last updated in
|
|
43
|
-
`data/ruby-advisory-db.ts`.
|
|
44
|
-
* Use `data/ruby-advisory-db.ts` instead of the creation time of the
|
|
45
|
-
`dataruby-advisory-db` directory, which is always the install time
|
|
46
|
-
of the rubygem.
|
|
47
|
-
|
|
48
|
-
### 0.3.0 / 2013-10-31
|
|
49
|
-
|
|
50
|
-
* Added {Bundler::Audit::Database.update!} which uses `git` to download
|
|
51
|
-
[ruby-advisory-db] to `~/.local/share/ruby-advisory-db`.
|
|
52
|
-
* {Bundler::Audit::Database.path} now returns the path to either
|
|
53
|
-
`~/.local/share/ruby-advisory-db` or the vendored copy, depending on which
|
|
54
|
-
is more recent.
|
|
55
|
-
|
|
56
|
-
#### CLI
|
|
57
|
-
|
|
58
|
-
* Added the `bundle-audit update` sub-command.
|
|
59
|
-
|
|
60
|
-
### 0.2.0 / 2013-03-05
|
|
61
|
-
|
|
62
|
-
* Require RubyGems >= 1.8.0. Prior versions of RubyGems could not correctly
|
|
63
|
-
parse approximate version requirements (`~> 1.2.3`).
|
|
64
|
-
* Updated the [ruby-advisory-db].
|
|
65
|
-
* Added {Bundler::Audit::Advisory#unaffected_versions}.
|
|
66
|
-
* Added {Bundler::Audit::Advisory#unaffected?}.
|
|
67
|
-
* Added {Bundler::Audit::Advisory#patched?}.
|
|
68
|
-
* Renamed `Advisory#cve` to {Bundler::Audit::Advisory#id}.
|
|
69
|
-
|
|
70
|
-
### 0.1.2 / 2013-02-17
|
|
71
|
-
|
|
72
|
-
* Require [bundler] ~> 1.2.
|
|
73
|
-
* Vendor a full copy of the [ruby-advisory-db].
|
|
74
|
-
* Added {Bundler::Audit::Advisory#path} for debugging purposes.
|
|
75
|
-
* Added {Bundler::Audit::Advisory#to_s} for debugging purposes.
|
|
76
|
-
|
|
77
|
-
#### CLI
|
|
78
|
-
|
|
79
|
-
* Simply parse the `Gemfile.lock` instead of loading the bundle (@grosser).
|
|
80
|
-
* Exit with non-zero status on failure (@grosser).
|
|
81
|
-
|
|
82
|
-
### 0.1.1 / 2013-02-12
|
|
83
|
-
|
|
84
|
-
* Fixed a Ruby 1.8 syntax error.
|
|
85
|
-
|
|
86
|
-
### Advisories
|
|
87
|
-
|
|
88
|
-
* Imported advisories from the [Ruby Advisory DB][ruby-advisory-db].
|
|
89
|
-
* [CVE-2011-0739](http://www.osvdb.org/show/osvdb/70667)
|
|
90
|
-
* [CVE-2012-2139](http://www.osvdb.org/show/osvdb/81631)
|
|
91
|
-
* [CVE-2012-2140](http://www.osvdb.org/show/osvdb/81632)
|
|
92
|
-
* [CVE-2012-267](http://osvdb.org/83077)
|
|
93
|
-
* [CVE-2012-1098](http://osvdb.org/79726)
|
|
94
|
-
* [CVE-2012-1099](http://www.osvdb.org/show/osvdb/79727)
|
|
95
|
-
* [CVE-2012-2660](http://www.osvdb.org/show/osvdb/82610)
|
|
96
|
-
* [CVE-2012-2661](http://www.osvdb.org/show/osvdb/82403)
|
|
97
|
-
* [CVE-2012-3424](http://www.osvdb.org/show/osvdb/84243)
|
|
98
|
-
* [CVE-2012-3463](http://osvdb.org/84515)
|
|
99
|
-
* [CVE-2012-3464](http://www.osvdb.org/show/osvdb/84516)
|
|
100
|
-
* [CVE-2012-3465](http://www.osvdb.org/show/osvdb/84513)
|
|
101
|
-
|
|
102
|
-
### CLI
|
|
103
|
-
|
|
104
|
-
* If the advisory has no `patched_versions`, recommend removing or disabling
|
|
105
|
-
the gem until a patch is made available.
|
|
106
|
-
|
|
107
|
-
### 0.1.0 / 2013-02-11
|
|
108
|
-
|
|
109
|
-
* Initial release:
|
|
110
|
-
* Checks for vulnerable versions of gems in `Gemfile.lock`.
|
|
111
|
-
* Prints advisory information.
|
|
112
|
-
* Does not require a network connection.
|
|
113
|
-
|
|
114
|
-
#### Advisories
|
|
115
|
-
|
|
116
|
-
* [CVE-2013-0269](http://direct.osvdb.org/show/osvdb/90074)
|
|
117
|
-
* [CVE-2013-0263](http://osvdb.org/show/osvdb/89939)
|
|
118
|
-
* [CVE-2013-0155](http://osvdb.org/show/osvdb/89025)
|
|
119
|
-
* [CVE-2013-0156](http://osvdb.org/show/osvdb/89026)
|
|
120
|
-
* [CVE-2013-0276](http://direct.osvdb.org/show/osvdb/90072)
|
|
121
|
-
* [CVE-2013-0277](http://direct.osvdb.org/show/osvdb/90073)
|
|
122
|
-
* [CVE-2013-0333](http://osvdb.org/show/osvdb/89594)
|
|
123
|
-
|
|
124
|
-
[bundler]: http://gembundler.com/
|
|
125
|
-
[ruby-advisory-db]: https://github.com/rubysec/ruby-advisory-db#readme
|
|
9
|
+
[bundler]: http://bundler.io/
|
|
10
|
+
[ruby-mem-advisory-db]: https://github.com/rubymem/ruby-mem-advisory-db#readme
|
data/README.md
CHANGED
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
|
|
10
10
|
## Description
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
The best tool to find leaky gems in your dependencies. Make sure memory leaks
|
|
13
|
+
are not in your gem dependencies.
|
|
13
14
|
|
|
14
15
|
## Features
|
|
15
16
|
|
|
16
|
-
* Checks for memory leaks of gems in `Gemfile.lock
|
|
17
|
-
* Prints memory leak information
|
|
18
|
-
* Does not require a network connection.
|
|
17
|
+
* Checks for memory leaks of gems in `Gemfile.lock`
|
|
18
|
+
* Prints memory leak information
|
|
19
19
|
|
|
20
20
|
## Synopsis
|
|
21
21
|
|
|
@@ -88,12 +88,12 @@ task default: 'bundle:leak'
|
|
|
88
88
|
## Contributing
|
|
89
89
|
|
|
90
90
|
1. Clone the repo
|
|
91
|
-
1. `
|
|
91
|
+
1. `./bin/setup` # To populate data dir.
|
|
92
92
|
1. `bundle exec rake`
|
|
93
93
|
|
|
94
94
|
## License
|
|
95
95
|
|
|
96
|
-
Copyright (c) 2019
|
|
96
|
+
Copyright (c) 2019 OmbuLabs (hello at ombulabs.com)
|
|
97
97
|
|
|
98
98
|
Copyright (c) 2013-2016 Hal Brodigan (postmodern.mod3 at gmail.com)
|
|
99
99
|
|
data/Rakefile
CHANGED
|
@@ -40,7 +40,7 @@ namespace :spec do
|
|
|
40
40
|
task :bundle do
|
|
41
41
|
root = 'spec/bundle'
|
|
42
42
|
|
|
43
|
-
%w[
|
|
43
|
+
%w[unpatched_gems].each do |bundle|
|
|
44
44
|
chdir(File.join(root,bundle)) do
|
|
45
45
|
sh 'unset BUNDLE_BIN_PATH BUNDLE_GEMFILE RUBYOPT && bundle install --path ../../../vendor/bundle'
|
|
46
46
|
end
|
|
@@ -53,5 +53,5 @@ task :test => :spec
|
|
|
53
53
|
task :default => :spec
|
|
54
54
|
|
|
55
55
|
require 'yard'
|
|
56
|
-
YARD::Rake::YardocTask.new
|
|
56
|
+
YARD::Rake::YardocTask.new
|
|
57
57
|
task :doc => :yard
|
data/bin/setup
ADDED
|
@@ -1 +1 @@
|
|
|
1
|
-
2019-08-
|
|
1
|
+
2019-08-28 18:09:52 UTC
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
gem: redis
|
|
3
3
|
url: https://github.com/redis/redis-rb/issues/612
|
|
4
|
-
title: Memory
|
|
4
|
+
title: Memory leak due to Timeout creating threads on each invocation.
|
|
5
5
|
date: 2016-04-25
|
|
6
6
|
description: |
|
|
7
7
|
write_timeout results in lots of short-lived threads created, since each timeout block creates a separate thread. Now every write to Redis requires the creation of a new Thread.
|
|
8
8
|
leaky_versions:
|
|
9
|
+
- "= 3.2.2"
|
|
9
10
|
- "= 3.3.0"
|
|
11
|
+
patched_versions:
|
|
12
|
+
- ">= 3.3.1"
|
|
@@ -100,15 +100,15 @@ module Bundler
|
|
|
100
100
|
end
|
|
101
101
|
|
|
102
102
|
#
|
|
103
|
-
# Checks whether the version is
|
|
103
|
+
# Checks whether the version is leaky to the advisory.
|
|
104
104
|
#
|
|
105
105
|
# @param [Gem::Version] version
|
|
106
106
|
# The version to compare against {#patched_versions}.
|
|
107
107
|
#
|
|
108
108
|
# @return [Boolean]
|
|
109
|
-
# Specifies whether the version is
|
|
109
|
+
# Specifies whether the version is leaky to the advisory or not.
|
|
110
110
|
#
|
|
111
|
-
def
|
|
111
|
+
def leaky?(version)
|
|
112
112
|
!patched?(version) && !unaffected?(version)
|
|
113
113
|
end
|
|
114
114
|
|
data/lib/bundler/plumber/cli.rb
CHANGED
|
@@ -30,7 +30,7 @@ module Bundler
|
|
|
30
30
|
default_task :check
|
|
31
31
|
map '--version' => :version
|
|
32
32
|
|
|
33
|
-
desc 'check', 'Checks the Gemfile.lock for
|
|
33
|
+
desc 'check', 'Checks the Gemfile.lock for known memory leaks'
|
|
34
34
|
method_option :quiet, :type => :boolean, :aliases => '-q'
|
|
35
35
|
method_option :verbose, :type => :boolean, :aliases => '-v'
|
|
36
36
|
method_option :update, :type => :boolean, :aliases => '-u'
|
|
@@ -39,10 +39,10 @@ module Bundler
|
|
|
39
39
|
update if options[:update]
|
|
40
40
|
|
|
41
41
|
scanner = Scanner.new
|
|
42
|
-
|
|
42
|
+
leaky = false
|
|
43
43
|
|
|
44
44
|
scanner.scan do |result|
|
|
45
|
-
|
|
45
|
+
leaky = true
|
|
46
46
|
|
|
47
47
|
case result
|
|
48
48
|
when Scanner::UnpatchedGem
|
|
@@ -50,11 +50,11 @@ module Bundler
|
|
|
50
50
|
end
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
-
if
|
|
54
|
-
say "
|
|
53
|
+
if leaky
|
|
54
|
+
say "Leaks found!", :red
|
|
55
55
|
exit 1
|
|
56
56
|
else
|
|
57
|
-
say("No
|
|
57
|
+
say("No leaks found", :green) unless options.quiet?
|
|
58
58
|
end
|
|
59
59
|
end
|
|
60
60
|
|
|
@@ -72,8 +72,10 @@ module Bundler
|
|
|
72
72
|
t1 = Dir.chdir(USER_PATH) { Time.parse(`git log --date=iso8601 --pretty="%cd" -1`) }
|
|
73
73
|
t2 = VENDORED_TIMESTAMP
|
|
74
74
|
|
|
75
|
-
if t1 >= t2
|
|
76
|
-
|
|
75
|
+
if t1 >= t2
|
|
76
|
+
USER_PATH
|
|
77
|
+
else
|
|
78
|
+
VENDORED_PATH
|
|
77
79
|
end
|
|
78
80
|
else
|
|
79
81
|
VENDORED_PATH
|
|
@@ -98,8 +100,7 @@ module Bundler
|
|
|
98
100
|
if File.directory?(USER_PATH)
|
|
99
101
|
if File.directory?(File.join(USER_PATH, ".git"))
|
|
100
102
|
Dir.chdir(USER_PATH) do
|
|
101
|
-
command =
|
|
102
|
-
command = %w(git reset --hard origin/master)
|
|
103
|
+
command = "git fetch --all; git reset --hard origin/master"
|
|
103
104
|
command << '--quiet' if options[:quiet]
|
|
104
105
|
|
|
105
106
|
system *command
|
|
@@ -176,7 +177,7 @@ module Bundler
|
|
|
176
177
|
return enum_for(__method__,gem) unless block_given?
|
|
177
178
|
|
|
178
179
|
advisories_for(gem.name) do |advisory|
|
|
179
|
-
if advisory.
|
|
180
|
+
if advisory.leaky?(gem.version)
|
|
180
181
|
yield advisory
|
|
181
182
|
end
|
|
182
183
|
end
|
data/spec/advisory_spec.rb
CHANGED
|
@@ -115,12 +115,12 @@ describe Bundler::Plumber::Advisory do
|
|
|
115
115
|
end
|
|
116
116
|
end
|
|
117
117
|
|
|
118
|
-
describe "#
|
|
118
|
+
describe "#leaky?" do
|
|
119
119
|
context "when passed a version that matches one patched version" do
|
|
120
120
|
let(:version) { Gem::Version.new('0.12.4') }
|
|
121
121
|
|
|
122
122
|
it "should return false" do
|
|
123
|
-
expect(subject.
|
|
123
|
+
expect(subject.leaky?(version)).to be_falsey
|
|
124
124
|
end
|
|
125
125
|
end
|
|
126
126
|
|
|
@@ -128,7 +128,7 @@ describe Bundler::Plumber::Advisory do
|
|
|
128
128
|
let(:version) { Gem::Version.new('2.9.0') }
|
|
129
129
|
|
|
130
130
|
it "should return true" do
|
|
131
|
-
expect(subject.
|
|
131
|
+
expect(subject.leaky?(version)).to be_truthy
|
|
132
132
|
end
|
|
133
133
|
|
|
134
134
|
context "when unaffected_versions is not empty" do
|
|
@@ -138,7 +138,7 @@ describe Bundler::Plumber::Advisory do
|
|
|
138
138
|
let(:version) { Gem::Version.new(an_unaffected_version) }
|
|
139
139
|
|
|
140
140
|
it "should return false" do
|
|
141
|
-
expect(subject.
|
|
141
|
+
expect(subject.leaky?(version)).to be_falsey
|
|
142
142
|
end
|
|
143
143
|
end
|
|
144
144
|
|
|
@@ -146,7 +146,7 @@ describe Bundler::Plumber::Advisory do
|
|
|
146
146
|
let(:version) { Gem::Version.new('1.2.3') }
|
|
147
147
|
|
|
148
148
|
it "should return true" do
|
|
149
|
-
expect(subject.
|
|
149
|
+
expect(subject.leaky?(version)).to be_truthy
|
|
150
150
|
end
|
|
151
151
|
end
|
|
152
152
|
end
|
data/spec/database_spec.rb
CHANGED
|
@@ -14,7 +14,8 @@ describe Bundler::Plumber::Database do
|
|
|
14
14
|
expect(File.directory?(subject)).to be_truthy
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
it "should prefer the user repo,
|
|
17
|
+
it "should prefer the user repo, if it's as up to date, or more up to date than the vendored one" do
|
|
18
|
+
|
|
18
19
|
Bundler::Plumber::Database.update!(quiet: false)
|
|
19
20
|
|
|
20
21
|
Dir.chdir(Bundler::Plumber::Database::USER_PATH) do
|
|
@@ -29,7 +30,7 @@ describe Bundler::Plumber::Database do
|
|
|
29
30
|
fake_a_commit_in_the_user_repo
|
|
30
31
|
expect(Bundler::Plumber::Database.path).to eq mocked_user_path
|
|
31
32
|
|
|
32
|
-
roll_user_repo_back(
|
|
33
|
+
roll_user_repo_back(2)
|
|
33
34
|
expect(Bundler::Plumber::Database.path).to eq Bundler::Plumber::Database::VENDORED_PATH
|
|
34
35
|
end
|
|
35
36
|
end
|
data/spec/integration_spec.rb
CHANGED
|
@@ -16,38 +16,25 @@ describe "CLI" do
|
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
it "should print a warning" do
|
|
19
|
-
expect(subject).to include("
|
|
19
|
+
expect(subject).to include("Leaks found!")
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
it "should print advisory information for the
|
|
22
|
+
it "should print advisory information for the leaky gems" do
|
|
23
23
|
advisory_pattern = /(Name: [^\n]+
|
|
24
24
|
Version: \d+.\d+.\d+
|
|
25
25
|
URL: https?:\/\/(www\.)?.+
|
|
26
26
|
Title: [^\n]*?
|
|
27
|
-
Solution:
|
|
27
|
+
Solution: upgrade to (~>|>=) \d+\.\d+\.\d+(\.\d+)?(, (~>|>=) \d+\.\d+\.\d+(\.\d+)?)*[\s\n]*?)/
|
|
28
28
|
|
|
29
29
|
expect(subject).to match(advisory_pattern)
|
|
30
|
-
expect(subject).to include("
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
context "when auditing a secure bundle" do
|
|
35
|
-
let(:bundle) { 'secure' }
|
|
36
|
-
let(:directory) { File.join('spec','bundle',bundle) }
|
|
37
|
-
|
|
38
|
-
subject do
|
|
39
|
-
Dir.chdir(directory) { sh(command) }
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
it "should print nothing when everything is fine" do
|
|
43
|
-
expect(subject.strip).to eq("No vulnerabilities found")
|
|
30
|
+
expect(subject).to include("Leaks found!")
|
|
44
31
|
end
|
|
45
32
|
end
|
|
46
33
|
|
|
47
34
|
describe "update" do
|
|
48
35
|
|
|
49
36
|
let(:update_command) { "#{command} update" }
|
|
50
|
-
let(:bundle) { '
|
|
37
|
+
let(:bundle) { 'unpatched_gems' }
|
|
51
38
|
let(:directory) { File.join('spec','bundle',bundle) }
|
|
52
39
|
|
|
53
40
|
subject do
|
data/spec/scanner_spec.rb
CHANGED
|
@@ -32,7 +32,7 @@ describe Scanner do
|
|
|
32
32
|
|
|
33
33
|
it "should match unpatched gems to their advisories" do
|
|
34
34
|
expect(subject.all? { |result|
|
|
35
|
-
result.advisory.
|
|
35
|
+
result.advisory.leaky?(result.gem.version)
|
|
36
36
|
}).to be_truthy
|
|
37
37
|
end
|
|
38
38
|
|
|
@@ -46,16 +46,4 @@ describe Scanner do
|
|
|
46
46
|
end
|
|
47
47
|
end
|
|
48
48
|
end
|
|
49
|
-
|
|
50
|
-
context "when auditing a secure bundle" do
|
|
51
|
-
let(:bundle) { 'secure' }
|
|
52
|
-
let(:directory) { File.join('spec','bundle',bundle) }
|
|
53
|
-
let(:scanner) { described_class.new(directory) }
|
|
54
|
-
|
|
55
|
-
subject { scanner.scan.to_a }
|
|
56
|
-
|
|
57
|
-
it "should print nothing when everything is fine" do
|
|
58
|
-
expect(subject).to be_empty
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
49
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bundler-leak
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ombulabs
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-10-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|
|
@@ -49,6 +49,7 @@ email: hello@ombulabs.com
|
|
|
49
49
|
executables:
|
|
50
50
|
- bundle-leak
|
|
51
51
|
- bundler-leak
|
|
52
|
+
- setup
|
|
52
53
|
extensions: []
|
|
53
54
|
extra_rdoc_files:
|
|
54
55
|
- COPYING.txt
|
|
@@ -68,6 +69,7 @@ files:
|
|
|
68
69
|
- Rakefile
|
|
69
70
|
- bin/bundle-leak
|
|
70
71
|
- bin/bundler-leak
|
|
72
|
+
- bin/setup
|
|
71
73
|
- bundler-leak.gemspec
|
|
72
74
|
- data/ruby-mem-advisory-db.ts
|
|
73
75
|
- data/ruby-mem-advisory-db/.gitignore
|
|
@@ -106,8 +108,6 @@ files:
|
|
|
106
108
|
- lib/bundler/plumber/version.rb
|
|
107
109
|
- spec/advisory_spec.rb
|
|
108
110
|
- spec/audit_spec.rb
|
|
109
|
-
- spec/bundle/insecure_sources/Gemfile
|
|
110
|
-
- spec/bundle/secure/Gemfile
|
|
111
111
|
- spec/bundle/unpatched_gems/Gemfile
|
|
112
112
|
- spec/cli_spec.rb
|
|
113
113
|
- spec/database_spec.rb
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
source 'http://rubygems.org'
|
|
2
|
-
|
|
3
|
-
gem 'rails', '3.2.12'
|
|
4
|
-
|
|
5
|
-
# Bundle edge Rails instead:
|
|
6
|
-
# gem 'rails', :git => 'git://github.com/rails/rails.git'
|
|
7
|
-
|
|
8
|
-
gem 'sqlite3', platform: [:mri, :rbx]
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# Gems used only for assets and not required
|
|
12
|
-
# in production environments by default.
|
|
13
|
-
group :assets do
|
|
14
|
-
# gem 'sass-rails', '~> 3.2.3'
|
|
15
|
-
# gem 'coffee-rails', '~> 3.2.1'
|
|
16
|
-
|
|
17
|
-
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
|
18
|
-
# gem 'therubyracer', :platforms => :ruby
|
|
19
|
-
|
|
20
|
-
# gem 'uglifier', '>= 1.0.3'
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
gem 'jquery-rails', :git => 'git://github.com/rails/jquery-rails.git',
|
|
24
|
-
:tag => 'v2.2.1'
|
|
25
|
-
|
|
26
|
-
# To use ActiveModel has_secure_password
|
|
27
|
-
# gem 'bcrypt-ruby', '~> 3.0.0'
|
|
28
|
-
|
|
29
|
-
# To use Jbuilder templates for JSON
|
|
30
|
-
# gem 'jbuilder'
|
|
31
|
-
|
|
32
|
-
# Use unicorn as the app server
|
|
33
|
-
# gem 'unicorn'
|
|
34
|
-
|
|
35
|
-
# Deploy with Capistrano
|
|
36
|
-
# gem 'capistrano'
|
|
37
|
-
|
|
38
|
-
# To use debugger
|
|
39
|
-
# gem 'debugger'
|
data/spec/bundle/secure/Gemfile
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
|
|
3
|
-
gem 'rails', '~> 4.2.7.1'
|
|
4
|
-
|
|
5
|
-
# Bundle edge Rails instead:
|
|
6
|
-
# gem 'rails', :git => 'git://github.com/rails/rails.git'
|
|
7
|
-
|
|
8
|
-
gem 'sqlite3', platform: [:mri, :rbx]
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# Gems used only for assets and not required
|
|
12
|
-
# in production environments by default.
|
|
13
|
-
group :assets do
|
|
14
|
-
# gem 'sass-rails', '~> 3.2.3'
|
|
15
|
-
# gem 'coffee-rails', '~> 3.2.1'
|
|
16
|
-
|
|
17
|
-
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
|
18
|
-
# gem 'therubyracer', :platforms => :ruby
|
|
19
|
-
|
|
20
|
-
# gem 'uglifier', '>= 1.0.3'
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
gem 'jquery-rails'
|
|
24
|
-
|
|
25
|
-
# To use ActiveModel has_secure_password
|
|
26
|
-
# gem 'bcrypt-ruby', '~> 3.0.0'
|
|
27
|
-
|
|
28
|
-
# To use Jbuilder templates for JSON
|
|
29
|
-
# gem 'jbuilder'
|
|
30
|
-
|
|
31
|
-
# Use unicorn as the app server
|
|
32
|
-
# gem 'unicorn'
|
|
33
|
-
|
|
34
|
-
# Deploy with Capistrano
|
|
35
|
-
# gem 'capistrano'
|
|
36
|
-
|
|
37
|
-
# To use debugger
|
|
38
|
-
# gem 'debugger'
|