shield_ast 1.2.0 → 1.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f6c61da40db55d33cb491cfac9aee8d6a42160b8703db338498d8990852245c
4
- data.tar.gz: a72f17d19e7b92057db035e00783c51d2007e874ec216f3b3301d1b9c640f349
3
+ metadata.gz: b38d31d7f4411ba2d4de694915019f9059cf19bab67079473c4597066d5e8269
4
+ data.tar.gz: 60d6255349f02a11a5c85adf5ec10b9de6019b7c9d9694d15f3101ffef838301
5
5
  SHA512:
6
- metadata.gz: f2cb6e62fa8dd5f7bf41f8411af8f4420179ba9b356413bb204eddc26a7213704d37a8534d4dcec5e6a62ed12b439dada3b1551ea5802eae12975fce8c84321c
7
- data.tar.gz: 2dca66c6eac359384237bf73e57621f911f8bea31d4b6a481325e5ab7f7011a7656114949908df4c026c060b3dedf6c025f0f2114b81d5cce4f5d0d86806a5d2
6
+ metadata.gz: afc99954084847d8c6d9e9d1348638169039d2bc08a0370d7f5d86e50ad2a6d146f0724423151f168941b909a20bf5386ec767e6cd0d03d34249e0a00290c9c5
7
+ data.tar.gz: c69b120cd7847b4b2f8aca24a6f9a5ac609cd12fea9eb6f95502996b050ccb3994250588f1dc59772766a0c3334f147906b7c6c79db213c51cedbead4cb4e09d
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ShieldAst
4
- VERSION = "1.2.0"
4
+ VERSION = "1.2.1"
5
5
  end
data/lib/shield_ast.rb CHANGED
@@ -21,10 +21,22 @@ module ShieldAst
21
21
  PDF_TEMPLATE = File.join(__dir__, "reports", "templates", "pdf_report_template.rb")
22
22
 
23
23
  def self.call(args)
24
+ ascii_banner
25
+
26
+ unless scanner_exists?("osv-scanner") && scanner_exists?("semgrep")
27
+ puts "\e[31m[!] ERROR:\e[0m Required tools not found."
28
+ puts " Install: \e[33mosv-scanner\e[0m, \e[33msemgrep\e[0m"
29
+ exit 1
30
+ end
31
+
24
32
  options = parse_args(args)
25
33
  handle_options(options)
26
34
  end
27
35
 
36
+ def self.scanner_exists?(scanner)
37
+ system("which #{scanner} > /dev/null 2>&1")
38
+ end
39
+
28
40
  def self.handle_options(options)
29
41
  if options[:help]
30
42
  show_help
@@ -361,5 +373,12 @@ module ShieldAst
361
373
  find and fix vulnerabilities early in the development lifecycle.
362
374
  HELP
363
375
  end
376
+
377
+ def self.ascii_banner
378
+ puts <<~BANNER
379
+ [>>> SHIELD AST <<<]
380
+ powered by open source (semgrep + osv-scanner) \n
381
+ BANNER
382
+ end
364
383
  end
365
384
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shield_ast
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jose Augusto
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  - !ruby/object:Gem::Version
127
127
  version: '0'
128
128
  requirements: []
129
- rubygems_version: 3.7.1
129
+ rubygems_version: 3.6.9
130
130
  specification_version: 4
131
131
  summary: A command-line tool for multi-scanner Application Security Testing.
132
132
  test_files: []