| 1 |
|
| 2 |
from __future__ import absolute_import, division, print_function |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
__metaclass__ = type |
| 7 |
|
| 8 |
ANSIBLE_METADATA = {'status': ['preview'], |
| 9 |
'supported_by': 'community', |
| 10 |
'metadata_version': '1.1'} |
| 11 |
|
| 12 |
DOCUMENTATION = ''' |
| 13 |
--- |
| 14 |
module: fmgr_system_npu_fpanomaly |
| 15 |
short_description: NP6Lite anomaly protection |
| 16 |
version_added: "2.1.0" |
| 17 |
extends_documentation_fragment: |
| 18 |
- fortinet.fortimanager.general |
| 19 |
- fortinet.fortimanager.general.partial_crud |
| 20 |
options: |
| 21 |
revision_note: |
| 22 |
description: The change note that can be specified when an object is created or updated. |
| 23 |
type: str |
| 24 |
adom: |
| 25 |
description: The parameter (adom) in requested url. |
| 26 |
type: str |
| 27 |
required: true |
| 28 |
system_npu_fpanomaly: |
| 29 |
description: The top level parameters set. |
| 30 |
required: false |
| 31 |
type: dict |
| 32 |
suboptions: |
| 33 |
esp_minlen_err: |
| 34 |
aliases: ['esp-minlen-err'] |
| 35 |
type: str |
| 36 |
description: Invalid IPv4 ESP short packet anomalies. |
| 37 |
choices: ['drop', 'trap-to-host'] |
| 38 |
icmp_csum_err: |
| 39 |
aliases: ['icmp-csum-err'] |
| 40 |
type: str |
| 41 |
description: Invalid IPv4 ICMP packet checksum anomalies. |
| 42 |
choices: ['drop', 'trap-to-host'] |
| 43 |
icmp_minlen_err: |
| 44 |
aliases: ['icmp-minlen-err'] |
| 45 |
type: str |
| 46 |
description: Invalid IPv4 ICMP short packet anomalies. |
| 47 |
choices: ['drop', 'trap-to-host'] |
| 48 |
ipv4_csum_err: |
| 49 |
aliases: ['ipv4-csum-err'] |
| 50 |
type: str |
| 51 |
description: Invalid IPv4 packet checksum anomalies. |
| 52 |
choices: ['drop', 'trap-to-host'] |
| 53 |
ipv4_ihl_err: |
| 54 |
aliases: ['ipv4-ihl-err'] |
| 55 |
type: str |
| 56 |
description: Invalid IPv4 header length anomalies. |
| 57 |
choices: ['drop', 'trap-to-host'] |
| 58 |
ipv4_len_err: |
| 59 |
aliases: ['ipv4-len-err'] |
| 60 |
type: str |
| 61 |
description: Invalid IPv4 packet length anomalies. |
| 62 |
choices: ['drop', 'trap-to-host'] |
| 63 |
ipv4_opt_err: |
| 64 |
aliases: ['ipv4-opt-err'] |
| 65 |
type: str |
| 66 |
description: Invalid IPv4 option parsing anomalies. |
| 67 |
choices: ['drop', 'trap-to-host'] |
| 68 |
ipv4_ttlzero_err: |
| 69 |
aliases: ['ipv4-ttlzero-err'] |
| 70 |
type: str |
| 71 |
description: Invalid IPv4 TTL field zero anomalies. |
| 72 |
choices: ['drop', 'trap-to-host'] |
| 73 |
ipv4_ver_err: |
| 74 |
aliases: ['ipv4-ver-err'] |
| 75 |
type: str |
| 76 |
description: Invalid IPv4 header version anomalies. |
| 77 |
choices: ['drop', 'trap-to-host'] |
| 78 |
ipv6_exthdr_len_err: |
| 79 |
aliases: ['ipv6-exthdr-len-err'] |
| 80 |
type: str |
| 81 |
description: Invalid IPv6 packet chain extension header total length anomalies. |
| 82 |
choices: ['drop', 'trap-to-host'] |
| 83 |
ipv6_exthdr_order_err: |
| 84 |
aliases: ['ipv6-exthdr-order-err'] |
| 85 |
type: str |
| 86 |
description: Invalid IPv6 packet extension header ordering anomalies. |
| 87 |
choices: ['drop', 'trap-to-host'] |
| 88 |
ipv6_ihl_err: |
| 89 |
aliases: ['ipv6-ihl-err'] |
| 90 |
type: str |
| 91 |
description: Invalid IPv6 packet length anomalies. |
| 92 |
choices: ['drop', 'trap-to-host'] |
| 93 |
ipv6_plen_zero: |
| 94 |
aliases: ['ipv6-plen-zero'] |
| 95 |
type: str |
| 96 |
description: Invalid IPv6 packet payload length zero anomalies. |
| 97 |
choices: ['drop', 'trap-to-host'] |
| 98 |
ipv6_ver_err: |
| 99 |
aliases: ['ipv6-ver-err'] |
| 100 |
type: str |
| 101 |
description: Invalid IPv6 packet version anomalies. |
| 102 |
choices: ['drop', 'trap-to-host'] |
| 103 |
tcp_csum_err: |
| 104 |
aliases: ['tcp-csum-err'] |
| 105 |
type: str |
| 106 |
description: Invalid IPv4 TCP packet checksum anomalies. |
| 107 |
choices: ['drop', 'trap-to-host'] |
| 108 |
tcp_hlen_err: |
| 109 |
aliases: ['tcp-hlen-err'] |
| 110 |
type: str |
| 111 |
description: Invalid IPv4 TCP header length anomalies. |
| 112 |
choices: ['drop', 'trap-to-host'] |
| 113 |
tcp_plen_err: |
| 114 |
aliases: ['tcp-plen-err'] |
| 115 |
type: str |
| 116 |
description: Invalid IPv4 TCP packet length anomalies. |
| 117 |
choices: ['drop', 'trap-to-host'] |
| 118 |
udp_csum_err: |
| 119 |
aliases: ['udp-csum-err'] |
| 120 |
type: str |
| 121 |
description: Invalid IPv4 UDP packet checksum anomalies. |
| 122 |
choices: ['drop', 'trap-to-host'] |
| 123 |
udp_hlen_err: |
| 124 |
aliases: ['udp-hlen-err'] |
| 125 |
type: str |
| 126 |
description: Invalid IPv4 UDP packet header length anomalies. |
| 127 |
choices: ['drop', 'trap-to-host'] |
| 128 |
udp_len_err: |
| 129 |
aliases: ['udp-len-err'] |
| 130 |
type: str |
| 131 |
description: Invalid IPv4 UDP packet length anomalies. |
| 132 |
choices: ['drop', 'trap-to-host'] |
| 133 |
udp_plen_err: |
| 134 |
aliases: ['udp-plen-err'] |
| 135 |
type: str |
| 136 |
description: Invalid IPv4 UDP packet minimum length anomalies. |
| 137 |
choices: ['drop', 'trap-to-host'] |
| 138 |
udplite_cover_err: |
| 139 |
aliases: ['udplite-cover-err'] |
| 140 |
type: str |
| 141 |
description: Invalid IPv4 UDP-Lite packet coverage anomalies. |
| 142 |
choices: ['drop', 'trap-to-host'] |
| 143 |
udplite_csum_err: |
| 144 |
aliases: ['udplite-csum-err'] |
| 145 |
type: str |
| 146 |
description: Invalid IPv4 UDP-Lite packet checksum anomalies. |
| 147 |
choices: ['drop', 'trap-to-host', 'allow'] |
| 148 |
unknproto_minlen_err: |
| 149 |
aliases: ['unknproto-minlen-err'] |
| 150 |
type: str |
| 151 |
description: Invalid IPv4 L4 unknown protocol short packet anomalies. |
| 152 |
choices: ['drop', 'trap-to-host'] |
| 153 |
tcp_fin_only: |
| 154 |
aliases: ['tcp-fin-only'] |
| 155 |
type: str |
| 156 |
description: TCP SYN flood with only FIN flag set anomalies. |
| 157 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 158 |
ipv4_optsecurity: |
| 159 |
aliases: ['ipv4-optsecurity'] |
| 160 |
type: str |
| 161 |
description: Security option anomalies. |
| 162 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 163 |
ipv6_optralert: |
| 164 |
aliases: ['ipv6-optralert'] |
| 165 |
type: str |
| 166 |
description: Router alert option anomalies. |
| 167 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 168 |
tcp_syn_fin: |
| 169 |
aliases: ['tcp-syn-fin'] |
| 170 |
type: str |
| 171 |
description: TCP SYN flood SYN/FIN flag set anomalies. |
| 172 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 173 |
ipv4_proto_err: |
| 174 |
aliases: ['ipv4-proto-err'] |
| 175 |
type: str |
| 176 |
description: Invalid layer 4 protocol anomalies. |
| 177 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 178 |
ipv6_saddr_err: |
| 179 |
aliases: ['ipv6-saddr-err'] |
| 180 |
type: str |
| 181 |
description: Source address as multicast anomalies. |
| 182 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 183 |
icmp_frag: |
| 184 |
aliases: ['icmp-frag'] |
| 185 |
type: str |
| 186 |
description: Layer 3 fragmented packets that could be part of layer 4 ICMP anomalies. |
| 187 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 188 |
ipv4_optssrr: |
| 189 |
aliases: ['ipv4-optssrr'] |
| 190 |
type: str |
| 191 |
description: Strict source record route option anomalies. |
| 192 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 193 |
ipv6_opthomeaddr: |
| 194 |
aliases: ['ipv6-opthomeaddr'] |
| 195 |
type: str |
| 196 |
description: Home address option anomalies. |
| 197 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 198 |
udp_land: |
| 199 |
aliases: ['udp-land'] |
| 200 |
type: str |
| 201 |
description: UDP land anomalies. |
| 202 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 203 |
ipv6_optinvld: |
| 204 |
aliases: ['ipv6-optinvld'] |
| 205 |
type: str |
| 206 |
description: Invalid option anomalies. |
| 207 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 208 |
tcp_fin_noack: |
| 209 |
aliases: ['tcp-fin-noack'] |
| 210 |
type: str |
| 211 |
description: TCP SYN flood with FIN flag set without ACK setting anomalies. |
| 212 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 213 |
ipv6_proto_err: |
| 214 |
aliases: ['ipv6-proto-err'] |
| 215 |
type: str |
| 216 |
description: Layer 4 invalid protocol anomalies. |
| 217 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 218 |
tcp_land: |
| 219 |
aliases: ['tcp-land'] |
| 220 |
type: str |
| 221 |
description: TCP land anomalies. |
| 222 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 223 |
ipv4_unknopt: |
| 224 |
aliases: ['ipv4-unknopt'] |
| 225 |
type: str |
| 226 |
description: Unknown option anomalies. |
| 227 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 228 |
ipv4_optstream: |
| 229 |
aliases: ['ipv4-optstream'] |
| 230 |
type: str |
| 231 |
description: Stream option anomalies. |
| 232 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 233 |
ipv6_optjumbo: |
| 234 |
aliases: ['ipv6-optjumbo'] |
| 235 |
type: str |
| 236 |
description: Jumbo options anomalies. |
| 237 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 238 |
icmp_land: |
| 239 |
aliases: ['icmp-land'] |
| 240 |
type: str |
| 241 |
description: ICMP land anomalies. |
| 242 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 243 |
tcp_winnuke: |
| 244 |
aliases: ['tcp-winnuke'] |
| 245 |
type: str |
| 246 |
description: TCP WinNuke anomalies. |
| 247 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 248 |
ipv6_daddr_err: |
| 249 |
aliases: ['ipv6-daddr-err'] |
| 250 |
type: str |
| 251 |
description: Destination address as unspecified or loopback address anomalies. |
| 252 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 253 |
ipv4_land: |
| 254 |
aliases: ['ipv4-land'] |
| 255 |
type: str |
| 256 |
description: Land anomalies. |
| 257 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 258 |
ipv6_opttunnel: |
| 259 |
aliases: ['ipv6-opttunnel'] |
| 260 |
type: str |
| 261 |
description: Tunnel encapsulation limit option anomalies. |
| 262 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 263 |
tcp_no_flag: |
| 264 |
aliases: ['tcp-no-flag'] |
| 265 |
type: str |
| 266 |
description: TCP SYN flood with no flag set anomalies. |
| 267 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 268 |
ipv6_land: |
| 269 |
aliases: ['ipv6-land'] |
| 270 |
type: str |
| 271 |
description: Land anomalies. |
| 272 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 273 |
ipv4_optlsrr: |
| 274 |
aliases: ['ipv4-optlsrr'] |
| 275 |
type: str |
| 276 |
description: Loose source record route option anomalies. |
| 277 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 278 |
ipv4_opttimestamp: |
| 279 |
aliases: ['ipv4-opttimestamp'] |
| 280 |
type: str |
| 281 |
description: Timestamp option anomalies. |
| 282 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 283 |
ipv4_optrr: |
| 284 |
aliases: ['ipv4-optrr'] |
| 285 |
type: str |
| 286 |
description: Record route option anomalies. |
| 287 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 288 |
ipv6_optnsap: |
| 289 |
aliases: ['ipv6-optnsap'] |
| 290 |
type: str |
| 291 |
description: Network service access point address option anomalies. |
| 292 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 293 |
ipv6_unknopt: |
| 294 |
aliases: ['ipv6-unknopt'] |
| 295 |
type: str |
| 296 |
description: Unknown option anomalies. |
| 297 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 298 |
tcp_syn_data: |
| 299 |
aliases: ['tcp-syn-data'] |
| 300 |
type: str |
| 301 |
description: TCP SYN flood packets with data anomalies. |
| 302 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 303 |
ipv6_optendpid: |
| 304 |
aliases: ['ipv6-optendpid'] |
| 305 |
type: str |
| 306 |
description: End point identification anomalies. |
| 307 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 308 |
gtpu_plen_err: |
| 309 |
aliases: ['gtpu-plen-err'] |
| 310 |
type: str |
| 311 |
description: Gtpu plen err. |
| 312 |
choices: ['drop', 'trap-to-host'] |
| 313 |
vxlan_minlen_err: |
| 314 |
aliases: ['vxlan-minlen-err'] |
| 315 |
type: str |
| 316 |
description: Vxlan minlen err. |
| 317 |
choices: ['drop', 'trap-to-host'] |
| 318 |
capwap_minlen_err: |
| 319 |
aliases: ['capwap-minlen-err'] |
| 320 |
type: str |
| 321 |
description: Capwap minlen err. |
| 322 |
choices: ['drop', 'trap-to-host'] |
| 323 |
gre_csum_err: |
| 324 |
aliases: ['gre-csum-err'] |
| 325 |
type: str |
| 326 |
description: Gre csum err. |
| 327 |
choices: ['drop', 'trap-to-host', 'allow'] |
| 328 |
nvgre_minlen_err: |
| 329 |
aliases: ['nvgre-minlen-err'] |
| 330 |
type: str |
| 331 |
description: Nvgre minlen err. |
| 332 |
choices: ['drop', 'trap-to-host'] |
| 333 |
sctp_l4len_err: |
| 334 |
aliases: ['sctp-l4len-err'] |
| 335 |
type: str |
| 336 |
description: Sctp l4len err. |
| 337 |
choices: ['drop', 'trap-to-host'] |
| 338 |
tcp_hlenvsl4len_err: |
| 339 |
aliases: ['tcp-hlenvsl4len-err'] |
| 340 |
type: str |
| 341 |
description: Tcp hlenvsl4len err. |
| 342 |
choices: ['drop', 'trap-to-host'] |
| 343 |
sctp_crc_err: |
| 344 |
aliases: ['sctp-crc-err'] |
| 345 |
type: str |
| 346 |
description: Sctp crc err. |
| 347 |
choices: ['drop', 'trap-to-host'] |
| 348 |
sctp_clen_err: |
| 349 |
aliases: ['sctp-clen-err'] |
| 350 |
type: str |
| 351 |
description: Sctp clen err. |
| 352 |
choices: ['drop', 'trap-to-host'] |
| 353 |
uesp_minlen_err: |
| 354 |
aliases: ['uesp-minlen-err'] |
| 355 |
type: str |
| 356 |
description: Uesp minlen err. |
| 357 |
choices: ['drop', 'trap-to-host'] |
| 358 |
sctp_csum_err: |
| 359 |
aliases: ['sctp-csum-err'] |
| 360 |
type: str |
| 361 |
description: Invalid IPv4 SCTP checksum anomalies. |
| 362 |
choices: ['allow', 'drop', 'trap-to-host'] |
| 363 |
''' |
| 364 |
|
| 365 |
EXAMPLES = ''' |
| 366 |
- name: Example playbook (generated based on argument schema) |
| 367 |
hosts: fortimanagers |
| 368 |
connection: httpapi |
| 369 |
gather_facts: false |
| 370 |
tasks: |
| 371 |
- name: NP6Lite anomaly protection |
| 372 |
fortinet.fortimanager.fmgr_system_npu_fpanomaly: |
| 373 |
# workspace_locking_adom: <global or your adom name> |
| 374 |
adom: <your own value> |
| 375 |
system_npu_fpanomaly: |
| 376 |
# esp_minlen_err: <value in [drop, trap-to-host]> |
| 377 |
# icmp_csum_err: <value in [drop, trap-to-host]> |
| 378 |
# icmp_minlen_err: <value in [drop, trap-to-host]> |
| 379 |
# ipv4_csum_err: <value in [drop, trap-to-host]> |
| 380 |
# ipv4_ihl_err: <value in [drop, trap-to-host]> |
| 381 |
# ipv4_len_err: <value in [drop, trap-to-host]> |
| 382 |
# ipv4_opt_err: <value in [drop, trap-to-host]> |
| 383 |
# ipv4_ttlzero_err: <value in [drop, trap-to-host]> |
| 384 |
# ipv4_ver_err: <value in [drop, trap-to-host]> |
| 385 |
# ipv6_exthdr_len_err: <value in [drop, trap-to-host]> |
| 386 |
# ipv6_exthdr_order_err: <value in [drop, trap-to-host]> |
| 387 |
# ipv6_ihl_err: <value in [drop, trap-to-host]> |
| 388 |
# ipv6_plen_zero: <value in [drop, trap-to-host]> |
| 389 |
# ipv6_ver_err: <value in [drop, trap-to-host]> |
| 390 |
# tcp_csum_err: <value in [drop, trap-to-host]> |
| 391 |
# tcp_hlen_err: <value in [drop, trap-to-host]> |
| 392 |
# tcp_plen_err: <value in [drop, trap-to-host]> |
| 393 |
# udp_csum_err: <value in [drop, trap-to-host]> |
| 394 |
# udp_hlen_err: <value in [drop, trap-to-host]> |
| 395 |
# udp_len_err: <value in [drop, trap-to-host]> |
| 396 |
# udp_plen_err: <value in [drop, trap-to-host]> |
| 397 |
# udplite_cover_err: <value in [drop, trap-to-host]> |
| 398 |
# udplite_csum_err: <value in [drop, trap-to-host, allow]> |
| 399 |
# unknproto_minlen_err: <value in [drop, trap-to-host]> |
| 400 |
# tcp_fin_only: <value in [allow, drop, trap-to-host]> |
| 401 |
# ipv4_optsecurity: <value in [allow, drop, trap-to-host]> |
| 402 |
# ipv6_optralert: <value in [allow, drop, trap-to-host]> |
| 403 |
# tcp_syn_fin: <value in [allow, drop, trap-to-host]> |
| 404 |
# ipv4_proto_err: <value in [allow, drop, trap-to-host]> |
| 405 |
# ipv6_saddr_err: <value in [allow, drop, trap-to-host]> |
| 406 |
# icmp_frag: <value in [allow, drop, trap-to-host]> |
| 407 |
# ipv4_optssrr: <value in [allow, drop, trap-to-host]> |
| 408 |
# ipv6_opthomeaddr: <value in [allow, drop, trap-to-host]> |
| 409 |
# udp_land: <value in [allow, drop, trap-to-host]> |
| 410 |
# ipv6_optinvld: <value in [allow, drop, trap-to-host]> |
| 411 |
# tcp_fin_noack: <value in [allow, drop, trap-to-host]> |
| 412 |
# ipv6_proto_err: <value in [allow, drop, trap-to-host]> |
| 413 |
# tcp_land: <value in [allow, drop, trap-to-host]> |
| 414 |
# ipv4_unknopt: <value in [allow, drop, trap-to-host]> |
| 415 |
# ipv4_optstream: <value in [allow, drop, trap-to-host]> |
| 416 |
# ipv6_optjumbo: <value in [allow, drop, trap-to-host]> |
| 417 |
# icmp_land: <value in [allow, drop, trap-to-host]> |
| 418 |
# tcp_winnuke: <value in [allow, drop, trap-to-host]> |
| 419 |
# ipv6_daddr_err: <value in [allow, drop, trap-to-host]> |
| 420 |
# ipv4_land: <value in [allow, drop, trap-to-host]> |
| 421 |
# ipv6_opttunnel: <value in [allow, drop, trap-to-host]> |
| 422 |
# tcp_no_flag: <value in [allow, drop, trap-to-host]> |
| 423 |
# ipv6_land: <value in [allow, drop, trap-to-host]> |
| 424 |
# ipv4_optlsrr: <value in [allow, drop, trap-to-host]> |
| 425 |
# ipv4_opttimestamp: <value in [allow, drop, trap-to-host]> |
| 426 |
# ipv4_optrr: <value in [allow, drop, trap-to-host]> |
| 427 |
# ipv6_optnsap: <value in [allow, drop, trap-to-host]> |
| 428 |
# ipv6_unknopt: <value in [allow, drop, trap-to-host]> |
| 429 |
# tcp_syn_data: <value in [allow, drop, trap-to-host]> |
| 430 |
# ipv6_optendpid: <value in [allow, drop, trap-to-host]> |
| 431 |
# gtpu_plen_err: <value in [drop, trap-to-host]> |
| 432 |
# vxlan_minlen_err: <value in [drop, trap-to-host]> |
| 433 |
# capwap_minlen_err: <value in [drop, trap-to-host]> |
| 434 |
# gre_csum_err: <value in [drop, trap-to-host, allow]> |
| 435 |
# nvgre_minlen_err: <value in [drop, trap-to-host]> |
| 436 |
# sctp_l4len_err: <value in [drop, trap-to-host]> |
| 437 |
# tcp_hlenvsl4len_err: <value in [drop, trap-to-host]> |
| 438 |
# sctp_crc_err: <value in [drop, trap-to-host]> |
| 439 |
# sctp_clen_err: <value in [drop, trap-to-host]> |
| 440 |
# uesp_minlen_err: <value in [drop, trap-to-host]> |
| 441 |
# sctp_csum_err: <value in [allow, drop, trap-to-host]> |
| 442 |
''' |
| 443 |
|
| 444 |
RETURN = ''' |
| 445 |
meta: |
| 446 |
description: The result of the request. |
| 447 |
type: dict |
| 448 |
returned: always |
| 449 |
contains: |
| 450 |
request_url: |
| 451 |
description: The full url requested. |
| 452 |
returned: always |
| 453 |
type: str |
| 454 |
sample: /sys/login/user |
| 455 |
response_code: |
| 456 |
description: The status of api request. |
| 457 |
returned: always |
| 458 |
type: int |
| 459 |
sample: 0 |
| 460 |
response_data: |
| 461 |
description: The api response. |
| 462 |
type: list |
| 463 |
returned: always |
| 464 |
response_message: |
| 465 |
description: The descriptive message of the api response. |
| 466 |
type: str |
| 467 |
returned: always |
| 468 |
sample: OK. |
| 469 |
system_information: |
| 470 |
description: The information of the target system. |
| 471 |
type: dict |
| 472 |
returned: always |
| 473 |
rc: |
| 474 |
description: The status the request. |
| 475 |
type: int |
| 476 |
returned: always |
| 477 |
sample: 0 |
| 478 |
version_check_warning: |
| 479 |
description: Warning if the parameters used in the playbook are not supported by the current FortiManager version. |
| 480 |
type: list |
| 481 |
returned: complex |
| 482 |
''' |
| 483 |
from ansible.module_utils.basic import AnsibleModule |
| 484 |
from ansible.module_utils.connection import Connection |
| 485 |
from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass |
| 486 |
from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec |
| 487 |
|
| 488 |
|
| 489 |
def main(): |
| 490 |
urls_list = [ |
| 491 |
'/pm/config/adom/{adom}/obj/system/npu/fp-anomaly', |
| 492 |
'/pm/config/global/obj/system/npu/fp-anomaly' |
| 493 |
] |
| 494 |
module_arg_spec = { |
| 495 |
'adom': {'required': True, 'type': 'str'}, |
| 496 |
'revision_note': {'type': 'str'}, |
| 497 |
'system_npu_fpanomaly': { |
| 498 |
'type': 'dict', 'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], |
| 499 |
'options': { |
| 500 |
'esp-minlen-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 501 |
'icmp-csum-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 502 |
'icmp-minlen-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 503 |
'ipv4-csum-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 504 |
'ipv4-ihl-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 505 |
'ipv4-len-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 506 |
'ipv4-opt-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 507 |
'ipv4-ttlzero-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 508 |
'ipv4-ver-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 509 |
'ipv6-exthdr-len-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 510 |
'ipv6-exthdr-order-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 511 |
'ipv6-ihl-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 512 |
'ipv6-plen-zero': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 513 |
'ipv6-ver-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 514 |
'tcp-csum-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 515 |
'tcp-hlen-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 516 |
'tcp-plen-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 517 |
'udp-csum-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 518 |
'udp-hlen-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 519 |
'udp-len-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 520 |
'udp-plen-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 521 |
'udplite-cover-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 522 |
'udplite-csum-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host', 'allow'], 'type': 'str'}, |
| 523 |
'unknproto-minlen-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 524 |
'tcp-fin-only': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 525 |
'ipv4-optsecurity': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 526 |
'ipv6-optralert': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 527 |
'tcp-syn-fin': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 528 |
'ipv4-proto-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 529 |
'ipv6-saddr-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 530 |
'icmp-frag': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 531 |
'ipv4-optssrr': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 532 |
'ipv6-opthomeaddr': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 533 |
'udp-land': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 534 |
'ipv6-optinvld': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 535 |
'tcp-fin-noack': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 536 |
'ipv6-proto-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 537 |
'tcp-land': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 538 |
'ipv4-unknopt': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 539 |
'ipv4-optstream': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 540 |
'ipv6-optjumbo': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 541 |
'icmp-land': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 542 |
'tcp-winnuke': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 543 |
'ipv6-daddr-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 544 |
'ipv4-land': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 545 |
'ipv6-opttunnel': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 546 |
'tcp-no-flag': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 547 |
'ipv6-land': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 548 |
'ipv4-optlsrr': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 549 |
'ipv4-opttimestamp': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 550 |
'ipv4-optrr': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 551 |
'ipv6-optnsap': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 552 |
'ipv6-unknopt': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 553 |
'tcp-syn-data': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 554 |
'ipv6-optendpid': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'}, |
| 555 |
'gtpu-plen-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '7.6.2']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 556 |
'vxlan-minlen-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '7.6.2']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 557 |
'capwap-minlen-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '7.6.2']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 558 |
'gre-csum-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['drop', 'trap-to-host', 'allow'], 'type': 'str'}, |
| 559 |
'nvgre-minlen-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '7.6.2']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 560 |
'sctp-l4len-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '7.6.2']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 561 |
'tcp-hlenvsl4len-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '7.6.2']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 562 |
'sctp-crc-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '7.6.2']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 563 |
'sctp-clen-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '7.6.2']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 564 |
'uesp-minlen-err': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '7.6.2']], 'choices': ['drop', 'trap-to-host'], 'type': 'str'}, |
| 565 |
'sctp-csum-err': {'v_range': [['7.2.5', '7.2.12'], ['7.4.3', '']], 'choices': ['allow', 'drop', 'trap-to-host'], 'type': 'str'} |
| 566 |
} |
| 567 |
} |
| 568 |
} |
| 569 |
|
| 570 |
module_option_spec = get_module_arg_spec('partial crud') |
| 571 |
module_arg_spec.update(module_option_spec) |
| 572 |
check_galaxy_version(module_arg_spec) |
| 573 |
module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'system_npu_fpanomaly'), |
| 574 |
supports_check_mode=True) |
| 575 |
if not module._socket_path: |
| 576 |
module.fail_json(msg='MUST RUN IN HTTPAPI MODE') |
| 577 |
connection = Connection(module._socket_path) |
| 578 |
fmgr = NAPIManager('partial crud', module_arg_spec, urls_list, |
| 579 |
None, 'data', module, connection) |
| 580 |
fmgr.process_partial_crud() |
| 581 |
module.exit_json(meta=module.params) |
| 582 |
|
| 583 |
|
| 584 |
if __name__ == '__main__': |
| 585 |
main() |