| 1 |
#!/usr/bin/python |
| 2 |
# -*- coding: utf-8 -*- |
| 3 |
# |
| 4 |
# Ansible module to manage Check Point Firewall (c) 2019 |
| 5 |
# |
| 6 |
# Ansible is free software: you can redistribute it and/or modify |
| 7 |
# it under the terms of the GNU General Public License as published by |
| 8 |
# the Free Software Foundation, either version 3 of the License, or |
| 9 |
# (at your option) any later version. |
| 10 |
# |
| 11 |
# Ansible is distributed in the hope that it will be useful, |
| 12 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
# GNU General Public License for more details. |
| 15 |
# |
| 16 |
# You should have received a copy of the GNU General Public License |
| 17 |
# along with Ansible. If not, see <http://www.gnu.org/licenses/>. |
| 18 |
# |
| 19 |
|
| 20 |
from __future__ import absolute_import, division, print_function |
| 21 |
|
| 22 |
__metaclass__ = type |
| 23 |
|
| 24 |
ANSIBLE_METADATA = { |
| 25 |
"metadata_version": "1.1", |
| 26 |
"status": ["preview"], |
| 27 |
"supported_by": "community", |
| 28 |
} |
| 29 |
|
| 30 |
DOCUMENTATION = """ |
| 31 |
--- |
| 32 |
module: cp_mgmt_vpn_community_star |
| 33 |
short_description: Manages vpn-community-star objects on Check Point over Web Services API |
| 34 |
description: |
| 35 |
- Manages vpn-community-star objects on Check Point devices including creating, updating and removing objects. |
| 36 |
- All operations are performed over Web Services API. |
| 37 |
- Available from R80 management version. |
| 38 |
version_added: "1.0.0" |
| 39 |
author: "Or Soffer (@chkp-orso)" |
| 40 |
options: |
| 41 |
name: |
| 42 |
description: |
| 43 |
- Object name. |
| 44 |
type: str |
| 45 |
required: True |
| 46 |
center_gateways: |
| 47 |
description: |
| 48 |
- Collection of center VPN Gateway and VPN Device objects identified by the name or UID. |
| 49 |
type: list |
| 50 |
elements: str |
| 51 |
disable_nat: |
| 52 |
description: |
| 53 |
- Indicates whether to disable NAT inside the VPN Community. |
| 54 |
- Available from R82 JHF management version. |
| 55 |
type: bool |
| 56 |
version_added: "6.5.0" |
| 57 |
disable_nat_on: |
| 58 |
description: |
| 59 |
- Indicates on which gateways to disable NAT inside the VPN Community. |
| 60 |
- Available from R82 JHF management version. |
| 61 |
type: str |
| 62 |
choices: ['satellite gateways only', 'both center and satellite gateways'] |
| 63 |
version_added: "6.5.0" |
| 64 |
encrypted_traffic: |
| 65 |
description: |
| 66 |
- Encrypted traffic settings. |
| 67 |
- Available from R82 JHF management version. |
| 68 |
type: dict |
| 69 |
version_added: "6.5.0" |
| 70 |
suboptions: |
| 71 |
enabled: |
| 72 |
description: |
| 73 |
- Indicates whether to accept all encrypted traffic. |
| 74 |
type: bool |
| 75 |
community_members: |
| 76 |
description: |
| 77 |
- Indicates on which community members to accept all encrypted traffic. |
| 78 |
type: str |
| 79 |
choices: ['satellite gateways only', 'both center and satellite gateways'] |
| 80 |
encryption_method: |
| 81 |
description: |
| 82 |
- The encryption method to be used. |
| 83 |
- Available from R80.10 management version. |
| 84 |
type: str |
| 85 |
choices: ['prefer ikev2 but support ikev1', 'ikev2 only', 'ikev1 for ipv4 and ikev2 for ipv6 only'] |
| 86 |
encryption_suite: |
| 87 |
description: |
| 88 |
- The encryption suite to be used. |
| 89 |
- Available from R80.10 management version. |
| 90 |
type: str |
| 91 |
choices: ['suite-b-gcm-256', 'custom', 'vpn b', 'vpn a', 'suite-b-gcm-128'] |
| 92 |
excluded_services: |
| 93 |
description: |
| 94 |
- Collection of services that are excluded from the community identified by the name or UID.<br> Connections with these services will not be |
| 95 |
encrypted and will not match rules specifying the community in the VPN community. |
| 96 |
- Available from R82 JHF management version. |
| 97 |
type: list |
| 98 |
elements: str |
| 99 |
version_added: "6.5.0" |
| 100 |
granular_encryptions: |
| 101 |
description: |
| 102 |
- VPN granular encryption settings. |
| 103 |
- Available from R81 management version. |
| 104 |
type: list |
| 105 |
elements: dict |
| 106 |
version_added: "5.1.0" |
| 107 |
suboptions: |
| 108 |
internal_gateway: |
| 109 |
description: |
| 110 |
- Internally managed Check Point gateway identified by name or UID, or 'Any' for all internal-gateways participants in this community. |
| 111 |
type: str |
| 112 |
external_gateway: |
| 113 |
description: |
| 114 |
- Externally managed or 3rd party gateway identified by name or UID. |
| 115 |
type: str |
| 116 |
encryption_method: |
| 117 |
description: |
| 118 |
- The encryption method to be used. |
| 119 |
type: str |
| 120 |
choices: ['prefer ikev2 but support ikev1', 'ikev2 only', 'ikev1 for ipv4 and ikev2 for ipv6 only'] |
| 121 |
encryption_suite: |
| 122 |
description: |
| 123 |
- The encryption suite to be used. |
| 124 |
type: str |
| 125 |
choices: ['suite-b-gcm-256', 'custom', 'vpn b', 'vpn a', 'suite-b-gcm-128'] |
| 126 |
ike_phase_1: |
| 127 |
description: |
| 128 |
- Ike Phase 1 settings. Only applicable when the encryption-suite is set to [custom]. |
| 129 |
type: dict |
| 130 |
suboptions: |
| 131 |
encryption_algorithm: |
| 132 |
description: |
| 133 |
- The encryption algorithm to be used. |
| 134 |
type: str |
| 135 |
choices: ['cast', 'aes-256', 'des', 'aes-128', '3des'] |
| 136 |
data_integrity: |
| 137 |
description: |
| 138 |
- The hash algorithm to be used. |
| 139 |
type: str |
| 140 |
choices: ['aes-xcbc', 'sha1', 'sha256', 'sha384', 'sha512', 'md5'] |
| 141 |
diffie_hellman_group: |
| 142 |
description: |
| 143 |
- The Diffie-Hellman group to be used. |
| 144 |
type: str |
| 145 |
choices: ['group-1', 'group-2', 'group-5', 'group-14', 'group-15', 'group-16', 'group-17', 'group-18', 'group-19', 'group-20', 'group-24'] |
| 146 |
ike_p1_rekey_time: |
| 147 |
description: |
| 148 |
- Indicates the time interval for IKE phase 1 renegotiation. |
| 149 |
- Available from R81 management version. |
| 150 |
type: int |
| 151 |
ike_p1_rekey_time_unit: |
| 152 |
description: |
| 153 |
- Indicates the time unit for [ike-p1-rekey-time-unit] parameter, rounded up to minutes scale. |
| 154 |
- Available from R81 management version. |
| 155 |
type: str |
| 156 |
choices: ['days', 'hours', 'minutes', 'seconds'] |
| 157 |
ike_phase_2: |
| 158 |
description: |
| 159 |
- Ike Phase 2 settings. Only applicable when the encryption-suite is set to [custom]. |
| 160 |
type: dict |
| 161 |
suboptions: |
| 162 |
encryption_algorithm: |
| 163 |
description: |
| 164 |
- The encryption algorithm to be used. |
| 165 |
type: str |
| 166 |
choices: ['cast', 'aes-gcm-256', 'cast-40', 'aes-256', 'des', 'aes-128', '3des', 'des-40cp', 'aes-gcm-128', 'none'] |
| 167 |
data_integrity: |
| 168 |
description: |
| 169 |
- The hash algorithm to be used. |
| 170 |
type: str |
| 171 |
choices: ['aes-xcbc', 'sha1', 'sha256', 'sha384', 'sha512', 'md5'] |
| 172 |
ike_p2_use_pfs: |
| 173 |
description: |
| 174 |
- Indicates whether Perfect Forward Secrecy (PFS) is being used for IKE phase 2. |
| 175 |
type: bool |
| 176 |
ike_p2_pfs_dh_grp: |
| 177 |
description: |
| 178 |
- The Diffie-Hellman group to be used. |
| 179 |
type: str |
| 180 |
choices: ['group-1', 'group-2', 'group-5', 'group-14', 'group-15', 'group-16', 'group-17', 'group-18', 'group-19', 'group-20', 'group-24'] |
| 181 |
ike_p2_rekey_time: |
| 182 |
description: |
| 183 |
- Indicates the time interval for IKE phase 2 renegotiation. |
| 184 |
- Available from R81 management version. |
| 185 |
type: int |
| 186 |
ike_p2_rekey_time_unit: |
| 187 |
description: |
| 188 |
- Indicates the time unit for [ike-p2-rekey-time-unit] parameter. |
| 189 |
- Available from R81 management version. |
| 190 |
type: str |
| 191 |
choices: ['days', 'hours', 'minutes', 'seconds'] |
| 192 |
ike_phase_1: |
| 193 |
description: |
| 194 |
- Ike Phase 1 settings. Only applicable when the encryption-suite is set to [custom]. |
| 195 |
- Available from R80.10 management version. |
| 196 |
type: dict |
| 197 |
suboptions: |
| 198 |
data_integrity: |
| 199 |
description: |
| 200 |
- The hash algorithm to be used. |
| 201 |
type: str |
| 202 |
choices: ['aes-xcbc', 'sha1', 'sha256', 'sha384', 'sha512', 'md5'] |
| 203 |
diffie_hellman_group: |
| 204 |
description: |
| 205 |
- The Diffie-Hellman group to be used. |
| 206 |
type: str |
| 207 |
choices: ['group-1', 'group-2', 'group-5', 'group-14', 'group-19', 'group-20'] |
| 208 |
encryption_algorithm: |
| 209 |
description: |
| 210 |
- The encryption algorithm to be used. |
| 211 |
type: str |
| 212 |
choices: ['cast', 'aes-256', 'des', 'aes-128', '3des'] |
| 213 |
ike_p1_rekey_time: |
| 214 |
description: |
| 215 |
- Indicates the time interval for IKE phase 1 renegotiation. |
| 216 |
- Available from R81 management version. |
| 217 |
type: int |
| 218 |
version_added: "5.1.0" |
| 219 |
ike_p1_rekey_time_unit: |
| 220 |
description: |
| 221 |
- Indicates the time unit for [ike-p1-rekey-time-unit] parameter, rounded up to minutes scale. |
| 222 |
- Available from R81 management version. |
| 223 |
type: str |
| 224 |
choices: ['days', 'hours', 'minutes', 'seconds'] |
| 225 |
version_added: "5.1.0" |
| 226 |
ike_phase_2: |
| 227 |
description: |
| 228 |
- Ike Phase 2 settings. Only applicable when the encryption-suite is set to [custom]. |
| 229 |
- Available from R80.10 management version. |
| 230 |
type: dict |
| 231 |
suboptions: |
| 232 |
data_integrity: |
| 233 |
description: |
| 234 |
- The hash algorithm to be used. |
| 235 |
type: str |
| 236 |
choices: ['aes-xcbc', 'sha1', 'sha256', 'sha384', 'sha512', 'md5'] |
| 237 |
encryption_algorithm: |
| 238 |
description: |
| 239 |
- The encryption algorithm to be used. |
| 240 |
type: str |
| 241 |
choices: ['cast', 'aes-gcm-256', 'cast-40', 'aes-256', 'des', 'aes-128', '3des', 'des-40cp', 'aes-gcm-128', 'none'] |
| 242 |
ike_p2_use_pfs: |
| 243 |
description: |
| 244 |
- Indicates whether Perfect Forward Secrecy (PFS) is being used for IKE phase 2. |
| 245 |
- Available from R81 management version. |
| 246 |
type: bool |
| 247 |
version_added: "5.1.0" |
| 248 |
ike_p2_pfs_dh_grp: |
| 249 |
description: |
| 250 |
- The Diffie-Hellman group to be used. |
| 251 |
type: str |
| 252 |
choices: ['group-1', 'group-2', 'group-5', 'group-14', 'group-15', 'group-16', 'group-17', 'group-18', 'group-19', 'group-20', 'group-24'] |
| 253 |
version_added: "5.1.0" |
| 254 |
ike_p2_rekey_time: |
| 255 |
description: |
| 256 |
- Indicates the time interval for IKE phase 2 renegotiation. |
| 257 |
- Available from R81 management version. |
| 258 |
type: int |
| 259 |
version_added: "5.1.0" |
| 260 |
ike_p2_rekey_time_unit: |
| 261 |
description: |
| 262 |
- Indicates the time unit for [ike-p2-rekey-time-unit] parameter. |
| 263 |
- Available from R81 management version. |
| 264 |
type: str |
| 265 |
choices: ['days', 'hours', 'minutes', 'seconds'] |
| 266 |
version_added: "5.1.0" |
| 267 |
mep: |
| 268 |
description: |
| 269 |
- Multiple Entry Point properties. |
| 270 |
- Available from R82 JHF management version. |
| 271 |
type: dict |
| 272 |
version_added: "6.5.0" |
| 273 |
suboptions: |
| 274 |
enabled: |
| 275 |
description: |
| 276 |
- Enable center gateways as Multiple Entry Points. |
| 277 |
type: bool |
| 278 |
entry_point_selection_mechanism: |
| 279 |
description: |
| 280 |
- The method by which the entry point gateway will be chosen from the gateways in the center. |
| 281 |
type: str |
| 282 |
choices: ['closest gateway to source', 'closest gateway to destination', 'random selection', 'manual'] |
| 283 |
entry_point_final_selection_mechanism: |
| 284 |
description: |
| 285 |
- The method by which the final entry point gateway will be chosen when the chosen mechanism returns more than one optional entry point. |
| 286 |
type: str |
| 287 |
choices: ['random selection', 'first to respond'] |
| 288 |
tracking: |
| 289 |
description: |
| 290 |
- Tracking option for the MEP. |
| 291 |
type: str |
| 292 |
choices: ['none', 'log', 'popup alert', 'mail alert', 'snmp trap alert', 'user defined alert no.1', 'user defined alert no.2', |
| 293 |
'user defined alert no.3'] |
| 294 |
default_priority_rule: |
| 295 |
description: |
| 296 |
- Priority rule for all satellite gateways. Relevant only if 'entry-point-selection-mechanism' is set to 'manual'. |
| 297 |
type: dict |
| 298 |
suboptions: |
| 299 |
first_priority_center_gateways: |
| 300 |
description: |
| 301 |
- Collection of first priority center gateways identified by the name or UID. |
| 302 |
type: list |
| 303 |
elements: str |
| 304 |
second_priority_center_gateways: |
| 305 |
description: |
| 306 |
- Collection of second priority center gateways identified by the name or UID. |
| 307 |
type: list |
| 308 |
elements: str |
| 309 |
third_priority_center_gateways: |
| 310 |
description: |
| 311 |
- Collection of third priority center gateways identified by the name or UID. |
| 312 |
type: list |
| 313 |
elements: str |
| 314 |
exception_priority_rules: |
| 315 |
description: |
| 316 |
- Exception priority rules for specific satellites gateways. Relevant only if 'entry-point-selection-mechanism' is set to 'manual'. |
| 317 |
type: list |
| 318 |
elements: dict |
| 319 |
suboptions: |
| 320 |
satellite_gateways: |
| 321 |
description: |
| 322 |
- Collection of satellite gateways to apply priority rules on identified by the name or UID. |
| 323 |
type: list |
| 324 |
elements: str |
| 325 |
first_priority_center_gateways: |
| 326 |
description: |
| 327 |
- Collection of first priority center gateways identified by the name or UID. |
| 328 |
type: list |
| 329 |
elements: str |
| 330 |
second_priority_center_gateways: |
| 331 |
description: |
| 332 |
- Collection of second priority center gateways identified by the name or UID. |
| 333 |
type: list |
| 334 |
elements: str |
| 335 |
third_priority_center_gateways: |
| 336 |
description: |
| 337 |
- Collection of third priority center gateways identified by the name or UID. |
| 338 |
type: list |
| 339 |
elements: str |
| 340 |
mesh_center_gateways: |
| 341 |
description: |
| 342 |
- Indicates whether the meshed community is in center. |
| 343 |
type: bool |
| 344 |
override_vpn_domains: |
| 345 |
description: |
| 346 |
- The Overrides VPN Domains of the participants GWs. |
| 347 |
- Available from R80.40 management version. |
| 348 |
type: list |
| 349 |
elements: dict |
| 350 |
version_added: "5.1.0" |
| 351 |
suboptions: |
| 352 |
gateway: |
| 353 |
description: |
| 354 |
- Participant gateway in override VPN domain identified by the name or UID. |
| 355 |
type: str |
| 356 |
vpn_domain: |
| 357 |
description: |
| 358 |
- VPN domain network identified by the name or UID. |
| 359 |
type: str |
| 360 |
permanent_tunnels: |
| 361 |
description: |
| 362 |
- Permanent tunnels properties. |
| 363 |
- Available from R82 JHF management version. |
| 364 |
type: dict |
| 365 |
version_added: "6.5.0" |
| 366 |
suboptions: |
| 367 |
set_permanent_tunnels: |
| 368 |
description: |
| 369 |
- Indicates which tunnels to set as permanent. |
| 370 |
type: str |
| 371 |
choices: ['on all tunnels in the community', 'on all tunnels of specific gateways', 'on specific tunnels in the community', 'off'] |
| 372 |
gateways: |
| 373 |
description: |
| 374 |
- List of gateways to set all their tunnels to permanent with specified track options. Will take effect only if set-permanent-tunnels-on |
| 375 |
is set to all-tunnels-of-specific-gateways. |
| 376 |
type: list |
| 377 |
elements: dict |
| 378 |
suboptions: |
| 379 |
gateway: |
| 380 |
description: |
| 381 |
- Gateway to set all is tunnels to permanent with specified track options.<br> Identified by name or UID. |
| 382 |
type: str |
| 383 |
track_options: |
| 384 |
description: |
| 385 |
- Indicates whether to use the community track options or to override track options for the permanent tunnels. |
| 386 |
type: str |
| 387 |
choices: ['according to community track options', 'override track options'] |
| 388 |
override_tunnel_down_track: |
| 389 |
description: |
| 390 |
- Gateway tunnel down track option. Relevant only if the track-options is set to 'override track options'. |
| 391 |
type: str |
| 392 |
choices: ['none', 'log', 'popup alert', 'mail alert', 'snmp trap alert', 'user defined alert no.1', 'user defined alert no.2', |
| 393 |
'user defined alert no.3'] |
| 394 |
override_tunnel_up_track: |
| 395 |
description: |
| 396 |
- Gateway tunnel up track option. Relevant only if the track-options is set to 'override track options'. |
| 397 |
type: str |
| 398 |
choices: ['none', 'log', 'popup alert', 'mail alert', 'snmp trap alert', 'user defined alert no.1', 'user defined alert no.2', |
| 399 |
'user defined alert no.3'] |
| 400 |
tunnels: |
| 401 |
description: |
| 402 |
- List of tunnels to set as permanent with specified track options. Will take effect only if set-permanent-tunnels-on is set to |
| 403 |
specific-tunnels-in-the-community. |
| 404 |
type: list |
| 405 |
elements: dict |
| 406 |
suboptions: |
| 407 |
first_tunnel_endpoint: |
| 408 |
description: |
| 409 |
- First tunnel endpoint (center gateway). Identified by name or UID. |
| 410 |
type: str |
| 411 |
second_tunnel_endpoint: |
| 412 |
description: |
| 413 |
- Second tunnel endpoint (center gateway for meshed VPN community and satellite gateway for star VPN community). Identified by name or UID. |
| 414 |
type: str |
| 415 |
track_options: |
| 416 |
description: |
| 417 |
- Indicates whether to use the community track options or to override track options for the permanent tunnels. |
| 418 |
type: str |
| 419 |
choices: ['according to community track options', 'override track options'] |
| 420 |
override_tunnel_down_track: |
| 421 |
description: |
| 422 |
- Gateway tunnel down track option. Relevant only if the track-options is set to 'override track options'. |
| 423 |
type: str |
| 424 |
choices: ['none', 'log', 'popup alert', 'mail alert', 'snmp trap alert', 'user defined alert no.1', 'user defined alert no.2', |
| 425 |
'user defined alert no.3'] |
| 426 |
override_tunnel_up_track: |
| 427 |
description: |
| 428 |
- Gateway tunnel up track option. Relevant only if the track-options is set to 'override track options'. |
| 429 |
type: str |
| 430 |
choices: ['none', 'log', 'popup alert', 'mail alert', 'snmp trap alert', 'user defined alert no.1', 'user defined alert no.2', |
| 431 |
'user defined alert no.3'] |
| 432 |
rim: |
| 433 |
description: |
| 434 |
- Route Injection Mechanism settings. |
| 435 |
type: dict |
| 436 |
suboptions: |
| 437 |
enabled: |
| 438 |
description: |
| 439 |
- Indicates whether Route Injection Mechanism is enabled. |
| 440 |
type: bool |
| 441 |
enable_on_center_gateways: |
| 442 |
description: |
| 443 |
- Indicates whether to enable automatic Route Injection Mechanism on center gateways. |
| 444 |
type: bool |
| 445 |
enable_on_satellite_gateways: |
| 446 |
description: |
| 447 |
- Indicates whether to enable automatic Route Injection Mechanism on satellite gateways. |
| 448 |
type: bool |
| 449 |
route_injection_track: |
| 450 |
description: |
| 451 |
- Route injection track method. |
| 452 |
type: str |
| 453 |
choices: ['none', 'log', 'popup alert', 'mail alert', 'snmp trap alert', 'user defined alert no.1', 'user defined alert no.2', |
| 454 |
'user defined alert no.3'] |
| 455 |
tunnel_down_track: |
| 456 |
description: |
| 457 |
- VPN community permanent tunnels down track option. |
| 458 |
type: str |
| 459 |
choices: ['none', 'log', 'popup alert', 'mail alert', 'snmp trap alert', 'user defined alert no.1', 'user defined alert no.2', |
| 460 |
'user defined alert no.3'] |
| 461 |
tunnel_up_track: |
| 462 |
description: |
| 463 |
- Permanent tunnels up track option. |
| 464 |
type: str |
| 465 |
choices: ['none', 'log', 'popup alert', 'mail alert', 'snmp trap alert', 'user defined alert no.1', 'user defined alert no.2', |
| 466 |
'user defined alert no.3'] |
| 467 |
satellite_gateways: |
| 468 |
description: |
| 469 |
- Collection of Gateway objects representing satellite gateways identified by the name or UID. |
| 470 |
type: list |
| 471 |
elements: str |
| 472 |
shared_secrets: |
| 473 |
description: |
| 474 |
- Shared secrets for external gateways. |
| 475 |
- Available from R80.10 management version. |
| 476 |
type: list |
| 477 |
elements: dict |
| 478 |
suboptions: |
| 479 |
external_gateway: |
| 480 |
description: |
| 481 |
- External gateway identified by the name or UID. |
| 482 |
type: str |
| 483 |
shared_secret: |
| 484 |
description: |
| 485 |
- Shared secret. |
| 486 |
type: str |
| 487 |
tags: |
| 488 |
description: |
| 489 |
- Collection of tag identifiers. |
| 490 |
type: list |
| 491 |
elements: str |
| 492 |
tunnel_granularity: |
| 493 |
description: |
| 494 |
- VPN tunnel sharing option to be used. |
| 495 |
- Available from R81 management version. |
| 496 |
type: str |
| 497 |
choices: ['per_host', 'per_subnet', 'universal'] |
| 498 |
version_added: "5.1.0" |
| 499 |
use_shared_secret: |
| 500 |
description: |
| 501 |
- Indicates whether the shared secret should be used for all external gateways. |
| 502 |
- Available from R80.10 management version. |
| 503 |
type: bool |
| 504 |
vpn_routing: |
| 505 |
description: |
| 506 |
- Enable VPN routing to satellites. |
| 507 |
- Available from R82 JHF management version. |
| 508 |
type: str |
| 509 |
choices: ['to center only', 'to center and to other satellites', 'to center other satellites and internet'] |
| 510 |
version_added: "6.5.0" |
| 511 |
wire_mode: |
| 512 |
description: |
| 513 |
- VPN Community Wire mode properties. |
| 514 |
- Available from R82 JHF management version. |
| 515 |
type: dict |
| 516 |
version_added: "6.5.0" |
| 517 |
suboptions: |
| 518 |
allow_uninspected_encrypted_traffic: |
| 519 |
description: |
| 520 |
- Allow uninspected encrypted traffic between Wire mode interfaces of this Community members. |
| 521 |
type: bool |
| 522 |
allow_uninspected_encrypted_routing: |
| 523 |
description: |
| 524 |
- Allow members to route uninspected encrypted traffic in VPN routing configurations. |
| 525 |
type: bool |
| 526 |
routing_mode: |
| 527 |
description: |
| 528 |
- VPN Community Routing Mode. |
| 529 |
- Available from R82 JHF management version. |
| 530 |
type: str |
| 531 |
choices: ['domain_based', 'route_based'] |
| 532 |
version_added: "6.5.0" |
| 533 |
advanced_properties: |
| 534 |
description: |
| 535 |
- Advanced properties. |
| 536 |
- Available from R82 JHF management version. |
| 537 |
type: dict |
| 538 |
version_added: "6.5.0" |
| 539 |
suboptions: |
| 540 |
support_ip_compression: |
| 541 |
description: |
| 542 |
- Indicates whether to support IP compression. |
| 543 |
type: bool |
| 544 |
use_aggressive_mode: |
| 545 |
description: |
| 546 |
- Indicates whether to use aggressive mode. |
| 547 |
type: bool |
| 548 |
color: |
| 549 |
description: |
| 550 |
- Color of the object. Should be one of existing colors. |
| 551 |
type: str |
| 552 |
choices: ['aquamarine', 'black', 'blue', 'crete blue', 'burlywood', 'cyan', 'dark green', 'khaki', 'orchid', 'dark orange', 'dark sea green', |
| 553 |
'pink', 'turquoise', 'dark blue', 'firebrick', 'brown', 'forest green', 'gold', 'dark gold', 'gray', 'dark gray', 'light green', 'lemon chiffon', |
| 554 |
'coral', 'sea green', 'sky blue', 'magenta', 'purple', 'slate blue', 'violet red', 'navy blue', 'olive', 'orange', 'red', 'sienna', 'yellow'] |
| 555 |
comments: |
| 556 |
description: |
| 557 |
- Comments string. |
| 558 |
type: str |
| 559 |
details_level: |
| 560 |
description: |
| 561 |
- The level of detail for some of the fields in the response can vary from showing only the UID value of the object to a fully detailed |
| 562 |
representation of the object. |
| 563 |
type: str |
| 564 |
choices: ['uid', 'standard', 'full'] |
| 565 |
ignore_warnings: |
| 566 |
description: |
| 567 |
- Apply changes ignoring warnings. |
| 568 |
type: bool |
| 569 |
ignore_errors: |
| 570 |
description: |
| 571 |
- Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored. |
| 572 |
type: bool |
| 573 |
extends_documentation_fragment: check_point.mgmt.checkpoint_objects |
| 574 |
""" |
| 575 |
|
| 576 |
EXAMPLES = """ |
| 577 |
- name: add-vpn-community-star |
| 578 |
cp_mgmt_vpn_community_star: |
| 579 |
center_gateways: Second_Security_Gateway |
| 580 |
encryption_method: prefer ikev2 but support ikev1 |
| 581 |
encryption_suite: custom |
| 582 |
ike_phase_1: |
| 583 |
data_integrity: sha1 |
| 584 |
diffie_hellman_group: group 19 |
| 585 |
encryption_algorithm: aes-128 |
| 586 |
ike_phase_2: |
| 587 |
data_integrity: aes-xcbc |
| 588 |
encryption_algorithm: aes-gcm-128 |
| 589 |
name: New_VPN_Community_Star_1 |
| 590 |
state: present |
| 591 |
|
| 592 |
- name: set-vpn-community-star |
| 593 |
cp_mgmt_vpn_community_star: |
| 594 |
encryption_method: ikev2 only |
| 595 |
encryption_suite: custom |
| 596 |
ike_phase_1: |
| 597 |
data_integrity: sha1 |
| 598 |
diffie_hellman_group: group 19 |
| 599 |
encryption_algorithm: aes-128 |
| 600 |
ike_phase_2: |
| 601 |
data_integrity: aes-xcbc |
| 602 |
encryption_algorithm: aes-gcm-128 |
| 603 |
name: New_VPN_Community_Star_1 |
| 604 |
state: present |
| 605 |
|
| 606 |
- name: delete-vpn-community-star |
| 607 |
cp_mgmt_vpn_community_star: |
| 608 |
name: New_VPN_Community_Star_1 |
| 609 |
state: absent |
| 610 |
""" |
| 611 |
|
| 612 |
RETURN = """ |
| 613 |
cp_mgmt_vpn_community_star: |
| 614 |
description: The checkpoint object created or updated. |
| 615 |
returned: always, except when deleting the object. |
| 616 |
type: dict |
| 617 |
""" |
| 618 |
|
| 619 |
from ansible.module_utils.basic import AnsibleModule |
| 620 |
from ansible_collections.check_point.mgmt.plugins.module_utils.checkpoint import ( |
| 621 |
checkpoint_argument_spec_for_objects, |
| 622 |
api_call, |
| 623 |
) |
| 624 |
|
| 625 |
|
| 626 |
def main(): |
| 627 |
argument_spec = dict( |
| 628 |
name=dict(type="str", required=True), |
| 629 |
center_gateways=dict(type="list", elements="str"), |
| 630 |
disable_nat=dict( |
| 631 |
type="bool" |
| 632 |
), |
| 633 |
|
| 634 |
disable_nat_on=dict( |
| 635 |
type="str", |
| 636 |
choices=[ |
| 637 |
"satellite gateways only", |
| 638 |
"both center and satellite gateways" |
| 639 |
] |
| 640 |
), |
| 641 |
|
| 642 |
encrypted_traffic=dict( |
| 643 |
type="dict", |
| 644 |
options=dict( |
| 645 |
enabled=dict(type="bool", ), |
| 646 |
community_members=dict( |
| 647 |
type="str", |
| 648 |
choices=[ |
| 649 |
"satellite gateways only", |
| 650 |
"both center and satellite gateways" |
| 651 |
] |
| 652 |
) |
| 653 |
) |
| 654 |
), |
| 655 |
encryption_method=dict( |
| 656 |
type="str", |
| 657 |
choices=[ |
| 658 |
"prefer ikev2 but support ikev1", |
| 659 |
"ikev2 only", |
| 660 |
"ikev1 for ipv4 and ikev2 for ipv6 only", |
| 661 |
], |
| 662 |
), |
| 663 |
encryption_suite=dict( |
| 664 |
type="str", |
| 665 |
choices=[ |
| 666 |
"suite-b-gcm-256", |
| 667 |
"custom", |
| 668 |
"vpn b", |
| 669 |
"vpn a", |
| 670 |
"suite-b-gcm-128", |
| 671 |
], |
| 672 |
), |
| 673 |
excluded_services=dict(type="list", elements="str"), |
| 674 |
granular_encryptions=dict(type='list', elements="dict", options=dict( |
| 675 |
internal_gateway=dict(type='str'), |
| 676 |
external_gateway=dict(type='str'), |
| 677 |
encryption_method=dict(type='str', choices=['prefer ikev2 but support ikev1', 'ikev2 only', |
| 678 |
'ikev1 for ipv4 and ikev2 for ipv6 only']), |
| 679 |
encryption_suite=dict(type='str', |
| 680 |
choices=['suite-b-gcm-256', 'custom', 'vpn b', 'vpn a', 'suite-b-gcm-128']), |
| 681 |
ike_phase_1=dict(type='dict', options=dict( |
| 682 |
encryption_algorithm=dict(type='str', choices=['cast', 'aes-256', 'des', 'aes-128', '3des']), |
| 683 |
data_integrity=dict(type='str', choices=['aes-xcbc', 'sha1', 'sha256', 'sha384', 'sha512', 'md5']), |
| 684 |
diffie_hellman_group=dict(type='str', choices=['group-1', 'group-2', 'group-5', |
| 685 |
'group-14', 'group-15', 'group-16', 'group-17', |
| 686 |
'group-18', 'group-19', 'group-20', |
| 687 |
'group-24']), |
| 688 |
ike_p1_rekey_time=dict(type='int', no_log=False), |
| 689 |
ike_p1_rekey_time_unit=dict(type='str', choices=['days', 'hours', 'minutes', 'seconds']) |
| 690 |
)), |
| 691 |
ike_phase_2=dict(type='dict', options=dict( |
| 692 |
encryption_algorithm=dict(type='str', choices=['cast', 'aes-gcm-256', 'cast-40', |
| 693 |
'aes-256', 'des', 'aes-128', '3des', 'des-40cp', |
| 694 |
'aes-gcm-128', 'none']), |
| 695 |
data_integrity=dict(type='str', choices=['aes-xcbc', 'sha1', 'sha256', 'sha384', 'sha512', 'md5']), |
| 696 |
ike_p2_use_pfs=dict(type='bool'), |
| 697 |
ike_p2_pfs_dh_grp=dict(type='str', choices=['group-1', 'group-2', 'group-5', |
| 698 |
'group-14', 'group-15', 'group-16', 'group-17', 'group-18', |
| 699 |
'group-19', 'group-20', 'group-24']), |
| 700 |
ike_p2_rekey_time=dict(type='int', no_log=False), |
| 701 |
ike_p2_rekey_time_unit=dict(type='str', choices=['days', 'hours', 'minutes', 'seconds']), |
| 702 |
)) |
| 703 |
)), |
| 704 |
ike_phase_1=dict( |
| 705 |
type="dict", |
| 706 |
options=dict( |
| 707 |
data_integrity=dict( |
| 708 |
type="str", |
| 709 |
choices=["aes-xcbc", "sha1", "sha256", "sha384", "sha512", "md5"], |
| 710 |
), |
| 711 |
diffie_hellman_group=dict( |
| 712 |
type="str", |
| 713 |
choices=[ |
| 714 |
"group-1", |
| 715 |
"group-2", |
| 716 |
"group-5", |
| 717 |
"group-14", |
| 718 |
"group-19", |
| 719 |
"group-20", |
| 720 |
], |
| 721 |
), |
| 722 |
encryption_algorithm=dict( |
| 723 |
type="str", |
| 724 |
choices=["cast", "aes-256", "des", "aes-128", "3des"], |
| 725 |
), |
| 726 |
ike_p1_rekey_time=dict(type='int', no_log=False), |
| 727 |
ike_p1_rekey_time_unit=dict(type='str', choices=['days', 'hours', 'minutes', 'seconds']), |
| 728 |
), |
| 729 |
), |
| 730 |
ike_phase_2=dict( |
| 731 |
type="dict", |
| 732 |
options=dict( |
| 733 |
data_integrity=dict( |
| 734 |
type="str", |
| 735 |
choices=["aes-xcbc", "sha1", "sha256", "sha384", "sha512", "md5"], |
| 736 |
), |
| 737 |
encryption_algorithm=dict( |
| 738 |
type="str", |
| 739 |
choices=[ |
| 740 |
"cast", |
| 741 |
"aes-gcm-256", |
| 742 |
"cast-40", |
| 743 |
"aes-256", |
| 744 |
"des", |
| 745 |
"aes-128", |
| 746 |
"3des", |
| 747 |
"des-40cp", |
| 748 |
"aes-gcm-128", |
| 749 |
"none", |
| 750 |
], |
| 751 |
), |
| 752 |
ike_p2_use_pfs=dict(type='bool'), |
| 753 |
ike_p2_pfs_dh_grp=dict(type='str', choices=['group-1', 'group-2', 'group-5', 'group-14', |
| 754 |
'group-15', 'group-16', 'group-17', 'group-18', 'group-19', |
| 755 |
'group-20', 'group-24']), |
| 756 |
ike_p2_rekey_time=dict(type='int', no_log=False), |
| 757 |
ike_p2_rekey_time_unit=dict(type='str', choices=['days', 'hours', 'minutes', 'seconds']), |
| 758 |
), |
| 759 |
), |
| 760 |
mep=dict( |
| 761 |
type="dict", |
| 762 |
options=dict( |
| 763 |
enabled=dict( |
| 764 |
type="bool" |
| 765 |
), |
| 766 |
entry_point_selection_mechanism=dict( |
| 767 |
type="str", |
| 768 |
choices=[ |
| 769 |
"closest gateway to source", |
| 770 |
"closest gateway to destination", |
| 771 |
"random selection", |
| 772 |
"manual" |
| 773 |
] |
| 774 |
), |
| 775 |
entry_point_final_selection_mechanism=dict( |
| 776 |
type="str", |
| 777 |
choices=[ |
| 778 |
"random selection", |
| 779 |
"first to respond" |
| 780 |
] |
| 781 |
), |
| 782 |
tracking=dict( |
| 783 |
type="str", |
| 784 |
choices=[ |
| 785 |
"none", |
| 786 |
"log", |
| 787 |
"popup alert", |
| 788 |
"mail alert", |
| 789 |
"snmp trap alert", |
| 790 |
"user defined alert no.1", |
| 791 |
"user defined alert no.2", |
| 792 |
"user defined alert no.3" |
| 793 |
] |
| 794 |
), |
| 795 |
default_priority_rule=dict( |
| 796 |
type="dict", |
| 797 |
options=dict( |
| 798 |
first_priority_center_gateways=dict( |
| 799 |
type="list", elements="str" |
| 800 |
), |
| 801 |
second_priority_center_gateways=dict( |
| 802 |
type="list", elements="str" |
| 803 |
), |
| 804 |
third_priority_center_gateways=dict( |
| 805 |
type="list", elements="str" |
| 806 |
) |
| 807 |
) |
| 808 |
), |
| 809 |
exception_priority_rules=dict( |
| 810 |
type="list", |
| 811 |
elements="dict", |
| 812 |
options=dict( |
| 813 |
satellite_gateways=dict( |
| 814 |
type="list", elements="str" |
| 815 |
), |
| 816 |
first_priority_center_gateways=dict( |
| 817 |
type="list", elements="str" |
| 818 |
), |
| 819 |
second_priority_center_gateways=dict( |
| 820 |
type="list", elements="str" |
| 821 |
), |
| 822 |
third_priority_center_gateways=dict( |
| 823 |
type="list", elements="str" |
| 824 |
) |
| 825 |
) |
| 826 |
) |
| 827 |
) |
| 828 |
), |
| 829 |
mesh_center_gateways=dict(type="bool"), |
| 830 |
permanent_tunnels=dict( |
| 831 |
type="dict", |
| 832 |
options=dict( |
| 833 |
set_permanent_tunnels=dict( |
| 834 |
type="str", |
| 835 |
choices=[ |
| 836 |
"on all tunnels in the community", |
| 837 |
"on all tunnels of specific gateways", |
| 838 |
"on specific tunnels in the community", |
| 839 |
"off" |
| 840 |
] |
| 841 |
), |
| 842 |
gateways=dict( |
| 843 |
type="list", |
| 844 |
elements="dict", |
| 845 |
options=dict( |
| 846 |
gateway=dict( |
| 847 |
type="str" |
| 848 |
), |
| 849 |
track_options=dict( |
| 850 |
type="str", |
| 851 |
choices=[ |
| 852 |
"according to community track options", |
| 853 |
"override track options" |
| 854 |
] |
| 855 |
), |
| 856 |
override_tunnel_down_track=dict( |
| 857 |
type="str", |
| 858 |
choices=[ |
| 859 |
"none", |
| 860 |
"log", |
| 861 |
"popup alert", |
| 862 |
"mail alert", |
| 863 |
"snmp trap alert", |
| 864 |
"user defined alert no.1", |
| 865 |
"user defined alert no.2", |
| 866 |
"user defined alert no.3" |
| 867 |
] |
| 868 |
), |
| 869 |
override_tunnel_up_track=dict( |
| 870 |
type="str", |
| 871 |
choices=[ |
| 872 |
"none", |
| 873 |
"log", |
| 874 |
"popup alert", |
| 875 |
"mail alert", |
| 876 |
"snmp trap alert", |
| 877 |
"user defined alert no.1", |
| 878 |
"user defined alert no.2", |
| 879 |
"user defined alert no.3" |
| 880 |
] |
| 881 |
) |
| 882 |
) |
| 883 |
), |
| 884 |
tunnels=dict( |
| 885 |
type="list", |
| 886 |
elements="dict", |
| 887 |
options=dict( |
| 888 |
first_tunnel_endpoint=dict( |
| 889 |
type="str" |
| 890 |
), |
| 891 |
second_tunnel_endpoint=dict( |
| 892 |
type="str" |
| 893 |
), |
| 894 |
track_options=dict( |
| 895 |
type="str", |
| 896 |
choices=[ |
| 897 |
"according to community track options", |
| 898 |
"override track options" |
| 899 |
] |
| 900 |
), |
| 901 |
override_tunnel_down_track=dict( |
| 902 |
type="str", |
| 903 |
choices=[ |
| 904 |
"none", |
| 905 |
"log", |
| 906 |
"popup alert", |
| 907 |
"mail alert", |
| 908 |
"snmp trap alert", |
| 909 |
"user defined alert no.1", |
| 910 |
"user defined alert no.2", |
| 911 |
"user defined alert no.3" |
| 912 |
] |
| 913 |
), |
| 914 |
override_tunnel_up_track=dict( |
| 915 |
type="str", |
| 916 |
choices=[ |
| 917 |
"none", |
| 918 |
"log", |
| 919 |
"popup alert", |
| 920 |
"mail alert", |
| 921 |
"snmp trap alert", |
| 922 |
"user defined alert no.1", |
| 923 |
"user defined alert no.2", |
| 924 |
"user defined alert no.3" |
| 925 |
] |
| 926 |
) |
| 927 |
) |
| 928 |
), |
| 929 |
rim=dict( |
| 930 |
type="dict", |
| 931 |
options=dict( |
| 932 |
enabled=dict( |
| 933 |
type="bool" |
| 934 |
), |
| 935 |
enable_on_center_gateways=dict( |
| 936 |
type="bool" |
| 937 |
), |
| 938 |
enable_on_satellite_gateways=dict( |
| 939 |
type="bool" |
| 940 |
), |
| 941 |
route_injection_track=dict( |
| 942 |
type="str", |
| 943 |
choices=[ |
| 944 |
"none", |
| 945 |
"log", |
| 946 |
"popup alert", |
| 947 |
"mail alert", |
| 948 |
"snmp trap alert", |
| 949 |
"user defined alert no.1", |
| 950 |
"user defined alert no.2", |
| 951 |
"user defined alert no.3" |
| 952 |
] |
| 953 |
) |
| 954 |
) |
| 955 |
), |
| 956 |
tunnel_down_track=dict( |
| 957 |
type="str", |
| 958 |
choices=[ |
| 959 |
"none", |
| 960 |
"log", |
| 961 |
"popup alert", |
| 962 |
"mail alert", |
| 963 |
"snmp trap alert", |
| 964 |
"user defined alert no.1", |
| 965 |
"user defined alert no.2", |
| 966 |
"user defined alert no.3" |
| 967 |
] |
| 968 |
), |
| 969 |
tunnel_up_track=dict( |
| 970 |
type="str", |
| 971 |
choices=[ |
| 972 |
"none", |
| 973 |
"log", |
| 974 |
"popup alert", |
| 975 |
"mail alert", |
| 976 |
"snmp trap alert", |
| 977 |
"user defined alert no.1", |
| 978 |
"user defined alert no.2", |
| 979 |
"user defined alert no.3" |
| 980 |
] |
| 981 |
) |
| 982 |
) |
| 983 |
), |
| 984 |
override_vpn_domains=dict(type='list', elements="dict", options=dict( |
| 985 |
gateway=dict(type='str'), |
| 986 |
vpn_domain=dict(type='str') |
| 987 |
)), |
| 988 |
satellite_gateways=dict(type="list", elements="str"), |
| 989 |
shared_secrets=dict( |
| 990 |
type="list", |
| 991 |
elements="dict", |
| 992 |
no_log=True, |
| 993 |
options=dict( |
| 994 |
external_gateway=dict(type="str"), |
| 995 |
shared_secret=dict(type="str", no_log=True), |
| 996 |
), |
| 997 |
), |
| 998 |
tags=dict(type="list", elements="str"), |
| 999 |
tunnel_granularity=dict(type='str', choices=['per_host', 'per_subnet', 'universal']), |
| 1000 |
use_shared_secret=dict(type="bool"), |
| 1001 |
vpn_routing=dict( |
| 1002 |
type="str", |
| 1003 |
choices=[ |
| 1004 |
"to center only", |
| 1005 |
"to center and to other satellites", |
| 1006 |
"to center other satellites and internet" |
| 1007 |
] |
| 1008 |
), |
| 1009 |
|
| 1010 |
wire_mode=dict( |
| 1011 |
type="dict", |
| 1012 |
options=dict( |
| 1013 |
allow_uninspected_encrypted_traffic=dict( |
| 1014 |
type="bool" |
| 1015 |
), |
| 1016 |
allow_uninspected_encrypted_routing=dict( |
| 1017 |
type="bool" |
| 1018 |
) |
| 1019 |
) |
| 1020 |
), |
| 1021 |
|
| 1022 |
routing_mode=dict( |
| 1023 |
type="str", |
| 1024 |
choices=[ |
| 1025 |
"domain_based", |
| 1026 |
"route_based" |
| 1027 |
] |
| 1028 |
), |
| 1029 |
|
| 1030 |
advanced_properties=dict( |
| 1031 |
type="dict", |
| 1032 |
options=dict( |
| 1033 |
support_ip_compression=dict( |
| 1034 |
type="bool" |
| 1035 |
), |
| 1036 |
use_aggressive_mode=dict( |
| 1037 |
type="bool" |
| 1038 |
) |
| 1039 |
) |
| 1040 |
), |
| 1041 |
color=dict( |
| 1042 |
type="str", |
| 1043 |
choices=[ |
| 1044 |
"aquamarine", |
| 1045 |
"black", |
| 1046 |
"blue", |
| 1047 |
"crete blue", |
| 1048 |
"burlywood", |
| 1049 |
"cyan", |
| 1050 |
"dark green", |
| 1051 |
"khaki", |
| 1052 |
"orchid", |
| 1053 |
"dark orange", |
| 1054 |
"dark sea green", |
| 1055 |
"pink", |
| 1056 |
"turquoise", |
| 1057 |
"dark blue", |
| 1058 |
"firebrick", |
| 1059 |
"brown", |
| 1060 |
"forest green", |
| 1061 |
"gold", |
| 1062 |
"dark gold", |
| 1063 |
"gray", |
| 1064 |
"dark gray", |
| 1065 |
"light green", |
| 1066 |
"lemon chiffon", |
| 1067 |
"coral", |
| 1068 |
"sea green", |
| 1069 |
"sky blue", |
| 1070 |
"magenta", |
| 1071 |
"purple", |
| 1072 |
"slate blue", |
| 1073 |
"violet red", |
| 1074 |
"navy blue", |
| 1075 |
"olive", |
| 1076 |
"orange", |
| 1077 |
"red", |
| 1078 |
"sienna", |
| 1079 |
"yellow", |
| 1080 |
], |
| 1081 |
), |
| 1082 |
comments=dict(type="str"), |
| 1083 |
details_level=dict(type="str", choices=["uid", "standard", "full"]), |
| 1084 |
ignore_warnings=dict(type="bool"), |
| 1085 |
ignore_errors=dict(type="bool"), |
| 1086 |
) |
| 1087 |
argument_spec.update(checkpoint_argument_spec_for_objects) |
| 1088 |
|
| 1089 |
module = AnsibleModule( |
| 1090 |
argument_spec=argument_spec, supports_check_mode=True |
| 1091 |
) |
| 1092 |
api_call_object = "vpn-community-star" |
| 1093 |
|
| 1094 |
result = api_call(module, api_call_object) |
| 1095 |
module.exit_json(**result) |
| 1096 |
|
| 1097 |
|
| 1098 |
if __name__ == "__main__": |
| 1099 |
main() |