Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 6 additions & 6 deletions lib/pipedawg/job/qualys/scan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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; ' \
Expand All @@ -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; ' \
Expand All @@ -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}")'
]
Expand Down
2 changes: 1 addition & 1 deletion lib/pipedawg/job/skopeo/copy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lib/pipedawg/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Pipedawg
VERSION = '1.0.1'
VERSION = '1.0.6'
end
9 changes: 4 additions & 5 deletions pipedawg.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down