Skip to content

Commit

Permalink
New function and markdown help (#54)
Browse files Browse the repository at this point in the history
* new function and markdown help

* Update src/UofIQualys/functions/public/Get-QualysKBContent.ps1

Co-authored-by: mabaumgartner <42626826+mabaumgartner@users.noreply.github.com>

* fix example and regen markdown

* version++

---------

Co-authored-by: mabaumgartner <42626826+mabaumgartner@users.noreply.github.com>
  • Loading branch information
baristaTam and mabaumgartner authored May 2, 2023
1 parent 701935e commit 95eb56a
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed

## [1.6.0] - 2023-05-02

### Added

- Function to get vulnerability information from Qualys KB. Get-QualysKBContent
- Generated new markdown help

## [1.5.0] - 2022-09-09

### Changed
Expand Down
5 changes: 3 additions & 2 deletions src/UofIQualys/UofIQualys.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
RootModule = 'UofIQualys.psm1'

# Version number of this module.
ModuleVersion = '1.5.0'
ModuleVersion = '1.6.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -91,7 +91,8 @@ FunctionsToExport = @(
'Get-QualysScanSummary',
'Get-QualysAPICallCount',
'Stop-QualysScan',
'Close-QualysSession'
'Close-QualysSession',
'Get-QualysKBContent'
)

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
Expand Down
35 changes: 35 additions & 0 deletions src/UofIQualys/functions/public/Get-QualysKBContent.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<#
.Synopsis
Returns KB information for a specified QID
.DESCRIPTION
Returns KB information for a specified QID
.EXAMPLE
Get-QualysKBContent -QID '372305'
#>
function Get-QualysKBContent{
[CmdletBinding()]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns', '',
Justification = 'This is consistent with the vendors verbiage')]
param (
[Parameter(Mandatory=$true)]
[String]$QID
)

process{

$RestSplat = @{
Method = 'GET'
RelativeURI = 'knowledge_base/vuln/'
Body = @{
action = 'list'
echo_request = '1'
ids = $QID
}
}

$Response = Invoke-QualysRestCall @RestSplat
$VulnInfo = $Response.KNOWLEDGE_BASE_VULN_LIST_OUTPUT.RESPONSE.VULN_LIST.VULN
$VulnInfo

}
}
37 changes: 37 additions & 0 deletions src/help/Close-QualysSession.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
external help file: UofIQualys-help.xml
Module Name: UofIQualys
online version:
schema: 2.0.0
---

# Close-QualysSession

## SYNOPSIS
This function closes the Qualys user session created by New-QualysSession.

## SYNTAX

```
Close-QualysSession
```

## DESCRIPTION
This function closes the Qualys user session created by New-QualysSession.

## EXAMPLES

### EXAMPLE 1
```
Close-QualysSession
```

## PARAMETERS

## INPUTS

## OUTPUTS

## NOTES

## RELATED LINKS
55 changes: 55 additions & 0 deletions src/help/Get-QualysKBContent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
external help file: UofIQualys-help.xml
Module Name: UofIQualys
online version:
schema: 2.0.0
---

# Get-QualysKBContent

## SYNOPSIS
Returns KB information for a specified QID

## SYNTAX

```
Get-QualysKBContent [-QID] <String> [<CommonParameters>]
```

## DESCRIPTION
Returns KB information for a specified QID

## EXAMPLES

### EXAMPLE 1
```
Get-QualysKBContent -QID '372305'
```

## PARAMETERS

### -QID
{{ Fill QID Description }}

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

0 comments on commit 95eb56a

Please sign in to comment.