Debian Codegraph @

ansible_collections/fortinet/fortios/plugins/modules/fortios_firewall_policy.py

raw symbols SCIP
1 #!/usr/bin/python
2 from __future__ import absolute_import, division, print_function
3
4 # Copyright: (c) 2022 Fortinet
5 # GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
6 #
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11
12 __metaclass__ = type
13
14 ANSIBLE_METADATA = {
15 "status": ["preview"],
16 "supported_by": "community",
17 "metadata_version": "1.1",
18 }
19
20 DOCUMENTATION = """
21 ---
22 module: fortios_firewall_policy
23 short_description: Configure IPv4/IPv6 policies in Fortinet's FortiOS and FortiGate.
24 description:
25 - This module is able to configure a FortiGate or FortiOS (FOS) device by allowing the
26 user to set and modify firewall feature and policy category.
27 Examples include all parameters and values need to be adjusted to datasources before usage.
28 Tested with FOS v6.0.0
29 version_added: "2.0.0"
30 author:
31 - Link Zheng (@chillancezen)
32 - Jie Xue (@JieX19)
33 - Hongbin Lu (@fgtdev-hblu)
34 - Frank Shen (@frankshen01)
35 - Miguel Angel Munoz (@mamunozgonzalez)
36 - Nicolas Thomas (@thomnico)
37 notes:
38 - We highly recommend using your own value as the policyid instead of 0, while '0' is a special placeholder that allows the backend to assign the latest
39 available number for the object, it does have limitations. Please find more details in Q&A.
40 - Legacy fortiosapi has been deprecated, httpapi is the preferred way to run playbooks
41 - Adjust object order by moving self after(before) another.
42 - Only one of [after, before] must be specified when action is moving an object.
43
44 - The module supports check_mode.
45
46 requirements:
47 - ansible>=2.16
48 options:
49 access_token:
50 description:
51 - Token-based authentication.
52 Generated from GUI of Fortigate.
53 type: str
54 required: false
55 enable_log:
56 description:
57 - Enable/Disable logging for task.
58 type: bool
59 required: false
60 default: false
61 vdom:
62 description:
63 - Virtual domain, among those defined previously. A vdom is a
64 virtual instance of the FortiGate that can be configured and
65 used as a different unit.
66 type: str
67 default: root
68 member_path:
69 type: str
70 description:
71 - Member attribute path to operate on.
72 - Delimited by a slash character if there are more than one attribute.
73 - Parameter marked with member_path is legitimate for doing member operation.
74 member_state:
75 type: str
76 description:
77 - Add or delete a member under specified attribute path.
78 - When member_state is specified, the state option is ignored.
79 choices:
80 - 'present'
81 - 'absent'
82 action:
83 description:
84 - the action indiactor to move an object in the list
85 type: str
86 choices:
87 - 'move'
88 self:
89 description:
90 - mkey of self identifier
91 type: str
92 after:
93 description:
94 - mkey of target identifier
95 type: str
96 before:
97 description:
98 - mkey of target identifier
99 type: str
100
101 state:
102 description:
103 - Indicates whether to create or remove the object.
104 type: str
105 required: false
106 choices:
107 - 'present'
108 - 'absent'
109 firewall_policy:
110 description:
111 - Configure IPv4/IPv6 policies.
112 default: null
113 type: dict
114 suboptions:
115 action:
116 description:
117 - Policy action (accept/deny/ipsec).
118 type: str
119 choices:
120 - 'accept'
121 - 'deny'
122 - 'ipsec'
123 anti_replay:
124 description:
125 - Enable/disable anti-replay check.
126 type: str
127 choices:
128 - 'enable'
129 - 'disable'
130 app_category:
131 description:
132 - Application category ID list.
133 type: list
134 elements: dict
135 suboptions:
136 id:
137 description:
138 - Category IDs. see <a href='#notes'>Notes</a>.
139 required: true
140 type: int
141 app_group:
142 description:
143 - Application group names.
144 type: list
145 elements: dict
146 suboptions:
147 name:
148 description:
149 - Application group names. Source application.group.name.
150 required: true
151 type: str
152 app_monitor:
153 description:
154 - Enable/disable application TCP metrics in session logs.When enabled, auto-asic-offload is disabled.
155 type: str
156 choices:
157 - 'enable'
158 - 'disable'
159 application:
160 description:
161 - Application ID list.
162 type: list
163 elements: dict
164 suboptions:
165 id:
166 description:
167 - Application IDs. see <a href='#notes'>Notes</a>.
168 required: true
169 type: int
170 application_list:
171 description:
172 - Name of an existing Application list. Source application.list.name.
173 type: str
174 auth_cert:
175 description:
176 - HTTPS server certificate for policy authentication. Source vpn.certificate.local.name.
177 type: str
178 auth_path:
179 description:
180 - Enable/disable authentication-based routing.
181 type: str
182 choices:
183 - 'enable'
184 - 'disable'
185 auth_redirect_addr:
186 description:
187 - HTTP-to-HTTPS redirect address for firewall authentication.
188 type: str
189 auto_asic_offload:
190 description:
191 - Enable/disable policy traffic ASIC offloading.
192 type: str
193 choices:
194 - 'enable'
195 - 'disable'
196 av_profile:
197 description:
198 - Name of an existing Antivirus profile. Source antivirus.profile.name.
199 type: str
200 block_notification:
201 description:
202 - Enable/disable block notification.
203 type: str
204 choices:
205 - 'enable'
206 - 'disable'
207 captive_portal_exempt:
208 description:
209 - Enable to exempt some users from the captive portal.
210 type: str
211 choices:
212 - 'enable'
213 - 'disable'
214 capture_packet:
215 description:
216 - Enable/disable capture packets.
217 type: str
218 choices:
219 - 'enable'
220 - 'disable'
221 casb_profile:
222 description:
223 - Name of an existing CASB profile. Source casb.profile.name.
224 type: str
225 cifs_profile:
226 description:
227 - Name of an existing CIFS profile. Source cifs.profile.name.
228 type: str
229 comments:
230 description:
231 - Comment.
232 type: str
233 custom_log_fields:
234 description:
235 - Custom fields to append to log messages for this policy.
236 type: list
237 elements: dict
238 suboptions:
239 field_id:
240 description:
241 - Custom log field. Source log.custom-field.id.
242 required: true
243 type: str
244 decrypted_traffic_mirror:
245 description:
246 - Decrypted traffic mirror. Source firewall.decrypted-traffic-mirror.name.
247 type: str
248 delay_tcp_npu_session:
249 description:
250 - Enable TCP NPU session delay to guarantee packet order of 3-way handshake.
251 type: str
252 choices:
253 - 'enable'
254 - 'disable'
255 devices:
256 description:
257 - Names of devices or device groups that can be matched by the policy.
258 type: list
259 elements: dict
260 suboptions:
261 name:
262 description:
263 - Device or group name. Source user.device.alias user.device-group.name user.device-category.name.
264 required: true
265 type: str
266 diameter_filter_profile:
267 description:
268 - Name of an existing Diameter filter profile. Source diameter-filter.profile.name.
269 type: str
270 diffserv_copy:
271 description:
272 - Enable to copy packet"s DiffServ values from session"s original direction to its reply direction.
273 type: str
274 choices:
275 - 'enable'
276 - 'disable'
277 diffserv_forward:
278 description:
279 - Enable to change packet"s DiffServ values to the specified diffservcode-forward value.
280 type: str
281 choices:
282 - 'enable'
283 - 'disable'
284 diffserv_reverse:
285 description:
286 - Enable to change packet"s reverse (reply) DiffServ values to the specified diffservcode-rev value.
287 type: str
288 choices:
289 - 'enable'
290 - 'disable'
291 diffservcode_forward:
292 description:
293 - Change packet"s DiffServ to this value.
294 type: str
295 diffservcode_rev:
296 description:
297 - Change packet"s reverse (reply) DiffServ to this value.
298 type: str
299 disclaimer:
300 description:
301 - Enable/disable user authentication disclaimer.
302 type: str
303 choices:
304 - 'enable'
305 - 'disable'
306 dlp_profile:
307 description:
308 - Name of an existing DLP profile. Source dlp.profile.name.
309 type: str
310 dlp_sensor:
311 description:
312 - Name of an existing DLP sensor. Source dlp.sensor.name.
313 type: str
314 dnsfilter_profile:
315 description:
316 - Name of an existing DNS filter profile. Source dnsfilter.profile.name.
317 type: str
318 dscp_match:
319 description:
320 - Enable DSCP check.
321 type: str
322 choices:
323 - 'enable'
324 - 'disable'
325 dscp_negate:
326 description:
327 - Enable negated DSCP match.
328 type: str
329 choices:
330 - 'enable'
331 - 'disable'
332 dscp_value:
333 description:
334 - DSCP value.
335 type: str
336 dsri:
337 description:
338 - Enable DSRI to ignore HTTP server responses.
339 type: str
340 choices:
341 - 'enable'
342 - 'disable'
343 dstaddr:
344 description:
345 - Destination IPv4 address and address group names.
346 type: list
347 elements: dict
348 suboptions:
349 name:
350 description:
351 - Address name. Source firewall.address.name firewall.addrgrp.name firewall.vip.name firewall.vipgrp.name system.external-resource
352 .name.
353 required: true
354 type: str
355 dstaddr_negate:
356 description:
357 - When enabled dstaddr specifies what the destination address must NOT be.
358 type: str
359 choices:
360 - 'enable'
361 - 'disable'
362 dstaddr6:
363 description:
364 - Destination IPv6 address name and address group names.
365 type: list
366 elements: dict
367 suboptions:
368 name:
369 description:
370 - Address name. Source firewall.address6.name firewall.addrgrp6.name firewall.vip6.name firewall.vipgrp6.name system
371 .external-resource.name.
372 required: true
373 type: str
374 dstaddr6_negate:
375 description:
376 - When enabled dstaddr6 specifies what the destination address must NOT be.
377 type: str
378 choices:
379 - 'enable'
380 - 'disable'
381 dstintf:
382 description:
383 - Outgoing (egress) interface.
384 type: list
385 elements: dict
386 suboptions:
387 name:
388 description:
389 - Interface name. Source system.interface.name system.zone.name system.sdwan.zone.name.
390 required: true
391 type: str
392 dynamic_shaping:
393 description:
394 - Enable/disable dynamic RADIUS defined traffic shaping.
395 type: str
396 choices:
397 - 'enable'
398 - 'disable'
399 email_collect:
400 description:
401 - Enable/disable email collection.
402 type: str
403 choices:
404 - 'enable'
405 - 'disable'
406 emailfilter_profile:
407 description:
408 - Name of an existing email filter profile. Source emailfilter.profile.name.
409 type: str
410 fec:
411 description:
412 - Enable/disable Forward Error Correction on traffic matching this policy on a FEC device.
413 type: str
414 choices:
415 - 'enable'
416 - 'disable'
417 file_filter_profile:
418 description:
419 - Name of an existing file-filter profile. Source file-filter.profile.name.
420 type: str
421 firewall_session_dirty:
422 description:
423 - How to handle sessions if the configuration of this firewall policy changes.
424 type: str
425 choices:
426 - 'check-all'
427 - 'check-new'
428 fixedport:
429 description:
430 - Enable to prevent source NAT from changing a session"s source port.
431 type: str
432 choices:
433 - 'enable'
434 - 'disable'
435 fsso:
436 description:
437 - Enable/disable Fortinet Single Sign-On.
438 type: str
439 choices:
440 - 'enable'
441 - 'disable'
442 fsso_agent_for_ntlm:
443 description:
444 - FSSO agent to use for NTLM authentication. Source user.fsso.name.
445 type: str
446 fsso_groups:
447 description:
448 - Names of FSSO groups.
449 type: list
450 elements: dict
451 suboptions:
452 name:
453 description:
454 - Names of FSSO groups. Source user.adgrp.name.
455 required: true
456 type: str
457 geoip_anycast:
458 description:
459 - Enable/disable recognition of anycast IP addresses using the geography IP database.
460 type: str
461 choices:
462 - 'enable'
463 - 'disable'
464 geoip_match:
465 description:
466 - Match geography address based either on its physical location or registered location.
467 type: str
468 choices:
469 - 'physical-location'
470 - 'registered-location'
471 global_label:
472 description:
473 - Label for the policy that appears when the GUI is in Global View mode.
474 type: str
475 groups:
476 description:
477 - Names of user groups that can authenticate with this policy.
478 type: list
479 elements: dict
480 suboptions:
481 name:
482 description:
483 - Group name. Source user.group.name.
484 required: true
485 type: str
486 gtp_profile:
487 description:
488 - GTP profile. Source firewall.gtp.name.
489 type: str
490 http_policy_redirect:
491 description:
492 - Redirect HTTP(S) traffic to matching transparent web proxy policy.
493 type: str
494 choices:
495 - 'enable'
496 - 'disable'
497 - 'legacy'
498 icap_profile:
499 description:
500 - Name of an existing ICAP profile. Source icap.profile.name.
501 type: str
502 identity_based_route:
503 description:
504 - Name of identity-based routing rule. Source firewall.identity-based-route.name.
505 type: str
506 inbound:
507 description:
508 - 'Policy-based IPsec VPN: only traffic from the remote network can initiate a VPN.'
509 type: str
510 choices:
511 - 'enable'
512 - 'disable'
513 inspection_mode:
514 description:
515 - Policy inspection mode (Flow/proxy). Default is Flow mode.
516 type: str
517 choices:
518 - 'proxy'
519 - 'flow'
520 internet_service:
521 description:
522 - Enable/disable use of Internet Services for this policy. If enabled, destination address and service are not used.
523 type: str
524 choices:
525 - 'enable'
526 - 'disable'
527 internet_service_custom:
528 description:
529 - Custom Internet Service name.
530 type: list
531 elements: dict
532 suboptions:
533 name:
534 description:
535 - Custom Internet Service name. Source firewall.internet-service-custom.name.
536 required: true
537 type: str
538 internet_service_custom_group:
539 description:
540 - Custom Internet Service group name.
541 type: list
542 elements: dict
543 suboptions:
544 name:
545 description:
546 - Custom Internet Service group name. Source firewall.internet-service-custom-group.name.
547 required: true
548 type: str
549 internet_service_fortiguard:
550 description:
551 - FortiGuard Internet Service name.
552 type: list
553 elements: dict
554 suboptions:
555 name:
556 description:
557 - FortiGuard Internet Service name. Source firewall.internet-service-fortiguard.name.
558 required: true
559 type: str
560 internet_service_group:
561 description:
562 - Internet Service group name.
563 type: list
564 elements: dict
565 suboptions:
566 name:
567 description:
568 - Internet Service group name. Source firewall.internet-service-group.name.
569 required: true
570 type: str
571 internet_service_id:
572 description:
573 - Internet Service ID.
574 type: list
575 elements: dict
576 suboptions:
577 id:
578 description:
579 - Internet Service ID. see <a href='#notes'>Notes</a>. Source firewall.internet-service.id.
580 required: true
581 type: int
582 internet_service_name:
583 description:
584 - Internet Service name.
585 type: list
586 elements: dict
587 suboptions:
588 name:
589 description:
590 - Internet Service name. Source firewall.internet-service-name.name.
591 required: true
592 type: str
593 internet_service_negate:
594 description:
595 - When enabled internet-service specifies what the service must NOT be.
596 type: str
597 choices:
598 - 'enable'
599 - 'disable'
600 internet_service_src:
601 description:
602 - Enable/disable use of Internet Services in source for this policy. If enabled, source address is not used.
603 type: str
604 choices:
605 - 'enable'
606 - 'disable'
607 internet_service_src_custom:
608 description:
609 - Custom Internet Service source name.
610 type: list
611 elements: dict
612 suboptions:
613 name:
614 description:
615 - Custom Internet Service name. Source firewall.internet-service-custom.name.
616 required: true
617 type: str
618 internet_service_src_custom_group:
619 description:
620 - Custom Internet Service source group name.
621 type: list
622 elements: dict
623 suboptions:
624 name:
625 description:
626 - Custom Internet Service group name. Source firewall.internet-service-custom-group.name.
627 required: true
628 type: str
629 internet_service_src_fortiguard:
630 description:
631 - FortiGuard Internet Service source name.
632 type: list
633 elements: dict
634 suboptions:
635 name:
636 description:
637 - FortiGuard Internet Service name. Source firewall.internet-service-fortiguard.name.
638 required: true
639 type: str
640 internet_service_src_group:
641 description:
642 - Internet Service source group name.
643 type: list
644 elements: dict
645 suboptions:
646 name:
647 description:
648 - Internet Service group name. Source firewall.internet-service-group.name.
649 required: true
650 type: str
651 internet_service_src_id:
652 description:
653 - Internet Service source ID.
654 type: list
655 elements: dict
656 suboptions:
657 id:
658 description:
659 - Internet Service ID. see <a href='#notes'>Notes</a>. Source firewall.internet-service.id.
660 required: true
661 type: int
662 internet_service_src_name:
663 description:
664 - Internet Service source name.
665 type: list
666 elements: dict
667 suboptions:
668 name:
669 description:
670 - Internet Service name. Source firewall.internet-service-name.name.
671 required: true
672 type: str
673 internet_service_src_negate:
674 description:
675 - When enabled internet-service-src specifies what the service must NOT be.
676 type: str
677 choices:
678 - 'enable'
679 - 'disable'
680 internet_service6:
681 description:
682 - Enable/disable use of IPv6 Internet Services for this policy. If enabled, destination address and service are not used.
683 type: str
684 choices:
685 - 'enable'
686 - 'disable'
687 internet_service6_custom:
688 description:
689 - Custom IPv6 Internet Service name.
690 type: list
691 elements: dict
692 suboptions:
693 name:
694 description:
695 - Custom Internet Service name. Source firewall.internet-service-custom.name.
696 required: true
697 type: str
698 internet_service6_custom_group:
699 description:
700 - Custom Internet Service6 group name.
701 type: list
702 elements: dict
703 suboptions:
704 name:
705 description:
706 - Custom Internet Service6 group name. Source firewall.internet-service-custom-group.name.
707 required: true
708 type: str
709 internet_service6_fortiguard:
710 description:
711 - FortiGuard IPv6 Internet Service name.
712 type: list
713 elements: dict
714 suboptions:
715 name:
716 description:
717 - FortiGuard Internet Service name. Source firewall.internet-service-fortiguard.name.
718 required: true
719 type: str
720 internet_service6_group:
721 description:
722 - Internet Service group name.
723 type: list
724 elements: dict
725 suboptions:
726 name:
727 description:
728 - Internet Service group name. Source firewall.internet-service-group.name.
729 required: true
730 type: str
731 internet_service6_name:
732 description:
733 - IPv6 Internet Service name.
734 type: list
735 elements: dict
736 suboptions:
737 name:
738 description:
739 - IPv6 Internet Service name. Source firewall.internet-service-name.name.
740 required: true
741 type: str
742 internet_service6_negate:
743 description:
744 - When enabled internet-service6 specifies what the service must NOT be.
745 type: str
746 choices:
747 - 'enable'
748 - 'disable'
749 internet_service6_src:
750 description:
751 - Enable/disable use of IPv6 Internet Services in source for this policy. If enabled, source address is not used.
752 type: str
753 choices:
754 - 'enable'
755 - 'disable'
756 internet_service6_src_custom:
757 description:
758 - Custom IPv6 Internet Service source name.
759 type: list
760 elements: dict
761 suboptions:
762 name:
763 description:
764 - Custom Internet Service name. Source firewall.internet-service-custom.name.
765 required: true
766 type: str
767 internet_service6_src_custom_group:
768 description:
769 - Custom Internet Service6 source group name.
770 type: list
771 elements: dict
772 suboptions:
773 name:
774 description:
775 - Custom Internet Service6 group name. Source firewall.internet-service-custom-group.name.
776 required: true
777 type: str
778 internet_service6_src_fortiguard:
779 description:
780 - FortiGuard IPv6 Internet Service source name.
781 type: list
782 elements: dict
783 suboptions:
784 name:
785 description:
786 - FortiGuard Internet Service name. Source firewall.internet-service-fortiguard.name.
787 required: true
788 type: str
789 internet_service6_src_group:
790 description:
791 - Internet Service6 source group name.
792 type: list
793 elements: dict
794 suboptions:
795 name:
796 description:
797 - Internet Service group name. Source firewall.internet-service-group.name.
798 required: true
799 type: str
800 internet_service6_src_name:
801 description:
802 - IPv6 Internet Service source name.
803 type: list
804 elements: dict
805 suboptions:
806 name:
807 description:
808 - Internet Service name. Source firewall.internet-service-name.name.
809 required: true
810 type: str
811 internet_service6_src_negate:
812 description:
813 - When enabled internet-service6-src specifies what the service must NOT be.
814 type: str
815 choices:
816 - 'enable'
817 - 'disable'
818 ippool:
819 description:
820 - Enable to use IP Pools for source NAT.
821 type: str
822 choices:
823 - 'enable'
824 - 'disable'
825 ips_sensor:
826 description:
827 - Name of an existing IPS sensor. Source ips.sensor.name.
828 type: str
829 ips_voip_filter:
830 description:
831 - Name of an existing VoIP (ips) profile. Source voip.profile.name.
832 type: str
833 label:
834 description:
835 - Label for the policy that appears when the GUI is in Section View mode.
836 type: str
837 learning_mode:
838 description:
839 - Enable to allow everything, but log all of the meaningful data for security information gathering. A learning report will be generated.
840 type: str
841 choices:
842 - 'enable'
843 - 'disable'
844 log_http_transaction:
845 description:
846 - Enable/disable HTTP transaction log.
847 type: str
848 choices:
849 - 'enable'
850 - 'disable'
851 logtraffic:
852 description:
853 - Enable or disable logging. Log all sessions or security profile sessions.
854 type: str
855 choices:
856 - 'all'
857 - 'utm'
858 - 'disable'
859 logtraffic_start:
860 description:
861 - Record logs when a session starts.
862 type: str
863 choices:
864 - 'enable'
865 - 'disable'
866 match_vip:
867 description:
868 - Enable to match packets that have had their destination addresses changed by a VIP.
869 type: str
870 choices:
871 - 'enable'
872 - 'disable'
873 match_vip_only:
874 description:
875 - Enable/disable matching of only those packets that have had their destination addresses changed by a VIP.
876 type: str
877 choices:
878 - 'enable'
879 - 'disable'
880 mms_profile:
881 description:
882 - Name of an existing MMS profile. Source firewall.mms-profile.name.
883 type: str
884 name:
885 description:
886 - Policy name.
887 type: str
888 nat:
889 description:
890 - Enable/disable source NAT.
891 type: str
892 choices:
893 - 'enable'
894 - 'disable'
895 nat46:
896 description:
897 - Enable/disable NAT46.
898 type: str
899 choices:
900 - 'enable'
901 - 'disable'
902 nat64:
903 description:
904 - Enable/disable NAT64.
905 type: str
906 choices:
907 - 'enable'
908 - 'disable'
909 natinbound:
910 description:
911 - 'Policy-based IPsec VPN: apply destination NAT to inbound traffic.'
912 type: str
913 choices:
914 - 'enable'
915 - 'disable'
916 natip:
917 description:
918 - 'Policy-based IPsec VPN: source NAT IP address for outgoing traffic.'
919 type: str
920 natoutbound:
921 description:
922 - 'Policy-based IPsec VPN: apply source NAT to outbound traffic.'
923 type: str
924 choices:
925 - 'enable'
926 - 'disable'
927 network_service_dynamic:
928 description:
929 - Dynamic Network Service name.
930 type: list
931 elements: dict
932 suboptions:
933 name:
934 description:
935 - Dynamic Network Service name. Source firewall.network-service-dynamic.name.
936 required: true
937 type: str
938 network_service_src_dynamic:
939 description:
940 - Dynamic Network Service source name.
941 type: list
942 elements: dict
943 suboptions:
944 name:
945 description:
946 - Dynamic Network Service name. Source firewall.network-service-dynamic.name.
947 required: true
948 type: str
949 np_acceleration:
950 description:
951 - Enable/disable UTM Network Processor acceleration.
952 type: str
953 choices:
954 - 'enable'
955 - 'disable'
956 ntlm:
957 description:
958 - Enable/disable NTLM authentication.
959 type: str
960 choices:
961 - 'enable'
962 - 'disable'
963 ntlm_enabled_browsers:
964 description:
965 - HTTP-User-Agent value of supported browsers.
966 type: list
967 elements: dict
968 suboptions:
969 user_agent_string:
970 description:
971 - User agent string.
972 required: true
973 type: str
974 ntlm_guest:
975 description:
976 - Enable/disable NTLM guest user access.
977 type: str
978 choices:
979 - 'enable'
980 - 'disable'
981 outbound:
982 description:
983 - 'Policy-based IPsec VPN: only traffic from the internal network can initiate a VPN.'
984 type: str
985 choices:
986 - 'enable'
987 - 'disable'
988 passive_wan_health_measurement:
989 description:
990 - Enable/disable passive WAN health measurement. When enabled, auto-asic-offload is disabled.
991 type: str
992 choices:
993 - 'enable'
994 - 'disable'
995 pcp_inbound:
996 description:
997 - Enable/disable PCP inbound DNAT.
998 type: str
999 choices:
1000 - 'enable'
1001 - 'disable'
1002 pcp_outbound:
1003 description:
1004 - Enable/disable PCP outbound SNAT.
1005 type: str
1006 choices:
1007 - 'enable'
1008 - 'disable'
1009 pcp_poolname:
1010 description:
1011 - PCP pool names.
1012 type: list
1013 elements: dict
1014 suboptions:
1015 name:
1016 description:
1017 - PCP pool name. Source system.pcp-server.pools.name.
1018 required: true
1019 type: str
1020 per_ip_shaper:
1021 description:
1022 - Per-IP traffic shaper. Source firewall.shaper.per-ip-shaper.name.
1023 type: str
1024 permit_any_host:
1025 description:
1026 - Enable/disable fullcone NAT. Accept UDP packets from any host.
1027 type: str
1028 choices:
1029 - 'enable'
1030 - 'disable'
1031 permit_stun_host:
1032 description:
1033 - Accept UDP packets from any Session Traversal Utilities for NAT (STUN) host.
1034 type: str
1035 choices:
1036 - 'enable'
1037 - 'disable'
1038 pfcp_profile:
1039 description:
1040 - PFCP profile. Source firewall.pfcp.name.
1041 type: str
1042 policy_expiry:
1043 description:
1044 - Enable/disable policy expiry.
1045 type: str
1046 choices:
1047 - 'enable'
1048 - 'disable'
1049 policy_expiry_date:
1050 description:
1051 - 'Policy expiry date (YYYY-MM-DD HH:MM:SS).'
1052 type: str
1053 policy_expiry_date_utc:
1054 description:
1055 - Policy expiry date and time, in epoch format.
1056 type: str
1057 policyid:
1058 description:
1059 - Policy ID (0 - 4294967294). see <a href='#notes'>Notes</a>.
1060 required: true
1061 type: int
1062 poolname:
1063 description:
1064 - IP Pool names.
1065 type: list
1066 elements: dict
1067 suboptions:
1068 name:
1069 description:
1070 - IP pool name. Source firewall.ippool.name.
1071 required: true
1072 type: str
1073 poolname6:
1074 description:
1075 - IPv6 pool names.
1076 type: list
1077 elements: dict
1078 suboptions:
1079 name:
1080 description:
1081 - IPv6 pool name. Source firewall.ippool6.name.
1082 required: true
1083 type: str
1084 port_preserve:
1085 description:
1086 - Enable/disable preservation of the original source port from source NAT if it has not been used.
1087 type: str
1088 choices:
1089 - 'enable'
1090 - 'disable'
1091 port_random:
1092 description:
1093 - Enable/disable random source port selection for source NAT.
1094 type: str
1095 choices:
1096 - 'enable'
1097 - 'disable'
1098 profile_group:
1099 description:
1100 - Name of profile group. Source firewall.profile-group.name.
1101 type: str
1102 profile_protocol_options:
1103 description:
1104 - Name of an existing Protocol options profile. Source firewall.profile-protocol-options.name.
1105 type: str
1106 profile_type:
1107 description:
1108 - Determine whether the firewall policy allows security profile groups or single profiles only.
1109 type: str
1110 choices:
1111 - 'single'
1112 - 'group'
1113 radius_ip_auth_bypass:
1114 description:
1115 - Enable IP authentication bypass. The bypassed IP address must be received from RADIUS server.
1116 type: str
1117 choices:
1118 - 'enable'
1119 - 'disable'
1120 radius_mac_auth_bypass:
1121 description:
1122 - Enable MAC authentication bypass. The bypassed MAC address must be received from RADIUS server.
1123 type: str
1124 choices:
1125 - 'enable'
1126 - 'disable'
1127 redirect_url:
1128 description:
1129 - URL users are directed to after seeing and accepting the disclaimer or authenticating.
1130 type: str
1131 replacemsg_override_group:
1132 description:
1133 - Override the default replacement message group for this policy. Source system.replacemsg-group.name.
1134 type: str
1135 reputation_direction:
1136 description:
1137 - Direction of the initial traffic for reputation to take effect.
1138 type: str
1139 choices:
1140 - 'source'
1141 - 'destination'
1142 reputation_direction6:
1143 description:
1144 - Direction of the initial traffic for IPv6 reputation to take effect.
1145 type: str
1146 choices:
1147 - 'source'
1148 - 'destination'
1149 reputation_minimum:
1150 description:
1151 - Minimum Reputation to take action. Source firewall.internet-service-reputation.id.
1152 type: int
1153 reputation_minimum6:
1154 description:
1155 - IPv6 Minimum Reputation to take action. Source firewall.internet-service-reputation.id.
1156 type: int
1157 rsso:
1158 description:
1159 - Enable/disable RADIUS single sign-on (RSSO).
1160 type: str
1161 choices:
1162 - 'enable'
1163 - 'disable'
1164 rtp_addr:
1165 description:
1166 - Address names if this is an RTP NAT policy.
1167 type: list
1168 elements: dict
1169 suboptions:
1170 name:
1171 description:
1172 - Address name. Source firewall.internet-service-custom-group.name firewall.addrgrp.name.
1173 required: true
1174 type: str
1175 rtp_nat:
1176 description:
1177 - Enable Real Time Protocol (RTP) NAT.
1178 type: str
1179 choices:
1180 - 'disable'
1181 - 'enable'
1182 saml_server:
1183 description:
1184 - SAML server name. Source user.saml.name.
1185 type: str
1186 scan_botnet_connections:
1187 description:
1188 - Block or monitor connections to Botnet servers or disable Botnet scanning.
1189 type: str
1190 choices:
1191 - 'disable'
1192 - 'block'
1193 - 'monitor'
1194 schedule:
1195 description:
1196 - Schedule name. Source firewall.schedule.onetime.name firewall.schedule.recurring.name firewall.schedule.group.name.
1197 type: str
1198 schedule_timeout:
1199 description:
1200 - Enable to force current sessions to end when the schedule object times out. Disable allows them to end from inactivity.
1201 type: str
1202 choices:
1203 - 'enable'
1204 - 'disable'
1205 scim:
1206 description:
1207 - Enable/disable SCIM .
1208 type: str
1209 choices:
1210 - 'enable'
1211 - 'disable'
1212 scim_groups:
1213 description:
1214 - Names of SCIM groups.
1215 type: list
1216 elements: dict
1217 suboptions:
1218 name:
1219 description:
1220 - Names of SCIM groups.
1221 required: true
1222 type: str
1223 scim_users:
1224 description:
1225 - Names of SCIM users.
1226 type: list
1227 elements: dict
1228 suboptions:
1229 name:
1230 description:
1231 - Names of SCIM users.
1232 required: true
1233 type: str
1234 sctp_filter_profile:
1235 description:
1236 - Name of an existing SCTP filter profile. Source sctp-filter.profile.name.
1237 type: str
1238 send_deny_packet:
1239 description:
1240 - Enable to send a reply when a session is denied or blocked by a firewall policy.
1241 type: str
1242 choices:
1243 - 'disable'
1244 - 'enable'
1245 service:
1246 description:
1247 - Service and service group names.
1248 type: list
1249 elements: dict
1250 suboptions:
1251 name:
1252 description:
1253 - Service and service group names. Source firewall.service.custom.name firewall.service.group.name.
1254 required: true
1255 type: str
1256 service_negate:
1257 description:
1258 - When enabled service specifies what the service must NOT be.
1259 type: str
1260 choices:
1261 - 'enable'
1262 - 'disable'
1263 session_ttl:
1264 description:
1265 - TTL in seconds for sessions accepted by this policy (0 means use the system ).
1266 type: str
1267 sgt:
1268 description:
1269 - Security group tags.
1270 type: list
1271 elements: dict
1272 suboptions:
1273 id:
1274 description:
1275 - Security group tag (1 - 65535). see <a href='#notes'>Notes</a>.
1276 required: true
1277 type: int
1278 sgt_check:
1279 description:
1280 - Enable/disable security group tags (SGT) check.
1281 type: str
1282 choices:
1283 - 'enable'
1284 - 'disable'
1285 spamfilter_profile:
1286 description:
1287 - Name of an existing Spam filter profile. Source spamfilter.profile.name.
1288 type: str
1289 src_vendor_mac:
1290 description:
1291 - Vendor MAC source ID.
1292 type: list
1293 elements: dict
1294 suboptions:
1295 id:
1296 description:
1297 - Vendor MAC ID. see <a href='#notes'>Notes</a>. Source firewall.vendor-mac.id.
1298 required: true
1299 type: int
1300 srcaddr:
1301 description:
1302 - Source IPv4 address and address group names.
1303 type: list
1304 elements: dict
1305 suboptions:
1306 name:
1307 description:
1308 - Address name. Source firewall.address.name firewall.addrgrp.name system.external-resource.name.
1309 required: true
1310 type: str
1311 srcaddr_negate:
1312 description:
1313 - When enabled srcaddr specifies what the source address must NOT be.
1314 type: str
1315 choices:
1316 - 'enable'
1317 - 'disable'
1318 srcaddr6:
1319 description:
1320 - Source IPv6 address name and address group names.
1321 type: list
1322 elements: dict
1323 suboptions:
1324 name:
1325 description:
1326 - Address name. Source firewall.address6.name system.external-resource.name firewall.addrgrp6.name.
1327 required: true
1328 type: str
1329 srcaddr6_negate:
1330 description:
1331 - When enabled srcaddr6 specifies what the source address must NOT be.
1332 type: str
1333 choices:
1334 - 'enable'
1335 - 'disable'
1336 srcintf:
1337 description:
1338 - Incoming (ingress) interface.
1339 type: list
1340 elements: dict
1341 suboptions:
1342 name:
1343 description:
1344 - Interface name. Source system.interface.name system.zone.name system.sdwan.zone.name.
1345 required: true
1346 type: str
1347 ssh_filter_profile:
1348 description:
1349 - Name of an existing SSH filter profile. Source ssh-filter.profile.name.
1350 type: str
1351 ssh_policy_redirect:
1352 description:
1353 - Redirect SSH traffic to matching transparent proxy policy.
1354 type: str
1355 choices:
1356 - 'enable'
1357 - 'disable'
1358 ssl_mirror:
1359 description:
1360 - Enable to copy decrypted SSL traffic to a FortiGate interface (called SSL mirroring).
1361 type: str
1362 choices:
1363 - 'enable'
1364 - 'disable'
1365 ssl_mirror_intf:
1366 description:
1367 - SSL mirror interface name.
1368 type: list
1369 elements: dict
1370 suboptions:
1371 name:
1372 description:
1373 - Mirror Interface name. Source system.interface.name system.zone.name.
1374 required: true
1375 type: str
1376 ssl_ssh_profile:
1377 description:
1378 - Name of an existing SSL SSH profile. Source firewall.ssl-ssh-profile.name.
1379 type: str
1380 status:
1381 description:
1382 - Enable or disable this policy.
1383 type: str
1384 choices:
1385 - 'enable'
1386 - 'disable'
1387 tcp_mss_receiver:
1388 description:
1389 - Receiver TCP maximum segment size (MSS).
1390 type: int
1391 tcp_mss_sender:
1392 description:
1393 - Sender TCP maximum segment size (MSS).
1394 type: int
1395 tcp_session_without_syn:
1396 description:
1397 - Enable/disable creation of TCP session without SYN flag.
1398 type: str
1399 choices:
1400 - 'all'
1401 - 'data-only'
1402 - 'disable'
1403 telemetry_profile:
1404 description:
1405 - Name of an existing telemetry profile. Source telemetry-controller.profile.name.
1406 type: str
1407 timeout_send_rst:
1408 description:
1409 - Enable/disable sending RST packets when TCP sessions expire.
1410 type: str
1411 choices:
1412 - 'enable'
1413 - 'disable'
1414 tos:
1415 description:
1416 - ToS (Type of Service) value used for comparison.
1417 type: str
1418 tos_mask:
1419 description:
1420 - Non-zero bit positions are used for comparison while zero bit positions are ignored.
1421 type: str
1422 tos_negate:
1423 description:
1424 - Enable negated TOS match.
1425 type: str
1426 choices:
1427 - 'enable'
1428 - 'disable'
1429 traffic_shaper:
1430 description:
1431 - Traffic shaper. Source firewall.shaper.traffic-shaper.name.
1432 type: str
1433 traffic_shaper_reverse:
1434 description:
1435 - Reverse traffic shaper. Source firewall.shaper.traffic-shaper.name.
1436 type: str
1437 url_category:
1438 description:
1439 - URL category ID list.
1440 type: list
1441 elements: dict
1442 suboptions:
1443 id:
1444 description:
1445 - URL category ID. see <a href='#notes'>Notes</a>.
1446 required: true
1447 type: int
1448 users:
1449 description:
1450 - Names of individual users that can authenticate with this policy.
1451 type: list
1452 elements: dict
1453 suboptions:
1454 name:
1455 description:
1456 - Names of individual users that can authenticate with this policy. Source user.local.name user.certificate.name.
1457 required: true
1458 type: str
1459 utm_status:
1460 description:
1461 - Enable to add one or more security profiles (AV, IPS, etc.) to the firewall policy.
1462 type: str
1463 choices:
1464 - 'enable'
1465 - 'disable'
1466 uuid:
1467 description:
1468 - Universally Unique Identifier (UUID; automatically assigned but can be manually reset).
1469 type: str
1470 videofilter_profile:
1471 description:
1472 - Name of an existing VideoFilter profile. Source videofilter.profile.name.
1473 type: str
1474 virtual_patch_profile:
1475 description:
1476 - Name of an existing virtual-patch profile. Source virtual-patch.profile.name.
1477 type: str
1478 vlan_cos_fwd:
1479 description:
1480 - 'VLAN forward direction user priority: 255 passthrough, 0 lowest, 7 highest.'
1481 type: int
1482 vlan_cos_rev:
1483 description:
1484 - 'VLAN reverse direction user priority: 255 passthrough, 0 lowest, 7 highest.'
1485 type: int
1486 vlan_filter:
1487 description:
1488 - VLAN ranges to allow
1489 type: str
1490 voip_profile:
1491 description:
1492 - Name of an existing VoIP (voipd) profile. Source voip.profile.name.
1493 type: str
1494 vpntunnel:
1495 description:
1496 - 'Policy-based IPsec VPN: name of the IPsec VPN Phase 1. Source vpn.ipsec.phase1.name vpn.ipsec.manualkey.name.'
1497 type: str
1498 waf_profile:
1499 description:
1500 - Name of an existing Web application firewall profile. Source waf.profile.name.
1501 type: str
1502 wanopt:
1503 description:
1504 - Enable/disable WAN optimization.
1505 type: str
1506 choices:
1507 - 'enable'
1508 - 'disable'
1509 wanopt_detection:
1510 description:
1511 - WAN optimization auto-detection mode.
1512 type: str
1513 choices:
1514 - 'active'
1515 - 'passive'
1516 - 'off'
1517 wanopt_passive_opt:
1518 description:
1519 - WAN optimization passive mode options. This option decides what IP address will be used to connect server.
1520 type: str
1521 choices:
1522 - 'default'
1523 - 'transparent'
1524 - 'non-transparent'
1525 wanopt_peer:
1526 description:
1527 - WAN optimization peer. Source wanopt.peer.peer-host-id.
1528 type: str
1529 wanopt_profile:
1530 description:
1531 - WAN optimization profile. Source wanopt.profile.name.
1532 type: str
1533 wccp:
1534 description:
1535 - Enable/disable forwarding traffic matching this policy to a configured WCCP server.
1536 type: str
1537 choices:
1538 - 'enable'
1539 - 'disable'
1540 webcache:
1541 description:
1542 - Enable/disable web cache.
1543 type: str
1544 choices:
1545 - 'enable'
1546 - 'disable'
1547 webcache_https:
1548 description:
1549 - Enable/disable web cache for HTTPS.
1550 type: str
1551 choices:
1552 - 'disable'
1553 - 'enable'
1554 webfilter_profile:
1555 description:
1556 - Name of an existing Web filter profile. Source webfilter.profile.name.
1557 type: str
1558 webproxy_forward_server:
1559 description:
1560 - Webproxy forward server name. Source web-proxy.forward-server.name web-proxy.forward-server-group.name.
1561 type: str
1562 webproxy_profile:
1563 description:
1564 - Webproxy profile name. Source web-proxy.profile.name.
1565 type: str
1566 wsso:
1567 description:
1568 - Enable/disable WiFi Single Sign On (WSSO).
1569 type: str
1570 choices:
1571 - 'enable'
1572 - 'disable'
1573 ztna_device_ownership:
1574 description:
1575 - Enable/disable zero trust device ownership.
1576 type: str
1577 choices:
1578 - 'enable'
1579 - 'disable'
1580 ztna_ems_tag:
1581 description:
1582 - Source ztna-ems-tag names.
1583 type: list
1584 elements: dict
1585 suboptions:
1586 name:
1587 description:
1588 - Address name. Source firewall.address.name firewall.addrgrp.name.
1589 required: true
1590 type: str
1591 ztna_ems_tag_negate:
1592 description:
1593 - When enabled ztna-ems-tag specifies what the tags must NOT be.
1594 type: str
1595 choices:
1596 - 'enable'
1597 - 'disable'
1598 ztna_ems_tag_secondary:
1599 description:
1600 - Source ztna-ems-tag-secondary names.
1601 type: list
1602 elements: dict
1603 suboptions:
1604 name:
1605 description:
1606 - Address name. Source firewall.address.name firewall.addrgrp.name.
1607 required: true
1608 type: str
1609 ztna_geo_tag:
1610 description:
1611 - Source ztna-geo-tag names.
1612 type: list
1613 elements: dict
1614 suboptions:
1615 name:
1616 description:
1617 - Address name. Source firewall.address.name firewall.addrgrp.name.
1618 required: true
1619 type: str
1620 ztna_policy_redirect:
1621 description:
1622 - Redirect ZTNA traffic to matching Access-Proxy proxy-policy.
1623 type: str
1624 choices:
1625 - 'enable'
1626 - 'disable'
1627 ztna_status:
1628 description:
1629 - Enable/disable zero trust access.
1630 type: str
1631 choices:
1632 - 'enable'
1633 - 'disable'
1634 ztna_tags_match_logic:
1635 description:
1636 - ZTNA tag matching logic.
1637 type: str
1638 choices:
1639 - 'or'
1640 - 'and'
1641 """
1642
1643 EXAMPLES = """
1644 - name: Configure IPv4/IPv6 policies.
1645 fortinet.fortios.fortios_firewall_policy:
1646 vdom: "{{ vdom }}"
1647 state: "present"
1648 access_token: "<your_own_value>"
1649 firewall_policy:
1650 action: "accept"
1651 anti_replay: "enable"
1652 app_category:
1653 -
1654 id: "6"
1655 app_group:
1656 -
1657 name: "default_name_8 (source application.group.name)"
1658 app_monitor: "enable"
1659 application:
1660 -
1661 id: "11"
1662 application_list: "<your_own_value> (source application.list.name)"
1663 auth_cert: "<your_own_value> (source vpn.certificate.local.name)"
1664 auth_path: "enable"
1665 auth_redirect_addr: "<your_own_value>"
1666 auto_asic_offload: "enable"
1667 av_profile: "<your_own_value> (source antivirus.profile.name)"
1668 block_notification: "enable"
1669 captive_portal_exempt: "enable"
1670 capture_packet: "enable"
1671 casb_profile: "<your_own_value> (source casb.profile.name)"
1672 cifs_profile: "<your_own_value> (source cifs.profile.name)"
1673 comments: "<your_own_value>"
1674 custom_log_fields:
1675 -
1676 field_id: "<your_own_value> (source log.custom-field.id)"
1677 decrypted_traffic_mirror: "<your_own_value> (source firewall.decrypted-traffic-mirror.name)"
1678 delay_tcp_npu_session: "enable"
1679 devices:
1680 -
1681 name: "default_name_29 (source user.device.alias user.device-group.name user.device-category.name)"
1682 diameter_filter_profile: "<your_own_value> (source diameter-filter.profile.name)"
1683 diffserv_copy: "enable"
1684 diffserv_forward: "enable"
1685 diffserv_reverse: "enable"
1686 diffservcode_forward: "<your_own_value>"
1687 diffservcode_rev: "<your_own_value>"
1688 disclaimer: "enable"
1689 dlp_profile: "<your_own_value> (source dlp.profile.name)"
1690 dlp_sensor: "<your_own_value> (source dlp.sensor.name)"
1691 dnsfilter_profile: "<your_own_value> (source dnsfilter.profile.name)"
1692 dscp_match: "enable"
1693 dscp_negate: "enable"
1694 dscp_value: "<your_own_value>"
1695 dsri: "enable"
1696 dstaddr:
1697 -
1698 name: "default_name_45 (source firewall.address.name firewall.addrgrp.name firewall.vip.name firewall.vipgrp.name system.external-resource
1699 .name)"
1700 dstaddr_negate: "enable"
1701 dstaddr6:
1702 -
1703 name: "default_name_48 (source firewall.address6.name firewall.addrgrp6.name firewall.vip6.name firewall.vipgrp6.name system
1704 .external-resource.name)"
1705 dstaddr6_negate: "enable"
1706 dstintf:
1707 -
1708 name: "default_name_51 (source system.interface.name system.zone.name system.sdwan.zone.name)"
1709 dynamic_shaping: "enable"
1710 email_collect: "enable"
1711 emailfilter_profile: "<your_own_value> (source emailfilter.profile.name)"
1712 fec: "enable"
1713 file_filter_profile: "<your_own_value> (source file-filter.profile.name)"
1714 firewall_session_dirty: "check-all"
1715 fixedport: "enable"
1716 fsso: "enable"
1717 fsso_agent_for_ntlm: "<your_own_value> (source user.fsso.name)"
1718 fsso_groups:
1719 -
1720 name: "default_name_62 (source user.adgrp.name)"
1721 geoip_anycast: "enable"
1722 geoip_match: "physical-location"
1723 global_label: "<your_own_value>"
1724 groups:
1725 -
1726 name: "default_name_67 (source user.group.name)"
1727 gtp_profile: "<your_own_value> (source firewall.gtp.name)"
1728 http_policy_redirect: "enable"
1729 icap_profile: "<your_own_value> (source icap.profile.name)"
1730 identity_based_route: "<your_own_value> (source firewall.identity-based-route.name)"
1731 inbound: "enable"
1732 inspection_mode: "proxy"
1733 internet_service: "enable"
1734 internet_service_custom:
1735 -
1736 name: "default_name_76 (source firewall.internet-service-custom.name)"
1737 internet_service_custom_group:
1738 -
1739 name: "default_name_78 (source firewall.internet-service-custom-group.name)"
1740 internet_service_fortiguard:
1741 -
1742 name: "default_name_80 (source firewall.internet-service-fortiguard.name)"
1743 internet_service_group:
1744 -
1745 name: "default_name_82 (source firewall.internet-service-group.name)"
1746 internet_service_id:
1747 -
1748 id: "84 (source firewall.internet-service.id)"
1749 internet_service_name:
1750 -
1751 name: "default_name_86 (source firewall.internet-service-name.name)"
1752 internet_service_negate: "enable"
1753 internet_service_src: "enable"
1754 internet_service_src_custom:
1755 -
1756 name: "default_name_90 (source firewall.internet-service-custom.name)"
1757 internet_service_src_custom_group:
1758 -
1759 name: "default_name_92 (source firewall.internet-service-custom-group.name)"
1760 internet_service_src_fortiguard:
1761 -
1762 name: "default_name_94 (source firewall.internet-service-fortiguard.name)"
1763 internet_service_src_group:
1764 -
1765 name: "default_name_96 (source firewall.internet-service-group.name)"
1766 internet_service_src_id:
1767 -
1768 id: "98 (source firewall.internet-service.id)"
1769 internet_service_src_name:
1770 -
1771 name: "default_name_100 (source firewall.internet-service-name.name)"
1772 internet_service_src_negate: "enable"
1773 internet_service6: "enable"
1774 internet_service6_custom:
1775 -
1776 name: "default_name_104 (source firewall.internet-service-custom.name)"
1777 internet_service6_custom_group:
1778 -
1779 name: "default_name_106 (source firewall.internet-service-custom-group.name)"
1780 internet_service6_fortiguard:
1781 -
1782 name: "default_name_108 (source firewall.internet-service-fortiguard.name)"
1783 internet_service6_group:
1784 -
1785 name: "default_name_110 (source firewall.internet-service-group.name)"
1786 internet_service6_name:
1787 -
1788 name: "default_name_112 (source firewall.internet-service-name.name)"
1789 internet_service6_negate: "enable"
1790 internet_service6_src: "enable"
1791 internet_service6_src_custom:
1792 -
1793 name: "default_name_116 (source firewall.internet-service-custom.name)"
1794 internet_service6_src_custom_group:
1795 -
1796 name: "default_name_118 (source firewall.internet-service-custom-group.name)"
1797 internet_service6_src_fortiguard:
1798 -
1799 name: "default_name_120 (source firewall.internet-service-fortiguard.name)"
1800 internet_service6_src_group:
1801 -
1802 name: "default_name_122 (source firewall.internet-service-group.name)"
1803 internet_service6_src_name:
1804 -
1805 name: "default_name_124 (source firewall.internet-service-name.name)"
1806 internet_service6_src_negate: "enable"
1807 ippool: "enable"
1808 ips_sensor: "<your_own_value> (source ips.sensor.name)"
1809 ips_voip_filter: "<your_own_value> (source voip.profile.name)"
1810 label: "<your_own_value>"
1811 learning_mode: "enable"
1812 log_http_transaction: "enable"
1813 logtraffic: "all"
1814 logtraffic_start: "enable"
1815 match_vip: "enable"
1816 match_vip_only: "enable"
1817 mms_profile: "<your_own_value> (source firewall.mms-profile.name)"
1818 name: "default_name_137"
1819 nat: "enable"
1820 nat46: "enable"
1821 nat64: "enable"
1822 natinbound: "enable"
1823 natip: "<your_own_value>"
1824 natoutbound: "enable"
1825 network_service_dynamic:
1826 -
1827 name: "default_name_145 (source firewall.network-service-dynamic.name)"
1828 network_service_src_dynamic:
1829 -
1830 name: "default_name_147 (source firewall.network-service-dynamic.name)"
1831 np_acceleration: "enable"
1832 ntlm: "enable"
1833 ntlm_enabled_browsers:
1834 -
1835 user_agent_string: "<your_own_value>"
1836 ntlm_guest: "enable"
1837 outbound: "enable"
1838 passive_wan_health_measurement: "enable"
1839 pcp_inbound: "enable"
1840 pcp_outbound: "enable"
1841 pcp_poolname:
1842 -
1843 name: "default_name_158 (source system.pcp-server.pools.name)"
1844 per_ip_shaper: "<your_own_value> (source firewall.shaper.per-ip-shaper.name)"
1845 permit_any_host: "enable"
1846 permit_stun_host: "enable"
1847 pfcp_profile: "<your_own_value> (source firewall.pfcp.name)"
1848 policy_expiry: "enable"
1849 policy_expiry_date: "<your_own_value>"
1850 policy_expiry_date_utc: "<your_own_value>"
1851 policyid: "<you_own_value>"
1852 poolname:
1853 -
1854 name: "default_name_168 (source firewall.ippool.name)"
1855 poolname6:
1856 -
1857 name: "default_name_170 (source firewall.ippool6.name)"
1858 port_preserve: "enable"
1859 port_random: "enable"
1860 profile_group: "<your_own_value> (source firewall.profile-group.name)"
1861 profile_protocol_options: "<your_own_value> (source firewall.profile-protocol-options.name)"
1862 profile_type: "single"
1863 radius_ip_auth_bypass: "enable"
1864 radius_mac_auth_bypass: "enable"
1865 redirect_url: "<your_own_value>"
1866 replacemsg_override_group: "<your_own_value> (source system.replacemsg-group.name)"
1867 reputation_direction: "source"
1868 reputation_direction6: "source"
1869 reputation_minimum: "0"
1870 reputation_minimum6: "0"
1871 rsso: "enable"
1872 rtp_addr:
1873 -
1874 name: "default_name_186 (source firewall.internet-service-custom-group.name firewall.addrgrp.name)"
1875 rtp_nat: "disable"
1876 saml_server: "<your_own_value> (source user.saml.name)"
1877 scan_botnet_connections: "disable"
1878 schedule: "<your_own_value> (source firewall.schedule.onetime.name firewall.schedule.recurring.name firewall.schedule.group.name)"
1879 schedule_timeout: "enable"
1880 scim: "enable"
1881 scim_groups:
1882 -
1883 name: "default_name_194"
1884 scim_users:
1885 -
1886 name: "default_name_196"
1887 sctp_filter_profile: "<your_own_value> (source sctp-filter.profile.name)"
1888 send_deny_packet: "disable"
1889 service:
1890 -
1891 name: "default_name_200 (source firewall.service.custom.name firewall.service.group.name)"
1892 service_negate: "enable"
1893 session_ttl: "<your_own_value>"
1894 sgt:
1895 -
1896 id: "204"
1897 sgt_check: "enable"
1898 spamfilter_profile: "<your_own_value> (source spamfilter.profile.name)"
1899 src_vendor_mac:
1900 -
1901 id: "208 (source firewall.vendor-mac.id)"
1902 srcaddr:
1903 -
1904 name: "default_name_210 (source firewall.address.name firewall.addrgrp.name system.external-resource.name)"
1905 srcaddr_negate: "enable"
1906 srcaddr6:
1907 -
1908 name: "default_name_213 (source firewall.address6.name system.external-resource.name firewall.addrgrp6.name)"
1909 srcaddr6_negate: "enable"
1910 srcintf:
1911 -
1912 name: "default_name_216 (source system.interface.name system.zone.name system.sdwan.zone.name)"
1913 ssh_filter_profile: "<your_own_value> (source ssh-filter.profile.name)"
1914 ssh_policy_redirect: "enable"
1915 ssl_mirror: "enable"
1916 ssl_mirror_intf:
1917 -
1918 name: "default_name_221 (source system.interface.name system.zone.name)"
1919 ssl_ssh_profile: "<your_own_value> (source firewall.ssl-ssh-profile.name)"
1920 status: "enable"
1921 tcp_mss_receiver: "0"
1922 tcp_mss_sender: "0"
1923 tcp_session_without_syn: "all"
1924 telemetry_profile: "<your_own_value> (source telemetry-controller.profile.name)"
1925 timeout_send_rst: "enable"
1926 tos: "<your_own_value>"
1927 tos_mask: "<your_own_value>"
1928 tos_negate: "enable"
1929 traffic_shaper: "<your_own_value> (source firewall.shaper.traffic-shaper.name)"
1930 traffic_shaper_reverse: "<your_own_value> (source firewall.shaper.traffic-shaper.name)"
1931 url_category:
1932 -
1933 id: "235"
1934 users:
1935 -
1936 name: "default_name_237 (source user.local.name user.certificate.name)"
1937 utm_status: "enable"
1938 uuid: "<your_own_value>"
1939 videofilter_profile: "<your_own_value> (source videofilter.profile.name)"
1940 virtual_patch_profile: "<your_own_value> (source virtual-patch.profile.name)"
1941 vlan_cos_fwd: "255"
1942 vlan_cos_rev: "255"
1943 vlan_filter: "<your_own_value>"
1944 voip_profile: "<your_own_value> (source voip.profile.name)"
1945 vpntunnel: "<your_own_value> (source vpn.ipsec.phase1.name vpn.ipsec.manualkey.name)"
1946 waf_profile: "<your_own_value> (source waf.profile.name)"
1947 wanopt: "enable"
1948 wanopt_detection: "active"
1949 wanopt_passive_opt: "default"
1950 wanopt_peer: "<your_own_value> (source wanopt.peer.peer-host-id)"
1951 wanopt_profile: "<your_own_value> (source wanopt.profile.name)"
1952 wccp: "enable"
1953 webcache: "enable"
1954 webcache_https: "disable"
1955 webfilter_profile: "<your_own_value> (source webfilter.profile.name)"
1956 webproxy_forward_server: "<your_own_value> (source web-proxy.forward-server.name web-proxy.forward-server-group.name)"
1957 webproxy_profile: "<your_own_value> (source web-proxy.profile.name)"
1958 wsso: "enable"
1959 ztna_device_ownership: "enable"
1960 ztna_ems_tag:
1961 -
1962 name: "default_name_262 (source firewall.address.name firewall.addrgrp.name)"
1963 ztna_ems_tag_negate: "enable"
1964 ztna_ems_tag_secondary:
1965 -
1966 name: "default_name_265 (source firewall.address.name firewall.addrgrp.name)"
1967 ztna_geo_tag:
1968 -
1969 name: "default_name_267 (source firewall.address.name firewall.addrgrp.name)"
1970 ztna_policy_redirect: "enable"
1971 ztna_status: "enable"
1972 ztna_tags_match_logic: "or"
1973 """
1974
1975 RETURN = """
1976 build:
1977 description: Build number of the fortigate image
1978 returned: always
1979 type: str
1980 sample: '1547'
1981 http_method:
1982 description: Last method used to provision the content into FortiGate
1983 returned: always
1984 type: str
1985 sample: 'PUT'
1986 http_status:
1987 description: Last result given by FortiGate on last operation applied
1988 returned: always
1989 type: str
1990 sample: "200"
1991 mkey:
1992 description: Master key (id) used in the last call to FortiGate
1993 returned: success
1994 type: str
1995 sample: "id"
1996 name:
1997 description: Name of the table used to fulfill the request
1998 returned: always
1999 type: str
2000 sample: "urlfilter"
2001 path:
2002 description: Path of the table used to fulfill the request
2003 returned: always
2004 type: str
2005 sample: "webfilter"
2006 revision:
2007 description: Internal revision number
2008 returned: always
2009 type: str
2010 sample: "17.0.2.10658"
2011 serial:
2012 description: Serial number of the unit
2013 returned: always
2014 type: str
2015 sample: "FGVMEVYYQT3AB5352"
2016 status:
2017 description: Indication of the operation's result
2018 returned: always
2019 type: str
2020 sample: "success"
2021 vdom:
2022 description: Virtual domain used
2023 returned: always
2024 type: str
2025 sample: "root"
2026 version:
2027 description: Version of the FortiGate
2028 returned: always
2029 type: str
2030 sample: "v5.6.3"
2031 """
2032 from ansible.module_utils.basic import AnsibleModule
2033 from ansible.module_utils.connection import Connection
2034 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.fortios import (
2035 FortiOSHandler,
2036 )
2037 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.fortios import (
2038 check_legacy_fortiosapi,
2039 )
2040 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.fortios import (
2041 schema_to_module_spec,
2042 )
2043 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.fortios import (
2044 check_schema_versioning,
2045 )
2046 from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.common import (
2047 FAIL_SOCKET_MSG,
2048 )
2049 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.data_post_processor import (
2050 remove_invalid_fields,
2051 )
2052 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.comparison import (
2053 is_same_comparison,
2054 )
2055 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.comparison import (
2056 serialize,
2057 )
2058 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.comparison import (
2059 find_current_values,
2060 )
2061 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.comparison import (
2062 unify_data_format,
2063 )
2064
2065
2066 def filter_firewall_policy_data(json):
2067 option_list = [
2068 "action",
2069 "anti_replay",
2070 "app_category",
2071 "app_group",
2072 "app_monitor",
2073 "application",
2074 "application_list",
2075 "auth_cert",
2076 "auth_path",
2077 "auth_redirect_addr",
2078 "auto_asic_offload",
2079 "av_profile",
2080 "block_notification",
2081 "captive_portal_exempt",
2082 "capture_packet",
2083 "casb_profile",
2084 "cifs_profile",
2085 "comments",
2086 "custom_log_fields",
2087 "decrypted_traffic_mirror",
2088 "delay_tcp_npu_session",
2089 "devices",
2090 "diameter_filter_profile",
2091 "diffserv_copy",
2092 "diffserv_forward",
2093 "diffserv_reverse",
2094 "diffservcode_forward",
2095 "diffservcode_rev",
2096 "disclaimer",
2097 "dlp_profile",
2098 "dlp_sensor",
2099 "dnsfilter_profile",
2100 "dscp_match",
2101 "dscp_negate",
2102 "dscp_value",
2103 "dsri",
2104 "dstaddr",
2105 "dstaddr_negate",
2106 "dstaddr6",
2107 "dstaddr6_negate",
2108 "dstintf",
2109 "dynamic_shaping",
2110 "email_collect",
2111 "emailfilter_profile",
2112 "fec",
2113 "file_filter_profile",
2114 "firewall_session_dirty",
2115 "fixedport",
2116 "fsso",
2117 "fsso_agent_for_ntlm",
2118 "fsso_groups",
2119 "geoip_anycast",
2120 "geoip_match",
2121 "global_label",
2122 "groups",
2123 "gtp_profile",
2124 "http_policy_redirect",
2125 "icap_profile",
2126 "identity_based_route",
2127 "inbound",
2128 "inspection_mode",
2129 "internet_service",
2130 "internet_service_custom",
2131 "internet_service_custom_group",
2132 "internet_service_fortiguard",
2133 "internet_service_group",
2134 "internet_service_id",
2135 "internet_service_name",
2136 "internet_service_negate",
2137 "internet_service_src",
2138 "internet_service_src_custom",
2139 "internet_service_src_custom_group",
2140 "internet_service_src_fortiguard",
2141 "internet_service_src_group",
2142 "internet_service_src_id",
2143 "internet_service_src_name",
2144 "internet_service_src_negate",
2145 "internet_service6",
2146 "internet_service6_custom",
2147 "internet_service6_custom_group",
2148 "internet_service6_fortiguard",
2149 "internet_service6_group",
2150 "internet_service6_name",
2151 "internet_service6_negate",
2152 "internet_service6_src",
2153 "internet_service6_src_custom",
2154 "internet_service6_src_custom_group",
2155 "internet_service6_src_fortiguard",
2156 "internet_service6_src_group",
2157 "internet_service6_src_name",
2158 "internet_service6_src_negate",
2159 "ippool",
2160 "ips_sensor",
2161 "ips_voip_filter",
2162 "label",
2163 "learning_mode",
2164 "log_http_transaction",
2165 "logtraffic",
2166 "logtraffic_start",
2167 "match_vip",
2168 "match_vip_only",
2169 "mms_profile",
2170 "name",
2171 "nat",
2172 "nat46",
2173 "nat64",
2174 "natinbound",
2175 "natip",
2176 "natoutbound",
2177 "network_service_dynamic",
2178 "network_service_src_dynamic",
2179 "np_acceleration",
2180 "ntlm",
2181 "ntlm_enabled_browsers",
2182 "ntlm_guest",
2183 "outbound",
2184 "passive_wan_health_measurement",
2185 "pcp_inbound",
2186 "pcp_outbound",
2187 "pcp_poolname",
2188 "per_ip_shaper",
2189 "permit_any_host",
2190 "permit_stun_host",
2191 "pfcp_profile",
2192 "policy_expiry",
2193 "policy_expiry_date",
2194 "policy_expiry_date_utc",
2195 "policyid",
2196 "poolname",
2197 "poolname6",
2198 "port_preserve",
2199 "port_random",
2200 "profile_group",
2201 "profile_protocol_options",
2202 "profile_type",
2203 "radius_ip_auth_bypass",
2204 "radius_mac_auth_bypass",
2205 "redirect_url",
2206 "replacemsg_override_group",
2207 "reputation_direction",
2208 "reputation_direction6",
2209 "reputation_minimum",
2210 "reputation_minimum6",
2211 "rsso",
2212 "rtp_addr",
2213 "rtp_nat",
2214 "saml_server",
2215 "scan_botnet_connections",
2216 "schedule",
2217 "schedule_timeout",
2218 "scim",
2219 "scim_groups",
2220 "scim_users",
2221 "sctp_filter_profile",
2222 "send_deny_packet",
2223 "service",
2224 "service_negate",
2225 "session_ttl",
2226 "sgt",
2227 "sgt_check",
2228 "spamfilter_profile",
2229 "src_vendor_mac",
2230 "srcaddr",
2231 "srcaddr_negate",
2232 "srcaddr6",
2233 "srcaddr6_negate",
2234 "srcintf",
2235 "ssh_filter_profile",
2236 "ssh_policy_redirect",
2237 "ssl_mirror",
2238 "ssl_mirror_intf",
2239 "ssl_ssh_profile",
2240 "status",
2241 "tcp_mss_receiver",
2242 "tcp_mss_sender",
2243 "tcp_session_without_syn",
2244 "telemetry_profile",
2245 "timeout_send_rst",
2246 "tos",
2247 "tos_mask",
2248 "tos_negate",
2249 "traffic_shaper",
2250 "traffic_shaper_reverse",
2251 "url_category",
2252 "users",
2253 "utm_status",
2254 "uuid",
2255 "videofilter_profile",
2256 "virtual_patch_profile",
2257 "vlan_cos_fwd",
2258 "vlan_cos_rev",
2259 "vlan_filter",
2260 "voip_profile",
2261 "vpntunnel",
2262 "waf_profile",
2263 "wanopt",
2264 "wanopt_detection",
2265 "wanopt_passive_opt",
2266 "wanopt_peer",
2267 "wanopt_profile",
2268 "wccp",
2269 "webcache",
2270 "webcache_https",
2271 "webfilter_profile",
2272 "webproxy_forward_server",
2273 "webproxy_profile",
2274 "wsso",
2275 "ztna_device_ownership",
2276 "ztna_ems_tag",
2277 "ztna_ems_tag_negate",
2278 "ztna_ems_tag_secondary",
2279 "ztna_geo_tag",
2280 "ztna_policy_redirect",
2281 "ztna_status",
2282 "ztna_tags_match_logic",
2283 ]
2284
2285 json = remove_invalid_fields(json)
2286 dictionary = {}
2287
2288 for attribute in option_list:
2289 if attribute in json and json[attribute] is not None:
2290 dictionary[attribute] = json[attribute]
2291
2292 return dictionary
2293
2294
2295 def underscore_to_hyphen(data):
2296 new_data = None
2297 if isinstance(data, list):
2298 new_data = []
2299 for i, elem in enumerate(data):
2300 new_data.append(underscore_to_hyphen(elem))
2301 elif isinstance(data, dict):
2302 new_data = {}
2303 for k, v in data.items():
2304 new_data[k.replace("_", "-")] = underscore_to_hyphen(v)
2305 else:
2306 return data
2307 return new_data
2308
2309
2310 def firewall_policy(data, fos, check_mode=False):
2311
2312 state = None
2313 vdom = data["vdom"]
2314 parameters = None
2315 state = data.get("state", None)
2316 firewall_policy_data = data["firewall_policy"]
2317
2318 filtered_data = filter_firewall_policy_data(firewall_policy_data)
2319 converted_data = underscore_to_hyphen(filtered_data)
2320
2321 # check_mode starts from here
2322 if check_mode:
2323 diff = {
2324 "before": "",
2325 "after": filtered_data,
2326 }
2327 mkeyname = fos.get_mkeyname(None, None)
2328 mkey = fos.get_mkey("firewall", "policy", filtered_data, vdom=vdom)
2329 current_data = fos.get(
2330 "firewall", "policy", vdom=vdom, mkey=mkey, parameters=parameters
2331 )
2332 is_existed = (
2333 current_data
2334 and current_data.get("http_status") == 200
2335 and (
2336 mkeyname
2337 and isinstance(current_data.get("results"), list)
2338 and len(current_data["results"]) > 0
2339 or not mkeyname
2340 and current_data["results"] # global object response
2341 )
2342 )
2343
2344 # 2. if it exists and the state is 'present' then compare current settings with desired
2345 if state == "present" or state is True or state is None:
2346 # for non global modules, mkeyname must exist and it's a new module when mkey is None
2347 if mkeyname is not None and mkey is None:
2348 return False, True, filtered_data, diff
2349
2350 # if mkey exists then compare each other
2351 # record exits and they're matched or not
2352 copied_filtered_data = filtered_data.copy()
2353 copied_filtered_data.pop(mkeyname, None)
2354 unified_filtered_data = unify_data_format(copied_filtered_data)
2355
2356 current_data_results = current_data.get("results", {})
2357 current_config = (
2358 current_data_results[0]
2359 if mkeyname
2360 and isinstance(current_data_results, list)
2361 and len(current_data_results) > 0
2362 else current_data_results
2363 )
2364 if is_existed:
2365 unified_current_values = find_current_values(
2366 unified_filtered_data,
2367 unify_data_format(current_config),
2368 )
2369
2370 is_same = is_same_comparison(
2371 serialize(unified_current_values), serialize(unified_filtered_data)
2372 )
2373
2374 return (
2375 False,
2376 not is_same,
2377 filtered_data,
2378 {"before": unified_current_values, "after": unified_filtered_data},
2379 )
2380
2381 # record does not exist
2382 return False, True, filtered_data, diff
2383
2384 if state == "absent":
2385 if mkey is None:
2386 return (
2387 False,
2388 False,
2389 filtered_data,
2390 {"before": current_data["results"][0], "after": ""},
2391 )
2392
2393 if is_existed:
2394 return (
2395 False,
2396 True,
2397 filtered_data,
2398 {"before": current_data["results"][0], "after": ""},
2399 )
2400 return False, False, filtered_data, {}
2401
2402 return True, False, {"reason: ": "Must provide state parameter"}, {}
2403 # pass post processed data to member operations
2404 # no need to do underscore_to_hyphen since do_member_operation handles it by itself
2405 data_copy = data.copy()
2406 data_copy["firewall_policy"] = filtered_data
2407 fos.do_member_operation(
2408 "firewall",
2409 "policy",
2410 data_copy,
2411 )
2412
2413 if state == "present" or state is True:
2414 return fos.set(
2415 "firewall", "policy", data=converted_data, vdom=vdom, parameters=parameters
2416 )
2417
2418 elif state == "absent":
2419 return fos.delete(
2420 "firewall",
2421 "policy",
2422 mkey=converted_data["policyid"],
2423 vdom=vdom,
2424 parameters=parameters,
2425 )
2426 else:
2427 fos._module.fail_json(msg="state must be present or absent!")
2428
2429
2430 def is_successful_status(resp):
2431 return (
2432 "status" in resp
2433 and resp["status"] == "success"
2434 or "http_status" in resp
2435 and resp["http_status"] == 200
2436 or "http_method" in resp
2437 and resp["http_method"] == "DELETE"
2438 and resp["http_status"] == 404
2439 )
2440
2441
2442 def move_fortios_firewall(data, fos):
2443 if not data["self"] or (not data["after"] and not data["before"]):
2444 fos._module.fail_json(msg="self, after(or before) must not be empty")
2445 vdom = data["vdom"]
2446 params_set = dict()
2447 params_set["action"] = "move"
2448 if data["after"]:
2449 params_set["after"] = data["after"]
2450 if data["before"]:
2451 params_set["before"] = data["before"]
2452 return fos.set(
2453 "firewall",
2454 "policy",
2455 data=None,
2456 mkey=data["self"],
2457 vdom=vdom,
2458 parameters=params_set,
2459 )
2460
2461
2462 def fortios_firewall(data, fos, check_mode):
2463
2464 if data["action"] == "move":
2465 resp = move_fortios_firewall(data, fos)
2466 elif data["firewall_policy"]:
2467 resp = firewall_policy(data, fos, check_mode)
2468 else:
2469 fos._module.fail_json(msg="missing task body: %s" % ("firewall_policy"))
2470 if isinstance(resp, tuple) and len(resp) == 4:
2471 return resp
2472 return (
2473 not is_successful_status(resp),
2474 is_successful_status(resp)
2475 and (resp["revision_changed"] if "revision_changed" in resp else True),
2476 resp,
2477 {},
2478 )
2479
2480
2481 versioned_schema = {
2482 "type": "list",
2483 "elements": "dict",
2484 "children": {
2485 "policyid": {"v_range": [["v6.0.0", ""]], "type": "integer", "required": True},
2486 "status": {
2487 "v_range": [["v6.0.0", ""]],
2488 "type": "string",
2489 "options": [{"value": "enable"}, {"value": "disable"}],
2490 },
2491 "name": {"v_range": [["v6.0.0", ""]], "type": "string"},
2492 "uuid": {"v_range": [["v6.0.0", ""]], "type": "string"},
2493 "srcintf": {
2494 "type": "list",
2495 "elements": "dict",
2496 "children": {
2497 "name": {
2498 "v_range": [["v6.0.0", ""]],
2499 "type": "string",
2500 "required": True,
2501 }
2502 },
2503 "v_range": [["v6.0.0", ""]],
2504 },
2505 "dstintf": {
2506 "type": "list",
2507 "elements": "dict",
2508 "children": {
2509 "name": {
2510 "v_range": [["v6.0.0", ""]],
2511 "type": "string",
2512 "required": True,
2513 }
2514 },
2515 "v_range": [["v6.0.0", ""]],
2516 },
2517 "action": {
2518 "v_range": [["v6.0.0", ""]],
2519 "type": "string",
2520 "options": [{"value": "accept"}, {"value": "deny"}, {"value": "ipsec"}],
2521 },
2522 "nat64": {
2523 "v_range": [["v7.0.1", ""]],
2524 "type": "string",
2525 "options": [{"value": "enable"}, {"value": "disable"}],
2526 },
2527 "nat46": {
2528 "v_range": [["v7.0.1", ""]],
2529 "type": "string",
2530 "options": [{"value": "enable"}, {"value": "disable"}],
2531 },
2532 "ztna_status": {
2533 "v_range": [["v7.0.0", ""]],
2534 "type": "string",
2535 "options": [{"value": "enable"}, {"value": "disable"}],
2536 },
2537 "ztna_device_ownership": {
2538 "v_range": [["v7.2.4", ""]],
2539 "type": "string",
2540 "options": [{"value": "enable"}, {"value": "disable"}],
2541 },
2542 "srcaddr": {
2543 "type": "list",
2544 "elements": "dict",
2545 "children": {
2546 "name": {
2547 "v_range": [["v6.0.0", ""]],
2548 "type": "string",
2549 "required": True,
2550 }
2551 },
2552 "v_range": [["v6.0.0", ""]],
2553 },
2554 "dstaddr": {
2555 "type": "list",
2556 "elements": "dict",
2557 "children": {
2558 "name": {
2559 "v_range": [["v6.0.0", ""]],
2560 "type": "string",
2561 "required": True,
2562 }
2563 },
2564 "v_range": [["v6.0.0", ""]],
2565 },
2566 "srcaddr6": {
2567 "type": "list",
2568 "elements": "dict",
2569 "children": {
2570 "name": {
2571 "v_range": [["v6.4.0", ""]],
2572 "type": "string",
2573 "required": True,
2574 }
2575 },
2576 "v_range": [["v6.4.0", ""]],
2577 },
2578 "dstaddr6": {
2579 "type": "list",
2580 "elements": "dict",
2581 "children": {
2582 "name": {
2583 "v_range": [["v6.4.0", ""]],
2584 "type": "string",
2585 "required": True,
2586 }
2587 },
2588 "v_range": [["v6.4.0", ""]],
2589 },
2590 "ztna_ems_tag": {
2591 "type": "list",
2592 "elements": "dict",
2593 "children": {
2594 "name": {
2595 "v_range": [["v7.0.0", ""]],
2596 "type": "string",
2597 "required": True,
2598 }
2599 },
2600 "v_range": [["v7.0.0", ""]],
2601 },
2602 "ztna_ems_tag_secondary": {
2603 "type": "list",
2604 "elements": "dict",
2605 "children": {
2606 "name": {
2607 "v_range": [["v7.4.0", ""]],
2608 "type": "string",
2609 "required": True,
2610 }
2611 },
2612 "v_range": [["v7.4.0", ""]],
2613 },
2614 "ztna_tags_match_logic": {
2615 "v_range": [["v7.2.4", ""]],
2616 "type": "string",
2617 "options": [{"value": "or"}, {"value": "and"}],
2618 },
2619 "ztna_geo_tag": {
2620 "type": "list",
2621 "elements": "dict",
2622 "children": {
2623 "name": {
2624 "v_range": [["v7.0.0", ""]],
2625 "type": "string",
2626 "required": True,
2627 }
2628 },
2629 "v_range": [["v7.0.0", ""]],
2630 },
2631 "internet_service": {
2632 "v_range": [["v6.0.0", ""]],
2633 "type": "string",
2634 "options": [{"value": "enable"}, {"value": "disable"}],
2635 },
2636 "internet_service_name": {
2637 "type": "list",
2638 "elements": "dict",
2639 "children": {
2640 "name": {
2641 "v_range": [["v6.4.0", ""]],
2642 "type": "string",
2643 "required": True,
2644 }
2645 },
2646 "v_range": [["v6.4.0", ""]],
2647 },
2648 "internet_service_group": {
2649 "type": "list",
2650 "elements": "dict",
2651 "children": {
2652 "name": {
2653 "v_range": [["v6.2.0", ""]],
2654 "type": "string",
2655 "required": True,
2656 }
2657 },
2658 "v_range": [["v6.2.0", ""]],
2659 },
2660 "internet_service_custom": {
2661 "type": "list",
2662 "elements": "dict",
2663 "children": {
2664 "name": {
2665 "v_range": [["v6.0.0", ""]],
2666 "type": "string",
2667 "required": True,
2668 }
2669 },
2670 "v_range": [["v6.0.0", ""]],
2671 },
2672 "network_service_dynamic": {
2673 "type": "list",
2674 "elements": "dict",
2675 "children": {
2676 "name": {
2677 "v_range": [["v7.2.1", ""]],
2678 "type": "string",
2679 "required": True,
2680 }
2681 },
2682 "v_range": [["v7.2.1", ""]],
2683 },
2684 "internet_service_custom_group": {
2685 "type": "list",
2686 "elements": "dict",
2687 "children": {
2688 "name": {
2689 "v_range": [["v6.2.0", ""]],
2690 "type": "string",
2691 "required": True,
2692 }
2693 },
2694 "v_range": [["v6.2.0", ""]],
2695 },
2696 "internet_service_src": {
2697 "v_range": [["v6.0.0", ""]],
2698 "type": "string",
2699 "options": [{"value": "enable"}, {"value": "disable"}],
2700 },
2701 "internet_service_src_name": {
2702 "type": "list",
2703 "elements": "dict",
2704 "children": {
2705 "name": {
2706 "v_range": [["v6.4.0", ""]],
2707 "type": "string",
2708 "required": True,
2709 }
2710 },
2711 "v_range": [["v6.4.0", ""]],
2712 },
2713 "internet_service_src_group": {
2714 "type": "list",
2715 "elements": "dict",
2716 "children": {
2717 "name": {
2718 "v_range": [["v6.2.0", ""]],
2719 "type": "string",
2720 "required": True,
2721 }
2722 },
2723 "v_range": [["v6.2.0", ""]],
2724 },
2725 "internet_service_src_custom": {
2726 "type": "list",
2727 "elements": "dict",
2728 "children": {
2729 "name": {
2730 "v_range": [["v6.0.0", ""]],
2731 "type": "string",
2732 "required": True,
2733 }
2734 },
2735 "v_range": [["v6.0.0", ""]],
2736 },
2737 "network_service_src_dynamic": {
2738 "type": "list",
2739 "elements": "dict",
2740 "children": {
2741 "name": {
2742 "v_range": [["v7.2.1", ""]],
2743 "type": "string",
2744 "required": True,
2745 }
2746 },
2747 "v_range": [["v7.2.1", ""]],
2748 },
2749 "internet_service_src_custom_group": {
2750 "type": "list",
2751 "elements": "dict",
2752 "children": {
2753 "name": {
2754 "v_range": [["v6.2.0", ""]],
2755 "type": "string",
2756 "required": True,
2757 }
2758 },
2759 "v_range": [["v6.2.0", ""]],
2760 },
2761 "reputation_minimum": {"v_range": [["v6.2.0", ""]], "type": "integer"},
2762 "reputation_direction": {
2763 "v_range": [["v6.2.0", ""]],
2764 "type": "string",
2765 "options": [{"value": "source"}, {"value": "destination"}],
2766 },
2767 "src_vendor_mac": {
2768 "type": "list",
2769 "elements": "dict",
2770 "children": {
2771 "id": {"v_range": [["v6.4.0", ""]], "type": "integer", "required": True}
2772 },
2773 "v_range": [["v6.4.0", ""]],
2774 },
2775 "internet_service6": {
2776 "v_range": [["v7.2.1", ""]],
2777 "type": "string",
2778 "options": [{"value": "enable"}, {"value": "disable"}],
2779 },
2780 "internet_service6_name": {
2781 "type": "list",
2782 "elements": "dict",
2783 "children": {
2784 "name": {
2785 "v_range": [["v7.2.1", ""]],
2786 "type": "string",
2787 "required": True,
2788 }
2789 },
2790 "v_range": [["v7.2.1", ""]],
2791 },
2792 "internet_service6_group": {
2793 "type": "list",
2794 "elements": "dict",
2795 "children": {
2796 "name": {
2797 "v_range": [["v7.2.1", ""]],
2798 "type": "string",
2799 "required": True,
2800 }
2801 },
2802 "v_range": [["v7.2.1", ""]],
2803 },
2804 "internet_service6_custom": {
2805 "type": "list",
2806 "elements": "dict",
2807 "children": {
2808 "name": {
2809 "v_range": [["v7.2.1", ""]],
2810 "type": "string",
2811 "required": True,
2812 }
2813 },
2814 "v_range": [["v7.2.1", ""]],
2815 },
2816 "internet_service6_custom_group": {
2817 "type": "list",
2818 "elements": "dict",
2819 "children": {
2820 "name": {
2821 "v_range": [["v7.2.1", ""]],
2822 "type": "string",
2823 "required": True,
2824 }
2825 },
2826 "v_range": [["v7.2.1", ""]],
2827 },
2828 "internet_service6_src": {
2829 "v_range": [["v7.2.1", ""]],
2830 "type": "string",
2831 "options": [{"value": "enable"}, {"value": "disable"}],
2832 },
2833 "internet_service6_src_name": {
2834 "type": "list",
2835 "elements": "dict",
2836 "children": {
2837 "name": {
2838 "v_range": [["v7.2.1", ""]],
2839 "type": "string",
2840 "required": True,
2841 }
2842 },
2843 "v_range": [["v7.2.1", ""]],
2844 },
2845 "internet_service6_src_group": {
2846 "type": "list",
2847 "elements": "dict",
2848 "children": {
2849 "name": {
2850 "v_range": [["v7.2.1", ""]],
2851 "type": "string",
2852 "required": True,
2853 }
2854 },
2855 "v_range": [["v7.2.1", ""]],
2856 },
2857 "internet_service6_src_custom": {
2858 "type": "list",
2859 "elements": "dict",
2860 "children": {
2861 "name": {
2862 "v_range": [["v7.2.1", ""]],
2863 "type": "string",
2864 "required": True,
2865 }
2866 },
2867 "v_range": [["v7.2.1", ""]],
2868 },
2869 "internet_service6_src_custom_group": {
2870 "type": "list",
2871 "elements": "dict",
2872 "children": {
2873 "name": {
2874 "v_range": [["v7.2.1", ""]],
2875 "type": "string",
2876 "required": True,
2877 }
2878 },
2879 "v_range": [["v7.2.1", ""]],
2880 },
2881 "reputation_minimum6": {"v_range": [["v7.2.1", ""]], "type": "integer"},
2882 "reputation_direction6": {
2883 "v_range": [["v7.2.1", ""]],
2884 "type": "string",
2885 "options": [{"value": "source"}, {"value": "destination"}],
2886 },
2887 "rtp_nat": {
2888 "v_range": [["v6.0.0", ""]],
2889 "type": "string",
2890 "options": [{"value": "disable"}, {"value": "enable"}],
2891 },
2892 "rtp_addr": {
2893 "type": "list",
2894 "elements": "dict",
2895 "children": {
2896 "name": {
2897 "v_range": [["v6.0.0", ""]],
2898 "type": "string",
2899 "required": True,
2900 }
2901 },
2902 "v_range": [["v6.0.0", ""]],
2903 },
2904 "send_deny_packet": {
2905 "v_range": [["v6.0.0", ""]],
2906 "type": "string",
2907 "options": [{"value": "disable"}, {"value": "enable"}],
2908 },
2909 "firewall_session_dirty": {
2910 "v_range": [["v6.0.0", ""]],
2911 "type": "string",
2912 "options": [{"value": "check-all"}, {"value": "check-new"}],
2913 },
2914 "schedule": {"v_range": [["v6.0.0", ""]], "type": "string"},
2915 "schedule_timeout": {
2916 "v_range": [["v6.0.0", ""]],
2917 "type": "string",
2918 "options": [{"value": "enable"}, {"value": "disable"}],
2919 },
2920 "policy_expiry": {
2921 "v_range": [["v7.2.0", ""]],
2922 "type": "string",
2923 "options": [{"value": "enable"}, {"value": "disable"}],
2924 },
2925 "policy_expiry_date": {"v_range": [["v7.2.0", ""]], "type": "string"},
2926 "policy_expiry_date_utc": {"v_range": [["v7.2.4", ""]], "type": "string"},
2927 "service": {
2928 "type": "list",
2929 "elements": "dict",
2930 "children": {
2931 "name": {
2932 "v_range": [["v6.0.0", ""]],
2933 "type": "string",
2934 "required": True,
2935 }
2936 },
2937 "v_range": [["v6.0.0", ""]],
2938 },
2939 "tos_mask": {"v_range": [["v6.2.0", ""]], "type": "string"},
2940 "tos": {"v_range": [["v6.2.0", ""]], "type": "string"},
2941 "tos_negate": {
2942 "v_range": [["v6.2.0", ""]],
2943 "type": "string",
2944 "options": [{"value": "enable"}, {"value": "disable"}],
2945 },
2946 "anti_replay": {
2947 "v_range": [["v6.2.0", ""]],
2948 "type": "string",
2949 "options": [{"value": "enable"}, {"value": "disable"}],
2950 },
2951 "tcp_session_without_syn": {
2952 "v_range": [["v6.0.0", ""]],
2953 "type": "string",
2954 "options": [{"value": "all"}, {"value": "data-only"}, {"value": "disable"}],
2955 },
2956 "geoip_anycast": {
2957 "v_range": [["v6.2.0", ""]],
2958 "type": "string",
2959 "options": [{"value": "enable"}, {"value": "disable"}],
2960 },
2961 "geoip_match": {
2962 "v_range": [["v6.4.0", ""]],
2963 "type": "string",
2964 "options": [
2965 {"value": "physical-location"},
2966 {"value": "registered-location"},
2967 ],
2968 },
2969 "dynamic_shaping": {
2970 "v_range": [["v7.0.0", ""]],
2971 "type": "string",
2972 "options": [{"value": "enable"}, {"value": "disable"}],
2973 },
2974 "passive_wan_health_measurement": {
2975 "v_range": [["v7.0.0", ""]],
2976 "type": "string",
2977 "options": [{"value": "enable"}, {"value": "disable"}],
2978 },
2979 "app_monitor": {
2980 "v_range": [["v7.6.1", ""]],
2981 "type": "string",
2982 "options": [{"value": "enable"}, {"value": "disable"}],
2983 },
2984 "utm_status": {
2985 "v_range": [["v6.0.0", ""]],
2986 "type": "string",
2987 "options": [{"value": "enable"}, {"value": "disable"}],
2988 },
2989 "inspection_mode": {
2990 "v_range": [["v6.2.0", ""]],
2991 "type": "string",
2992 "options": [{"value": "proxy"}, {"value": "flow"}],
2993 },
2994 "http_policy_redirect": {
2995 "v_range": [["v6.2.0", ""]],
2996 "type": "string",
2997 "options": [
2998 {"value": "enable"},
2999 {"value": "disable"},
3000 {"value": "legacy", "v_range": [["v7.6.3", ""]]},
3001 ],
3002 },
3003 "ssh_policy_redirect": {
3004 "v_range": [["v6.2.0", ""]],
3005 "type": "string",
3006 "options": [{"value": "enable"}, {"value": "disable"}],
3007 },
3008 "ztna_policy_redirect": {
3009 "v_range": [["v7.2.4", ""]],
3010 "type": "string",
3011 "options": [{"value": "enable"}, {"value": "disable"}],
3012 },
3013 "webproxy_profile": {"v_range": [["v6.2.0", ""]], "type": "string"},
3014 "profile_type": {
3015 "v_range": [["v6.0.0", ""]],
3016 "type": "string",
3017 "options": [{"value": "single"}, {"value": "group"}],
3018 },
3019 "profile_group": {"v_range": [["v6.0.0", ""]], "type": "string"},
3020 "profile_protocol_options": {"v_range": [["v6.0.0", ""]], "type": "string"},
3021 "ssl_ssh_profile": {"v_range": [["v6.0.0", ""]], "type": "string"},
3022 "av_profile": {"v_range": [["v6.0.0", ""]], "type": "string"},
3023 "webfilter_profile": {"v_range": [["v6.0.0", ""]], "type": "string"},
3024 "dnsfilter_profile": {"v_range": [["v6.0.0", ""]], "type": "string"},
3025 "emailfilter_profile": {"v_range": [["v6.2.0", ""]], "type": "string"},
3026 "dlp_profile": {"v_range": [["v7.2.0", ""]], "type": "string"},
3027 "file_filter_profile": {"v_range": [["v6.4.0", ""]], "type": "string"},
3028 "ips_sensor": {"v_range": [["v6.0.0", ""]], "type": "string"},
3029 "application_list": {"v_range": [["v6.0.0", ""]], "type": "string"},
3030 "voip_profile": {"v_range": [["v6.0.0", ""]], "type": "string"},
3031 "ips_voip_filter": {"v_range": [["v7.4.0", ""]], "type": "string"},
3032 "sctp_filter_profile": {"v_range": [["v7.0.1", ""]], "type": "string"},
3033 "diameter_filter_profile": {"v_range": [["v7.4.2", ""]], "type": "string"},
3034 "virtual_patch_profile": {"v_range": [["v7.4.1", ""]], "type": "string"},
3035 "icap_profile": {"v_range": [["v6.0.0", ""]], "type": "string"},
3036 "videofilter_profile": {"v_range": [["v7.0.0", ""]], "type": "string"},
3037 "waf_profile": {"v_range": [["v6.0.0", ""]], "type": "string"},
3038 "ssh_filter_profile": {"v_range": [["v6.0.0", ""]], "type": "string"},
3039 "casb_profile": {"v_range": [["v7.4.1", ""]], "type": "string"},
3040 "telemetry_profile": {"v_range": [["v7.6.3", ""]], "type": "string"},
3041 "logtraffic": {
3042 "v_range": [["v6.0.0", ""]],
3043 "type": "string",
3044 "options": [{"value": "all"}, {"value": "utm"}, {"value": "disable"}],
3045 },
3046 "logtraffic_start": {
3047 "v_range": [["v6.0.0", ""]],
3048 "type": "string",
3049 "options": [{"value": "enable"}, {"value": "disable"}],
3050 },
3051 "log_http_transaction": {
3052 "v_range": [["v7.6.0", ""]],
3053 "type": "string",
3054 "options": [{"value": "enable"}, {"value": "disable"}],
3055 },
3056 "capture_packet": {
3057 "v_range": [["v6.0.0", "v7.4.1"], ["v7.4.3", ""]],
3058 "type": "string",
3059 "options": [
3060 {"value": "enable", "v_range": [["v6.0.0", ""]]},
3061 {"value": "disable", "v_range": [["v6.0.0", ""]]},
3062 ],
3063 },
3064 "auto_asic_offload": {
3065 "v_range": [["v6.0.0", ""]],
3066 "type": "string",
3067 "options": [{"value": "enable"}, {"value": "disable"}],
3068 },
3069 "np_acceleration": {
3070 "v_range": [["v6.0.0", ""]],
3071 "type": "string",
3072 "options": [{"value": "enable"}, {"value": "disable"}],
3073 },
3074 "wanopt": {
3075 "v_range": [["v6.0.0", "v7.4.1"], ["v7.4.3", ""]],
3076 "type": "string",
3077 "options": [
3078 {"value": "enable", "v_range": [["v6.0.0", ""]]},
3079 {"value": "disable", "v_range": [["v6.0.0", ""]]},
3080 ],
3081 },
3082 "wanopt_detection": {
3083 "v_range": [["v6.0.0", "v7.4.1"], ["v7.4.3", ""]],
3084 "type": "string",
3085 "options": [
3086 {"value": "active", "v_range": [["v6.0.0", ""]]},
3087 {"value": "passive", "v_range": [["v6.0.0", ""]]},
3088 {"value": "off", "v_range": [["v6.0.0", ""]]},
3089 ],
3090 },
3091 "wanopt_passive_opt": {
3092 "v_range": [["v6.0.0", "v7.4.1"], ["v7.4.3", ""]],
3093 "type": "string",
3094 "options": [
3095 {"value": "default", "v_range": [["v6.0.0", ""]]},
3096 {"value": "transparent", "v_range": [["v6.0.0", ""]]},
3097 {"value": "non-transparent", "v_range": [["v6.0.0", ""]]},
3098 ],
3099 },
3100 "wanopt_profile": {
3101 "v_range": [["v6.0.0", "v7.4.1"], ["v7.4.3", ""]],
3102 "type": "string",
3103 },
3104 "wanopt_peer": {
3105 "v_range": [["v6.0.0", "v7.4.1"], ["v7.4.3", ""]],
3106 "type": "string",
3107 },
3108 "webcache": {
3109 "v_range": [["v6.0.0", "v7.4.1"], ["v7.4.3", ""]],
3110 "type": "string",
3111 "options": [
3112 {"value": "enable", "v_range": [["v6.0.0", ""]]},
3113 {"value": "disable", "v_range": [["v6.0.0", ""]]},
3114 ],
3115 },
3116 "webcache_https": {
3117 "v_range": [["v6.0.0", "v7.4.1"], ["v7.4.3", ""]],
3118 "type": "string",
3119 "options": [
3120 {"value": "disable", "v_range": [["v6.0.0", ""]]},
3121 {"value": "enable", "v_range": [["v6.0.0", ""]]},
3122 ],
3123 },
3124 "webproxy_forward_server": {"v_range": [["v6.2.0", ""]], "type": "string"},
3125 "traffic_shaper": {"v_range": [["v6.0.0", ""]], "type": "string"},
3126 "traffic_shaper_reverse": {"v_range": [["v6.0.0", ""]], "type": "string"},
3127 "per_ip_shaper": {"v_range": [["v6.0.0", ""]], "type": "string"},
3128 "nat": {
3129 "v_range": [["v6.0.0", ""]],
3130 "type": "string",
3131 "options": [{"value": "enable"}, {"value": "disable"}],
3132 },
3133 "pcp_outbound": {
3134 "v_range": [["v7.4.0", ""]],
3135 "type": "string",
3136 "options": [{"value": "enable"}, {"value": "disable"}],
3137 },
3138 "pcp_inbound": {
3139 "v_range": [["v7.4.0", ""]],
3140 "type": "string",
3141 "options": [{"value": "enable"}, {"value": "disable"}],
3142 },
3143 "pcp_poolname": {
3144 "type": "list",
3145 "elements": "dict",
3146 "children": {
3147 "name": {
3148 "v_range": [["v7.4.0", ""]],
3149 "type": "string",
3150 "required": True,
3151 }
3152 },
3153 "v_range": [["v7.4.0", ""]],
3154 },
3155 "permit_any_host": {
3156 "v_range": [["v6.0.0", ""]],
3157 "type": "string",
3158 "options": [{"value": "enable"}, {"value": "disable"}],
3159 },
3160 "permit_stun_host": {
3161 "v_range": [["v6.0.0", ""]],
3162 "type": "string",
3163 "options": [{"value": "enable"}, {"value": "disable"}],
3164 },
3165 "fixedport": {
3166 "v_range": [["v6.0.0", ""]],
3167 "type": "string",
3168 "options": [{"value": "enable"}, {"value": "disable"}],
3169 },
3170 "port_preserve": {
3171 "v_range": [["v7.4.4", ""]],
3172 "type": "string",
3173 "options": [{"value": "enable"}, {"value": "disable"}],
3174 },
3175 "port_random": {
3176 "v_range": [["v7.6.1", ""]],
3177 "type": "string",
3178 "options": [{"value": "enable"}, {"value": "disable"}],
3179 },
3180 "ippool": {
3181 "v_range": [["v6.0.0", ""]],
3182 "type": "string",
3183 "options": [{"value": "enable"}, {"value": "disable"}],
3184 },
3185 "poolname": {
3186 "type": "list",
3187 "elements": "dict",
3188 "children": {
3189 "name": {
3190 "v_range": [["v6.0.0", ""]],
3191 "type": "string",
3192 "required": True,
3193 }
3194 },
3195 "v_range": [["v6.0.0", ""]],
3196 },
3197 "poolname6": {
3198 "type": "list",
3199 "elements": "dict",
3200 "children": {
3201 "name": {
3202 "v_range": [["v6.4.0", ""]],
3203 "type": "string",
3204 "required": True,
3205 }
3206 },
3207 "v_range": [["v6.4.0", ""]],
3208 },
3209 "session_ttl": {"v_range": [["v6.0.0", ""]], "type": "string"},
3210 "vlan_cos_fwd": {"v_range": [["v6.0.0", ""]], "type": "integer"},
3211 "vlan_cos_rev": {"v_range": [["v6.0.0", ""]], "type": "integer"},
3212 "inbound": {
3213 "v_range": [["v6.0.0", ""]],
3214 "type": "string",
3215 "options": [{"value": "enable"}, {"value": "disable"}],
3216 },
3217 "outbound": {
3218 "v_range": [["v6.0.0", ""]],
3219 "type": "string",
3220 "options": [{"value": "enable"}, {"value": "disable"}],
3221 },
3222 "natinbound": {
3223 "v_range": [["v6.0.0", ""]],
3224 "type": "string",
3225 "options": [{"value": "enable"}, {"value": "disable"}],
3226 },
3227 "natoutbound": {
3228 "v_range": [["v6.0.0", ""]],
3229 "type": "string",
3230 "options": [{"value": "enable"}, {"value": "disable"}],
3231 },
3232 "fec": {
3233 "v_range": [["v7.0.2", ""]],
3234 "type": "string",
3235 "options": [{"value": "enable"}, {"value": "disable"}],
3236 },
3237 "wccp": {
3238 "v_range": [["v6.0.0", ""]],
3239 "type": "string",
3240 "options": [{"value": "enable"}, {"value": "disable"}],
3241 },
3242 "ntlm": {
3243 "v_range": [["v6.0.0", ""]],
3244 "type": "string",
3245 "options": [{"value": "enable"}, {"value": "disable"}],
3246 },
3247 "ntlm_guest": {
3248 "v_range": [["v6.0.0", ""]],
3249 "type": "string",
3250 "options": [{"value": "enable"}, {"value": "disable"}],
3251 },
3252 "ntlm_enabled_browsers": {
3253 "type": "list",
3254 "elements": "dict",
3255 "children": {
3256 "user_agent_string": {
3257 "v_range": [["v6.0.0", ""]],
3258 "type": "string",
3259 "required": True,
3260 }
3261 },
3262 "v_range": [["v6.0.0", ""]],
3263 },
3264 "fsso_agent_for_ntlm": {"v_range": [["v6.0.0", ""]], "type": "string"},
3265 "groups": {
3266 "type": "list",
3267 "elements": "dict",
3268 "children": {
3269 "name": {
3270 "v_range": [["v6.0.0", ""]],
3271 "type": "string",
3272 "required": True,
3273 }
3274 },
3275 "v_range": [["v6.0.0", ""]],
3276 },
3277 "users": {
3278 "type": "list",
3279 "elements": "dict",
3280 "children": {
3281 "name": {
3282 "v_range": [["v6.0.0", ""]],
3283 "type": "string",
3284 "required": True,
3285 }
3286 },
3287 "v_range": [["v6.0.0", ""]],
3288 },
3289 "fsso_groups": {
3290 "type": "list",
3291 "elements": "dict",
3292 "children": {
3293 "name": {
3294 "v_range": [["v6.2.0", ""]],
3295 "type": "string",
3296 "required": True,
3297 }
3298 },
3299 "v_range": [["v6.2.0", ""]],
3300 },
3301 "auth_path": {
3302 "v_range": [["v6.0.0", ""]],
3303 "type": "string",
3304 "options": [{"value": "enable"}, {"value": "disable"}],
3305 },
3306 "disclaimer": {
3307 "v_range": [["v6.0.0", ""]],
3308 "type": "string",
3309 "options": [{"value": "enable"}, {"value": "disable"}],
3310 },
3311 "email_collect": {
3312 "v_range": [["v6.2.0", ""]],
3313 "type": "string",
3314 "options": [{"value": "enable"}, {"value": "disable"}],
3315 },
3316 "vpntunnel": {"v_range": [["v6.0.0", ""]], "type": "string"},
3317 "natip": {"v_range": [["v6.0.0", ""]], "type": "string"},
3318 "match_vip": {
3319 "v_range": [["v6.0.0", ""]],
3320 "type": "string",
3321 "options": [{"value": "enable"}, {"value": "disable"}],
3322 },
3323 "match_vip_only": {
3324 "v_range": [["v6.2.0", ""]],
3325 "type": "string",
3326 "options": [{"value": "enable"}, {"value": "disable"}],
3327 },
3328 "diffserv_copy": {
3329 "v_range": [["v7.2.1", ""]],
3330 "type": "string",
3331 "options": [{"value": "enable"}, {"value": "disable"}],
3332 },
3333 "diffserv_forward": {
3334 "v_range": [["v6.0.0", ""]],
3335 "type": "string",
3336 "options": [{"value": "enable"}, {"value": "disable"}],
3337 },
3338 "diffserv_reverse": {
3339 "v_range": [["v6.0.0", ""]],
3340 "type": "string",
3341 "options": [{"value": "enable"}, {"value": "disable"}],
3342 },
3343 "diffservcode_forward": {"v_range": [["v6.0.0", ""]], "type": "string"},
3344 "diffservcode_rev": {"v_range": [["v6.0.0", ""]], "type": "string"},
3345 "tcp_mss_sender": {"v_range": [["v6.0.0", ""]], "type": "integer"},
3346 "tcp_mss_receiver": {"v_range": [["v6.0.0", ""]], "type": "integer"},
3347 "comments": {"v_range": [["v6.0.0", ""]], "type": "string"},
3348 "gtp_profile": {
3349 "v_range": [["v6.0.0", "v7.0.8"], ["v7.2.0", "v7.2.4"], ["v7.4.3", ""]],
3350 "type": "string",
3351 },
3352 "pfcp_profile": {
3353 "v_range": [["v7.0.1", "v7.0.8"], ["v7.2.0", "v7.2.4"], ["v7.4.3", ""]],
3354 "type": "string",
3355 },
3356 "auth_cert": {"v_range": [["v6.0.0", ""]], "type": "string"},
3357 "auth_redirect_addr": {"v_range": [["v6.0.0", ""]], "type": "string"},
3358 "redirect_url": {"v_range": [["v6.0.0", ""]], "type": "string"},
3359 "identity_based_route": {"v_range": [["v6.0.0", ""]], "type": "string"},
3360 "block_notification": {
3361 "v_range": [["v6.0.0", ""]],
3362 "type": "string",
3363 "options": [{"value": "enable"}, {"value": "disable"}],
3364 },
3365 "custom_log_fields": {
3366 "type": "list",
3367 "elements": "dict",
3368 "children": {
3369 "field_id": {
3370 "v_range": [["v6.0.0", ""]],
3371 "type": "string",
3372 "required": True,
3373 }
3374 },
3375 "v_range": [["v6.0.0", ""]],
3376 },
3377 "replacemsg_override_group": {"v_range": [["v6.0.0", ""]], "type": "string"},
3378 "srcaddr_negate": {
3379 "v_range": [["v6.0.0", ""]],
3380 "type": "string",
3381 "options": [{"value": "enable"}, {"value": "disable"}],
3382 },
3383 "srcaddr6_negate": {
3384 "v_range": [["v7.2.1", ""]],
3385 "type": "string",
3386 "options": [{"value": "enable"}, {"value": "disable"}],
3387 },
3388 "dstaddr_negate": {
3389 "v_range": [["v6.0.0", ""]],
3390 "type": "string",
3391 "options": [{"value": "enable"}, {"value": "disable"}],
3392 },
3393 "dstaddr6_negate": {
3394 "v_range": [["v7.2.1", ""]],
3395 "type": "string",
3396 "options": [{"value": "enable"}, {"value": "disable"}],
3397 },
3398 "ztna_ems_tag_negate": {
3399 "v_range": [["v7.6.1", ""]],
3400 "type": "string",
3401 "options": [{"value": "enable"}, {"value": "disable"}],
3402 },
3403 "service_negate": {
3404 "v_range": [["v6.0.0", ""]],
3405 "type": "string",
3406 "options": [{"value": "enable"}, {"value": "disable"}],
3407 },
3408 "internet_service_negate": {
3409 "v_range": [["v6.0.0", ""]],
3410 "type": "string",
3411 "options": [{"value": "enable"}, {"value": "disable"}],
3412 },
3413 "internet_service_src_negate": {
3414 "v_range": [["v6.0.0", ""]],
3415 "type": "string",
3416 "options": [{"value": "enable"}, {"value": "disable"}],
3417 },
3418 "internet_service6_negate": {
3419 "v_range": [["v7.2.1", ""]],
3420 "type": "string",
3421 "options": [{"value": "enable"}, {"value": "disable"}],
3422 },
3423 "internet_service6_src_negate": {
3424 "v_range": [["v7.2.1", ""]],
3425 "type": "string",
3426 "options": [{"value": "enable"}, {"value": "disable"}],
3427 },
3428 "timeout_send_rst": {
3429 "v_range": [["v6.0.0", ""]],
3430 "type": "string",
3431 "options": [{"value": "enable"}, {"value": "disable"}],
3432 },
3433 "captive_portal_exempt": {
3434 "v_range": [["v6.0.0", ""]],
3435 "type": "string",
3436 "options": [{"value": "enable"}, {"value": "disable"}],
3437 },
3438 "decrypted_traffic_mirror": {"v_range": [["v6.4.0", ""]], "type": "string"},
3439 "dsri": {
3440 "v_range": [["v6.0.0", ""]],
3441 "type": "string",
3442 "options": [{"value": "enable"}, {"value": "disable"}],
3443 },
3444 "radius_mac_auth_bypass": {
3445 "v_range": [["v6.0.0", ""]],
3446 "type": "string",
3447 "options": [{"value": "enable"}, {"value": "disable"}],
3448 },
3449 "radius_ip_auth_bypass": {
3450 "v_range": [["v7.6.0", ""]],
3451 "type": "string",
3452 "options": [{"value": "enable"}, {"value": "disable"}],
3453 },
3454 "delay_tcp_npu_session": {
3455 "v_range": [["v6.0.0", ""]],
3456 "type": "string",
3457 "options": [{"value": "enable"}, {"value": "disable"}],
3458 },
3459 "vlan_filter": {"v_range": [["v6.0.0", ""]], "type": "string"},
3460 "sgt_check": {
3461 "v_range": [["v7.0.1", ""]],
3462 "type": "string",
3463 "options": [{"value": "enable"}, {"value": "disable"}],
3464 },
3465 "sgt": {
3466 "type": "list",
3467 "elements": "dict",
3468 "children": {
3469 "id": {"v_range": [["v7.0.1", ""]], "type": "integer", "required": True}
3470 },
3471 "v_range": [["v7.0.1", ""]],
3472 },
3473 "internet_service_fortiguard": {
3474 "type": "list",
3475 "elements": "dict",
3476 "children": {
3477 "name": {
3478 "v_range": [["v7.6.4", ""]],
3479 "type": "string",
3480 "required": True,
3481 }
3482 },
3483 "v_range": [["v7.6.4", ""]],
3484 },
3485 "internet_service_src_fortiguard": {
3486 "type": "list",
3487 "elements": "dict",
3488 "children": {
3489 "name": {
3490 "v_range": [["v7.6.4", ""]],
3491 "type": "string",
3492 "required": True,
3493 }
3494 },
3495 "v_range": [["v7.6.4", ""]],
3496 },
3497 "internet_service6_fortiguard": {
3498 "type": "list",
3499 "elements": "dict",
3500 "children": {
3501 "name": {
3502 "v_range": [["v7.6.4", ""]],
3503 "type": "string",
3504 "required": True,
3505 }
3506 },
3507 "v_range": [["v7.6.4", ""]],
3508 },
3509 "internet_service6_src_fortiguard": {
3510 "type": "list",
3511 "elements": "dict",
3512 "children": {
3513 "name": {
3514 "v_range": [["v7.6.4", ""]],
3515 "type": "string",
3516 "required": True,
3517 }
3518 },
3519 "v_range": [["v7.6.4", ""]],
3520 },
3521 "scim": {
3522 "v_range": [["v7.6.4", "v7.6.4"]],
3523 "type": "string",
3524 "options": [{"value": "enable"}, {"value": "disable"}],
3525 },
3526 "saml_server": {"v_range": [["v7.6.4", "v7.6.4"]], "type": "string"},
3527 "scim_users": {
3528 "type": "list",
3529 "elements": "dict",
3530 "children": {
3531 "name": {
3532 "v_range": [["v7.6.4", "v7.6.4"]],
3533 "type": "string",
3534 "required": True,
3535 }
3536 },
3537 "v_range": [["v7.6.4", "v7.6.4"]],
3538 },
3539 "scim_groups": {
3540 "type": "list",
3541 "elements": "dict",
3542 "children": {
3543 "name": {
3544 "v_range": [["v7.6.4", "v7.6.4"]],
3545 "type": "string",
3546 "required": True,
3547 }
3548 },
3549 "v_range": [["v7.6.4", "v7.6.4"]],
3550 },
3551 "cifs_profile": {"v_range": [["v6.2.0", "v7.6.0"]], "type": "string"},
3552 "dlp_sensor": {"v_range": [["v6.0.0", "v7.0.12"]], "type": "string"},
3553 "internet_service_id": {
3554 "type": "list",
3555 "elements": "dict",
3556 "children": {
3557 "id": {
3558 "v_range": [["v6.0.0", "v6.2.7"]],
3559 "type": "integer",
3560 "required": True,
3561 }
3562 },
3563 "v_range": [["v6.0.0", "v6.2.7"]],
3564 },
3565 "internet_service_src_id": {
3566 "type": "list",
3567 "elements": "dict",
3568 "children": {
3569 "id": {
3570 "v_range": [["v6.0.0", "v6.2.7"]],
3571 "type": "integer",
3572 "required": True,
3573 }
3574 },
3575 "v_range": [["v6.0.0", "v6.2.7"]],
3576 },
3577 "mms_profile": {"v_range": [["v6.0.0", "v6.2.7"]], "type": "string"},
3578 "application": {
3579 "type": "list",
3580 "elements": "dict",
3581 "children": {
3582 "id": {
3583 "v_range": [["v6.0.0", "v6.2.7"]],
3584 "type": "integer",
3585 "required": True,
3586 }
3587 },
3588 "v_range": [["v6.0.0", "v6.2.7"]],
3589 },
3590 "app_category": {
3591 "type": "list",
3592 "elements": "dict",
3593 "children": {
3594 "id": {
3595 "v_range": [["v6.0.0", "v6.2.7"]],
3596 "type": "integer",
3597 "required": True,
3598 }
3599 },
3600 "v_range": [["v6.0.0", "v6.2.7"]],
3601 },
3602 "url_category": {
3603 "type": "list",
3604 "elements": "dict",
3605 "children": {
3606 "id": {
3607 "v_range": [["v6.0.0", "v6.2.7"]],
3608 "type": "integer",
3609 "required": True,
3610 }
3611 },
3612 "v_range": [["v6.0.0", "v6.2.7"]],
3613 },
3614 "app_group": {
3615 "type": "list",
3616 "elements": "dict",
3617 "children": {
3618 "name": {
3619 "v_range": [["v6.0.0", "v6.2.7"]],
3620 "type": "string",
3621 "required": True,
3622 }
3623 },
3624 "v_range": [["v6.0.0", "v6.2.7"]],
3625 },
3626 "fsso": {
3627 "v_range": [["v6.0.0", "v6.2.7"]],
3628 "type": "string",
3629 "options": [{"value": "enable"}, {"value": "disable"}],
3630 },
3631 "wsso": {
3632 "v_range": [["v6.0.0", "v6.2.7"]],
3633 "type": "string",
3634 "options": [{"value": "enable"}, {"value": "disable"}],
3635 },
3636 "rsso": {
3637 "v_range": [["v6.0.0", "v6.2.7"]],
3638 "type": "string",
3639 "options": [{"value": "enable"}, {"value": "disable"}],
3640 },
3641 "ssl_mirror": {
3642 "v_range": [["v6.0.0", "v6.2.7"]],
3643 "type": "string",
3644 "options": [{"value": "enable"}, {"value": "disable"}],
3645 },
3646 "ssl_mirror_intf": {
3647 "type": "list",
3648 "elements": "dict",
3649 "children": {
3650 "name": {
3651 "v_range": [["v6.0.0", "v6.2.7"]],
3652 "type": "string",
3653 "required": True,
3654 }
3655 },
3656 "v_range": [["v6.0.0", "v6.2.7"]],
3657 },
3658 "devices": {
3659 "type": "list",
3660 "elements": "dict",
3661 "children": {
3662 "name": {
3663 "v_range": [["v6.0.0", "v6.0.11"], ["v6.2.3", "v6.2.3"]],
3664 "type": "string",
3665 "required": True,
3666 }
3667 },
3668 "v_range": [["v6.0.0", "v6.0.11"], ["v6.2.3", "v6.2.3"]],
3669 },
3670 "label": {
3671 "v_range": [["v6.0.0", "v6.0.11"], ["v6.2.3", "v6.2.3"]],
3672 "type": "string",
3673 },
3674 "global_label": {
3675 "v_range": [["v6.0.0", "v6.0.11"], ["v6.2.3", "v6.2.3"]],
3676 "type": "string",
3677 },
3678 "learning_mode": {
3679 "v_range": [["v6.0.0", "v6.0.11"]],
3680 "type": "string",
3681 "options": [{"value": "enable"}, {"value": "disable"}],
3682 },
3683 "dscp_match": {
3684 "v_range": [["v6.0.0", "v6.0.11"]],
3685 "type": "string",
3686 "options": [{"value": "enable"}, {"value": "disable"}],
3687 },
3688 "dscp_negate": {
3689 "v_range": [["v6.0.0", "v6.0.11"]],
3690 "type": "string",
3691 "options": [{"value": "enable"}, {"value": "disable"}],
3692 },
3693 "dscp_value": {"v_range": [["v6.0.0", "v6.0.11"]], "type": "string"},
3694 "spamfilter_profile": {"v_range": [["v6.0.0", "v6.0.11"]], "type": "string"},
3695 "scan_botnet_connections": {
3696 "v_range": [["v6.0.0", "v6.0.11"]],
3697 "type": "string",
3698 "options": [{"value": "disable"}, {"value": "block"}, {"value": "monitor"}],
3699 },
3700 },
3701 "v_range": [["v6.0.0", ""]],
3702 }
3703
3704
3705 def main():
3706 module_spec = schema_to_module_spec(versioned_schema)
3707 mkeyname = "policyid"
3708 fields = {
3709 "access_token": {"required": False, "type": "str", "no_log": True},
3710 "enable_log": {"required": False, "type": "bool", "default": False},
3711 "vdom": {"required": False, "type": "str", "default": "root"},
3712 "member_path": {"required": False, "type": "str"},
3713 "member_state": {
3714 "type": "str",
3715 "required": False,
3716 "choices": ["present", "absent"],
3717 },
3718 "action": {"type": "str", "required": False, "choices": ["move"]},
3719 "self": {"type": "str", "required": False},
3720 "before": {"type": "str", "required": False},
3721 "after": {"type": "str", "required": False},
3722 "state": {"required": False, "type": "str", "choices": ["present", "absent"]},
3723 "firewall_policy": {
3724 "required": False,
3725 "type": "dict",
3726 "default": None,
3727 "options": {},
3728 },
3729 }
3730 for attribute_name in module_spec["options"]:
3731 fields["firewall_policy"]["options"][attribute_name] = module_spec["options"][
3732 attribute_name
3733 ]
3734 if mkeyname and mkeyname == attribute_name:
3735 fields["firewall_policy"]["options"][attribute_name]["required"] = True
3736
3737 module = AnsibleModule(argument_spec=fields, supports_check_mode=True)
3738 check_legacy_fortiosapi(module)
3739
3740 is_error = False
3741 has_changed = False
3742 result = None
3743 diff = None
3744
3745 versions_check_result = None
3746 if module._socket_path:
3747 connection = Connection(module._socket_path)
3748 if "access_token" in module.params:
3749 connection.set_custom_option("access_token", module.params["access_token"])
3750
3751 if "enable_log" in module.params:
3752 connection.set_custom_option("enable_log", module.params["enable_log"])
3753 else:
3754 connection.set_custom_option("enable_log", False)
3755 fos = FortiOSHandler(connection, module, mkeyname, admin_passwd_header=False)
3756 versions_check_result = check_schema_versioning(
3757 fos, versioned_schema, "firewall_policy"
3758 )
3759
3760 is_error, has_changed, result, diff = fortios_firewall(
3761 module.params, fos, module.check_mode
3762 )
3763
3764 else:
3765 module.fail_json(**FAIL_SOCKET_MSG)
3766
3767 if versions_check_result and versions_check_result["matched"] is False:
3768 module.warn(
3769 "Ansible has detected version mismatch between FortOS system and your playbook, see more details by specifying option -vvv"
3770 )
3771
3772 if not is_error:
3773 if versions_check_result and versions_check_result["matched"] is False:
3774 module.exit_json(
3775 changed=has_changed,
3776 version_check_warning=versions_check_result,
3777 meta=result,
3778 diff=diff,
3779 )
3780 else:
3781 module.exit_json(changed=has_changed, meta=result, diff=diff)
3782 else:
3783 if versions_check_result and versions_check_result["matched"] is False:
3784 module.fail_json(
3785 msg="Error in repo",
3786 version_check_warning=versions_check_result,
3787 meta=result,
3788 )
3789 else:
3790 module.fail_json(msg="Error in repo", meta=result)
3791
3792
3793 if __name__ == "__main__":
3794 main()