Sha256: d91a64815b827c30cfd8c638147127c6ad3d42482a5a98e9bfb2f7aa43e29e9e

Contents?: true

Size: 1.38 KB

Versions: 12

Compression:

Stored size: 1.38 KB

Contents

# frozen_string_literal: true

require_relative "../../../github/bundle_audit"

module Neetob
  class CLI
    module MonthlyAudit
      module Security
        module Code
          class BundleAudit < CLI::Base
            def initialize
              super()
            end

            def run
              ui.success("### 1.1.1. Checking whether running `bundle-audit check` throws any vulnerabilities")
              repo_data = [["Repository", "Vulnerabilities Found", "Comments", "Audit Passed"]]
              ui.info "\n"
              NeetoCompliance::NeetoRepos.products.keys.each do |repo|
                ui.info("Checking bundle audit run results for #{repo}", print_to_audit_log: false)
                bundle_audit_result = Neetob::CLI::Github::BundleAudit.new([repo]).run
                vulnerabilities_found = "No"
                audit_passed = "No"
                comments = nil
                if bundle_audit_result && bundle_audit_result.include?("No vulnerabilities found")
                  audit_passed = "Yes"
                else
                  vulnerabilities_found = "Yes"
                  comments = bundle_audit_result.gsub("\n", "<br>")
                end
                repo_data << [repo, vulnerabilities_found, comments, audit_passed]
              end
              ui.print_table(repo_data)
            end
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
neetob-0.5.28 lib/neetob/cli/monthly_audit/security/code/bundle_audit.rb
neetob-0.5.27 lib/neetob/cli/monthly_audit/security/code/bundle_audit.rb
neetob-0.5.26 lib/neetob/cli/monthly_audit/security/code/bundle_audit.rb
neetob-0.5.25 lib/neetob/cli/monthly_audit/security/code/bundle_audit.rb
neetob-0.5.24 lib/neetob/cli/monthly_audit/security/code/bundle_audit.rb
neetob-0.5.23 lib/neetob/cli/monthly_audit/security/code/bundle_audit.rb
neetob-0.5.22 lib/neetob/cli/monthly_audit/security/code/bundle_audit.rb
neetob-0.5.21 lib/neetob/cli/monthly_audit/security/code/bundle_audit.rb
neetob-0.5.20 lib/neetob/cli/monthly_audit/security/code/bundle_audit.rb
neetob-0.5.19 lib/neetob/cli/monthly_audit/security/code/bundle_audit.rb
neetob-0.5.18 lib/neetob/cli/monthly_audit/security/code/bundle_audit.rb
neetob-0.5.17 lib/neetob/cli/monthly_audit/security/code/bundle_audit.rb