-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqAPI.psm1
539 lines (449 loc) · 39.3 KB
/
qAPI.psm1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
# This module is designed to interface with the Qualsy API for ticketing and provide the user with the ability to manage remediation.
# REQUIRES -Version 3.0
#defaults - set these below
#
#$cred = "yourAPI_CREDS"
#$server = "qualysapi.qualys.com"
# be sure to read code for environment specific configurable variables
function Write-Log {
Param ([Parameter(Mandatory=$True)][string]$filePath,
[Parameter(Mandatory=$True)][string]$outPut)
$timeStamp = Get-Date -UFormat "%Y%m%d-%H%M%S"
$user = $env:USERNAME
$outPut = $user + " " + $timeStamp + " " + $outPut
$outPut |Out-File -FilePath $filePath -Append
}
function Get-qAPI {
<#
.SYNOPSIS
This cmdlet establishes the connectionto the Qualys API
.DESCRIPTION
Connects to the Qualys api and handles passing parameters to the correct api endpoint
.NOTES
File Name : qAPI.psm1
Author : johnny_DEP
Prerequisite : PowerShell V3
.EXAMPLE
Get-qAPI -api_endpoint "ticket_list.php" -TicketNumbers "123"
#>
# ticket API parameters
Param ([string]$api_endpoint,
#[ValidateCount(1,1000)]
[string[]]$TicketNumbers,
[string]$SinceTicketNumber,
[string]$UntilTicketNumber,
[string]$TicketAssignee,
#[ValidateSet("0","1")]
[string]$Overdue,
#[ValidateSet("0","1")]
[string]$Invalid,
#[ValidateSet("OPEN","RESOLVED","CLOSED","IGNORED")]
[string[]]$States,
[string]$ModifiedSinceDateTime,
[string]$UnModifiedSinceDateTime,
[string[]]$IPs,
[string[]]$AssetGroups,
#[ValidateLength(1,100)]
[string]$DNSContains,
#[ValidateLength(1,100)]
[string]$NetbiosContains,
#[ValidateSet("1","2","3","4","5")]
[string[]]$VulnSevereties,
#[ValidateSet("1","2","3","4","5")]
[string[]]$PotVulnSevereties,
#[ValidateCount(1,10)]
[string[]]$QIDs,
#[ValidateLength(1,100)]
[string]$VulnTitleContains,
#[ValidateLength(1,100)]
[string]$VulnDetailsContains,
#[ValidateLength(1,100)]
[string]$VendorRefContains,
[string]$ChangeAssignee,
#[ValidateSet("OPEN","RESOLVED","IGNORED")]
[string]$ChangeState,
#[ValidateLength(1,2000)]
[string]$AddComment,
#[ValidateSet("0","1")]
[string]$show_vuln_details
)
#defaults
$cred = "yourAPI_CREDS"
$server = "qualysapi.qualys.com"
#build api params
# Set the parameters to be passed to the function if they are specified as script parameters.
### Ticket Selection parameters ###
If ($ticketNumbers -ne $null) { $paramTicketNumbers = "&ticket_numbers="+($ticketNumbers -join ",") }
If ($sinceTicketNumber -ne "") { $paramSinceTicketNumber = "&since_ticket_number="+$sinceTicketNumber }
If ($untilticketNumber -ne "") { $paramUntilticketNumber = "&since_ticket_number="+$untilticketNumber }
If ($overdue -ne "") { $paramOverdue = "&overdue="+$overdue }
If ($invalid -ne "") { $paramInvalid = "&overdue="+$invalid }
If ($ticketAssignee -ne "") { $paramAssignee = "&ticket_assignee="+$ticketAssignee }
If ($states -ne $null) { $paramStates = "&states="+($states -join ",") }
If ($modifiedSinceDateTime -ne "") { $parammodifiedSinceDateTime = "&modified_since_datetime="+$modifiedSinceDateTime }
If ($unmodifiedSinceDateTime -ne "") { $paramUnmodifiedSinceDateTime = "&unmodified_since_datetime="+$unmodifiedSinceDateTime }
If ($ips -ne $null) { $paramIps = "&ips="+($ips -join ",") }
If ($assetGroups -ne $null) { $paramAssetGroups = "&asset_groups="+($assetGroups -join ",") }
If ($dnsContains -ne "") { $paramDnsContains = "&dns_contains="+$dnsContains }
If ($netbiosContains -ne "") { $paramNetbiosContains = "&netbios_contains="+$netbiosContains }
If ($vulnSevereties -ne $null) { $paramVulnSevereties = "&vuln_severities="+($vulnSevereties -join ",") }
If ($potVulnSevereties -ne $null) { $paramPotVulnSevereties = "&potential_vuln_severities="+($potVulnSevereties -join ",") }
If ($qids -ne $null) { $paramQids = "&qids="+($qids -join ",") }
If ($vulnTitleContains -ne "") { $paramVulnTitleContains = "&vuln_title_contains="+$vulnTitleContains }
If ($vulnDetailsContains -ne "") { $paramVulnDetailsContains = "&vuln_details_contains="+$vulnDetailsContains }
If ($vendorRefContains -ne "") { $paramVendorRefContains = "&vendor_ref_contains="+$vendorRefContains }
### Ticket Action parameters ###
If ($changeAssignee -ne "") { $paramChangeAssignee = "&change_assignee="+$changeAssignee }
If ($changeState -ne "") { $paramChangeState = "&change_state="+$changeState }
If ($addComment -ne "") { $paramAddComment = "&add_comment="+$addComment }
### List ticket specific params ###
If ($show_vuln_details -ne "") {$paramshow_vuln_details = "&show_vuln_details="+$show_vuln_details}
$api_params = $api_endpoint + $paramTicketNumbers+$paramSinceTicketNumber+$paramUntilticketNumber+$paramOverdue+$paramInvalid+$parammodifiedSinceDateTime+$paramUnmodifiedSinceDateTime+$paramIps+$paramAssignee+$paramStates+$paramAssetGroups+$paramDnsContains+$paramNetbiosContains+$paramVulnSevereties+$paramPotVulnSevereties+$paramQids+$paramVulnTitleContains+$paramVulnDetailsContains+$paramVendorRefContains+$paramChangeAssignee+$paramChangeState+$paramAddComment +$paramshow_vuln_details
#For Debug show what is being passed - start log
$log_path = "\\somenetworkstorage\Vulnerability Management\Logs\"
$log_file = $timeStamp = Get-Date -UFormat "%Y%m%d"
$log_file += ".log"
$log_path += $log_file
Write-Host "Logging API connections to:" $log_path
Write-Log -filePath $log_path -outPut "--connected to Qualys API--"
$log_out = " passing these params " + $api_params + "`n https://$server/msp/$api_params"
Write-Log -filePath $log_path -outPut $log_out
if ($api_params -ne $null){
#build web request
$r = Invoke-WebRequest -URI "https://$server/msp/$api_params" -Credential $cred
#return web content
$r.content
}
else {
Write-Log -filePath $log_path -outPut "Parameters cannot be null"
}
}
function List-qTickets {
<#
.SYNOPSIS
Cmdlet to list current tickets
.DESCRIPTION
Makes call to api with specific parameters to list tickets that match the query.
.NOTES
File Name : qAPI.psm1
Author : johnny_dep
Prerequisite : PowerShell V3
.SYNTAX
.EXAMPLE
List-qTickets -State "OPEN"
#>
Param (
#[ValidateCount(1,1000)]
[string[]]$TicketNumbers,
[string]$SinceTicketNumber,
[string]$UntilTicketNumber,
[string]$TicketAssignee,
#[ValidateSet("0","1")]
[string]$Overdue,
#[ValidateSet("0","1")]
[string]$Invalid,
#[ValidateSet("OPEN","RESOLVED","CLOSED","IGNORED")]
[string[]]$States,
[string]$ModifiedSinceDateTime,
[string]$UnModifiedSinceDateTime,
[string[]]$IPs,
[string[]]$AssetGroups,
#[ValidateLength(1,100)]
[string]$DNSContains,
#[ValidateLength(1,100)]
[string]$NetbiosContains,
#[ValidateSet("1","2","3","4","5")]
[string[]]$VulnSevereties,
#[ValidateSet("1","2","3","4","5")]
[string[]]$PotVulnSevereties,
#[ValidateCount(1,10)]
[string[]]$QIDs,
#[ValidateLength(1,100)]
[string]$VulnTitleContains,
#[ValidateLength(1,100)]
[string]$VulnDetailsContains,
#[ValidateLength(1,100)]
[string]$VendorRefContains,
#[ValidateSet("0","1")]
[string]$show_vuln_details
)
#setup logging
$log_path = "\\somenetworkstorage\Vulnerability Management\Logs\"
$log_file = $timeStamp = Get-Date -UFormat "%Y%m%d"
$log_file += ".log"
$log_path += $log_file
#list specific api endpoint
$api_endpoint = "ticket_list.php?"
#make web call
Get-qAPI -api_endpoint $api_endpoint -TicketNumbers $TicketNumbers -SinceTicketNumber $SinceTicketNumber -UntilTicketNumber $UntilTicketNumber -TicketAssignee $TicketAssignee -Overdue $Overdue -Invalid $Invalid -States $States -ModifiedSinceDateTime $ModifiedSinceDateTime -IPs $IPs -AssetGroups $AssetGroups -DNSContains $DNSContains -NetbiosContains $NetbiosContains -VulnSevereties $VulnSevereties -PotVulnSevereties $PotVulnSevereties -QIDs $QIDs -VulnTitleContains $VulnTitleContains -VulnDetailsContains $VulnDetailsContains -VendorRefContains $VendorRefContains -show_vuln_details $show_vuln_details
}
function Set-qTickets {
<#
.SYNOPSIS
Change state of current ticket that matches critieria.
.DESCRIPTION
Invoke this cmdlet with specific parameters to edit the owner/status of a ticket within qualys.
.NOTES
File Name : qAPI.psm1
Author : johnny_dep
Prerequisite : PowerShell V3
.SYNTAX
.EXAMPLE
Set-qTickets -Overdue "1" -TicketAssignee "user_id" -ChangeState "CLOSED"
#>
Param ([string]$api_endpoint,
#[ValidateCount(1,1000)]
[string[]]$TicketNumbers,
[string]$SinceTicketNumber,
[string]$UntilTicketNumber,
[string]$TicketAssignee,
#[ValidateSet("0","1")]
[string]$Overdue,
#[ValidateSet("0","1")]
[string]$Invalid,
#[ValidateSet("OPEN","RESOLVED","CLOSED","IGNORED")]
[string[]]$States,
[string]$ModifiedSinceDateTime,
[string]$UnModifiedSinceDateTime,
[string[]]$IPs,
[string[]]$AssetGroups,
#[ValidateLength(1,100)]
[string]$DNSContains,
#[ValidateLength(1,100)]
[string]$NetbiosContains,
#[ValidateSet("1","2","3","4","5")]
[string[]]$VulnSevereties,
#[ValidateSet("1","2","3","4","5")]
[string[]]$PotVulnSevereties,
#[ValidateCount(1,10)]
[string[]]$QIDs,
#[ValidateLength(1,100)]
[string]$VulnTitleContains,
#[ValidateLength(1,100)]
[string]$VulnDetailsContains,
#[ValidateLength(1,100)]
[string]$VendorRefContains,
[string]$ChangeAssignee,
#[ValidateSet("OPEN","RESOLVED","IGNORED")]
[string]$ChangeState,
#[ValidateLength(1,2000)]
[string]$AddComment,
#[ValidateSet("0","1")]
[string]$show_vuln_details
)
#setup logging
$log_path = "\\somenetworkstorage\Vulnerability Management\Logs\"
$log_file = $timeStamp = Get-Date -UFormat "%Y%m%d"
$log_file += ".log"
$log_path += $log_file
#list specific api endpoint
$api_endpoint = "ticket_edit.php?"
#make web call
Get-qAPI -api_endpoint $api_endpoint -TicketNumbers $TicketNumbers -SinceTicketNumber $SinceTicketNumber -UntilTicketNumber $UntilTicketNumber -TicketAssignee $TicketAssignee -Overdue $Overdue -Invalid $Invalid -States $States -ModifiedSinceDateTime $ModifiedSinceDateTime -IPs $IPs -AssetGroups $AssetGroups -DNSContains $DNSContains -NetbiosContains $NetbiosContains -VulnSevereties $VulnSevereties -PotVulnSevereties $PotVulnSevereties -QIDs $QIDs -VulnTitleContains $VulnTitleContains -VulnDetailsContains $VulnDetailsContains -VendorRefContains $VendorRefContains -ChangeAssignee $ChangeAssignee -ChangeState $ChangeState -UnModifiedSinceDateTime $UnModifiedSinceDateTime -AddComment $AddComment -show_vuln_details $show_vuln_details
}
function Delete-qTickets {
<#
.SYNOPSIS
Delets tickets that match critieria.
.DESCRIPTION
Connects to Qualys api and deletes tickets that match a given critieria that is passed via parameters.
.NOTES
File Name : qAPI.psm1
Author : johnny_DEP
Prerequisite : PowerShell V3
.SYNTAX
.EXAMPLE
Delete-qTickets -TicketNumbers "123"
#>
Param ([string]$api_endpoint,
#[ValidateCount(1,1000)]
[string[]]$TicketNumbers,
[string]$SinceTicketNumber,
[string]$UntilTicketNumber,
[string]$TicketAssignee,
#[ValidateSet("0","1")]
[string]$Overdue,
#[ValidateSet("0","1")]
[string]$Invalid,
#[ValidateSet("OPEN","RESOLVED","CLOSED","IGNORED")]
[string[]]$States,
[string]$ModifiedSinceDateTime,
[string]$UnModifiedSinceDateTime,
[string[]]$IPs,
[string[]]$AssetGroups,
#[ValidateLength(1,100)]
[string]$DNSContains,
#[ValidateLength(1,100)]
[string]$NetbiosContains,
#[ValidateSet("1","2","3","4","5")]
[string[]]$VulnSevereties,
#[ValidateSet("1","2","3","4","5")]
[string[]]$PotVulnSevereties,
#[ValidateCount(1,10)]
[string[]]$QIDs,
#[ValidateLength(1,100)]
[string]$VulnTitleContains,
#[ValidateLength(1,100)]
[string]$VulnDetailsContains,
#[ValidateLength(1,100)]
[string]$VendorRefContains,
[string]$ChangeAssignee,
#[ValidateSet("OPEN","RESOLVED","IGNORED")]
[string]$ChangeState,
#[ValidateLength(1,2000)]
[string]$AddComment,
#[ValidateSet("0","1")]
[string]$show_vuln_details
)
#setup logging
$log_path = "\\somenetworkstorage\Vulnerability Management\Logs\"
$log_file = $timeStamp = Get-Date -UFormat "%Y%m%d"
$log_file += ".log"
$log_path += $log_file
#list specific api endpoint
$api_endpoint = "ticket_delete.php?"
#make web call
Get-qAPI -api_endpoint $api_endpoint -TicketNumbers $TicketNumbers -SinceTicketNumber $SinceTicketNumber -UntilTicketNumber $UntilTicketNumber -TicketAssignee $TicketAssignee -Overdue $Overdue -Invalid $Invalid -States $States -ModifiedSinceDateTime $ModifiedSinceDateTime -IPs $IPs -AssetGroups $AssetGroups -DNSContains $DNSContains -NetbiosContains $NetbiosContains -VulnSevereties $VulnSevereties -PotVulnSevereties $PotVulnSevereties -QIDs $QIDs -VulnTitleContains $VulnTitleContains -VulnDetailsContains $VulnDetailsContains -VendorRefContains $VendorRefContains -ChangeAssignee $ChangeAssignee -ChangeState $ChangeState -UnModifiedSinceDateTime $UnModifiedSinceDateTime -AddComment $AddComment -show_vuln_details $show_vuln_details
}
function create-qTicket {
<#
.SYNOPSIS
Creates CASD ticket based on Qualys Tickets
.DESCRIPTION
Parses tickets automatically created via Qualys and sends an email to the mail eater service from CASD to create an incident for the appropriate area, areas have to be configured and match the CASD DB in order for the ticket creation to work
.NOTES
File Name : qAPI.psm1
Author : johnny_dep
Prerequisite : PowerShell V3
.SYNTAX
.EXAMPLE
list-qTickets| create-qTicket -dstEmail "[email protected]" -group "Temp" -smtpserver "10.0.0.1"
#>
<#
Email format for CASD
%DESCRIPTION=
----------------------------------------------------------------
Vulnerability Description:
----------------------------------------------------------------
Affected Assets:
----------------------------------------------------------------
Suggested Remedation:
----------------------------------------------------------------
Vulnerailty Information is Confidential
Please contact [email protected] with questions or if more info
rmation is needed.
----------------------------------------------------------------
%FROM_USERID= 'User ID'
%LOG_AGENT= 'Vulnerability Mangement Process'
%CATEGORY= Configure
%GROUP= 'Area reference from User ID'
%IMPACT= 'Calculated from number of vulnerable assets'
%URGENCY= 'Calculated from Severity'
#>
Param ([string]$smtpserver, #server to relay email message
[string]$group,# assigned to group
[Parameter(Mandatory=$false)][string]$dstEmail, # target email address
[Parameter(Mandatory=$True,ValueFromPipeline=$True)][PSObject]$apiOut # object returned from api call
)
#setup logging
$log_path = "\\someserver\Vulnerability Management\Logs\"
$log_file = $timeStamp = Get-Date -UFormat "%Y%m%d"
$log_file += ".log"
$log_path += $log_file
Write-Host "Logging tickets functions to:" $log_path
#convert psobject to xml
[xml]$xml= $apiOut
#[xml]$xml = Get-Content "C:\windows\temp\tix.xml"
#print total number of tickets
$numTickets = $xml.REMEDIATION_TICKETS.TICKET_LIST.TICKET.NUMBER.count
$log_out = "Total number of Qualys tickets being processed:" + $numTickets
Write-log -filePath $log_path -outPut $log_out
#get unique QIDs
$QIDs = $xml.REMEDIATION_TICKETS.TICKET_LIST.TICKET.VULNINFO.QID
$QIDs = $QIDs | sort -Unique
$log_out = "Total Unique QIDS(Numerber of CASD tickets to be created):" + $QIDs.count
Write-log -filePath $log_path -outPut $log_out
$ticketsCursor = $QIDs.count
#test dstemail
if ($dstEmail.length -lt 1){
# change this to match your CASD mail eater service account
$dstEmail = "[email protected]"
}
#for each QID process ticket
$interator = 0
foreach ($i in $QIDs)
{$log_out = "Processing QID:" +$i
Write-Log -filePath $log_path -outPut $log_out
#build ticket email body for each QID
$xPathBase = "/REMEDIATION_TICKETS/TICKET_LIST/TICKET/"
#description
$xPathQry = $xPathBase + 'VULNINFO/QID[text() = "' + $i + '"]'
#Write-Host "xpath:" $xPathQry
$cursor = $xml.SelectNodes($xPathQry)
$description = "%description=`n"
$tixEmail += "-----------------------------------------------------`n`n"
$description += $cursor|%{$_.ParentNode.TITLE.InnerText} | sort -Unique
$tixEmail = $description + "`n"
$tixEmail += "-----------------------------------------------------`n`n"
$tixEmail += "Related CVE(s):`n"
$cves = $cursor|%{$_.ParentNode.CVE_ID_LIST.CVE_ID.InnerText} | sort -Unique
[string]$cves = $cves
$cveArray = $cves -split " "
$cves = $cves -replace " ","`n"
$tixEmail += $cves + "`n`n"
#affected assets
$assetsNodes = $cursor|%{$_.ParentNode.ParentNode.DETECTION.DNSNAME.InnerText} | sort -Unique
[string]$assets = $assetsNodes
$assets = $assets -replace " ","`n"
$tixEmail += "-----------------------------------------------------`n`n"
$tixEmail += "Affected Assets:`n"
$tixEmail += $assets + "`n`n"
#remediation
$tixEmail += "-----------------------------------------------------`n`n"
$tixEmail += "Suggested Remediation:`n"
$tixEmail += "These link(s) provide the information that is available for how this vulnerabilty can be remediated.`n"
foreach ($z in $cveArray)
{ $fixUrl = "http://cve.mitre.org/cgi-bin/cvename.cgi?name=" + $z
$tixEmail += $fixUrl + "`n"
}
$tixEmail += "`nIf the above links do not provide clear remediation steps please contact security for assistance`n"
$tixEmail += "-----------------------------------------------------`n`n"
$tixEmail += "In an effort to streamline our vulnerability management process, remediation activities will now be`n"
$tixEmail += "communicated via a CASD ticket. Please work thru the suggested remediation within the ticket or comments.`n"
$tixEmail += "If you cannot fix the vulnerability please provide a business justification and transfer the ticket back `n"
$tixEmail += "to the security group to begin the variance process.`n`n"
$tixEmail += "Vulnerability Information is Confidential`n"
#$tixEmail += "%FROM_USERID=" + "`n"# 'User ID looked up from Teamtrack'
#$tixEmail += "%LOG_AGENT=" + "`n"#'Vulnerability Mangement Process'
$tixEmail += "%CATEGORY=Other.Temp`n" #assign to whoever you want - configurable
if($group -eq ""){
$tixEmail += "%GROUP=Temp" + "`n" #'Area reference from User ID' just whoever for testing - configurable
} else {$tixEmail += "%GROUP=Security"+ $group + "`n" #'Area reference from User ID' just security for testing
}
if($assetsNodes.Count -gt 1){
$tixEmail += "%IMPACT=5-One Person" + "`n" #'Calculated from number of vulnerable assets' 5 if 1, 4 if > 1
} else {$tixEmail += "%IMPACT=5-One Person" + "`n" #'Calculated from number of vulnerable assets' 5 if 1, 4 if > 1
}
$severity = $cursor|%{$_.ParentNode.SEVERITY} | sort -Unique
if($severity -eq "5"){
$tixEmail += "%URGENCY=1-Primary Tool - Completely down" + "`n" #'Calculated from Severity' 3 if 4, 1 if 5
} else {$tixEmail += "%URGENCY=3-Primary Tool - Partial functionality" + "`n" #'Calculated from Severity' 3 if 4, 1 if 5
}
$log_out = "EMAIL for Ticket "+$i+" Created:`n"
Write-log -filePath $log_path -outPut $log_out
#Write-Host $tixEmail
Send-MailMessage -Body $tixEmail -SmtpServer $smtpserver -From "[email protected]" -To $dstEmail -Subject "Vuln Ticket:$i"
$log_out = "Ticket for QID "+$i+" created, with priority:" + $severity
Write-log -filePath $log_path -outPut $log_out
}
# uncomment if you want to use assignedment to manage which ones you processed already
#$cleanup = Set-qTickets -TicketAssignee "unprocessed" -ChangeAssignee "processed"
$log_out = "Set "+$numTickets+" to assignee _enter_yourself_here_ in Qualys"
Write-log -filePath $log_path -outPut $log_out
}
Export-ModuleMember Write-Log
Export-ModuleMember create-qTicket
Export-ModuleMember Get-qAPI
Export-ModuleMember List-qTickets
Export-ModuleMember Set-qTickets
Export-ModuleMember Delete-qTickets