forked from shaniacht1/content
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautomation-CBFindIP.yml
67 lines (64 loc) · 1.8 KB
/
automation-CBFindIP.yml
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
args:
- default: true
description: CSV list of IP addresses to identify.
name: ip
required: true
comment: Search Carbon Black for connection to specified IP addresses.
commonfields:
id: CBFindIP
version: -1
dependson:
must: []
enabled: true
name: CBFindIP
outputs:
- contextPath: Process.Path
description: Process path.
type: String
- contextPath: Process.PID
description: Process PID.
type: Number
- contextPath: Process.MD5
description: Process MD5 hash.
type: String
- contextPath: Process.Hostname
description: Process hostname.
type: String
- contextPath: Process.Name
description: Process name.
type: String
- contextPath: Process.CbSegmentID
description: Carbon Black "segment" where this process instance is stored. Required
to fetch additional information for a process.
type: String
- contextPath: Process.CbID
description: Carbon Black unique ID for this process instance. Required (together
with CbSegmentID) to fetch additional information for a process.
type: String
- contextPath: Process.Endpoint
description: The endpoint of the process.
type: String
runas: DBotWeakRole
runonce: false
script: |2-
t = [] # type: list
found = []
ips = argToList(demisto.args()['ip'])
for ip in ips:
for e in demisto.executeCommand('cb-get-processes', {'query': 'ipaddr:' + ip}):
if isError(e):
return_error(e['Contents'])
else:
found.append(ip)
t += e['HumanReadable']
if t:
appendContext("found_ips", ','.join(found), dedup=True)
demisto.results({'ContentsFormat': formats['markdown'], 'Type': entryTypes['note'], 'Contents': e['HumanReadable'],
'EntryContext': e['EntryContext']})
scripttarget: 0
system: true
tags:
- carbon-black
- endpoint
- enhancement
type: python