Class: Pipedawg::Job::Qualys::Scan

Inherits:
Pipedawg::Job::Qualys show all
Defined in:
lib/pipedawg/job/qualys/scan.rb

Overview

Pipedawg::Job::Qualys::Scan class

Instance Attribute Summary

Attributes inherited from Pipedawg::Job

#name, #opts

Instance Method Summary collapse

Methods inherited from Pipedawg::Job

#to_hash

Constructor Details

#initialize(name, opts = {}) ⇒ Scan

rubocop:disable Metrics/ClassLength



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/pipedawg/job/qualys/scan.rb', line 8

def initialize(name, opts = {})
  opts = {
    acceptable_risk: '${QUALYS_ACCEPTABLE_IMAGE_RISK}',
    artifacts: { expire_in: '1 month', paths: ['software.json', 'vulnerabilities.json'], when: 'always' },
    config: { auths: { '$CI_REGISTRY': { username: '$CI_REGISTRY_USER', password: '$CI_REGISTRY_PASSWORD' } } },
    gateway: '${QUALYS_GATEWAY}', image: nil, password: '${QUALYS_PASSWORD}',
    scan_image: '${QUALYS_IMAGE}', scan_target_prefix: 'qualys_scan_target',
    user: '${QUALYS_USERNAME}', variables: { GIT_STRATEGY: 'clone' }
  }.merge(opts)
  super name, opts
  update
end

Instance Method Details

#updateObject

rubocop:disable Metrics/AbcSize



21
22
23
24
25
26
# File 'lib/pipedawg/job/qualys/scan.rb', line 21

def update # rubocop:disable Metrics/AbcSize
  require 'json'
  opts[:script] =
    debug + config + image + clean_config + token + scan_start +
    scan_complete + artifacts + severities + outputs
end