shield_ast 1.2.0 → 1.2.2
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/lib/shield_ast/version.rb +1 -1
- data/lib/shield_ast.rb +23 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6c939647ea823bcc6ab0e154d45ae601348a1d6be7dd3ff5d042a2bd789141f
|
4
|
+
data.tar.gz: c9f1d745bc005ed3d7c904cf23d09e62094560ee490b3771289ec224de34437d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83cfc9f81a86de10ccbaaee5950d5495afeb380d73b674438345619e954c05f5a0fcf9b402fe285af83bfc7880642103b48579ea0a898dac71a372ae9e847b34
|
7
|
+
data.tar.gz: dd36eef5cb01fb5ae39025fdae774b9fa33689f96b3feacda4671544c6c778274c4f4676633b360105968b57abcaa8873c28a40a06e304357802496b8439741c
|
data/lib/shield_ast/version.rb
CHANGED
data/lib/shield_ast.rb
CHANGED
@@ -15,16 +15,28 @@ module ShieldAst
|
|
15
15
|
|
16
16
|
# Main class for the Shield AST command-line tool.
|
17
17
|
class Main
|
18
|
-
SCAN_DATA_FILE = File.join(Dir.pwd, "
|
19
|
-
REPORT_JSON_FILE = File.join(Dir.pwd, "
|
20
|
-
REPORT_PDF_FILE = File.join(Dir.pwd, "
|
18
|
+
SCAN_DATA_FILE = File.join(Dir.pwd, "reports", "scan_data.json")
|
19
|
+
REPORT_JSON_FILE = File.join(Dir.pwd, "reports", "scan_report.json")
|
20
|
+
REPORT_PDF_FILE = File.join(Dir.pwd, "reports", "scan_report.pdf")
|
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
|
@@ -309,7 +321,7 @@ module ShieldAst
|
|
309
321
|
severity_icon = get_severity_icon(result[:severity] || result["severity"] || result[:extra]&.[](:severity) || result["extra"]&.[]("severity"))
|
310
322
|
message = result[:extra]&.[](:message) || result["extra"]&.[]("message") || "Unknown issue"
|
311
323
|
title = message.split(".")[0].strip
|
312
|
-
file_info = "#{
|
324
|
+
file_info = "#{result[:path] || result["path"] || "N/A"}:#{result[:start]&.[](:line) || result["start"]&.[]("line") || "N/A"}"
|
313
325
|
|
314
326
|
puts " #{severity_icon} #{title}"
|
315
327
|
puts " 📁 #{file_info} | #{(result[:extra]&.[](:message) || result["extra"]&.[]("message") || "No description available")[0..80]}..."
|
@@ -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.
|
4
|
+
version: 1.2.2
|
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.
|
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: []
|