Skip to content

Commit

Permalink
Add -Asn param to Get-CIF3Indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
mdavis332 committed Dec 22, 2022
1 parent 170ec66 commit 29066b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CIF3.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
RootModule = 'CIF3.psm1'

# Version number of this module.
ModuleVersion = '1.0.0'
ModuleVersion = '1.0.1'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -105,7 +105,7 @@
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = 'Adds new params to Get-CIF3Indicator cmdlet.'
ReleaseNotes = 'Adds -Asn param to Get-CIF3Indicator cmdlet to filter by autonomous system number.'

} # End of PSData hashtable

Expand Down
6 changes: 6 additions & 0 deletions Public/Get-CIF3Indicator.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ function Get-CIF3Indicator {
The Base Uri to use for the CIF instance API (uses session Uri if not specified).
.PARAMETER Indicator
Indicator value to pass to the API call to narrow down the search server-side.
.PARAMETER Asn
Autonomous System Number value to pass to the API call to narrow down the search server-side. Only indicators with a matching ASN will be returned.
Since ASNs are only stored on IP addresses, this effectively also filters indicator types to only include IP addresses.
.PARAMETER Confidence
Confidence value to pass to the API call to narrow down the search server-side. Only indicators >= to this value will be returned.
Defaults to 5.
Expand Down Expand Up @@ -85,6 +88,8 @@ function Get-CIF3Indicator {

[float]$Confidence = 5,

[uint32]$Asn,

[string[]]$Provider,

[string]$Group,
Expand Down Expand Up @@ -143,6 +148,7 @@ function Get-CIF3Indicator {
'NoLog' { $Body.Add('nolog', $NoLog) }
'Indicator' { $Body.Add('q', $Indicator) }
'Confidence' { $Body.Add('confidence', $Confidence) }
'Asn' { $Body.Add('asn', $Asn) }
'Provider' { $Body.Add('provider', $Provider -join ',') }
'Group' { $Body.Add('group', $Group) }
'Tag' { $Body.Add('tags', $Tag -join ',') }
Expand Down

0 comments on commit 29066b7

Please sign in to comment.