bundler-audit 0.9.0.1 → 0.9.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/.github/ISSUE_TEMPLATE/feature-request.md +14 -0
- data/.github/workflows/ruby.yml +2 -1
- data/.rubocop.yml +3 -0
- data/ChangeLog.md +21 -0
- data/Gemfile +1 -0
- data/README.md +43 -17
- data/bundler-audit.gemspec +4 -4
- data/gemspec.yml +7 -0
- data/lib/bundler/audit/advisory.rb +2 -1
- data/lib/bundler/audit/cli/formats/json.rb +1 -1
- data/lib/bundler/audit/cli/formats/junit.rb +2 -2
- data/lib/bundler/audit/cli/formats/text.rb +2 -2
- data/lib/bundler/audit/cli/formats.rb +1 -1
- data/lib/bundler/audit/cli.rb +5 -3
- data/lib/bundler/audit/configuration.rb +1 -1
- data/lib/bundler/audit/database.rb +8 -6
- data/lib/bundler/audit/results/insecure_source.rb +1 -1
- data/lib/bundler/audit/results/unpatched_gem.rb +1 -1
- data/lib/bundler/audit/results.rb +1 -1
- data/lib/bundler/audit/scanner.rb +9 -6
- data/lib/bundler/audit/task.rb +32 -2
- data/lib/bundler/audit/version.rb +2 -2
- data/lib/bundler/audit.rb +1 -1
- data/spec/advisory_spec.rb +10 -1
- data/spec/bundle/insecure_sources/Gemfile.lock +5 -5
- data/spec/bundle/secure/Gemfile.lock +58 -58
- data/spec/cli/formats/junit_spec.rb +1 -1
- data/spec/cli/formats/text_spec.rb +1 -1
- data/spec/database_spec.rb +1 -1
- metadata +22 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 762980c9b274b19e477ee0be0ae021e452a1e7d63796ceb6da0d667de704dad9
|
4
|
+
data.tar.gz: 3e0fae808a027e677f3d218949c092d8189fc124bb34f61b57fdf982b5ffd6b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: faa37304223ab40fd5678b6a4fcc1f9edb6d112c418c3a80a38aff6dbfbfacd416481f32f402998ece370d4646fe416e8f9453a5cec98d634845ff7bfd1abc6f
|
7
|
+
data.tar.gz: 7fbd39c761fdee364266207e4f0b52be6347b480b8447d31688428b8d3b5337c7f7403142ef0b2da0bc293ddfbe1ea5df93750b3a70be3920eff37af1d6a7884
|
@@ -0,0 +1,14 @@
|
|
1
|
+
---
|
2
|
+
name: Feature Request
|
3
|
+
about: Request a new Feature
|
4
|
+
title: ''
|
5
|
+
labels: feature
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
## Description
|
11
|
+
|
12
|
+
<!-- Explain how the desired feature would work. -->
|
13
|
+
<!-- Explain why the desired feature is needed. -->
|
14
|
+
<!-- Explain who would use the desired feature. -->
|
data/.github/workflows/ruby.yml
CHANGED
data/.rubocop.yml
CHANGED
@@ -65,6 +65,9 @@ Style/WordArray: { Enabled: false } # Offense count: 1
|
|
65
65
|
Style/Lambda: { Enabled: false } # Offense count: 2
|
66
66
|
Style/SafeNavigation: { Enabled: false } # Offense count: 2
|
67
67
|
Lint/IneffectiveAccessModifier: { Enabled: false } # Offense count: 1
|
68
|
+
Gemspec/DuplicatedAssignment:
|
69
|
+
Exclude:
|
70
|
+
- 'bundler-audit.gemspec'
|
68
71
|
|
69
72
|
#
|
70
73
|
# Rules that may be disabled in the future.
|
data/ChangeLog.md
CHANGED
@@ -1,7 +1,28 @@
|
|
1
|
+
### 0.9.1 / 2022-05-19
|
2
|
+
|
3
|
+
#### CLI
|
4
|
+
|
5
|
+
* Improve the readability of the suggested gem versions to upgrade to
|
6
|
+
(pull #331).
|
7
|
+
|
8
|
+
#### Rake Task
|
9
|
+
|
10
|
+
* Fixed a regression introduced in 0.9.0 where the `bundler:audit` rake task
|
11
|
+
was not exiting with an error status code if vulnerabilities were found.
|
12
|
+
Now when the `bundler-audit` command fails, the rake task will also exit with
|
13
|
+
the `bundler-audit` command's error code.
|
14
|
+
* If the `bundler-audit` command could not be found for some reason raise the
|
15
|
+
{Bundler::Audit::Task::CommandNotFound} exception.
|
16
|
+
|
1
17
|
### 0.9.0.1 / 2021-08-31
|
2
18
|
|
3
19
|
* Add a workaround for Psych < 3.1.0 to support running on Ruby < 2.6.
|
4
20
|
(issue #319)
|
21
|
+
* Although, Ruby 2.5 and prior have all reached [End-of-Life] and
|
22
|
+
are no longer receiving security updates. It is strongly advised that you
|
23
|
+
should upgrade to a currently supported version of Ruby.
|
24
|
+
|
25
|
+
[End-of-Life]: https://www.ruby-lang.org/en/downloads/branches/
|
5
26
|
|
6
27
|
### 0.9.0 / 2021-08-31
|
7
28
|
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -111,27 +111,39 @@ Update the [ruby-advisory-db] that `bundle audit` uses:
|
|
111
111
|
|
112
112
|
Update the [ruby-advisory-db] and check `Gemfile.lock` (useful for CI runs):
|
113
113
|
|
114
|
-
|
114
|
+
```shell
|
115
|
+
$ bundle-audit check --update
|
116
|
+
```
|
115
117
|
|
116
118
|
Checking the `Gemfile.lock` without updating the [ruby-advisory-db]:
|
117
119
|
|
118
|
-
|
120
|
+
```shell
|
121
|
+
$ bundle-audit check --no-update
|
122
|
+
```
|
119
123
|
|
120
124
|
Ignore specific advisories:
|
121
125
|
|
122
|
-
|
126
|
+
```shell
|
127
|
+
$ bundle-audit check --ignore OSVDB-108664
|
128
|
+
```
|
123
129
|
|
124
130
|
Checking a custom `Gemfile.lock` file:
|
125
131
|
|
126
|
-
|
132
|
+
```shell
|
133
|
+
$ bundle-audit check --gemfile-lock Gemfile.custom.lock
|
134
|
+
```
|
127
135
|
|
128
136
|
Output the audit's results in JSON:
|
129
137
|
|
130
|
-
|
138
|
+
```shell
|
139
|
+
$ bundle-audit check --format json
|
140
|
+
```
|
131
141
|
|
132
142
|
Output the audit's results in JSON, to a file:
|
133
143
|
|
134
|
-
|
144
|
+
```shell
|
145
|
+
$ bundle-audit check --format json --output bundle-audit.json
|
146
|
+
```
|
135
147
|
|
136
148
|
## Rake Tasks
|
137
149
|
|
@@ -149,16 +161,20 @@ bundler-audit also supports a per-project configuration file:
|
|
149
161
|
|
150
162
|
`.bundler-audit.yml`:
|
151
163
|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
164
|
+
```yaml
|
165
|
+
---
|
166
|
+
ignore:
|
167
|
+
- CVE-YYYY-XXXX
|
168
|
+
- ...
|
169
|
+
```
|
156
170
|
|
157
171
|
* `ignore:` \[Array\<String\>\] - A list of advisory IDs to ignore.
|
158
172
|
|
159
173
|
You can provide a path to a config file using the `--config` flag:
|
160
174
|
|
161
|
-
|
175
|
+
```shell
|
176
|
+
$ bundle-audit check --config bundler-audit.custom.yaml
|
177
|
+
```
|
162
178
|
|
163
179
|
## Requirements
|
164
180
|
|
@@ -170,25 +186,35 @@ You can provide a path to a config file using the `--config` flag:
|
|
170
186
|
|
171
187
|
## Install
|
172
188
|
|
173
|
-
|
189
|
+
```shell
|
190
|
+
$ [sudo] gem install bundler-audit
|
191
|
+
```
|
174
192
|
|
175
193
|
### Git
|
176
194
|
|
177
195
|
* Debian / Ubuntu:
|
178
196
|
|
179
|
-
|
197
|
+
```shell
|
198
|
+
$ sudo apt install git
|
199
|
+
```
|
180
200
|
|
181
201
|
* RedHat / Fedora:
|
182
202
|
|
183
|
-
|
203
|
+
```shell
|
204
|
+
$ sudo dnf install git
|
205
|
+
```
|
184
206
|
|
185
207
|
* Alpine Linux:
|
186
208
|
|
187
|
-
|
209
|
+
```shell
|
210
|
+
$ apk add git
|
211
|
+
```
|
188
212
|
|
189
213
|
* macOS:
|
190
214
|
|
191
|
-
|
215
|
+
```shell
|
216
|
+
$ brew install git
|
217
|
+
```
|
192
218
|
|
193
219
|
## Contributing
|
194
220
|
|
@@ -205,7 +231,7 @@ You can provide a path to a config file using the `--config` flag:
|
|
205
231
|
|
206
232
|
## License
|
207
233
|
|
208
|
-
Copyright (c) 2013-
|
234
|
+
Copyright (c) 2013-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
|
209
235
|
|
210
236
|
bundler-audit is free software: you can redistribute it and/or modify
|
211
237
|
it under the terms of the GNU General Public License as published by
|
data/bundler-audit.gemspec
CHANGED
@@ -21,9 +21,8 @@ Gem::Specification.new do |gem|
|
|
21
21
|
|
22
22
|
glob = lambda { |patterns| gem.files & Dir[*patterns] }
|
23
23
|
|
24
|
-
gem.files =
|
25
|
-
|
26
|
-
end
|
24
|
+
gem.files = `git ls-files`.split($/)
|
25
|
+
gem.files = glob[gemspec['files']] if gemspec['files']
|
27
26
|
|
28
27
|
gem.executables = gemspec.fetch('executables') do
|
29
28
|
glob['bin/*'].map { |path| File.basename(path) }
|
@@ -31,7 +30,7 @@ Gem::Specification.new do |gem|
|
|
31
30
|
gem.default_executable = gem.executables.first if Gem::VERSION < '1.7.'
|
32
31
|
|
33
32
|
gem.extensions = glob[gemspec['extensions'] || 'ext/**/extconf.rb']
|
34
|
-
gem.test_files = glob[gemspec['test_files'] || '
|
33
|
+
gem.test_files = glob[gemspec['test_files'] || 'spec/{**/}*_spec.rb']
|
35
34
|
gem.extra_rdoc_files = glob[gemspec['extra_doc_files'] || '*.{txt,md}']
|
36
35
|
|
37
36
|
gem.require_paths = Array(gemspec.fetch('require_paths') {
|
@@ -56,4 +55,5 @@ Gem::Specification.new do |gem|
|
|
56
55
|
gem.add_development_dependency(name,split[versions])
|
57
56
|
end
|
58
57
|
end
|
58
|
+
gem.metadata['rubygems_mfa_required'] = 'true'
|
59
59
|
end
|
data/gemspec.yml
CHANGED
@@ -6,6 +6,13 @@ authors: Postmodern
|
|
6
6
|
email: postmodern.mod3@gmail.com
|
7
7
|
homepage: https://github.com/rubysec/bundler-audit#readme
|
8
8
|
|
9
|
+
metadata:
|
10
|
+
documentation_uri: https://rubydoc.info/gems/bundler-audit
|
11
|
+
source_code_uri: https://github.com/rubysec/bundler-audit.rb
|
12
|
+
bug_tracker_uri: https://github.com/rubysec/bundler-audit.rb/issues
|
13
|
+
changelog_uri: https://github.com/rubysec/bundler-audit.rb/blob/master/ChangeLog.md
|
14
|
+
rubygems_mfa_required: 'true'
|
15
|
+
|
9
16
|
required_ruby_version: ">= 2.0.0"
|
10
17
|
required_rubygems_version: ">= 1.8.0"
|
11
18
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013-
|
2
|
+
# Copyright (c) 2013-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
4
|
# bundler-audit is free software: you can redistribute it and/or modify
|
5
5
|
# it under the terms of the GNU General Public License as published by
|
@@ -15,6 +15,7 @@
|
|
15
15
|
# along with bundler-audit. If not, see <https://www.gnu.org/licenses/>.
|
16
16
|
#
|
17
17
|
|
18
|
+
require 'date'
|
18
19
|
require 'yaml'
|
19
20
|
|
20
21
|
module Bundler
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013-
|
2
|
+
# Copyright (c) 2013-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
4
|
# bundler-audit is free software: you can redistribute it and/or modify
|
5
5
|
# it under the terms of the GNU General Public License as published by
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013-
|
2
|
+
# Copyright (c) 2013-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
4
|
# bundler-audit is free software: you can redistribute it and/or modify
|
5
5
|
# it under the terms of the GNU General Public License as published by
|
@@ -101,7 +101,7 @@ module Bundler
|
|
101
101
|
|
102
102
|
def advisory_solution(advisory)
|
103
103
|
unless advisory.patched_versions.empty?
|
104
|
-
"upgrade to #{advisory.patched_versions.join(', ')}"
|
104
|
+
"upgrade to #{advisory.patched_versions.map { |v| "'#{v}'" }.join(', ')}"
|
105
105
|
else
|
106
106
|
"remove or disable this gem until a patch is available!"
|
107
107
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013-
|
2
|
+
# Copyright (c) 2013-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
4
|
# bundler-audit is free software: you can redistribute it and/or modify
|
5
5
|
# it under the terms of the GNU General Public License as published by
|
@@ -105,7 +105,7 @@ module Bundler
|
|
105
105
|
|
106
106
|
unless advisory.patched_versions.empty?
|
107
107
|
say "Solution: upgrade to ", :red
|
108
|
-
say advisory.patched_versions.join(', ')
|
108
|
+
say advisory.patched_versions.map { |v| "'#{v}'" }.join(', ')
|
109
109
|
else
|
110
110
|
say "Solution: ", :red
|
111
111
|
say "remove or disable this gem until a patch is available!", [:red, :bold]
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013-
|
2
|
+
# Copyright (c) 2013-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
4
|
# bundler-audit is free software: you can redistribute it and/or modify
|
5
5
|
# it under the terms of the GNU General Public License as published by
|
data/lib/bundler/audit/cli.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013-
|
2
|
+
# Copyright (c) 2013-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
4
|
# bundler-audit is free software: you can redistribute it and/or modify
|
5
5
|
# it under the terms of the GNU General Public License as published by
|
@@ -75,8 +75,10 @@ module Bundler
|
|
75
75
|
|
76
76
|
report = scanner.report(ignore: options.ignore)
|
77
77
|
|
78
|
-
output = if options[:output]
|
79
|
-
|
78
|
+
output = if options[:output]
|
79
|
+
File.new(options[:output],'w')
|
80
|
+
else
|
81
|
+
$stdout
|
80
82
|
end
|
81
83
|
|
82
84
|
print_report(report,output)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013-
|
2
|
+
# Copyright (c) 2013-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
4
|
# bundler-audit is free software: you can redistribute it and/or modify
|
5
5
|
# it under the terms of the GNU General Public License as published by
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013-
|
2
|
+
# Copyright (c) 2013-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
4
|
# bundler-audit is free software: you can redistribute it and/or modify
|
5
5
|
# it under the terms of the GNU General Public License as published by
|
@@ -34,18 +34,20 @@ module Bundler
|
|
34
34
|
class UpdateFailed < RuntimeError
|
35
35
|
end
|
36
36
|
|
37
|
-
# Git URL of the ruby-advisory-db
|
37
|
+
# Git URL of the ruby-advisory-db.
|
38
38
|
URL = 'https://github.com/rubysec/ruby-advisory-db.git'
|
39
39
|
|
40
|
-
# Path to the user's copy of the ruby-advisory-db
|
40
|
+
# Path to the user's copy of the ruby-advisory-db.
|
41
41
|
USER_PATH = File.expand_path(File.join(Gem.user_home,'.local','share','ruby-advisory-db'))
|
42
42
|
|
43
|
-
# Default path to the ruby-advisory-db
|
43
|
+
# Default path to the ruby-advisory-db.
|
44
44
|
#
|
45
45
|
# @since 0.8.0
|
46
|
-
DEFAULT_PATH = ENV
|
46
|
+
DEFAULT_PATH = ENV.fetch('BUNDLER_AUDIT_DB',USER_PATH)
|
47
47
|
|
48
|
-
# The path to the advisory database
|
48
|
+
# The path to the advisory database.
|
49
|
+
#
|
50
|
+
# @return [String]
|
49
51
|
attr_reader :path
|
50
52
|
|
51
53
|
#
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013-
|
2
|
+
# Copyright (c) 2013-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
4
|
# bundler-audit is free software: you can redistribute it and/or modify
|
5
5
|
# it under the terms of the GNU General Public License as published by
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013-
|
2
|
+
# Copyright (c) 2013-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
4
|
# bundler-audit is free software: you can redistribute it and/or modify
|
5
5
|
# it under the terms of the GNU General Public License as published by
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013-
|
2
|
+
# Copyright (c) 2013-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
4
|
# bundler-audit is free software: you can redistribute it and/or modify
|
5
5
|
# it under the terms of the GNU General Public License as published by
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013-
|
2
|
+
# Copyright (c) 2013-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
4
|
# bundler-audit is free software: you can redistribute it and/or modify
|
5
5
|
# it under the terms of the GNU General Public License as published by
|
@@ -36,7 +36,7 @@ module Bundler
|
|
36
36
|
#
|
37
37
|
class Scanner
|
38
38
|
|
39
|
-
# The advisory database
|
39
|
+
# The advisory database.
|
40
40
|
#
|
41
41
|
# @return [Database]
|
42
42
|
attr_reader :database
|
@@ -44,12 +44,13 @@ module Bundler
|
|
44
44
|
# Project root directory
|
45
45
|
attr_reader :root
|
46
46
|
|
47
|
-
# The parsed `Gemfile.lock` from the project
|
47
|
+
# The parsed `Gemfile.lock` from the project.
|
48
48
|
#
|
49
49
|
# @return [Bundler::LockfileParser]
|
50
50
|
attr_reader :lockfile
|
51
51
|
|
52
|
-
# The configuration loaded from the `.bundler-audit.yml` file from the
|
52
|
+
# The configuration loaded from the `.bundler-audit.yml` file from the
|
53
|
+
# project.
|
53
54
|
#
|
54
55
|
# @return [Hash]
|
55
56
|
attr_reader :config
|
@@ -217,8 +218,10 @@ module Bundler
|
|
217
218
|
def scan_specs(options={})
|
218
219
|
return enum_for(__method__,options) unless block_given?
|
219
220
|
|
220
|
-
ignore = if options[:ignore]
|
221
|
-
|
221
|
+
ignore = if options[:ignore]
|
222
|
+
Set.new(options[:ignore])
|
223
|
+
else
|
224
|
+
config.ignore
|
222
225
|
end
|
223
226
|
|
224
227
|
@lockfile.specs.each do |gem|
|
data/lib/bundler/audit/task.rb
CHANGED
@@ -6,6 +6,9 @@ module Bundler
|
|
6
6
|
# Defines the `bundle:audit` rake tasks.
|
7
7
|
#
|
8
8
|
class Task < Rake::TaskLib
|
9
|
+
class CommandNotFound < RuntimeError
|
10
|
+
end
|
11
|
+
|
9
12
|
#
|
10
13
|
# Initializes the task.
|
11
14
|
#
|
@@ -23,12 +26,12 @@ module Bundler
|
|
23
26
|
namespace :audit do
|
24
27
|
desc 'Checks the Gemfile.lock for insecure dependencies'
|
25
28
|
task :check do
|
26
|
-
|
29
|
+
bundler_audit 'check'
|
27
30
|
end
|
28
31
|
|
29
32
|
desc 'Updates the bundler-audit vulnerability database'
|
30
33
|
task :update do
|
31
|
-
|
34
|
+
bundler_audit 'update'
|
32
35
|
end
|
33
36
|
end
|
34
37
|
|
@@ -39,6 +42,33 @@ module Bundler
|
|
39
42
|
task 'bundler:audit:check' => 'bundle:audit:check'
|
40
43
|
task 'bundler:audit:update' => 'bundle:audit:update'
|
41
44
|
end
|
45
|
+
|
46
|
+
#
|
47
|
+
# Runs the `bundler-audit` command with the additional arguments.
|
48
|
+
#
|
49
|
+
# @param [Array<String>] arguments
|
50
|
+
# Additional command-line arguments for `bundler-audit`.
|
51
|
+
#
|
52
|
+
# @return [true]
|
53
|
+
# The `bundler-audit` command successfully exited.
|
54
|
+
#
|
55
|
+
# @raise [CommandNotFound]
|
56
|
+
# The `bundler-audit` command could not be executed or was not found.
|
57
|
+
#
|
58
|
+
# @note
|
59
|
+
# If the `bundler-audit` command exits with an error, the rake task
|
60
|
+
# will also exit with the same error code.
|
61
|
+
#
|
62
|
+
def bundler_audit(*arguments)
|
63
|
+
case system('bundler-audit',*arguments)
|
64
|
+
when false
|
65
|
+
exit $?.exitstatus || 1
|
66
|
+
when nil
|
67
|
+
raise(CommandNotFound,"bundler-audit could not be executed")
|
68
|
+
else
|
69
|
+
return true
|
70
|
+
end
|
71
|
+
end
|
42
72
|
end
|
43
73
|
end
|
44
74
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013-
|
2
|
+
# Copyright (c) 2013-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
4
|
# bundler-audit is free software: you can redistribute it and/or modify
|
5
5
|
# it under the terms of the GNU General Public License as published by
|
@@ -18,6 +18,6 @@
|
|
18
18
|
module Bundler
|
19
19
|
module Audit
|
20
20
|
# bundler-audit version
|
21
|
-
VERSION = '0.9.
|
21
|
+
VERSION = '0.9.1'
|
22
22
|
end
|
23
23
|
end
|
data/lib/bundler/audit.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2013-
|
2
|
+
# Copyright (c) 2013-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
4
|
# bundler-audit is free software: you can redistribute it and/or modify
|
5
5
|
# it under the terms of the GNU General Public License as published by
|
data/spec/advisory_spec.rb
CHANGED
@@ -45,7 +45,16 @@ describe Bundler::Audit::Advisory do
|
|
45
45
|
end
|
46
46
|
|
47
47
|
describe "load" do
|
48
|
-
let(:data)
|
48
|
+
let(:data) do
|
49
|
+
File.open(path) do |yaml|
|
50
|
+
if Psych::VERSION >= '3.1.0'
|
51
|
+
YAML.safe_load(yaml, permitted_classes: [Date])
|
52
|
+
else
|
53
|
+
# XXX: psych < 3.1.0 YAML.safe_load calling convention
|
54
|
+
YAML.safe_load(yaml, [Date])
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
49
58
|
|
50
59
|
describe '#id' do
|
51
60
|
subject { super().id }
|
@@ -85,15 +85,15 @@ GEM
|
|
85
85
|
marcel (1.0.1)
|
86
86
|
method_source (1.0.0)
|
87
87
|
mini_mime (1.0.3)
|
88
|
-
mini_portile2 (2.
|
88
|
+
mini_portile2 (2.8.0)
|
89
89
|
minitest (5.14.4)
|
90
90
|
nio4r (2.5.7)
|
91
|
-
nokogiri (1.
|
92
|
-
mini_portile2 (~> 2.
|
91
|
+
nokogiri (1.13.6)
|
92
|
+
mini_portile2 (~> 2.8.0)
|
93
93
|
racc (~> 1.4)
|
94
|
-
nokogiri (1.
|
94
|
+
nokogiri (1.13.6-x86_64-linux)
|
95
95
|
racc (~> 1.4)
|
96
|
-
racc (1.
|
96
|
+
racc (1.6.0)
|
97
97
|
rack (2.2.3)
|
98
98
|
rack-test (1.1.0)
|
99
99
|
rack (>= 1.0, < 3)
|
@@ -1,113 +1,113 @@
|
|
1
1
|
GEM
|
2
2
|
remote: https://rubygems.org/
|
3
3
|
specs:
|
4
|
-
actioncable (5.2.
|
5
|
-
actionpack (= 5.2.
|
4
|
+
actioncable (5.2.8)
|
5
|
+
actionpack (= 5.2.8)
|
6
6
|
nio4r (~> 2.0)
|
7
7
|
websocket-driver (>= 0.6.1)
|
8
|
-
actionmailer (5.2.
|
9
|
-
actionpack (= 5.2.
|
10
|
-
actionview (= 5.2.
|
11
|
-
activejob (= 5.2.
|
8
|
+
actionmailer (5.2.8)
|
9
|
+
actionpack (= 5.2.8)
|
10
|
+
actionview (= 5.2.8)
|
11
|
+
activejob (= 5.2.8)
|
12
12
|
mail (~> 2.5, >= 2.5.4)
|
13
13
|
rails-dom-testing (~> 2.0)
|
14
|
-
actionpack (5.2.
|
15
|
-
actionview (= 5.2.
|
16
|
-
activesupport (= 5.2.
|
14
|
+
actionpack (5.2.8)
|
15
|
+
actionview (= 5.2.8)
|
16
|
+
activesupport (= 5.2.8)
|
17
17
|
rack (~> 2.0, >= 2.0.8)
|
18
18
|
rack-test (>= 0.6.3)
|
19
19
|
rails-dom-testing (~> 2.0)
|
20
20
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
21
|
-
actionview (5.2.
|
22
|
-
activesupport (= 5.2.
|
21
|
+
actionview (5.2.8)
|
22
|
+
activesupport (= 5.2.8)
|
23
23
|
builder (~> 3.1)
|
24
24
|
erubi (~> 1.4)
|
25
25
|
rails-dom-testing (~> 2.0)
|
26
26
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
27
|
-
activejob (5.2.
|
28
|
-
activesupport (= 5.2.
|
27
|
+
activejob (5.2.8)
|
28
|
+
activesupport (= 5.2.8)
|
29
29
|
globalid (>= 0.3.6)
|
30
|
-
activemodel (5.2.
|
31
|
-
activesupport (= 5.2.
|
32
|
-
activerecord (5.2.
|
33
|
-
activemodel (= 5.2.
|
34
|
-
activesupport (= 5.2.
|
30
|
+
activemodel (5.2.8)
|
31
|
+
activesupport (= 5.2.8)
|
32
|
+
activerecord (5.2.8)
|
33
|
+
activemodel (= 5.2.8)
|
34
|
+
activesupport (= 5.2.8)
|
35
35
|
arel (>= 9.0)
|
36
|
-
activestorage (5.2.
|
37
|
-
actionpack (= 5.2.
|
38
|
-
activerecord (= 5.2.
|
36
|
+
activestorage (5.2.8)
|
37
|
+
actionpack (= 5.2.8)
|
38
|
+
activerecord (= 5.2.8)
|
39
39
|
marcel (~> 1.0.0)
|
40
|
-
activesupport (5.2.
|
40
|
+
activesupport (5.2.8)
|
41
41
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
42
42
|
i18n (>= 0.7, < 2)
|
43
43
|
minitest (~> 5.1)
|
44
44
|
tzinfo (~> 1.1)
|
45
45
|
arel (9.0.0)
|
46
46
|
builder (3.2.4)
|
47
|
-
concurrent-ruby (1.1.
|
47
|
+
concurrent-ruby (1.1.10)
|
48
48
|
crass (1.0.6)
|
49
49
|
erubi (1.10.0)
|
50
|
-
globalid (0.
|
51
|
-
activesupport (>=
|
52
|
-
i18n (1.
|
50
|
+
globalid (1.0.0)
|
51
|
+
activesupport (>= 5.0)
|
52
|
+
i18n (1.10.0)
|
53
53
|
concurrent-ruby (~> 1.0)
|
54
|
-
loofah (2.
|
54
|
+
loofah (2.18.0)
|
55
55
|
crass (~> 1.0.2)
|
56
56
|
nokogiri (>= 1.5.9)
|
57
57
|
mail (2.7.1)
|
58
58
|
mini_mime (>= 0.1.1)
|
59
|
-
marcel (1.0.
|
59
|
+
marcel (1.0.2)
|
60
60
|
method_source (1.0.0)
|
61
|
-
mini_mime (1.1.
|
62
|
-
mini_portile2 (2.
|
63
|
-
minitest (5.
|
64
|
-
nio4r (2.5.
|
65
|
-
nokogiri (1.
|
66
|
-
mini_portile2 (~> 2.
|
61
|
+
mini_mime (1.1.2)
|
62
|
+
mini_portile2 (2.8.0)
|
63
|
+
minitest (5.15.0)
|
64
|
+
nio4r (2.5.8)
|
65
|
+
nokogiri (1.13.6)
|
66
|
+
mini_portile2 (~> 2.8.0)
|
67
67
|
racc (~> 1.4)
|
68
|
-
nokogiri (1.
|
68
|
+
nokogiri (1.13.6-x86_64-linux)
|
69
69
|
racc (~> 1.4)
|
70
|
-
racc (1.
|
70
|
+
racc (1.6.0)
|
71
71
|
rack (2.2.3)
|
72
72
|
rack-test (1.1.0)
|
73
73
|
rack (>= 1.0, < 3)
|
74
|
-
rails (5.2.
|
75
|
-
actioncable (= 5.2.
|
76
|
-
actionmailer (= 5.2.
|
77
|
-
actionpack (= 5.2.
|
78
|
-
actionview (= 5.2.
|
79
|
-
activejob (= 5.2.
|
80
|
-
activemodel (= 5.2.
|
81
|
-
activerecord (= 5.2.
|
82
|
-
activestorage (= 5.2.
|
83
|
-
activesupport (= 5.2.
|
74
|
+
rails (5.2.8)
|
75
|
+
actioncable (= 5.2.8)
|
76
|
+
actionmailer (= 5.2.8)
|
77
|
+
actionpack (= 5.2.8)
|
78
|
+
actionview (= 5.2.8)
|
79
|
+
activejob (= 5.2.8)
|
80
|
+
activemodel (= 5.2.8)
|
81
|
+
activerecord (= 5.2.8)
|
82
|
+
activestorage (= 5.2.8)
|
83
|
+
activesupport (= 5.2.8)
|
84
84
|
bundler (>= 1.3.0)
|
85
|
-
railties (= 5.2.
|
85
|
+
railties (= 5.2.8)
|
86
86
|
sprockets-rails (>= 2.0.0)
|
87
87
|
rails-dom-testing (2.0.3)
|
88
88
|
activesupport (>= 4.2.0)
|
89
89
|
nokogiri (>= 1.6)
|
90
90
|
rails-html-sanitizer (1.0.4)
|
91
91
|
loofah (~> 2.2, >= 2.2.2)
|
92
|
-
railties (5.2.
|
93
|
-
actionpack (= 5.2.
|
94
|
-
activesupport (= 5.2.
|
92
|
+
railties (5.2.8)
|
93
|
+
actionpack (= 5.2.8)
|
94
|
+
activesupport (= 5.2.8)
|
95
95
|
method_source
|
96
96
|
rake (>= 0.8.7)
|
97
97
|
thor (>= 0.19.0, < 2.0)
|
98
|
-
rake (13.0.
|
99
|
-
sprockets (4.0.
|
98
|
+
rake (13.0.6)
|
99
|
+
sprockets (4.0.3)
|
100
100
|
concurrent-ruby (~> 1.0)
|
101
101
|
rack (> 1, < 3)
|
102
|
-
sprockets-rails (3.
|
103
|
-
actionpack (>=
|
104
|
-
activesupport (>=
|
102
|
+
sprockets-rails (3.4.2)
|
103
|
+
actionpack (>= 5.2)
|
104
|
+
activesupport (>= 5.2)
|
105
105
|
sprockets (>= 3.0.0)
|
106
|
-
thor (1.1
|
106
|
+
thor (1.2.1)
|
107
107
|
thread_safe (0.3.6)
|
108
108
|
tzinfo (1.2.9)
|
109
109
|
thread_safe (~> 0.1)
|
110
|
-
websocket-driver (0.7.
|
110
|
+
websocket-driver (0.7.5)
|
111
111
|
websocket-extensions (>= 0.1.0)
|
112
112
|
websocket-extensions (0.1.5)
|
113
113
|
|
@@ -120,4 +120,4 @@ DEPENDENCIES
|
|
120
120
|
rails-html-sanitizer (~> 1.0.3)
|
121
121
|
|
122
122
|
BUNDLED WITH
|
123
|
-
2.
|
123
|
+
2.3.6
|
@@ -241,7 +241,7 @@ describe Bundler::Audit::CLI::Formats::Junit do
|
|
241
241
|
|
242
242
|
context "when Advisory#patched_versions is not empty" do
|
243
243
|
it 'must print "Solution: upgrade to ..."' do
|
244
|
-
expect(output).to include("Solution: upgrade to #{CGI.escapeHTML(advisory.patched_versions.join(', '))}")
|
244
|
+
expect(output).to include("Solution: upgrade to #{CGI.escapeHTML(advisory.patched_versions.map { |v| "'#{v}'" }.join(', '))}")
|
245
245
|
end
|
246
246
|
end
|
247
247
|
|
@@ -230,7 +230,7 @@ describe Bundler::Audit::CLI::Formats::Text do
|
|
230
230
|
|
231
231
|
context "when Advisory#patched_versions is not empty" do
|
232
232
|
it 'must print "Solution: upgrade to ..."' do
|
233
|
-
expect(output_lines).to include("Solution: upgrade to #{advisory.patched_versions.join(', ')}")
|
233
|
+
expect(output_lines).to include("Solution: upgrade to #{advisory.patched_versions.map { |v| "'#{v}'" }.join(', ')}")
|
234
234
|
end
|
235
235
|
end
|
236
236
|
|
data/spec/database_spec.rb
CHANGED
@@ -292,7 +292,7 @@ describe Bundler::Audit::Database do
|
|
292
292
|
let(:last_commit) { Fixtures::Database::COMMIT }
|
293
293
|
let(:last_commit_timestamp) do
|
294
294
|
Dir.chdir(Fixtures::Database::PATH) do
|
295
|
-
Time.parse(`git log --date=iso8601 --pretty="%cd" #{last_commit}`)
|
295
|
+
Time.parse(`git log -n 2 --date=iso8601 --pretty="%cd" #{last_commit}`)
|
296
296
|
end
|
297
297
|
end
|
298
298
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bundler-audit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Postmodern
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -58,6 +58,7 @@ files:
|
|
58
58
|
- ".document"
|
59
59
|
- ".github/FUNDING.yml"
|
60
60
|
- ".github/ISSUE_TEMPLATE/bug-report.md"
|
61
|
+
- ".github/ISSUE_TEMPLATE/feature-request.md"
|
61
62
|
- ".github/workflows/ruby.yml"
|
62
63
|
- ".gitignore"
|
63
64
|
- ".rspec"
|
@@ -126,7 +127,8 @@ files:
|
|
126
127
|
homepage: https://github.com/rubysec/bundler-audit#readme
|
127
128
|
licenses:
|
128
129
|
- GPL-3.0+
|
129
|
-
metadata:
|
130
|
+
metadata:
|
131
|
+
rubygems_mfa_required: 'true'
|
130
132
|
post_install_message:
|
131
133
|
rdoc_options: []
|
132
134
|
require_paths:
|
@@ -142,8 +144,23 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
144
|
- !ruby/object:Gem::Version
|
143
145
|
version: 1.8.0
|
144
146
|
requirements: []
|
145
|
-
rubygems_version: 3.2.
|
147
|
+
rubygems_version: 3.2.33
|
146
148
|
signing_key:
|
147
149
|
specification_version: 4
|
148
150
|
summary: Patch-level verification for Bundler
|
149
|
-
test_files:
|
151
|
+
test_files:
|
152
|
+
- spec/advisory_spec.rb
|
153
|
+
- spec/audit_spec.rb
|
154
|
+
- spec/cli/formats/json_spec.rb
|
155
|
+
- spec/cli/formats/junit_spec.rb
|
156
|
+
- spec/cli/formats/text_spec.rb
|
157
|
+
- spec/cli/formats_spec.rb
|
158
|
+
- spec/cli_spec.rb
|
159
|
+
- spec/configuration_spec.rb
|
160
|
+
- spec/database_spec.rb
|
161
|
+
- spec/integration_spec.rb
|
162
|
+
- spec/report_spec.rb
|
163
|
+
- spec/results/insecure_source_spec.rb
|
164
|
+
- spec/results/result_spec.rb
|
165
|
+
- spec/results/unpatched_gem_spec.rb
|
166
|
+
- spec/scanner_spec.rb
|