This repository was archived by the owner on May 15, 2022. It is now read-only.
forked from demisto/content
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript-BlockIP.yml
More file actions
68 lines (63 loc) · 1.51 KB
/
Copy pathscript-BlockIP.yml
File metadata and controls
68 lines (63 loc) · 1.51 KB
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
commonfields:
id: bffdcf72-2061-4767-83d5-3ff2a9e8afe7
version: 5
name: BlockIP
script: |-
var blockPanorama = !!executeCommand('IsIntegrationAvailable',{'brandname': 'panorama'})[0].Contents;
var blockCP = !!executeCommand('IsIntegrationAvailable',{'brandname': 'check point'})[0].Contents;
if (args['using-brand']) {
switch (args['using-brand'].toLowerCase()) {
case 'panorama':
blockCP = false;
break;
case 'check point':
blockPanorama = false;
break;
}
}
if (!args.rulename) {
args.rulename = 'ip' + args.ip + ' blocked in direction ' + args.direction;
}
var entries = [];
if (blockPanorama) {
entries.push(executeCommand('PanoramaBlockIP', args));
}
if (blockCP) {
if (!args.ipname) {
args.ipname = + args.ip + ' . ' + args.direction;
}
entries.push(executeCommand('CPBlockIP', args));
}
return entries;
type: javascript
tags:
- firewall
- checkpoint
- panorama
comment: Blocks IP in configured firewall
enabled: true
args:
- name: ip
required: true
default: true
description: IP to block
- name: rulename
description: Rule name
- name: direction
required: true
auto: PREDEFINED
predefined:
- to
- from
- both
description: Direction to block (to, from or both - default)
- name: ipname
description: Base name for added ip/hosts inside checkpoint db
scripttarget: 0
runonce: false
dependson:
should:
- panorama
- checkpoint
tests:
- blockip_test_playbook