vrt-cli 1.1.0 → 1.2.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: bdde2e9c99bb239daa686d2d3bc8417c99f7017b68d71f8d8b7eb09364c1faa8
4
- data.tar.gz: c97e9093e177ba95e2b691bf87b551d430fb8b66844024400d0fc64eb7664646
3
+ metadata.gz: 12ffc1ef26c84c00647cf656c0d87fcc65e18d2cc5deb058e42b4039bab12456
4
+ data.tar.gz: 60db69ef74bc34439db4c92a3913427fa53c4fdf757a10e7d9c8d103e369931d
5
5
  SHA512:
6
- metadata.gz: 9ee90bf0b2bd6f3df65da01194b3cd876b1351ec8b550f9d2553cda88c3ff8bc00eaeae12363d55c70e8124a53d5c0c9c0d191b93b843fe43d16f677edf6f002
7
- data.tar.gz: a39d68f5beccf43f46332ed971ae8b378155521edb89f96497010786dac340c23102a2650dd14e6ff62763a579a632158a34e4969973b365b025961102685b04
6
+ metadata.gz: 43c0b56eecd7c0222ac982b15863a9e9b6849326b4b83515c8583fb7908c4b07fbedd73a0d1be052c3177845037c7aba47a570f43dd578fbec21ceb544df0e2d
7
+ data.tar.gz: e36895910e151e1229e9d66385d131e6044ecf73edd0cd6c75d42021b4110fbfb5875f531b188f334e768b7fb7486fc99c81c07dadcd46935ebd5bc07204a464
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 Alexandre ZANNI
3
+ Copyright (c) 2021-2026 Alexandre ZANNI
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/bin/vrt-cli CHANGED
@@ -2,7 +2,6 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  # Ruby internal
5
- require 'pp'
6
5
  # Project internal
7
6
  require 'vrt_cli'
8
7
  # External
@@ -31,7 +30,7 @@ DOCOPT
31
30
  begin
32
31
  args = Docopt.docopt(doc, version: VrtCli::VERSION)
33
32
  Paint.mode = 0 if args['--no-color']
34
- pp args if args['--debug']
33
+ puts args if args['--debug']
35
34
  vc = VrtCli::App.new
36
35
  if args['tree']
37
36
  vc.display_tree
@@ -8,9 +8,9 @@ module VrtCli
8
8
  class App
9
9
  # Display vulnerabilities in a tree
10
10
  def display_tree
11
- VRT.get_map.structure.each do |_cat_id, category|
11
+ VRT.get_map.structure.each_value do |category|
12
12
  puts Paint[category.name, :bold]
13
- category.children.each do |_subcat_id, subcategory|
13
+ category.children.each_value do |subcategory|
14
14
  if subcategory.priority
15
15
  print ''.ljust(4) + Paint[subcategory.priority, SEVERITY[subcategory.priority]]
16
16
  puts " #{subcategory.name}"
@@ -20,7 +20,7 @@ module VrtCli
20
20
 
21
21
  next unless subcategory.children?
22
22
 
23
- subcategory.children.each do |_variant_id, variant|
23
+ subcategory.children.each_value do |variant|
24
24
  if variant.priority
25
25
  print ''.ljust(8) + Paint[variant.priority, SEVERITY[variant.priority]]
26
26
  puts " #{variant.name}"
@@ -30,7 +30,7 @@ module VrtCli
30
30
  end
31
31
  end
32
32
  end
33
- true
33
+ nil
34
34
  end
35
35
 
36
36
  # Sort vulnerabilities
@@ -41,7 +41,7 @@ module VrtCli
41
41
  @vulnerabilities.sort! { |a, b| a[sortby].to_s <=> b[sortby].to_s }
42
42
  @vulnerabilities.reverse! if order == :dsc
43
43
  end
44
- true
44
+ nil
45
45
  end
46
46
 
47
47
  # Display vulnerabilities in a simple justified table
@@ -56,7 +56,7 @@ module VrtCli
56
56
  output += "#{v[:subcategory].ljust(55)} #{v[:variant]}"
57
57
  puts output
58
58
  end
59
- true
59
+ nil
60
60
  end
61
61
  end
62
62
  end
data/lib/vrt_cli/parse.rb CHANGED
@@ -8,10 +8,10 @@ module VrtCli
8
8
  # @return [Array<Hash>] An array of vulnerabilities (`:priority`, `:category`, `:subcategory`, `:variant`)
9
9
  def parse
10
10
  vulns = []
11
- VRT.get_map.structure.each do |_cat_id, category|
12
- category.children.each do |_subcat_id, subcategory|
11
+ VRT.get_map.structure.each_value do |category|
12
+ category.children.each_value do |subcategory|
13
13
  if subcategory.children?
14
- subcategory.children.each do |_variant_id, variant|
14
+ subcategory.children.each_value do |variant|
15
15
  priority = variant.priority || '?'
16
16
  vuln = {
17
17
  priority: priority,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Version
4
- VERSION = '1.1.0'
4
+ VERSION = '1.2.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vrt-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre ZANNI
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2022-01-31 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: docopt
@@ -30,28 +29,28 @@ dependencies:
30
29
  requirements:
31
30
  - - "~>"
32
31
  - !ruby/object:Gem::Version
33
- version: '2.2'
32
+ version: '2.3'
34
33
  type: :runtime
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
37
  - - "~>"
39
38
  - !ruby/object:Gem::Version
40
- version: '2.2'
39
+ version: '2.3'
41
40
  - !ruby/object:Gem::Dependency
42
41
  name: vrt
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
44
  - - "~>"
46
45
  - !ruby/object:Gem::Version
47
- version: '0.11'
46
+ version: '0.13'
48
47
  type: :runtime
49
48
  prerelease: false
50
49
  version_requirements: !ruby/object:Gem::Requirement
51
50
  requirements:
52
51
  - - "~>"
53
52
  - !ruby/object:Gem::Version
54
- version: '0.11'
53
+ version: '0.13'
55
54
  description: A simple tool to visualize VRT (Vulnerability Rating Taxonomy) from the
56
55
  CLI.
57
56
  email: alexandre.zanni@engineer.com
@@ -78,8 +77,8 @@ metadata:
78
77
  documentation_uri: https://noraj.github.io/vrt-cli/
79
78
  homepage_uri: https://noraj.github.io/vrt-cli/
80
79
  source_code_uri: https://github.com/noraj/vrt-cli/
80
+ funding_uri: https://github.com/sponsors/noraj
81
81
  rubygems_mfa_required: 'true'
82
- post_install_message:
83
82
  rdoc_options: []
84
83
  require_paths:
85
84
  - lib
@@ -87,18 +86,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
87
86
  requirements:
88
87
  - - ">="
89
88
  - !ruby/object:Gem::Version
90
- version: 2.6.0
89
+ version: 3.2.0
91
90
  - - "<"
92
91
  - !ruby/object:Gem::Version
93
- version: '3.2'
92
+ version: '5.0'
94
93
  required_rubygems_version: !ruby/object:Gem::Requirement
95
94
  requirements:
96
95
  - - ">="
97
96
  - !ruby/object:Gem::Version
98
97
  version: '0'
99
98
  requirements: []
100
- rubygems_version: 3.3.3
101
- signing_key:
99
+ rubygems_version: 4.0.3
102
100
  specification_version: 4
103
101
  summary: A simple tool to visualize VRT (Vulnerability Rating Taxonomy) from the CLI.
104
102
  test_files: []