diff --git a/README.md b/README.md index a6f519e..d4b31bf 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ To make this behaviour a default for all gem projects, the above line can be add ## Contributing -Bug reports and pull requests are welcome on [GitHub](https://github.com/liger1978/pipedawg). +Bug reports and pull requests are welcome on [GitHub](https://github.com/ValdrinLushaj/pipedawg). ## License diff --git a/lib/pipedawg/job/qualys/scan.rb b/lib/pipedawg/job/qualys/scan.rb index f1b0c54..bfe3bc2 100644 --- a/lib/pipedawg/job/qualys/scan.rb +++ b/lib/pipedawg/job/qualys/scan.rb @@ -50,7 +50,7 @@ def image "image_target=\"#{opts[:scan_target_prefix]}:$(echo #{opts[:scan_image]} | sed 's/^[^/]*\\///'| sed 's/[:/]/-/g')\"", # rubocop:disable Layout/LineLength "docker --config=\"${CONFIG}\" pull \"#{opts[:scan_image]}\"", "docker image tag \"#{opts[:scan_image]}\" \"${image_target}\"", - "image_id=$(docker inspect --format=\"{{index .Id}}\" \"#{opts[:scan_image]}\" | cut -c8-19)", + "image_id=$(docker inspect --format=\"{{index .Id}}\" \"#{opts[:scan_image]}\" | sed 's/sha256://')", 'echo "Image ID: ${image_id}"' ] end @@ -69,7 +69,7 @@ def token def scan_start [ 'while true; do ' \ - "result=$(curl -s -o /dev/null -w ''%{http_code}'' --location --request GET \"https://#{opts[:gateway]}/csapi/v1.2/images/$image_id\" --header \"Authorization: Bearer $token\"); " + # rubocop:disable Layout/LineLength, Style/FormatStringToken + "result=$(curl -s -o /dev/null -w ''%{http_code}'' --location --request GET \"https://#{opts[:gateway]}/csapi/v1.3/images/$image_id\" --header \"Authorization: Bearer $token\"); " + # rubocop:disable Layout/LineLength, Style/FormatStringToken 'echo "Waiting for scan to start..."; ' \ 'echo " Result: ${result}"; ' \ 'if [ "${result}" = "200" ]; then break; fi; ' \ @@ -80,7 +80,7 @@ def scan_start def scan_complete [ 'while true; do ' \ - "result=$(curl -s --location --request GET \"https://#{opts[:gateway]}/csapi/v1.2/images/$image_id\" --header \"Authorization: Bearer $token\" | jq -r '.scanStatus'); " + # rubocop:disable Layout/LineLength + "result=$(curl -s --location --request GET \"https://#{opts[:gateway]}/csapi/v1.3/images/$image_id\" --header \"Authorization: Bearer $token\" | jq -r '.scanStatus'); " + # rubocop:disable Layout/LineLength 'echo "Waiting for scan to complete..."; ' \ 'echo " Result: ${result}"; ' \ 'if [ "${result}" = "SUCCESS" ]; then break; fi; ' \ @@ -90,14 +90,14 @@ def scan_complete def artifacts [ - "curl -s --location --request GET \"https://#{opts[:gateway]}/csapi/v1.2/images/$image_id/software\" --header \"Authorization: Bearer $token\" | jq . > software.json", # rubocop:disable Layout/LineLength - "curl -s --location --request GET \"https://#{opts[:gateway]}/csapi/v1.2/images/$image_id/vuln\" --header \"Authorization: Bearer $token\" | jq . > vulnerabilities.json" # rubocop:disable Layout/LineLength + "curl -s --location --request GET \"https://#{opts[:gateway]}/csapi/v1.3/images/$image_id/software\" --header \"Authorization: Bearer $token\" | jq . > software.json", # rubocop:disable Layout/LineLength + "curl -s --location --request GET \"https://#{opts[:gateway]}/csapi/v1.3/images/$image_id/vuln\" --header \"Authorization: Bearer $token\" | jq . > vulnerabilities.json" # rubocop:disable Layout/LineLength ] end def severities [ - "response=$(curl -s --location --request GET \"https://#{opts[:gateway]}/csapi/v1.2/images/$image_id/vuln/count\" --header \"Authorization: Bearer $token\")", # rubocop:disable Layout/LineLength + "response=$(curl -s --location --request GET \"https://#{opts[:gateway]}/csapi/v1.3/images/$image_id/vuln/count\" --header \"Authorization: Bearer $token\")", # rubocop:disable Layout/LineLength 'severity5=$(jq -r ".severity5Count" <<< "${response}")', 'severity4=$(jq -r ".severity4Count" <<< "${response}")' ] diff --git a/lib/pipedawg/job/skopeo/copy.rb b/lib/pipedawg/job/skopeo/copy.rb index 29d36bd..098a7bb 100644 --- a/lib/pipedawg/job/skopeo/copy.rb +++ b/lib/pipedawg/job/skopeo/copy.rb @@ -37,7 +37,7 @@ def cert_copies def login opts.fetch(:logins, {}).map do |k, v| - "echo \"#{v['password']}\" | #{opts[:command]} login --authfile \"${CONFIG}/config.json\" --username \"#{v['username']}\" --password-stdin \"#{k}\"" # rubocop:disable Layout/LineLength + "echo \"#{v['password']}\" | #{opts[:command]} login --authfile \"${CONFIG}/config.json\" --username \"#{v['username']}\" --password-stdin \"#{k}\" || echo \"Failed to login\"" # rubocop:disable Layout/LineLength end end diff --git a/lib/pipedawg/version.rb b/lib/pipedawg/version.rb index 53f3f6e..7de72fa 100644 --- a/lib/pipedawg/version.rb +++ b/lib/pipedawg/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Pipedawg - VERSION = '1.0.1' + VERSION = '1.0.6' end diff --git a/pipedawg.gemspec b/pipedawg.gemspec index 3cbe6c0..7509756 100644 --- a/pipedawg.gemspec +++ b/pipedawg.gemspec @@ -3,19 +3,18 @@ require_relative 'lib/pipedawg/version' Gem::Specification.new do |spec| - spec.name = 'pipedawg' + spec.name = 'pipedawg-vl' spec.version = Pipedawg::VERSION spec.authors = ['harbottle'] spec.email = ['harbottle@room3d3.com'] spec.summary = 'Generate GitLab CI pipelines.' spec.description = 'Generate GitLab CI pipelines.' - spec.homepage = 'https://github.com/liger1978/pipedawg' - spec.license = 'MIT' + spec.homepage = 'https://github.com/ValdrinLushaj/pipedawg' spec.metadata['homepage_uri'] = spec.homepage - spec.metadata['source_code_uri'] = 'https://github.com/liger1978/pipedawg' - spec.metadata['changelog_uri'] = 'https://github.com/liger1978/pipedawg' + spec.metadata['source_code_uri'] = 'https://github.com/ValdrinLushaj/pipedawg' + spec.metadata['changelog_uri'] = 'https://github.com/ValdrinLushaj/pipedawg' # Specify which files should be added to the gem when it is released. # The `git ls-files -z` loads the files in the RubyGem that have been added into git.