forked from Cephalowat/PSFalcon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Get-CsIocProcessId.psm1
73 lines (62 loc) · 1.73 KB
/
Get-CsIocProcessId.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
function Get-CsIocProcessId {
<#
.SYNOPSIS
Find processes on a Host associated with a custom IOC
.PARAMETER TYPE
Type of the indicator
.PARAMETER VALUE
String representation of the indicator
.PARAMETER ID
Target Host ID
.PARAMETER LIMIT
The maximum records to return [default: 100]
.PARAMETER OFFSET
The offset to start retrieving records from [default: 0]
.PARAMETER ALL
Repeat requests until all results are retrieved
#>
[CmdletBinding()]
[OutputType([psobject])]
param(
[Parameter(Mandatory = $true)]
[ValidateSet('domain', 'ipv4', 'ipv6', 'md5', 'sha256')]
[string]
$Type,
[Parameter(Mandatory = $true)]
[ValidateLength(1,200)]
[string]
$Value,
[Parameter(Mandatory = $true)]
[ValidateLength(32,32)]
[string]
$Id,
[ValidateRange(1,100)]
[int]
$Limit = 100,
[int]
$Offset = 0,
[switch]
$All
)
process{
$Param = @{
Uri = '/indicators/queries/devices/v1?limit=' + [string] $Limit + '&offset=' + [string] $Offset +
'&type=' + $Type + '&value=' + $Value + '&device_id=' + $Id
Method = 'get'
Header = @{
accept = 'application/json'
'content-type' = 'application/json'
}
}
switch ($PSBoundParameters.Keys) {
'Debug' { $Param['Debug'] = $true }
'Verbose' { $Param['Verbose'] = $true }
}
if ($All) {
Join-CsResult -Activity $MyInvocation.MyCommand.Name -Param $Param
}
else {
Invoke-CsAPI @Param
}
}
}