Sha256: 77b9ad570f545944b02aef9933ef2ca766e1eb1b860aa4bf66aa4f1bf43cd0ff

Contents?: true

Size: 629 Bytes

Versions: 1

Compression:

Stored size: 629 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require 'dccscr/whitelist'

wl = DCCSCR::Whitelist.new

ARGV.each { |arg| wl[arg] }

local_list = begin
  YAML.safe_load(File.read('vulnerability-allowlist.yml'))
rescue Errno::ENOENT
  warn $!.message
  {}
end

dccscr_list = {
  'generalallowlist' => Hash[
    wl.entries.map { |_, entry|
      entry.value['whitelisted_vulnerabilities'].map { |v|
        [v['vulnerability'], "dccscr-whitelists:\n#{v['justification']}"]
      }
    }.flatten(1).sort
  ]
}

puts dccscr_list.merge(local_list) { |_, dl, ll|
  case dl
  when Hash
    dl.merge(ll)
  else
    ll
  end
}.to_yaml

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dccscr-0.1.0 exe/dccscr_to_gitlab