Class: DCCSCR::Whitelist::UpdateAllowlistWithDCCSCR
- Inherits:
-
Object
- Object
- DCCSCR::Whitelist::UpdateAllowlistWithDCCSCR
- Defined in:
- lib/dccscr/whitelist/update_allowlist_with_dccscr.rb
Overview
Service class to update a GitLab vulnerability-allowlist.yml with whitelisted_vulnerabilities from the dccscr-whitelist for a set of images.
Instance Attribute Summary collapse
-
#allow_filename ⇒ Object
readonly
Returns the value of attribute allow_filename.
-
#images ⇒ Object
readonly
Returns the value of attribute images.
-
#local_filename ⇒ Object
readonly
Returns the value of attribute local_filename.
Instance Method Summary collapse
-
#initialize(images: [], allow_filename: nil, local_filename: nil) ⇒ UpdateAllowlistWithDCCSCR
constructor
A new instance of UpdateAllowlistWithDCCSCR.
- #run ⇒ Object
- #whitelist ⇒ Object
Constructor Details
#initialize(images: [], allow_filename: nil, local_filename: nil) ⇒ UpdateAllowlistWithDCCSCR
Returns a new instance of UpdateAllowlistWithDCCSCR.
13 14 15 16 17 |
# File 'lib/dccscr/whitelist/update_allowlist_with_dccscr.rb', line 13 def initialize(images: [], allow_filename: nil, local_filename: nil) @images = images @allow_filename = allow_filename || 'vulnerability-allowlist.yml' @local_filename = local_filename || 'local-vulnerability-allowlist.yml' end |
Instance Attribute Details
#allow_filename ⇒ Object (readonly)
Returns the value of attribute allow_filename.
11 12 13 |
# File 'lib/dccscr/whitelist/update_allowlist_with_dccscr.rb', line 11 def allow_filename @allow_filename end |
#images ⇒ Object (readonly)
Returns the value of attribute images.
11 12 13 |
# File 'lib/dccscr/whitelist/update_allowlist_with_dccscr.rb', line 11 def images @images end |
#local_filename ⇒ Object (readonly)
Returns the value of attribute local_filename.
11 12 13 |
# File 'lib/dccscr/whitelist/update_allowlist_with_dccscr.rb', line 11 def local_filename @local_filename end |
Instance Method Details
#run ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/dccscr/whitelist/update_allowlist_with_dccscr.rb', line 23 def run ll = load_gitlab_allowlist wl = load_dccscr_whitelist dl = allow_list_dccscr(wl) cl = combined_list(dl, ll) update_allow_list_file(cl) end |