Module: Vulnerability::AffectedFiles

Defined in:
lib/puppet_x/vulnerability/implementation/affected_files.rb

Overview

Implementation of puppet function vulnerability::affected_files

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



9
10
11
12
13
14
# File 'lib/puppet_x/vulnerability/implementation/affected_files.rb', line 9

def self.included(base)
  base.dispatch :affected_files do
    param       'String[1]', :vulnerability_id
    return_type 'Array[Stdlib::Absolutepath]'
  end
end

Instance Method Details

#affected_files(vulnerability_id) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/puppet_x/vulnerability/implementation/affected_files.rb', line 16

def affected_files(vulnerability_id)
  return [] unless closure_scope.include?('cve_list')

  value = closure_scope['cve_list']&.dig(vulnerability_id, 'locations')
  value ||= []
  value
end