qualys 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -2
- data/.rubocop.yml +7 -0
- data/.rubocop_todo.yml +71 -0
- data/.travis.yml +13 -1
- data/Gemfile +3 -1
- data/Gemfile.lock +91 -0
- data/README.md +50 -10
- data/Rakefile +3 -4
- data/lib/qualys.rb +10 -11
- data/lib/qualys/api.rb +38 -47
- data/lib/qualys/auth.rb +11 -20
- data/lib/qualys/compliance.rb +3 -7
- data/lib/qualys/config.rb +3 -5
- data/lib/qualys/host.rb +17 -0
- data/lib/qualys/report.rb +90 -0
- data/lib/qualys/scans.rb +10 -22
- data/lib/qualys/version.rb +1 -1
- data/lib/qualys/vulnerability.rb +74 -0
- data/qualys.gemspec +18 -19
- data/spec/fixtures/vcr_cassettes/api_get.yml +52 -0
- data/spec/fixtures/vcr_cassettes/create_global_report.yml +68 -0
- data/spec/fixtures/vcr_cassettes/emptyscans.yml +35 -0
- data/spec/fixtures/vcr_cassettes/get.yml +107 -0
- data/spec/fixtures/vcr_cassettes/global_report.yml +17800 -0
- data/spec/fixtures/vcr_cassettes/load_global_report.yml +625 -0
- data/spec/fixtures/vcr_cassettes/login.yml +50 -0
- data/spec/fixtures/vcr_cassettes/logout.yml +50 -0
- data/spec/fixtures/vcr_cassettes/scan.yml +73 -0
- data/spec/fixtures/vcr_cassettes/scans.yml +89 -0
- data/spec/fixtures/vcr_cassettes/templates.yml +121 -0
- data/spec/fixtures/vcr_cassettes/try_load_not_existing_report.yml +63 -0
- data/spec/fixtures/vcr_cassettes/unlogged.yml +45 -0
- data/spec/fixtures/vcr_cassettes/wrong.yml +101 -0
- data/spec/qualys/api_spec.rb +27 -0
- data/spec/qualys/report_spec.rb +65 -0
- data/spec/qualys/scans_spec.rb +75 -0
- data/spec/qualys/version_spec.rb +11 -0
- data/spec/qualys/vulnerability_spec.rb +53 -0
- data/spec/qualys_spec.rb +20 -0
- data/spec/spec_helper.rb +37 -0
- metadata +61 -15
- data/.rock.yml +0 -17
- data/lib/qualys/reports.rb +0 -47
data/.rock.yml
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
runtime: ruby21
|
2
|
-
build_gem: |
|
3
|
-
rm -rf *.gem
|
4
|
-
gem build qualys.gemspec
|
5
|
-
|
6
|
-
push_gem: exec gem push *.gem
|
7
|
-
|
8
|
-
gem: |
|
9
|
-
rm -rf *.gem
|
10
|
-
gem build qualys.gemspec
|
11
|
-
gem push *.gem
|
12
|
-
|
13
|
-
sublime: |
|
14
|
-
rock run bin/test.rb
|
15
|
-
|
16
|
-
todo: |
|
17
|
-
find bin lib spec -type f -exec grep -Hni --color "todo" {} \; > TODO
|
data/lib/qualys/reports.rb
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
module Qualys
|
2
|
-
class Reports < Api
|
3
|
-
|
4
|
-
def self.all
|
5
|
-
response = api_get("report/", { :query => { :action => 'list' }} )
|
6
|
-
puts response.parsed_response.inspect
|
7
|
-
unless response.parsed_response['SCAN_LIST_OUTPUT']['RESPONSE'].has_key? 'SCAN_LIST'
|
8
|
-
return []
|
9
|
-
end
|
10
|
-
|
11
|
-
#scanlist = response.parsed_response['SCAN_LIST_OUTPUT']['RESPONSE']['SCAN_LIST']['SCAN']
|
12
|
-
#scanlist.map!{|scan| Scan.new(scan)}
|
13
|
-
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.each
|
17
|
-
self.all
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
21
|
-
|
22
|
-
class Report
|
23
|
-
|
24
|
-
attr_accessor :ref, :title, :type, :date, :duration, :status, :target, :user
|
25
|
-
|
26
|
-
def initialize(scan)
|
27
|
-
@ref = scan['REF']
|
28
|
-
@title = scan['TITLE']
|
29
|
-
@type = scan['TYPE']
|
30
|
-
@date = scan['LAUNCH_DATETIME']
|
31
|
-
@duration = scan['DURATION']
|
32
|
-
@status = scan['STATUS']['STATE']
|
33
|
-
@target = scan['TARGET']
|
34
|
-
@user = scan['USER_LOGIN']
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
38
|
-
|
39
|
-
def finished?
|
40
|
-
if @status.eql? 'Finished'
|
41
|
-
return true
|
42
|
-
end
|
43
|
-
|
44
|
-
false
|
45
|
-
end
|
46
|
-
|
47
|
-
end
|