nexpose-functions 0.0.4 → 0.0.5
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.
- data/doc/Nexpose/Connection.html +200 -10
- data/doc/Nexpose/Site.html +18 -18
- data/doc/_index.html +1 -1
- data/doc/index.html +1 -1
- data/doc/method_list.html +12 -0
- data/doc/top-level-namespace.html +1 -1
- data/lib/nexpose-functions.rb +23 -0
- metadata +2 -2
data/doc/Nexpose/Connection.html
CHANGED
@@ -135,6 +135,56 @@
|
|
135
135
|
<p>Get an Asset object for the specified host IP.</p>
|
136
136
|
</div></span>
|
137
137
|
|
138
|
+
</li>
|
139
|
+
|
140
|
+
|
141
|
+
<li class="public ">
|
142
|
+
<span class="summary_signature">
|
143
|
+
|
144
|
+
<a href="#getScanTemplatesbyId-instance_method" title="#getScanTemplatesbyId (instance method)">- (Hash) <strong>getScanTemplatesbyId</strong> </a>
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
</span>
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
<span class="summary_desc"><div class='inline'>
|
159
|
+
<p>Get a Hash object containing pairs of scan template names/ids where the
|
160
|
+
Hash key is the scan template id.</p>
|
161
|
+
</div></span>
|
162
|
+
|
163
|
+
</li>
|
164
|
+
|
165
|
+
|
166
|
+
<li class="public ">
|
167
|
+
<span class="summary_signature">
|
168
|
+
|
169
|
+
<a href="#getScanTemplatesbyName-instance_method" title="#getScanTemplatesbyName (instance method)">- (Hash) <strong>getScanTemplatesbyName</strong> </a>
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
</span>
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
<span class="summary_desc"><div class='inline'>
|
184
|
+
<p>Get a Hash object containing pairs of scan template names/ids where the
|
185
|
+
Hash key is the scan template name.</p>
|
186
|
+
</div></span>
|
187
|
+
|
138
188
|
</li>
|
139
189
|
|
140
190
|
|
@@ -358,15 +408,153 @@ days.</p>
|
|
358
408
|
<pre class="lines">
|
359
409
|
|
360
410
|
|
411
|
+
111
|
412
|
+
112
|
413
|
+
113</pre>
|
414
|
+
</td>
|
415
|
+
<td>
|
416
|
+
<pre class="code"><span class="info file"># File 'lib\nexpose-functions.rb', line 111</span>
|
417
|
+
|
418
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_getAsset'>getAsset</span><span class='lparen'>(</span><span class='id identifier rubyid_host'>host</span><span class='rparen'>)</span>
|
419
|
+
<span class='kw'>return</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_filter'>filter</span><span class='lparen'>(</span><span class='const'>Nexpose</span><span class='op'>::</span><span class='const'>Search</span><span class='op'>::</span><span class='const'>Field</span><span class='op'>::</span><span class='const'>ASSET</span><span class='comma'>,</span> <span class='const'>Nexpose</span><span class='op'>::</span><span class='const'>Search</span><span class='op'>::</span><span class='const'>Operator</span><span class='op'>::</span><span class='const'>IS</span><span class='comma'>,</span> <span class='id identifier rubyid_host'>host</span><span class='rparen'>)</span>
|
420
|
+
<span class='kw'>end</span></pre>
|
421
|
+
</td>
|
422
|
+
</tr>
|
423
|
+
</table>
|
424
|
+
</div>
|
425
|
+
|
426
|
+
<div class="method_details ">
|
427
|
+
<h3 class="signature " id="getScanTemplatesbyId-instance_method">
|
428
|
+
|
429
|
+
- (<tt>Hash</tt>) <strong>getScanTemplatesbyId</strong>
|
430
|
+
|
431
|
+
|
432
|
+
|
433
|
+
|
434
|
+
|
435
|
+
</h3><div class="docstring">
|
436
|
+
<div class="discussion">
|
437
|
+
|
438
|
+
<p>Get a Hash object containing pairs of scan template names/ids where the
|
439
|
+
Hash key is the scan template id.</p>
|
440
|
+
|
441
|
+
|
442
|
+
</div>
|
443
|
+
</div>
|
444
|
+
<div class="tags">
|
445
|
+
|
446
|
+
<p class="tag_title">Returns:</p>
|
447
|
+
<ul class="return">
|
448
|
+
|
449
|
+
<li>
|
450
|
+
|
451
|
+
|
452
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
453
|
+
|
454
|
+
|
455
|
+
|
456
|
+
—
|
457
|
+
<div class='inline'>
|
458
|
+
<p>object with scan template ids as the keys and scan template names as the
|
459
|
+
values.</p>
|
460
|
+
</div>
|
461
|
+
|
462
|
+
</li>
|
463
|
+
|
464
|
+
</ul>
|
465
|
+
|
466
|
+
</div><table class="source_code">
|
467
|
+
<tr>
|
468
|
+
<td>
|
469
|
+
<pre class="lines">
|
470
|
+
|
471
|
+
|
361
472
|
88
|
362
473
|
89
|
363
|
-
90
|
474
|
+
90
|
475
|
+
91
|
476
|
+
92
|
477
|
+
93
|
478
|
+
94</pre>
|
364
479
|
</td>
|
365
480
|
<td>
|
366
481
|
<pre class="code"><span class="info file"># File 'lib\nexpose-functions.rb', line 88</span>
|
367
482
|
|
368
|
-
<span class='kw'>def</span> <span class='id identifier
|
369
|
-
<span class='
|
483
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_getScanTemplatesbyId'>getScanTemplatesbyId</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
484
|
+
<span class='id identifier rubyid_templateinfo'>templateinfo</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
485
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_list_scan_templates'>list_scan_templates</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_template'>template</span><span class='op'>|</span>
|
486
|
+
<span class='id identifier rubyid_templateinfo'>templateinfo</span><span class='lbracket'>[</span><span class='id identifier rubyid_template'>template</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_template'>template</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span>
|
487
|
+
<span class='rbrace'>}</span>
|
488
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_templateinfo'>templateinfo</span>
|
489
|
+
<span class='kw'>end</span></pre>
|
490
|
+
</td>
|
491
|
+
</tr>
|
492
|
+
</table>
|
493
|
+
</div>
|
494
|
+
|
495
|
+
<div class="method_details ">
|
496
|
+
<h3 class="signature " id="getScanTemplatesbyName-instance_method">
|
497
|
+
|
498
|
+
- (<tt>Hash</tt>) <strong>getScanTemplatesbyName</strong>
|
499
|
+
|
500
|
+
|
501
|
+
|
502
|
+
|
503
|
+
|
504
|
+
</h3><div class="docstring">
|
505
|
+
<div class="discussion">
|
506
|
+
|
507
|
+
<p>Get a Hash object containing pairs of scan template names/ids where the
|
508
|
+
Hash key is the scan template name.</p>
|
509
|
+
|
510
|
+
|
511
|
+
</div>
|
512
|
+
</div>
|
513
|
+
<div class="tags">
|
514
|
+
|
515
|
+
<p class="tag_title">Returns:</p>
|
516
|
+
<ul class="return">
|
517
|
+
|
518
|
+
<li>
|
519
|
+
|
520
|
+
|
521
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
522
|
+
|
523
|
+
|
524
|
+
|
525
|
+
—
|
526
|
+
<div class='inline'>
|
527
|
+
<p>object with scan template names as the keys and scan template ids as the
|
528
|
+
values.</p>
|
529
|
+
</div>
|
530
|
+
|
531
|
+
</li>
|
532
|
+
|
533
|
+
</ul>
|
534
|
+
|
535
|
+
</div><table class="source_code">
|
536
|
+
<tr>
|
537
|
+
<td>
|
538
|
+
<pre class="lines">
|
539
|
+
|
540
|
+
|
541
|
+
99
|
542
|
+
100
|
543
|
+
101
|
544
|
+
102
|
545
|
+
103
|
546
|
+
104
|
547
|
+
105</pre>
|
548
|
+
</td>
|
549
|
+
<td>
|
550
|
+
<pre class="code"><span class="info file"># File 'lib\nexpose-functions.rb', line 99</span>
|
551
|
+
|
552
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_getScanTemplatesbyName'>getScanTemplatesbyName</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
553
|
+
<span class='id identifier rubyid_templateinfo'>templateinfo</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
554
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_list_scan_templates'>list_scan_templates</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_template'>template</span><span class='op'>|</span>
|
555
|
+
<span class='id identifier rubyid_templateinfo'>templateinfo</span><span class='lbracket'>[</span><span class='id identifier rubyid_template'>template</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_template'>template</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
|
556
|
+
<span class='rbrace'>}</span>
|
557
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_templateinfo'>templateinfo</span>
|
370
558
|
<span class='kw'>end</span></pre>
|
371
559
|
</td>
|
372
560
|
</tr>
|
@@ -491,7 +679,8 @@ the site name.</p>
|
|
491
679
|
79
|
492
680
|
80
|
493
681
|
81
|
494
|
-
82
|
682
|
+
82
|
683
|
+
83</pre>
|
495
684
|
</td>
|
496
685
|
<td>
|
497
686
|
<pre class="code"><span class="info file"># File 'lib\nexpose-functions.rb', line 77</span>
|
@@ -499,8 +688,9 @@ the site name.</p>
|
|
499
688
|
<span class='kw'>def</span> <span class='id identifier rubyid_getSitesInfobyName'>getSitesInfobyName</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
500
689
|
<span class='id identifier rubyid_sitesinfo'>sitesinfo</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
501
690
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_list_sites'>list_sites</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_site'>site</span><span class='op'>|</span>
|
502
|
-
<span class='id identifier rubyid_sitesinfo'>sitesinfo</span><span class='lbracket'>[</span><span class='id identifier rubyid_site'>site</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier
|
691
|
+
<span class='id identifier rubyid_sitesinfo'>sitesinfo</span><span class='lbracket'>[</span><span class='id identifier rubyid_site'>site</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_site'>site</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
|
503
692
|
<span class='rbrace'>}</span>
|
693
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_sitesinfo'>sitesinfo</span>
|
504
694
|
<span class='kw'>end</span></pre>
|
505
695
|
</td>
|
506
696
|
</tr>
|
@@ -572,12 +762,12 @@ days.</p>
|
|
572
762
|
<pre class="lines">
|
573
763
|
|
574
764
|
|
575
|
-
|
576
|
-
|
577
|
-
|
765
|
+
119
|
766
|
+
120
|
767
|
+
121</pre>
|
578
768
|
</td>
|
579
769
|
<td>
|
580
|
-
<pre class="code"><span class="info file"># File 'lib\nexpose-functions.rb', line
|
770
|
+
<pre class="code"><span class="info file"># File 'lib\nexpose-functions.rb', line 119</span>
|
581
771
|
|
582
772
|
<span class='kw'>def</span> <span class='id identifier rubyid_notScannedSince'>notScannedSince</span><span class='lparen'>(</span><span class='id identifier rubyid_days'>days</span><span class='rparen'>)</span>
|
583
773
|
<span class='kw'>return</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_filter'>filter</span><span class='lparen'>(</span><span class='const'>Nexpose</span><span class='op'>::</span><span class='const'>Search</span><span class='op'>::</span><span class='const'>Field</span><span class='op'>::</span><span class='const'>SCAN_DATE</span><span class='comma'>,</span> <span class='const'>Nexpose</span><span class='op'>::</span><span class='const'>Search</span><span class='op'>::</span><span class='const'>Operator</span><span class='op'>::</span><span class='const'>EARLIER_THAN</span><span class='comma'>,</span> <span class='id identifier rubyid_days'>days</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='rparen'>)</span>
|
@@ -857,7 +1047,7 @@ days.</p>
|
|
857
1047
|
</div>
|
858
1048
|
|
859
1049
|
<div id="footer">
|
860
|
-
Generated on
|
1050
|
+
Generated on Fri Dec 5 14:41:35 2014 by
|
861
1051
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
862
1052
|
0.8.7.6 (ruby-1.9.3).
|
863
1053
|
</div>
|
data/doc/Nexpose/Site.html
CHANGED
@@ -209,25 +209,25 @@
|
|
209
209
|
<pre class="lines">
|
210
210
|
|
211
211
|
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
212
|
+
130
|
213
|
+
131
|
214
|
+
132
|
215
|
+
133
|
216
|
+
134
|
217
|
+
135
|
218
|
+
136
|
219
|
+
137
|
220
|
+
138
|
221
|
+
139
|
222
|
+
140
|
223
|
+
141
|
224
|
+
142
|
225
|
+
143
|
226
|
+
144
|
227
|
+
145</pre>
|
228
228
|
</td>
|
229
229
|
<td>
|
230
|
-
<pre class="code"><span class="info file"># File 'lib\nexpose-functions.rb', line
|
230
|
+
<pre class="code"><span class="info file"># File 'lib\nexpose-functions.rb', line 130</span>
|
231
231
|
|
232
232
|
<span class='kw'>def</span> <span class='id identifier rubyid_load_csv_hostnames'>load_csv_hostnames</span><span class='lparen'>(</span><span class='id identifier rubyid_nsc'>nsc</span><span class='comma'>,</span> <span class='id identifier rubyid_csvfile'>csvfile</span><span class='rparen'>)</span>
|
233
233
|
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Loading site...</span><span class='tstring_end'>"</span></span>
|
@@ -255,7 +255,7 @@
|
|
255
255
|
</div>
|
256
256
|
|
257
257
|
<div id="footer">
|
258
|
-
Generated on
|
258
|
+
Generated on Fri Dec 5 14:41:35 2014 by
|
259
259
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
260
260
|
0.8.7.6 (ruby-1.9.3).
|
261
261
|
</div>
|
data/doc/_index.html
CHANGED
@@ -111,7 +111,7 @@
|
|
111
111
|
</div>
|
112
112
|
|
113
113
|
<div id="footer">
|
114
|
-
Generated on
|
114
|
+
Generated on Fri Dec 5 14:41:35 2014 by
|
115
115
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
116
116
|
0.8.7.6 (ruby-1.9.3).
|
117
117
|
</div>
|
data/doc/index.html
CHANGED
@@ -111,7 +111,7 @@
|
|
111
111
|
</div>
|
112
112
|
|
113
113
|
<div id="footer">
|
114
|
-
Generated on
|
114
|
+
Generated on Fri Dec 5 14:41:35 2014 by
|
115
115
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
116
116
|
0.8.7.6 (ruby-1.9.3).
|
117
117
|
</div>
|
data/doc/method_list.html
CHANGED
@@ -63,6 +63,18 @@
|
|
63
63
|
</li>
|
64
64
|
|
65
65
|
|
66
|
+
<li class="r1 ">
|
67
|
+
<span class='object_link'><a href="Nexpose/Connection.html#getScanTemplatesbyId-instance_method" title="Nexpose::Connection#getScanTemplatesbyId (method)">#getScanTemplatesbyId</a></span>
|
68
|
+
<small>Nexpose::Connection</small>
|
69
|
+
</li>
|
70
|
+
|
71
|
+
|
72
|
+
<li class="r2 ">
|
73
|
+
<span class='object_link'><a href="Nexpose/Connection.html#getScanTemplatesbyName-instance_method" title="Nexpose::Connection#getScanTemplatesbyName (method)">#getScanTemplatesbyName</a></span>
|
74
|
+
<small>Nexpose::Connection</small>
|
75
|
+
</li>
|
76
|
+
|
77
|
+
|
66
78
|
<li class="r1 ">
|
67
79
|
<span class='object_link'><a href="Nexpose/Connection.html#getSitesInfobyId-instance_method" title="Nexpose::Connection#getSitesInfobyId (method)">#getSitesInfobyId</a></span>
|
68
80
|
<small>Nexpose::Connection</small>
|
@@ -235,7 +235,7 @@
|
|
235
235
|
</div>
|
236
236
|
|
237
237
|
<div id="footer">
|
238
|
-
Generated on
|
238
|
+
Generated on Fri Dec 5 14:41:35 2014 by
|
239
239
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
240
240
|
0.8.7.6 (ruby-1.9.3).
|
241
241
|
</div>
|
data/lib/nexpose-functions.rb
CHANGED
@@ -79,6 +79,29 @@ class Nexpose::Connection
|
|
79
79
|
self.list_sites.each { |site|
|
80
80
|
sitesinfo[site.name] = site.id
|
81
81
|
}
|
82
|
+
return sitesinfo
|
83
|
+
end
|
84
|
+
|
85
|
+
# Get a Hash object containing pairs of scan template names/ids where the Hash key is the scan template id.
|
86
|
+
#
|
87
|
+
# @return [Hash] object with scan template ids as the keys and scan template names as the values.
|
88
|
+
def getScanTemplatesbyId()
|
89
|
+
templateinfo = {}
|
90
|
+
self.list_scan_templates.each { |template|
|
91
|
+
templateinfo[template.id] = template.name
|
92
|
+
}
|
93
|
+
return templateinfo
|
94
|
+
end
|
95
|
+
|
96
|
+
# Get a Hash object containing pairs of scan template names/ids where the Hash key is the scan template name.
|
97
|
+
#
|
98
|
+
# @return [Hash] object with scan template names as the keys and scan template ids as the values.
|
99
|
+
def getScanTemplatesbyName()
|
100
|
+
templateinfo = {}
|
101
|
+
self.list_scan_templates.each { |template|
|
102
|
+
templateinfo[template.name] = template.id
|
103
|
+
}
|
104
|
+
return templateinfo
|
82
105
|
end
|
83
106
|
|
84
107
|
# Get an Asset object for the specified host IP.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nexpose-functions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-12-
|
12
|
+
date: 2014-12-05 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Additional useful functions for use with the Nexpose API.
|
15
15
|
email:
|