forked from ryanrasmuss/ansible-checkpoint-playbooks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
3-internal-policy-playbook.yml
executable file
·185 lines (185 loc) · 4.8 KB
/
3-internal-policy-playbook.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
---
- hosts: checkpoint
tasks:
- name: "login"
check_point_mgmt:
command: login
parameters:
username: "{{mgmt_user}}"
password: "{{mgmt_password}}"
management: "{{mgmt_server}}"
fingerprint: "{{fingerprint}}"
register: login_response
tags: login
- name: "add Management Rule"
check_point_mgmt:
command: add-access-rule
parameters:
layer: "Network"
position: "bottom"
name: "Management"
action: "Accept"
destination: "Example-Gateway"
enabled: "true"
source: "Admins"
track:
type: "Log"
session-data: "{{login_response}}"
- name: "add SSH Rule"
check_point_mgmt:
command: add-access-rule
parameters:
layer: "Network"
position: "bottom"
name: "Allow SSH"
action: "Accept"
destination: "CP-Gateways"
enabled: "true"
service:
- "ssh"
- "ssh_version_2"
source: "Admins"
track:
type: "Log"
session-data: "{{login_response}}"
- name: "add Pings/DNS/DHCP/trace Rule"
check_point_mgmt:
command: add-access-rule
parameters:
layer: "Network"
position: "bottom"
name: "Pings,DNS,DHCP,Trace"
action: "Accept"
enabled: "true"
service:
- "dns"
- "dhcp"
- "icmp-proto"
- "traceroute"
session-data: "{{login_response}}"
- name: "add Stealth Rule"
check_point_mgmt:
command: add-access-rule
parameters:
layer: "Network"
position: "bottom"
name: "Stealth Rule"
action: "Drop"
destination: "CP-Gateways"
enabled: "true"
track:
type: "Log"
session-data: "{{login_response}}"
- name: "add Stop External Rule"
check_point_mgmt:
command: add-access-rule
parameters:
layer: "Network"
position: "bottom"
name: "Stop External"
action: "Drop"
destination:
- "Internal"
- "Management"
enabled: "true"
source: "External"
track:
type: "Log"
session-data: "{{login_response}}"
- name: "add Wild Access Rule"
check_point_mgmt:
command: add-access-rule
parameters:
layer: "Network"
position: "bottom"
name: "Wild Access"
action: "Accept"
enabled: "true"
source:
- "External"
- "Internal"
- "Management"
track:
type: "Log"
session-data: "{{login_response}}"
- name: "add Cleanup Rule"
check_point_mgmt:
command: add-access-rule
parameters:
layer: "Network"
position: "bottom"
name: "Cleanup"
action: "Drop"
enabled: "true"
session-data: "{{login_response}}"
- name: "delete default Rule"
check_point_mgmt:
command: delete-access-rule
parameters:
layer: "Network"
rule-number: "1"
session-data: "{{login_response}}"
- name: "add Management Section Title"
check_point_mgmt:
command: add-access-section
parameters:
layer: "Network"
position: "top"
name: "Management Rules"
session-data: "{{login_response}}"
- name: "add Network Section Title"
check_point_mgmt:
command: add-access-section
parameters:
layer: "Network"
position: "5"
name: "Subnet Rules"
session-data: "{{login_response}}"
- name: "add Cleanup Section Title"
check_point_mgmt:
command: add-access-section
parameters:
layer: "Network"
position: "7"
name: "Explicit Cleanup"
session-data: "{{login_response}}"
- name: "add blacklist outgoing"
check_point_mgmt:
command: add-access-rule
parameters:
layer: "Network"
position: "top"
name: "Blacklist Egress"
action: "Drop"
destination: "Suspicious-Hosts"
track:
type: "Log"
session-data: "{{login_response}}"
- name: "add blacklist incoming"
check_point_mgmt:
command: add-access-rule
parameters:
layer: "Network"
position: "top"
name: "Blacklist Ingress"
action: "Drop"
source: "Suspicious-Hosts"
track:
type: "Log"
session-data: "{{login_response}}"
- name: "publish this session"
check_point_mgmt:
command: publish
session-data: "{{login_response}}"
# - name: "install policy"
# check_point_mgmt:
# command: install-policy
#parameters:
# policy-package: "standard"
#session-data: "{{login_response}}"
#tags: install
- name: "logout"
check_point_mgmt:
command: logout
session-data: "{{login_response}}"
tags: logout