forked from Cephalowat/PSFalcon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Edit-CsIoc.psm1
48 lines (43 loc) · 1.16 KB
/
Edit-CsIoc.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
function Edit-CsIoc {
<#
.SYNOPSIS
Update an IOC by providing a type and value
.PARAMETER TYPE
The type of the indicator
.PARAMETER VALUE
The string representation of the indicator
.PARAMETER BODY
A hashtable of IOC properties to modify
#>
[CmdletBinding()]
[OutputType([psobject])]
param(
[Parameter(Mandatory = $true)]
[ValidateSet('sha256','md5','domain','ipv4','ipv6')]
[string]
$Type,
[Parameter(Mandatory = $true)]
[ValidateLength(1,200)]
[string]
$Value,
[Parameter(Mandatory = $true)]
[hashtable]
$Body
)
process{
$Param = @{
Uri = '/indicators/entities/iocs/v1?type=' + $Type + '&value=' + $Value
Method = 'patch'
Header = @{
accept = 'application/json'
'content-type' = 'application/json'
}
Body = ConvertTo-Json $Body
}
switch ($PSBoundParameters.Keys) {
'Verbose' { $Param['Verbose'] = $true }
'Debug' { $Param['Debug'] = $true }
}
Invoke-CsAPI @Param
}
}