ruby_audit 2.3.0 → 3.0.0

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: 03b8220013a541f8b113b8b6fababafecdd92de4badea9df13147d5ecc8df68a
4
- data.tar.gz: 0c873a6f538b774268df8c7e670a21e28eab51348337b36bffa62aa91df09850
3
+ metadata.gz: 3c7d4dd1d68e8876981650f3fa3aac753b1ba2c3751da011c1ac3958c7e0bd7d
4
+ data.tar.gz: 964d04790d84d33c9d58ff074ddb259b67b2a95de951b72768a57a571949ab13
5
5
  SHA512:
6
- metadata.gz: 3e1c97decf4d3acf3b742f3d5697d9c629160f96102fc596cdc296fd52a1847d66dc3dd7f118f3084e929b93ec8b8eff04bad1b6360130052987da2c0a9015f2
7
- data.tar.gz: 329e52e574282fd6b40ba7a046c8f5dfe9e2fa8680e7237abc8b936032efa86e9cf11c60b6dea4f9521c3633d8721dcdc8afb51df347d177021171496b47dbc1
6
+ metadata.gz: 4201365adab2c239a9d213d938405882a49913f578f89192b280135fc5ea0db9196e9b7b9d1eda0c8f96588a6af753042655fbf8ad117d9a91bd1beaf61b5ef7
7
+ data.tar.gz: 64e180ec574c6f3a9306df3588c926871e736d5279bf1a17fa7eb220d5ebfc92d60f26093dabedb6230a43e27f7da0e290e9889277d4da62e007d90005162750
@@ -12,7 +12,7 @@ jobs:
12
12
  test:
13
13
  strategy:
14
14
  matrix:
15
- ruby_version: [2.5, 2.6, 2.7, '3.0', 3.1, 3.2, 3.3]
15
+ ruby_version: [3.1, 3.2, 3.3, 3.4]
16
16
  runs-on: ubuntu-latest
17
17
  steps:
18
18
  - uses: actions/checkout@v2
@@ -21,8 +21,6 @@ jobs:
21
21
  with:
22
22
  ruby-version: ${{ matrix.ruby_version }}
23
23
  bundler-cache: true
24
- - name: Install dependencies
25
- run: bundle install --jobs=3 --retry=3
26
24
  - name: Initialize submodule
27
25
  run: git submodule update --init
28
26
  - name: Run tests
data/.rubocop.yml CHANGED
@@ -1,8 +1,11 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.5
2
+ TargetRubyVersion: 3.1
3
3
  NewCops: enable
4
4
  SuggestExtensions: false
5
5
 
6
+ Gemspec/DevelopmentDependencies:
7
+ EnforcedStyle: gemspec
8
+
6
9
  Layout/LineLength:
7
10
  Exclude:
8
11
  - 'ruby_audit.gemspec'
@@ -11,7 +14,7 @@ Metrics/MethodLength:
11
14
  Max: 15
12
15
 
13
16
  Metrics/BlockLength:
14
- IgnoredMethods:
17
+ AllowedMethods:
15
18
  - describe
16
19
 
17
20
  Style/Documentation:
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.3.0
1
+ 3.4.1
data/CHANGELOG.md CHANGED
@@ -5,101 +5,130 @@ This project adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## 3.0.0 - 2025-01-09
9
+
10
+ ### Changed
11
+
12
+ - Bumped Rubocop dependency to 1.64.0
13
+ - Require MFA for rubygems operations
14
+
15
+ ### Removed
16
+
17
+ - Removed support for Ruby 2.5 through 3.0
18
+ - Removed Timecop dependency
19
+
20
+ ## [2.3.1] - 2024-05-17
21
+
22
+ ### Removed
23
+
24
+ - [#34](https://github.com/civisanalytics/ruby_audit/pull/34)
25
+ Removed check for stale database that no longer does anything
26
+
27
+ ### Fixed
28
+
29
+ - [#35](https://github.com/civisanalytics/ruby_audit/pull/35)
30
+ Look for rubygems advisories in the correct directory of the ruby-advisory-db
31
+
32
+ ## [2.3.0] - 2024-01-10
33
+
8
34
  ### Added
9
35
 
10
- * Support for Ruby 3.3
36
+ - Support for Ruby 3.3
11
37
 
12
38
  ## [2.2.0] - 2023-01-05
13
39
 
14
40
  ### Added
15
41
 
16
- * Support for Ruby 3.2
42
+ - Support for Ruby 3.2
17
43
 
18
44
  ## [2.1.0] - 2022-02-23
19
45
 
20
46
  ### Added
21
47
 
22
- * Support for ruby 3.1
23
- * Require bundler-audit >= 0.9
48
+ - Support for ruby 3.1
49
+ - Require bundler-audit >= 0.9
24
50
 
25
51
  ## [2.0.0] - 2021-03-22
26
52
 
27
53
  ### Added
28
54
 
29
- * Require bundler-audit 0.8
30
- * Added Ruby 3.0 to the Travis matrix
55
+ - Require bundler-audit 0.8
56
+ - Added Ruby 3.0 to the Travis matrix
31
57
 
32
58
  ### Removed
33
59
 
34
- * Removed support for bundler-audit 0.7
60
+ - Removed support for bundler-audit 0.7
35
61
 
36
62
  ## [1.3.0] - 2020-07-01
37
63
 
38
64
  ### Added
39
65
 
40
- * Added Ruby 2.5, 2.6, and 2.7 to the Travis matrix
41
- * Added the ability to ignore an advisory by its GHSA identifier
66
+ - Added Ruby 2.5, 2.6, and 2.7 to the Travis matrix
67
+ - Added the ability to ignore an advisory by its GHSA identifier
42
68
 
43
69
  ### Changed
44
70
 
45
- * Bumped the bundler-audit version to 0.7
46
- * Bumped the Ruby version for development to 2.7.1
47
- * Bumped the Pry version for development to 0.13
48
- * Bumped the Rake version for development to 13
49
- * Bumped the Rspec version for development to 3.9
50
- * Bumped the RuboCop version for development to 0.86
51
- * Bumped the Timecop verison for development to 0.9
52
- * RuboCop fixes
71
+ - Bumped the bundler-audit version to 0.7
72
+ - Bumped the Ruby version for development to 2.7.1
73
+ - Bumped the Pry version for development to 0.13
74
+ - Bumped the Rake version for development to 13
75
+ - Bumped the Rspec version for development to 3.9
76
+ - Bumped the RuboCop version for development to 0.86
77
+ - Bumped the Timecop verison for development to 0.9
78
+ - RuboCop fixes
53
79
 
54
80
  ### Removed
55
81
 
56
- * Removed Ruby 2.1 through 2.4 from the Travis matrix
57
- * Removed the explicit Bundler dependency for development, since it is now included with RubyGems
82
+ - Removed Ruby 2.1 through 2.4 from the Travis matrix
83
+ - Removed the explicit Bundler dependency for development, since it is now included with RubyGems
58
84
 
59
85
  ## [1.2.0] - 2017-09-21
60
86
 
61
87
  ### Added
62
88
 
63
- * Added 2.4 to the Travis matrix ([@errm])
89
+ - Added 2.4 to the Travis matrix ([@errm])
64
90
 
65
91
  ### Changed
66
92
 
67
- * Bumped the bundler-audit version to 0.6 ([@errm])
68
- * Bumped the RuboCop version for development to 0.50 ([@errm])
69
- * Bumped the Ruby version for development to 2.4.2 ([@errm])
93
+ - Bumped the bundler-audit version to 0.6 ([@errm])
94
+ - Bumped the RuboCop version for development to 0.50 ([@errm])
95
+ - Bumped the Ruby version for development to 2.4.2 ([@errm])
70
96
 
71
97
  ## [1.1.0] - 2016-09-15
72
98
 
73
99
  ### Added
74
100
 
75
- * Added a matrix build of 2.1, 2.2, and 2.3 to Travis
101
+ - Added a matrix build of 2.1, 2.2, and 2.3 to Travis
76
102
 
77
103
  ### Changed
78
104
 
79
- * Added a [Code of Conduct](CODE_OF_CONDUCT.md)
80
- * Bumped the bundler-audit version to 0.5
81
- * Bumped the RSpec version for development to 3.5
82
- * Bumped the Rake version for development to 11.2
83
- * Bumped the RuboCop version for development to 0.42
84
- * Bumped the Ruby version for development to 2.3.1
105
+ - Added a [Code of Conduct](CODE_OF_CONDUCT.md)
106
+ - Bumped the bundler-audit version to 0.5
107
+ - Bumped the RSpec version for development to 3.5
108
+ - Bumped the Rake version for development to 11.2
109
+ - Bumped the RuboCop version for development to 0.42
110
+ - Bumped the Ruby version for development to 2.3.1
85
111
 
86
112
  ## [1.0.1] - 2016-02-03
87
113
 
88
114
  ### Fixed
89
115
 
90
- * [#1](https://github.com/civisanalytics/ruby_audit/pull/1)
116
+ - [#1](https://github.com/civisanalytics/ruby_audit/pull/1)
91
117
  removing unreliable last-update check
92
118
 
93
119
  ## 1.0.0 (2016-02-03)
94
120
 
95
- * Initial Release
121
+ - Initial Release
96
122
 
97
- [Unreleased]: https://github.com/civisanalytics/ruby_audit/compare/v2.0.0...HEAD
98
- [1.3.0]: https://github.com/civisanalytics/ruby_audit/compare/v1.3.0...v2.0.0
123
+ [Unreleased]: https://github.com/civisanalytics/ruby_audit/compare/v2.3.1...HEAD
124
+ [2.3.1]: https://github.com/civisanalytics/ruby_audit/compare/v2.3.0...v2.3.1
125
+ [2.3.0]: https://github.com/civisanalytics/ruby_audit/compare/v2.2.0...v2.3.0
126
+ [2.2.0]: https://github.com/civisanalytics/ruby_audit/compare/v2.1.0...v2.2.0
127
+ [2.1.0]: https://github.com/civisanalytics/ruby_audit/compare/v2.0.0...v2.1.0
128
+ [2.0.0]: https://github.com/civisanalytics/ruby_audit/compare/v1.3.0...v2.0.0
99
129
  [1.3.0]: https://github.com/civisanalytics/ruby_audit/compare/v1.2.0...v1.3.0
100
130
  [1.2.0]: https://github.com/civisanalytics/ruby_audit/compare/v1.1.0...v1.2.0
101
131
  [1.1.0]: https://github.com/civisanalytics/ruby_audit/compare/v1.0.1...v1.1.0
102
132
  [1.0.1]: https://github.com/civisanalytics/ruby_audit/compare/v1.0.0...v1.0.1
103
133
  [1.0.0]: https://github.com/civisanalytics/ruby_audit/commit/7535b70412641c888c80d99514b27ba254fb8316
104
-
105
134
  [@errm]: https://github.com/errm
data/Gemfile CHANGED
@@ -2,3 +2,10 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in ruby_audit.gemspec
4
4
  gemspec
5
+
6
+ gem 'base64', '~> 0.2.0'
7
+ gem 'ostruct', '~> 0.6.1'
8
+ gem 'pry', '~> 0.14.1'
9
+ gem 'rake', '~> 13.0'
10
+ gem 'rspec', '~> 3.9'
11
+ gem 'rubocop', '~> 1.69.2'
data/README.md CHANGED
@@ -57,9 +57,12 @@ $ ruby-audit check -n
57
57
 
58
58
  After checking out the repo, run `bin/setup` to install dependencies.
59
59
  You'll also want to run `git submodule update --init` to populate the ruby-advisory-db
60
- submodule used for testing. Then, run `rake spec` to run the tests.
60
+ submodule in `/vendor` that is used for testing. Then, run `rake` to run linting and tests.
61
61
  You can also run `bin/console` for an interactive prompt that will allow you to experiment.
62
62
 
63
+ The database in `/vendor/ruby-advisory-db` is only used as a fixture for unit tests.
64
+ By default, the database used for actual vulnerability checks is stored at `~/.local/share/ruby-advisory-db`.
65
+
63
66
  To install this gem onto your local machine, run `bundle exec rake install`.
64
67
  To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
65
68
 
@@ -12,8 +12,6 @@ module RubyAudit
12
12
  def check
13
13
  update unless options[:no_update]
14
14
 
15
- check_for_stale_database
16
-
17
15
  scanner = Scanner.new
18
16
  vulnerable = false
19
17
 
@@ -30,7 +28,6 @@ module RubyAudit
30
28
  end
31
29
  end
32
30
 
33
- # Copied from bundler-audit master. Not present in 0.4.0.
34
31
  desc 'update', 'Updates the ruby-advisory-db'
35
32
  def update
36
33
  say 'Updating ruby-advisory-db ...'
@@ -45,14 +42,16 @@ module RubyAudit
45
42
  say 'Skipping update', :yellow
46
43
  end
47
44
 
48
- puts "ruby-advisory-db: #{Database.new.size} advisories"
45
+ database = Database.new
46
+ puts "ruby-advisory-db: #{database.size} advisories, " \
47
+ "last updated #{database.last_updated_at.utc}"
49
48
  end
50
49
 
51
50
  desc 'version', 'Prints the ruby-audit version'
52
51
  def version
53
52
  database = Database.new
54
- puts "#{File.basename($PROGRAM_NAME)} #{VERSION} "\
55
- "(advisories: #{database.size})"
53
+ puts "#{File.basename($PROGRAM_NAME)} #{VERSION} " \
54
+ "(advisories: #{database.size}, last updated: #{database.last_updated_at.utc})"
56
55
  end
57
56
 
58
57
  private
@@ -122,16 +121,5 @@ module RubyAudit
122
121
  # rubocop:enable Metrics/MethodLength
123
122
  # rubocop:enable Metrics/CyclomaticComplexity
124
123
  # rubocop:enable Metrics/AbcSize
125
-
126
- def check_for_stale_database
127
- database = Database.new
128
- return unless database.size == 89
129
-
130
- # bundler-audit 0.4.0 comes bundled with an old verison of
131
- # ruby-advisory-db that has 89 advisories and NO advisories for Ruby
132
- # or RubyGems. If #size == 89, the database has never been updated.
133
- say 'The database must be updated before using RubyAudit', :red
134
- exit 1
135
- end
136
124
  end
137
125
  end
@@ -10,12 +10,12 @@ module RubyAudit
10
10
  end
11
11
  end
12
12
 
13
- def check_ruby(ruby, &block)
14
- check(ruby, 'rubies', &block)
13
+ def check_ruby(ruby, &)
14
+ check(ruby, 'rubies', &)
15
15
  end
16
16
 
17
- def check_library(library, &block)
18
- check(library, 'libraries', &block)
17
+ def check_rubygems(rubygems, &)
18
+ check(rubygems, 'gems', &)
19
19
  end
20
20
 
21
21
  def check(object, type = 'gems')
@@ -28,13 +28,12 @@ module RubyAudit
28
28
 
29
29
  protected
30
30
 
31
- def each_advisory_path(&block)
32
- Dir.glob(File.join(@path, '{gems,libraries,rubies}', '*', '*.yml'),
33
- &block)
31
+ def each_advisory_path(&)
32
+ Dir.glob(File.join(@path, '{gems,rubies}', '*', '*.yml'), &)
34
33
  end
35
34
 
36
- def each_advisory_path_for(name, type = 'gems', &block)
37
- Dir.glob(File.join(@path, type, name, '*.yml'), &block)
35
+ def each_advisory_path_for(name, type = 'gems', &)
36
+ Dir.glob(File.join(@path, type, name, '*.yml'), &)
38
37
  end
39
38
  end
40
39
  end
@@ -25,19 +25,19 @@ module RubyAudit
25
25
  self
26
26
  end
27
27
 
28
- def scan_ruby(options = {}, &block)
28
+ def scan_ruby(options = {}, &)
29
29
  version = if RUBY_PATCHLEVEL < 0
30
30
  ruby_version
31
31
  else
32
32
  "#{RUBY_VERSION}.#{RUBY_PATCHLEVEL}"
33
33
  end
34
34
  specs = [Version.new(RUBY_ENGINE, version)]
35
- scan_inner(specs, 'ruby', options, &block)
35
+ scan_inner(specs, 'ruby', options, &)
36
36
  end
37
37
 
38
- def scan_rubygems(options = {}, &block)
39
- specs = [Version.new('rubygems', rubygems_version)]
40
- scan_inner(specs, 'library', options, &block)
38
+ def scan_rubygems(options = {}, &)
39
+ specs = [Version.new('rubygems-update', rubygems_version)]
40
+ scan_inner(specs, 'rubygems', options, &)
41
41
  end
42
42
 
43
43
  private
@@ -61,7 +61,7 @@ module RubyAudit
61
61
  ignore += options[:ignore] if options[:ignore]
62
62
 
63
63
  specs.each do |spec|
64
- @database.send("check_#{type}".to_sym, spec) do |advisory|
64
+ @database.send(:"check_#{type}", spec) do |advisory|
65
65
  unless ignore.intersect?(advisory.identifiers.to_set)
66
66
  yield Bundler::Audit::Results::UnpatchedGem.new(spec, advisory)
67
67
  end
@@ -1,3 +1,3 @@
1
1
  module RubyAudit
2
- VERSION = '2.3.0'.freeze
2
+ VERSION = '3.0.0'.freeze
3
3
  end
data/ruby_audit.gemspec CHANGED
@@ -7,6 +7,7 @@ Gem::Specification.new do |spec|
7
7
  spec.version = RubyAudit::VERSION
8
8
  spec.authors = ['Jeff Cousens, Mike Saelim', 'John Zhang', 'Cristina Muñoz']
9
9
  spec.email = ['opensource@civisanalytics.com']
10
+ spec.metadata['rubygems_mfa_required'] = 'true'
10
11
 
11
12
  spec.summary = 'Checks Ruby and RubyGems against known vulnerabilities.'
12
13
  spec.description = 'RubyAudit checks your current version of Ruby and ' \
@@ -17,16 +18,11 @@ Gem::Specification.new do |spec|
17
18
  spec.homepage = 'https://github.com/civisanalytics/ruby_audit'
18
19
  spec.license = 'GPL-3.0-or-later'
19
20
 
20
- spec.required_ruby_version = ['>= 2.5', '< 3.4']
21
+ spec.required_ruby_version = ['>= 3.1', '< 3.5']
21
22
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
23
  spec.bindir = 'exe'
23
24
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
25
  spec.require_paths = ['lib']
25
26
 
26
27
  spec.add_dependency 'bundler-audit', '~> 0.9.0'
27
- spec.add_development_dependency 'pry', '~> 0.14.1'
28
- spec.add_development_dependency 'rake', '~> 13.0'
29
- spec.add_development_dependency 'rspec', '~> 3.9'
30
- spec.add_development_dependency 'rubocop', '~> 1.9.1'
31
- spec.add_development_dependency 'timecop', '~> 0.9.1'
32
28
  end
metadata CHANGED
@@ -1,16 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_audit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Cousens, Mike Saelim
8
8
  - John Zhang
9
9
  - Cristina Muñoz
10
- autorequire:
11
10
  bindir: exe
12
11
  cert_chain: []
13
- date: 2024-01-10 00:00:00.000000000 Z
12
+ date: 2025-01-09 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: bundler-audit
@@ -26,76 +25,6 @@ dependencies:
26
25
  - - "~>"
27
26
  - !ruby/object:Gem::Version
28
27
  version: 0.9.0
29
- - !ruby/object:Gem::Dependency
30
- name: pry
31
- requirement: !ruby/object:Gem::Requirement
32
- requirements:
33
- - - "~>"
34
- - !ruby/object:Gem::Version
35
- version: 0.14.1
36
- type: :development
37
- prerelease: false
38
- version_requirements: !ruby/object:Gem::Requirement
39
- requirements:
40
- - - "~>"
41
- - !ruby/object:Gem::Version
42
- version: 0.14.1
43
- - !ruby/object:Gem::Dependency
44
- name: rake
45
- requirement: !ruby/object:Gem::Requirement
46
- requirements:
47
- - - "~>"
48
- - !ruby/object:Gem::Version
49
- version: '13.0'
50
- type: :development
51
- prerelease: false
52
- version_requirements: !ruby/object:Gem::Requirement
53
- requirements:
54
- - - "~>"
55
- - !ruby/object:Gem::Version
56
- version: '13.0'
57
- - !ruby/object:Gem::Dependency
58
- name: rspec
59
- requirement: !ruby/object:Gem::Requirement
60
- requirements:
61
- - - "~>"
62
- - !ruby/object:Gem::Version
63
- version: '3.9'
64
- type: :development
65
- prerelease: false
66
- version_requirements: !ruby/object:Gem::Requirement
67
- requirements:
68
- - - "~>"
69
- - !ruby/object:Gem::Version
70
- version: '3.9'
71
- - !ruby/object:Gem::Dependency
72
- name: rubocop
73
- requirement: !ruby/object:Gem::Requirement
74
- requirements:
75
- - - "~>"
76
- - !ruby/object:Gem::Version
77
- version: 1.9.1
78
- type: :development
79
- prerelease: false
80
- version_requirements: !ruby/object:Gem::Requirement
81
- requirements:
82
- - - "~>"
83
- - !ruby/object:Gem::Version
84
- version: 1.9.1
85
- - !ruby/object:Gem::Dependency
86
- name: timecop
87
- requirement: !ruby/object:Gem::Requirement
88
- requirements:
89
- - - "~>"
90
- - !ruby/object:Gem::Version
91
- version: 0.9.1
92
- type: :development
93
- prerelease: false
94
- version_requirements: !ruby/object:Gem::Requirement
95
- requirements:
96
- - - "~>"
97
- - !ruby/object:Gem::Version
98
- version: 0.9.1
99
28
  description: RubyAudit checks your current version of Ruby and RubyGems against known
100
29
  security vulnerabilities (CVEs), alerting you if you are using an insecure version.
101
30
  It complements bundler-audit, providing complete coverage for your Ruby stack.
@@ -131,8 +60,8 @@ files:
131
60
  homepage: https://github.com/civisanalytics/ruby_audit
132
61
  licenses:
133
62
  - GPL-3.0-or-later
134
- metadata: {}
135
- post_install_message:
63
+ metadata:
64
+ rubygems_mfa_required: 'true'
136
65
  rdoc_options: []
137
66
  require_paths:
138
67
  - lib
@@ -140,18 +69,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
69
  requirements:
141
70
  - - ">="
142
71
  - !ruby/object:Gem::Version
143
- version: '2.5'
72
+ version: '3.1'
144
73
  - - "<"
145
74
  - !ruby/object:Gem::Version
146
- version: '3.4'
75
+ version: '3.5'
147
76
  required_rubygems_version: !ruby/object:Gem::Requirement
148
77
  requirements:
149
78
  - - ">="
150
79
  - !ruby/object:Gem::Version
151
80
  version: '0'
152
81
  requirements: []
153
- rubygems_version: 3.0.3.1
154
- signing_key:
82
+ rubygems_version: 3.6.2
155
83
  specification_version: 4
156
84
  summary: Checks Ruby and RubyGems against known vulnerabilities.
157
85
  test_files: []