veracodecli 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/veracodecli/api.rb +7 -8
- data/lib/veracodecli/settings.rb +1 -1
- data/veracodecli-1.0.9.gem +0 -0
- data/veracodecli.gemspec +7 -6
- metadata +4 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47a755b1783a8f5003057b7eec2a7c730df092da
|
4
|
+
data.tar.gz: 9879f64e287e149bdc8f7eecbb52dde685506f40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bad75a2293677e42e44152c2a52079f0d85aeebddba63bdd877f992b3279a2cdc59884a2950f9fb69e173892e04d0eaa6c70654c6ceb04608b861880a92f565
|
7
|
+
data.tar.gz: 0d7937a40cd678398a984b50708bbed3286bb9d2fe0a598fa349c17e4c520990f9e2e68c56f10491328ddbc9b11cde1bfd45e839631641d17d6af791a17c57be
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.10
|
data/lib/veracodecli/api.rb
CHANGED
@@ -8,12 +8,13 @@ require_relative 'log'
|
|
8
8
|
module VeracodeApiBase
|
9
9
|
def veracode_api_request(api_call, api_version: '4.0', **params)
|
10
10
|
begin
|
11
|
-
response = RestClient.
|
11
|
+
response = RestClient.get "https://#{Settings.veracode_username}:#{Settings.veracode_password}@analysiscenter.veracode.com/api/#{api_version}/#{api_call}", { params: params }
|
12
12
|
log = ResponseLogger.new "/home/#{ENV['USER']/veracodecli_data}"
|
13
13
|
log.log api_call, response.code, response.body
|
14
14
|
rescue
|
15
15
|
abort '401: Unauthorized. Veracode API call Failed, please check your veracode credentials or whitelisted IPs'
|
16
16
|
end
|
17
|
+
if [500,501,502,503].any?{|code| response.code == code} then abort 'Internal server error.' end
|
17
18
|
response
|
18
19
|
end
|
19
20
|
|
@@ -25,7 +26,6 @@ module VeracodeApiBase
|
|
25
26
|
`git clone #{url} #{directory}`
|
26
27
|
end
|
27
28
|
`cd /tmp; zip -r sast_upload.zip sast_clone`
|
28
|
-
# `git archive --remote #{url} --format=tar -o #{directory}/sast_upload.tar master`
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -35,21 +35,20 @@ module VeracodeApiScan
|
|
35
35
|
def get_app_id(app_name)
|
36
36
|
app_list = veracode_api_request 'getapplist.do', include_user_info: 'true'
|
37
37
|
scan = app_list.body.scan(/app_id=\"(.+)\" app_name=\"#{app_name}\"/)
|
38
|
-
|
38
|
+
if scan.empty?
|
39
39
|
app_id = scan[0][0]
|
40
|
-
|
40
|
+
else
|
41
41
|
app_id = nil
|
42
42
|
end
|
43
|
-
app_id
|
44
43
|
end
|
45
44
|
|
46
45
|
def create_app_profile(app_name, business_criticality, business_unit, team)
|
47
46
|
create_app_response = veracode_api_request 'createapp.do', app_name: app_name, business_criticality: business_criticality, business_unit: business_unit, teams: team
|
48
|
-
|
49
|
-
if
|
47
|
+
scan = create_app_response.body.scan(/app_id=\"(.+)\" app_name=\"#{app_name}\"/)
|
48
|
+
if scan.empty?
|
50
49
|
fail 'createapp failed. Make sure you have supplied the correct parameters.'
|
51
50
|
else
|
52
|
-
app_id[0][0]
|
51
|
+
app_id = scan[0][0]
|
53
52
|
end
|
54
53
|
end
|
55
54
|
|
data/lib/veracodecli/settings.rb
CHANGED
@@ -14,7 +14,7 @@ class Settings < Settingslogic
|
|
14
14
|
|
15
15
|
load!
|
16
16
|
rescue Errno::ENOENT
|
17
|
-
Announce.failure "Unable to find a configuration at #{config_path}/veracodecli.
|
17
|
+
Announce.failure "Unable to find a configuration at #{config_path}/veracodecli.yaml"
|
18
18
|
exit
|
19
19
|
# InteractiveSetup.start
|
20
20
|
end
|
Binary file
|
data/veracodecli.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: veracodecli 1.0.
|
5
|
+
# stub: veracodecli 1.0.10 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "veracodecli"
|
9
|
-
s.version = "1.0.
|
9
|
+
s.version = "1.0.10"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["isaiah thiessen"]
|
14
|
-
s.date = "2015-11-
|
14
|
+
s.date = "2015-11-03"
|
15
15
|
s.description = "Ruby based CLI for accessing veracode's api"
|
16
16
|
s.email = "isaiah.thiessen@telus.com"
|
17
17
|
s.executables = ["veracodecli"]
|
@@ -31,19 +31,19 @@ Gem::Specification.new do |s|
|
|
31
31
|
"bin/veracodecli",
|
32
32
|
"lib/veracodecli.rb",
|
33
33
|
"lib/veracodecli/api.rb",
|
34
|
+
"lib/veracodecli/log.rb",
|
34
35
|
"lib/veracodecli/settings.rb",
|
35
36
|
"lib/veracodecli/slack.rb",
|
36
|
-
"lib/veracodecli/log.rb",
|
37
37
|
"test/API.rb",
|
38
38
|
"test/helper.rb",
|
39
39
|
"test/test_veracodecli.rb",
|
40
|
+
"veracodecli-1.0.9.gem",
|
40
41
|
"veracodecli.gemspec"
|
41
42
|
]
|
42
43
|
s.homepage = "http://github.com/isand3r/veracodecli"
|
43
44
|
s.licenses = ["MIT"]
|
44
|
-
s.rubygems_version = "2.4.
|
45
|
+
s.rubygems_version = "2.4.8"
|
45
46
|
s.summary = "Ruby based CLI for accessing veracode's api"
|
46
|
-
s.test_files = ["test/API.rb", "test/helper.rb", "test/test_veracodecli.rb"]
|
47
47
|
|
48
48
|
if s.respond_to? :specification_version then
|
49
49
|
s.specification_version = 4
|
@@ -99,3 +99,4 @@ Gem::Specification.new do |s|
|
|
99
99
|
s.add_dependency(%q<yard>, ["~> 0.7"])
|
100
100
|
end
|
101
101
|
end
|
102
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: veracodecli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- isaiah thiessen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -246,6 +246,7 @@ files:
|
|
246
246
|
- test/API.rb
|
247
247
|
- test/helper.rb
|
248
248
|
- test/test_veracodecli.rb
|
249
|
+
- veracodecli-1.0.9.gem
|
249
250
|
- veracodecli.gemspec
|
250
251
|
homepage: http://github.com/isand3r/veracodecli
|
251
252
|
licenses:
|
@@ -271,8 +272,4 @@ rubygems_version: 2.4.8
|
|
271
272
|
signing_key:
|
272
273
|
specification_version: 4
|
273
274
|
summary: Ruby based CLI for accessing veracode's api
|
274
|
-
test_files:
|
275
|
-
- test/API.rb
|
276
|
-
- test/helper.rb
|
277
|
-
- test/test_veracodecli.rb
|
278
|
-
has_rdoc:
|
275
|
+
test_files: []
|