Debian Codegraph @

ansible_collections/fortinet/fortios/plugins/modules/fortios_antivirus_profile.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_antivirus_profile
23 short_description: Configure AntiVirus profiles 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 antivirus feature and profile 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 - Legacy fortiosapi has been deprecated, httpapi is the preferred way to run playbooks
39
40 - The module supports check_mode.
41
42 requirements:
43 - ansible>=2.16
44 options:
45 access_token:
46 description:
47 - Token-based authentication.
48 Generated from GUI of Fortigate.
49 type: str
50 required: false
51 enable_log:
52 description:
53 - Enable/Disable logging for task.
54 type: bool
55 required: false
56 default: false
57 vdom:
58 description:
59 - Virtual domain, among those defined previously. A vdom is a
60 virtual instance of the FortiGate that can be configured and
61 used as a different unit.
62 type: str
63 default: root
64 member_path:
65 type: str
66 description:
67 - Member attribute path to operate on.
68 - Delimited by a slash character if there are more than one attribute.
69 - Parameter marked with member_path is legitimate for doing member operation.
70 member_state:
71 type: str
72 description:
73 - Add or delete a member under specified attribute path.
74 - When member_state is specified, the state option is ignored.
75 choices:
76 - 'present'
77 - 'absent'
78
79 state:
80 description:
81 - Indicates whether to create or remove the object.
82 type: str
83 required: true
84 choices:
85 - 'present'
86 - 'absent'
87 antivirus_profile:
88 description:
89 - Configure AntiVirus profiles.
90 default: null
91 type: dict
92 suboptions:
93 analytics_accept_filetype:
94 description:
95 - Only submit files matching this DLP file-pattern to FortiSandbox (post-transfer scan only). Source dlp.filepattern.id.
96 type: int
97 analytics_bl_filetype:
98 description:
99 - Only submit files matching this DLP file-pattern to FortiSandbox. Source dlp.filepattern.id.
100 type: int
101 analytics_db:
102 description:
103 - Enable/disable using the FortiSandbox signature database to supplement the AV signature databases.
104 type: str
105 choices:
106 - 'disable'
107 - 'enable'
108 analytics_ignore_filetype:
109 description:
110 - Do not submit files matching this DLP file-pattern to FortiSandbox (post-transfer scan only). Source dlp.filepattern.id.
111 type: int
112 analytics_max_upload:
113 description:
114 - Maximum size of files that can be uploaded to FortiSandbox.
115 type: int
116 analytics_wl_filetype:
117 description:
118 - Do not submit files matching this DLP file-pattern to FortiSandbox. Source dlp.filepattern.id.
119 type: int
120 av_block_log:
121 description:
122 - Enable/disable logging for AntiVirus file blocking.
123 type: str
124 choices:
125 - 'enable'
126 - 'disable'
127 av_virus_log:
128 description:
129 - Enable/disable AntiVirus logging.
130 type: str
131 choices:
132 - 'enable'
133 - 'disable'
134 cifs:
135 description:
136 - Configure CIFS AntiVirus options.
137 type: dict
138 suboptions:
139 archive_block:
140 description:
141 - Select the archive types to block.
142 type: list
143 elements: str
144 choices:
145 - 'encrypted'
146 - 'corrupted'
147 - 'partiallycorrupted'
148 - 'multipart'
149 - 'nested'
150 - 'mailbomb'
151 - 'timeout'
152 - 'unhandled'
153 - 'fileslimit'
154 archive_log:
155 description:
156 - Select the archive types to log.
157 type: list
158 elements: str
159 choices:
160 - 'encrypted'
161 - 'corrupted'
162 - 'partiallycorrupted'
163 - 'multipart'
164 - 'nested'
165 - 'mailbomb'
166 - 'timeout'
167 - 'unhandled'
168 - 'fileslimit'
169 av_scan:
170 description:
171 - Enable AntiVirus scan service.
172 type: str
173 choices:
174 - 'disable'
175 - 'block'
176 - 'monitor'
177 emulator:
178 description:
179 - Enable/disable the virus emulator.
180 type: str
181 choices:
182 - 'enable'
183 - 'disable'
184 external_blocklist:
185 description:
186 - Enable external-blocklist. Analyzes files including the content of archives.
187 type: str
188 choices:
189 - 'disable'
190 - 'block'
191 - 'monitor'
192 fortiai:
193 description:
194 - Enable/disable scanning of files by FortiAI.
195 type: str
196 choices:
197 - 'disable'
198 - 'block'
199 - 'monitor'
200 fortindr:
201 description:
202 - Enable scanning of files by FortiNDR.
203 type: str
204 choices:
205 - 'disable'
206 - 'block'
207 - 'monitor'
208 fortisandbox:
209 description:
210 - Enable scanning of files by FortiSandbox.
211 type: str
212 choices:
213 - 'disable'
214 - 'block'
215 - 'monitor'
216 malware_stream:
217 description:
218 - Enable 0-day malware-stream scanning. Analyzes files including the content of archives.
219 type: str
220 choices:
221 - 'disable'
222 - 'block'
223 - 'monitor'
224 options:
225 description:
226 - Enable/disable CIFS AntiVirus scanning, monitoring, and quarantine.
227 type: list
228 elements: str
229 choices:
230 - 'scan'
231 - 'avmonitor'
232 - 'quarantine'
233 outbreak_prevention:
234 description:
235 - Enable virus outbreak prevention service.
236 type: str
237 choices:
238 - 'disable'
239 - 'block'
240 - 'monitor'
241 - 'disabled'
242 - 'files'
243 - 'full-archive'
244 quarantine:
245 description:
246 - Enable/disable quarantine for infected files.
247 type: str
248 choices:
249 - 'disable'
250 - 'enable'
251 comment:
252 description:
253 - Comment.
254 type: str
255 content_disarm:
256 description:
257 - AV Content Disarm and Reconstruction settings.
258 type: dict
259 suboptions:
260 analytics_suspicious:
261 description:
262 - Enable/disable using CDR as a secondary method for determining suspicous files for analytics.
263 type: str
264 choices:
265 - 'disable'
266 - 'enable'
267 cover_page:
268 description:
269 - Enable/disable inserting a cover page into the disarmed document.
270 type: str
271 choices:
272 - 'disable'
273 - 'enable'
274 detect_only:
275 description:
276 - Enable/disable only detect disarmable files, do not alter content.
277 type: str
278 choices:
279 - 'disable'
280 - 'enable'
281 error_action:
282 description:
283 - Action to be taken if CDR engine encounters an unrecoverable error.
284 type: str
285 choices:
286 - 'block'
287 - 'log-only'
288 - 'ignore'
289 office_action:
290 description:
291 - Enable/disable stripping of PowerPoint action events in Microsoft Office documents.
292 type: str
293 choices:
294 - 'disable'
295 - 'enable'
296 office_dde:
297 description:
298 - Enable/disable stripping of Dynamic Data Exchange events in Microsoft Office documents.
299 type: str
300 choices:
301 - 'disable'
302 - 'enable'
303 office_embed:
304 description:
305 - Enable/disable stripping of embedded objects in Microsoft Office documents.
306 type: str
307 choices:
308 - 'disable'
309 - 'enable'
310 office_hylink:
311 description:
312 - Enable/disable stripping of hyperlinks in Microsoft Office documents.
313 type: str
314 choices:
315 - 'disable'
316 - 'enable'
317 office_linked:
318 description:
319 - Enable/disable stripping of linked objects in Microsoft Office documents.
320 type: str
321 choices:
322 - 'disable'
323 - 'enable'
324 office_macro:
325 description:
326 - Enable/disable stripping of macros in Microsoft Office documents.
327 type: str
328 choices:
329 - 'disable'
330 - 'enable'
331 original_file_destination:
332 description:
333 - Destination to send original file if active content is removed.
334 type: str
335 choices:
336 - 'fortisandbox'
337 - 'quarantine'
338 - 'discard'
339 pdf_act_form:
340 description:
341 - Enable/disable stripping of PDF document actions that submit data to other targets.
342 type: str
343 choices:
344 - 'disable'
345 - 'enable'
346 pdf_act_gotor:
347 description:
348 - Enable/disable stripping of PDF document actions that access other PDF documents.
349 type: str
350 choices:
351 - 'disable'
352 - 'enable'
353 pdf_act_java:
354 description:
355 - Enable/disable stripping of PDF document actions that execute JavaScript code.
356 type: str
357 choices:
358 - 'disable'
359 - 'enable'
360 pdf_act_launch:
361 description:
362 - Enable/disable stripping of PDF document actions that launch other applications.
363 type: str
364 choices:
365 - 'disable'
366 - 'enable'
367 pdf_act_movie:
368 description:
369 - Enable/disable stripping of PDF document actions that play a movie.
370 type: str
371 choices:
372 - 'disable'
373 - 'enable'
374 pdf_act_sound:
375 description:
376 - Enable/disable stripping of PDF document actions that play a sound.
377 type: str
378 choices:
379 - 'disable'
380 - 'enable'
381 pdf_embedfile:
382 description:
383 - Enable/disable stripping of embedded files in PDF documents.
384 type: str
385 choices:
386 - 'disable'
387 - 'enable'
388 pdf_hyperlink:
389 description:
390 - Enable/disable stripping of hyperlinks from PDF documents.
391 type: str
392 choices:
393 - 'disable'
394 - 'enable'
395 pdf_javacode:
396 description:
397 - Enable/disable stripping of JavaScript code in PDF documents.
398 type: str
399 choices:
400 - 'disable'
401 - 'enable'
402 ems_threat_feed:
403 description:
404 - Enable/disable use of EMS threat feed when performing AntiVirus scan. Analyzes files including the content of archives.
405 type: str
406 choices:
407 - 'disable'
408 - 'enable'
409 extended_log:
410 description:
411 - Enable/disable extended logging for antivirus.
412 type: str
413 choices:
414 - 'enable'
415 - 'disable'
416 external_blocklist:
417 description:
418 - One or more external malware block lists.
419 type: list
420 elements: dict
421 suboptions:
422 name:
423 description:
424 - External blocklist. Source system.external-resource.name.
425 required: true
426 type: str
427 external_blocklist_archive_scan:
428 description:
429 - Enable/disable external-blocklist archive scanning.
430 type: str
431 choices:
432 - 'disable'
433 - 'enable'
434 external_blocklist_enable_all:
435 description:
436 - Enable/disable all external blocklists.
437 type: str
438 choices:
439 - 'disable'
440 - 'enable'
441 feature_set:
442 description:
443 - Flow/proxy feature set.
444 type: str
445 choices:
446 - 'flow'
447 - 'proxy'
448 fortiai_error_action:
449 description:
450 - Action to take if FortiAI encounters an error.
451 type: str
452 choices:
453 - 'log-only'
454 - 'block'
455 - 'ignore'
456 fortiai_timeout_action:
457 description:
458 - Action to take if FortiAI encounters a scan timeout.
459 type: str
460 choices:
461 - 'log-only'
462 - 'block'
463 - 'ignore'
464 fortindr_error_action:
465 description:
466 - Action to take if FortiNDR encounters an error.
467 type: str
468 choices:
469 - 'log-only'
470 - 'block'
471 - 'ignore'
472 fortindr_timeout_action:
473 description:
474 - Action to take if FortiNDR encounters a scan timeout.
475 type: str
476 choices:
477 - 'log-only'
478 - 'block'
479 - 'ignore'
480 fortisandbox_error_action:
481 description:
482 - Action to take if FortiSandbox inline scan encounters an error.
483 type: str
484 choices:
485 - 'log-only'
486 - 'block'
487 - 'ignore'
488 fortisandbox_max_upload:
489 description:
490 - Maximum size of files that can be uploaded to FortiSandbox in Mbytes.
491 type: int
492 fortisandbox_mode:
493 description:
494 - FortiSandbox scan modes.
495 type: str
496 choices:
497 - 'inline'
498 - 'analytics-suspicious'
499 - 'analytics-everything'
500 fortisandbox_scan_timeout:
501 description:
502 - FortiSandbox inline scan timeout in seconds (30 - 180).
503 type: int
504 fortisandbox_timeout_action:
505 description:
506 - Action to take if FortiSandbox inline scan encounters a scan timeout.
507 type: str
508 choices:
509 - 'log-only'
510 - 'block'
511 - 'ignore'
512 ftgd_analytics:
513 description:
514 - Settings to control which files are uploaded to FortiSandbox.
515 type: str
516 choices:
517 - 'disable'
518 - 'suspicious'
519 - 'everything'
520 ftp:
521 description:
522 - Configure FTP AntiVirus options.
523 type: dict
524 suboptions:
525 archive_block:
526 description:
527 - Select the archive types to block.
528 type: list
529 elements: str
530 choices:
531 - 'encrypted'
532 - 'corrupted'
533 - 'partiallycorrupted'
534 - 'multipart'
535 - 'nested'
536 - 'mailbomb'
537 - 'timeout'
538 - 'unhandled'
539 - 'fileslimit'
540 archive_log:
541 description:
542 - Select the archive types to log.
543 type: list
544 elements: str
545 choices:
546 - 'encrypted'
547 - 'corrupted'
548 - 'partiallycorrupted'
549 - 'multipart'
550 - 'nested'
551 - 'mailbomb'
552 - 'timeout'
553 - 'unhandled'
554 - 'fileslimit'
555 av_scan:
556 description:
557 - Enable AntiVirus scan service.
558 type: str
559 choices:
560 - 'disable'
561 - 'block'
562 - 'monitor'
563 emulator:
564 description:
565 - Enable/disable the virus emulator.
566 type: str
567 choices:
568 - 'enable'
569 - 'disable'
570 external_blocklist:
571 description:
572 - Enable external-blocklist. Analyzes files including the content of archives.
573 type: str
574 choices:
575 - 'disable'
576 - 'block'
577 - 'monitor'
578 fortiai:
579 description:
580 - Enable/disable scanning of files by FortiAI.
581 type: str
582 choices:
583 - 'disable'
584 - 'block'
585 - 'monitor'
586 fortindr:
587 description:
588 - Enable scanning of files by FortiNDR.
589 type: str
590 choices:
591 - 'disable'
592 - 'block'
593 - 'monitor'
594 fortisandbox:
595 description:
596 - Enable scanning of files by FortiSandbox.
597 type: str
598 choices:
599 - 'disable'
600 - 'block'
601 - 'monitor'
602 malware_stream:
603 description:
604 - Enable 0-day malware-stream scanning. Analyzes files including the content of archives.
605 type: str
606 choices:
607 - 'disable'
608 - 'block'
609 - 'monitor'
610 options:
611 description:
612 - Enable/disable FTP AntiVirus scanning, monitoring, and quarantine.
613 type: list
614 elements: str
615 choices:
616 - 'scan'
617 - 'avmonitor'
618 - 'quarantine'
619 outbreak_prevention:
620 description:
621 - Enable virus outbreak prevention service.
622 type: str
623 choices:
624 - 'disable'
625 - 'block'
626 - 'monitor'
627 - 'disabled'
628 - 'files'
629 - 'full-archive'
630 quarantine:
631 description:
632 - Enable/disable quarantine for infected files.
633 type: str
634 choices:
635 - 'disable'
636 - 'enable'
637 http:
638 description:
639 - Configure HTTP AntiVirus options.
640 type: dict
641 suboptions:
642 archive_block:
643 description:
644 - Select the archive types to block.
645 type: list
646 elements: str
647 choices:
648 - 'encrypted'
649 - 'corrupted'
650 - 'partiallycorrupted'
651 - 'multipart'
652 - 'nested'
653 - 'mailbomb'
654 - 'timeout'
655 - 'unhandled'
656 - 'fileslimit'
657 archive_log:
658 description:
659 - Select the archive types to log.
660 type: list
661 elements: str
662 choices:
663 - 'encrypted'
664 - 'corrupted'
665 - 'partiallycorrupted'
666 - 'multipart'
667 - 'nested'
668 - 'mailbomb'
669 - 'timeout'
670 - 'unhandled'
671 - 'fileslimit'
672 av_scan:
673 description:
674 - Enable AntiVirus scan service.
675 type: str
676 choices:
677 - 'disable'
678 - 'block'
679 - 'monitor'
680 content_disarm:
681 description:
682 - Enable/disable Content Disarm and Reconstruction when performing AntiVirus scan.
683 type: str
684 choices:
685 - 'disable'
686 - 'enable'
687 emulator:
688 description:
689 - Enable/disable the virus emulator.
690 type: str
691 choices:
692 - 'enable'
693 - 'disable'
694 external_blocklist:
695 description:
696 - Enable external-blocklist. Analyzes files including the content of archives.
697 type: str
698 choices:
699 - 'disable'
700 - 'block'
701 - 'monitor'
702 fortiai:
703 description:
704 - Enable/disable scanning of files by FortiAI.
705 type: str
706 choices:
707 - 'disable'
708 - 'block'
709 - 'monitor'
710 fortindr:
711 description:
712 - Enable scanning of files by FortiNDR.
713 type: str
714 choices:
715 - 'disable'
716 - 'block'
717 - 'monitor'
718 fortisandbox:
719 description:
720 - Enable scanning of files by FortiSandbox.
721 type: str
722 choices:
723 - 'disable'
724 - 'block'
725 - 'monitor'
726 malware_stream:
727 description:
728 - Enable 0-day malware-stream scanning. Analyzes files including the content of archives.
729 type: str
730 choices:
731 - 'disable'
732 - 'block'
733 - 'monitor'
734 options:
735 description:
736 - Enable/disable HTTP AntiVirus scanning, monitoring, and quarantine.
737 type: list
738 elements: str
739 choices:
740 - 'scan'
741 - 'avmonitor'
742 - 'quarantine'
743 outbreak_prevention:
744 description:
745 - Enable virus outbreak prevention service.
746 type: str
747 choices:
748 - 'disable'
749 - 'block'
750 - 'monitor'
751 - 'disabled'
752 - 'files'
753 - 'full-archive'
754 quarantine:
755 description:
756 - Enable/disable quarantine for infected files.
757 type: str
758 choices:
759 - 'disable'
760 - 'enable'
761 unknown_content_encoding:
762 description:
763 - Configure the action the FortiGate unit will take on unknown content-encoding.
764 type: str
765 choices:
766 - 'block'
767 - 'inspect'
768 - 'bypass'
769 imap:
770 description:
771 - Configure IMAP AntiVirus options.
772 type: dict
773 suboptions:
774 archive_block:
775 description:
776 - Select the archive types to block.
777 type: list
778 elements: str
779 choices:
780 - 'encrypted'
781 - 'corrupted'
782 - 'partiallycorrupted'
783 - 'multipart'
784 - 'nested'
785 - 'mailbomb'
786 - 'timeout'
787 - 'unhandled'
788 - 'fileslimit'
789 archive_log:
790 description:
791 - Select the archive types to log.
792 type: list
793 elements: str
794 choices:
795 - 'encrypted'
796 - 'corrupted'
797 - 'partiallycorrupted'
798 - 'multipart'
799 - 'nested'
800 - 'mailbomb'
801 - 'timeout'
802 - 'unhandled'
803 - 'fileslimit'
804 av_scan:
805 description:
806 - Enable AntiVirus scan service.
807 type: str
808 choices:
809 - 'disable'
810 - 'block'
811 - 'monitor'
812 content_disarm:
813 description:
814 - Enable/disable Content Disarm and Reconstruction when performing AntiVirus scan.
815 type: str
816 choices:
817 - 'disable'
818 - 'enable'
819 emulator:
820 description:
821 - Enable/disable the virus emulator.
822 type: str
823 choices:
824 - 'enable'
825 - 'disable'
826 executables:
827 description:
828 - Treat Windows executable files as viruses for the purpose of blocking or monitoring.
829 type: str
830 choices:
831 - 'default'
832 - 'virus'
833 external_blocklist:
834 description:
835 - Enable external-blocklist. Analyzes files including the content of archives.
836 type: str
837 choices:
838 - 'disable'
839 - 'block'
840 - 'monitor'
841 fortiai:
842 description:
843 - Enable/disable scanning of files by FortiAI.
844 type: str
845 choices:
846 - 'disable'
847 - 'block'
848 - 'monitor'
849 fortindr:
850 description:
851 - Enable scanning of files by FortiNDR.
852 type: str
853 choices:
854 - 'disable'
855 - 'block'
856 - 'monitor'
857 fortisandbox:
858 description:
859 - Enable scanning of files by FortiSandbox.
860 type: str
861 choices:
862 - 'disable'
863 - 'block'
864 - 'monitor'
865 malware_stream:
866 description:
867 - Enable 0-day malware-stream scanning. Analyzes files including the content of archives.
868 type: str
869 choices:
870 - 'disable'
871 - 'block'
872 - 'monitor'
873 options:
874 description:
875 - Enable/disable IMAP AntiVirus scanning, monitoring, and quarantine.
876 type: list
877 elements: str
878 choices:
879 - 'scan'
880 - 'avmonitor'
881 - 'quarantine'
882 outbreak_prevention:
883 description:
884 - Enable virus outbreak prevention service.
885 type: str
886 choices:
887 - 'disable'
888 - 'block'
889 - 'monitor'
890 - 'disabled'
891 - 'files'
892 - 'full-archive'
893 quarantine:
894 description:
895 - Enable/disable quarantine for infected files.
896 type: str
897 choices:
898 - 'disable'
899 - 'enable'
900 inspection_mode:
901 description:
902 - Inspection mode.
903 type: str
904 choices:
905 - 'proxy'
906 - 'flow-based'
907 mapi:
908 description:
909 - Configure MAPI AntiVirus options.
910 type: dict
911 suboptions:
912 archive_block:
913 description:
914 - Select the archive types to block.
915 type: list
916 elements: str
917 choices:
918 - 'encrypted'
919 - 'corrupted'
920 - 'partiallycorrupted'
921 - 'multipart'
922 - 'nested'
923 - 'mailbomb'
924 - 'timeout'
925 - 'unhandled'
926 - 'fileslimit'
927 archive_log:
928 description:
929 - Select the archive types to log.
930 type: list
931 elements: str
932 choices:
933 - 'encrypted'
934 - 'corrupted'
935 - 'partiallycorrupted'
936 - 'multipart'
937 - 'nested'
938 - 'mailbomb'
939 - 'timeout'
940 - 'unhandled'
941 - 'fileslimit'
942 av_scan:
943 description:
944 - Enable AntiVirus scan service.
945 type: str
946 choices:
947 - 'disable'
948 - 'block'
949 - 'monitor'
950 emulator:
951 description:
952 - Enable/disable the virus emulator.
953 type: str
954 choices:
955 - 'enable'
956 - 'disable'
957 executables:
958 description:
959 - Treat Windows executable files as viruses for the purpose of blocking or monitoring.
960 type: str
961 choices:
962 - 'default'
963 - 'virus'
964 external_blocklist:
965 description:
966 - Enable external-blocklist. Analyzes files including the content of archives.
967 type: str
968 choices:
969 - 'disable'
970 - 'block'
971 - 'monitor'
972 fortiai:
973 description:
974 - Enable/disable scanning of files by FortiAI.
975 type: str
976 choices:
977 - 'disable'
978 - 'block'
979 - 'monitor'
980 fortindr:
981 description:
982 - Enable scanning of files by FortiNDR.
983 type: str
984 choices:
985 - 'disable'
986 - 'block'
987 - 'monitor'
988 fortisandbox:
989 description:
990 - Enable scanning of files by FortiSandbox.
991 type: str
992 choices:
993 - 'disable'
994 - 'block'
995 - 'monitor'
996 malware_stream:
997 description:
998 - Enable 0-day malware-stream scanning. Analyzes files including the content of archives.
999 type: str
1000 choices:
1001 - 'disable'
1002 - 'block'
1003 - 'monitor'
1004 options:
1005 description:
1006 - Enable/disable MAPI AntiVirus scanning, monitoring, and quarantine.
1007 type: list
1008 elements: str
1009 choices:
1010 - 'scan'
1011 - 'avmonitor'
1012 - 'quarantine'
1013 outbreak_prevention:
1014 description:
1015 - Enable virus outbreak prevention service.
1016 type: str
1017 choices:
1018 - 'disable'
1019 - 'block'
1020 - 'monitor'
1021 - 'disabled'
1022 - 'files'
1023 - 'full-archive'
1024 quarantine:
1025 description:
1026 - Enable/disable quarantine for infected files.
1027 type: str
1028 choices:
1029 - 'disable'
1030 - 'enable'
1031 mobile_malware_db:
1032 description:
1033 - Enable/disable using the mobile malware signature database.
1034 type: str
1035 choices:
1036 - 'disable'
1037 - 'enable'
1038 nac_quar:
1039 description:
1040 - Configure AntiVirus quarantine settings.
1041 type: dict
1042 suboptions:
1043 expiry:
1044 description:
1045 - Duration of quarantine.
1046 type: str
1047 infected:
1048 description:
1049 - Enable/Disable quarantining infected hosts to the banned user list.
1050 type: str
1051 choices:
1052 - 'none'
1053 - 'quar-src-ip'
1054 log:
1055 description:
1056 - Enable/disable AntiVirus quarantine logging.
1057 type: str
1058 choices:
1059 - 'enable'
1060 - 'disable'
1061 name:
1062 description:
1063 - Profile name.
1064 required: true
1065 type: str
1066 nntp:
1067 description:
1068 - Configure NNTP AntiVirus options.
1069 type: dict
1070 suboptions:
1071 archive_block:
1072 description:
1073 - Select the archive types to block.
1074 type: list
1075 elements: str
1076 choices:
1077 - 'encrypted'
1078 - 'corrupted'
1079 - 'partiallycorrupted'
1080 - 'multipart'
1081 - 'nested'
1082 - 'mailbomb'
1083 - 'timeout'
1084 - 'unhandled'
1085 - 'fileslimit'
1086 archive_log:
1087 description:
1088 - Select the archive types to log.
1089 type: list
1090 elements: str
1091 choices:
1092 - 'encrypted'
1093 - 'corrupted'
1094 - 'partiallycorrupted'
1095 - 'multipart'
1096 - 'nested'
1097 - 'mailbomb'
1098 - 'timeout'
1099 - 'unhandled'
1100 - 'fileslimit'
1101 av_scan:
1102 description:
1103 - Enable AntiVirus scan service.
1104 type: str
1105 choices:
1106 - 'disable'
1107 - 'block'
1108 - 'monitor'
1109 emulator:
1110 description:
1111 - Enable/disable the virus emulator.
1112 type: str
1113 choices:
1114 - 'enable'
1115 - 'disable'
1116 external_blocklist:
1117 description:
1118 - Enable external-blocklist. Analyzes files including the content of archives.
1119 type: str
1120 choices:
1121 - 'disable'
1122 - 'block'
1123 - 'monitor'
1124 fortiai:
1125 description:
1126 - Enable/disable scanning of files by FortiAI.
1127 type: str
1128 choices:
1129 - 'disable'
1130 - 'block'
1131 - 'monitor'
1132 fortindr:
1133 description:
1134 - Enable scanning of files by FortiNDR.
1135 type: str
1136 choices:
1137 - 'disable'
1138 - 'block'
1139 - 'monitor'
1140 fortisandbox:
1141 description:
1142 - Enable scanning of files by FortiSandbox.
1143 type: str
1144 choices:
1145 - 'disable'
1146 - 'block'
1147 - 'monitor'
1148 malware_stream:
1149 description:
1150 - Enable 0-day malware-stream scanning. Analyzes files including the content of archives.
1151 type: str
1152 choices:
1153 - 'disable'
1154 - 'block'
1155 - 'monitor'
1156 options:
1157 description:
1158 - Enable/disable NNTP AntiVirus scanning, monitoring, and quarantine.
1159 type: list
1160 elements: str
1161 choices:
1162 - 'scan'
1163 - 'avmonitor'
1164 - 'quarantine'
1165 outbreak_prevention:
1166 description:
1167 - Enable virus outbreak prevention service.
1168 type: str
1169 choices:
1170 - 'disable'
1171 - 'block'
1172 - 'monitor'
1173 - 'disabled'
1174 - 'files'
1175 - 'full-archive'
1176 quarantine:
1177 description:
1178 - Enable/disable quarantine for infected files.
1179 type: str
1180 choices:
1181 - 'disable'
1182 - 'enable'
1183 outbreak_prevention:
1184 description:
1185 - Configure Virus Outbreak Prevention settings.
1186 type: dict
1187 suboptions:
1188 external_blocklist:
1189 description:
1190 - Enable/disable external malware blocklist.
1191 type: str
1192 choices:
1193 - 'disable'
1194 - 'enable'
1195 ftgd_service:
1196 description:
1197 - Enable/disable FortiGuard Virus outbreak prevention service.
1198 type: str
1199 choices:
1200 - 'disable'
1201 - 'enable'
1202 outbreak_prevention_archive_scan:
1203 description:
1204 - Enable/disable outbreak-prevention archive scanning.
1205 type: str
1206 choices:
1207 - 'disable'
1208 - 'enable'
1209 pop3:
1210 description:
1211 - Configure POP3 AntiVirus options.
1212 type: dict
1213 suboptions:
1214 archive_block:
1215 description:
1216 - Select the archive types to block.
1217 type: list
1218 elements: str
1219 choices:
1220 - 'encrypted'
1221 - 'corrupted'
1222 - 'partiallycorrupted'
1223 - 'multipart'
1224 - 'nested'
1225 - 'mailbomb'
1226 - 'timeout'
1227 - 'unhandled'
1228 - 'fileslimit'
1229 archive_log:
1230 description:
1231 - Select the archive types to log.
1232 type: list
1233 elements: str
1234 choices:
1235 - 'encrypted'
1236 - 'corrupted'
1237 - 'partiallycorrupted'
1238 - 'multipart'
1239 - 'nested'
1240 - 'mailbomb'
1241 - 'timeout'
1242 - 'unhandled'
1243 - 'fileslimit'
1244 av_scan:
1245 description:
1246 - Enable AntiVirus scan service.
1247 type: str
1248 choices:
1249 - 'disable'
1250 - 'block'
1251 - 'monitor'
1252 content_disarm:
1253 description:
1254 - Enable/disable Content Disarm and Reconstruction when performing AntiVirus scan.
1255 type: str
1256 choices:
1257 - 'disable'
1258 - 'enable'
1259 emulator:
1260 description:
1261 - Enable/disable the virus emulator.
1262 type: str
1263 choices:
1264 - 'enable'
1265 - 'disable'
1266 executables:
1267 description:
1268 - Treat Windows executable files as viruses for the purpose of blocking or monitoring.
1269 type: str
1270 choices:
1271 - 'default'
1272 - 'virus'
1273 external_blocklist:
1274 description:
1275 - Enable external-blocklist. Analyzes files including the content of archives.
1276 type: str
1277 choices:
1278 - 'disable'
1279 - 'block'
1280 - 'monitor'
1281 fortiai:
1282 description:
1283 - Enable/disable scanning of files by FortiAI.
1284 type: str
1285 choices:
1286 - 'disable'
1287 - 'block'
1288 - 'monitor'
1289 fortindr:
1290 description:
1291 - Enable scanning of files by FortiNDR.
1292 type: str
1293 choices:
1294 - 'disable'
1295 - 'block'
1296 - 'monitor'
1297 fortisandbox:
1298 description:
1299 - Enable scanning of files by FortiSandbox.
1300 type: str
1301 choices:
1302 - 'disable'
1303 - 'block'
1304 - 'monitor'
1305 malware_stream:
1306 description:
1307 - Enable 0-day malware-stream scanning. Analyzes files including the content of archives.
1308 type: str
1309 choices:
1310 - 'disable'
1311 - 'block'
1312 - 'monitor'
1313 options:
1314 description:
1315 - Enable/disable POP3 AntiVirus scanning, monitoring, and quarantine.
1316 type: list
1317 elements: str
1318 choices:
1319 - 'scan'
1320 - 'avmonitor'
1321 - 'quarantine'
1322 outbreak_prevention:
1323 description:
1324 - Enable virus outbreak prevention service.
1325 type: str
1326 choices:
1327 - 'disable'
1328 - 'block'
1329 - 'monitor'
1330 - 'disabled'
1331 - 'files'
1332 - 'full-archive'
1333 quarantine:
1334 description:
1335 - Enable/disable quarantine for infected files.
1336 type: str
1337 choices:
1338 - 'disable'
1339 - 'enable'
1340 replacemsg_group:
1341 description:
1342 - Replacement message group customized for this profile. Source system.replacemsg-group.name.
1343 type: str
1344 scan_mode:
1345 description:
1346 - Configure scan mode .
1347 type: str
1348 choices:
1349 - 'default'
1350 - 'legacy'
1351 - 'quick'
1352 - 'full'
1353 smb:
1354 description:
1355 - Configure SMB AntiVirus options.
1356 type: dict
1357 suboptions:
1358 archive_block:
1359 description:
1360 - Select the archive types to block.
1361 type: str
1362 choices:
1363 - 'encrypted'
1364 - 'corrupted'
1365 - 'partiallycorrupted'
1366 - 'multipart'
1367 - 'nested'
1368 - 'mailbomb'
1369 - 'fileslimit'
1370 - 'timeout'
1371 - 'unhandled'
1372 archive_log:
1373 description:
1374 - Select the archive types to log.
1375 type: str
1376 choices:
1377 - 'encrypted'
1378 - 'corrupted'
1379 - 'partiallycorrupted'
1380 - 'multipart'
1381 - 'nested'
1382 - 'mailbomb'
1383 - 'fileslimit'
1384 - 'timeout'
1385 - 'unhandled'
1386 emulator:
1387 description:
1388 - Enable/disable the virus emulator.
1389 type: str
1390 choices:
1391 - 'enable'
1392 - 'disable'
1393 options:
1394 description:
1395 - Enable/disable SMB AntiVirus scanning, monitoring, and quarantine.
1396 type: str
1397 choices:
1398 - 'scan'
1399 - 'avmonitor'
1400 - 'quarantine'
1401 outbreak_prevention:
1402 description:
1403 - Enable FortiGuard Virus Outbreak Prevention service.
1404 type: str
1405 choices:
1406 - 'disabled'
1407 - 'files'
1408 - 'full-archive'
1409 smtp:
1410 description:
1411 - Configure SMTP AntiVirus options.
1412 type: dict
1413 suboptions:
1414 archive_block:
1415 description:
1416 - Select the archive types to block.
1417 type: list
1418 elements: str
1419 choices:
1420 - 'encrypted'
1421 - 'corrupted'
1422 - 'partiallycorrupted'
1423 - 'multipart'
1424 - 'nested'
1425 - 'mailbomb'
1426 - 'timeout'
1427 - 'unhandled'
1428 - 'fileslimit'
1429 archive_log:
1430 description:
1431 - Select the archive types to log.
1432 type: list
1433 elements: str
1434 choices:
1435 - 'encrypted'
1436 - 'corrupted'
1437 - 'partiallycorrupted'
1438 - 'multipart'
1439 - 'nested'
1440 - 'mailbomb'
1441 - 'timeout'
1442 - 'unhandled'
1443 - 'fileslimit'
1444 av_scan:
1445 description:
1446 - Enable AntiVirus scan service.
1447 type: str
1448 choices:
1449 - 'disable'
1450 - 'block'
1451 - 'monitor'
1452 content_disarm:
1453 description:
1454 - Enable/disable Content Disarm and Reconstruction when performing AntiVirus scan.
1455 type: str
1456 choices:
1457 - 'disable'
1458 - 'enable'
1459 emulator:
1460 description:
1461 - Enable/disable the virus emulator.
1462 type: str
1463 choices:
1464 - 'enable'
1465 - 'disable'
1466 executables:
1467 description:
1468 - Treat Windows executable files as viruses for the purpose of blocking or monitoring.
1469 type: str
1470 choices:
1471 - 'default'
1472 - 'virus'
1473 external_blocklist:
1474 description:
1475 - Enable external-blocklist. Analyzes files including the content of archives.
1476 type: str
1477 choices:
1478 - 'disable'
1479 - 'block'
1480 - 'monitor'
1481 fortiai:
1482 description:
1483 - Enable/disable scanning of files by FortiAI.
1484 type: str
1485 choices:
1486 - 'disable'
1487 - 'block'
1488 - 'monitor'
1489 fortindr:
1490 description:
1491 - Enable scanning of files by FortiNDR.
1492 type: str
1493 choices:
1494 - 'disable'
1495 - 'block'
1496 - 'monitor'
1497 fortisandbox:
1498 description:
1499 - Enable scanning of files by FortiSandbox.
1500 type: str
1501 choices:
1502 - 'disable'
1503 - 'block'
1504 - 'monitor'
1505 malware_stream:
1506 description:
1507 - Enable 0-day malware-stream scanning. Analyzes files including the content of archives.
1508 type: str
1509 choices:
1510 - 'disable'
1511 - 'block'
1512 - 'monitor'
1513 options:
1514 description:
1515 - Enable/disable SMTP AntiVirus scanning, monitoring, and quarantine.
1516 type: list
1517 elements: str
1518 choices:
1519 - 'scan'
1520 - 'avmonitor'
1521 - 'quarantine'
1522 outbreak_prevention:
1523 description:
1524 - Enable virus outbreak prevention service.
1525 type: str
1526 choices:
1527 - 'disable'
1528 - 'block'
1529 - 'monitor'
1530 - 'disabled'
1531 - 'files'
1532 - 'full-archive'
1533 quarantine:
1534 description:
1535 - Enable/disable quarantine for infected files.
1536 type: str
1537 choices:
1538 - 'disable'
1539 - 'enable'
1540 ssh:
1541 description:
1542 - Configure SFTP and SCP AntiVirus options.
1543 type: dict
1544 suboptions:
1545 archive_block:
1546 description:
1547 - Select the archive types to block.
1548 type: list
1549 elements: str
1550 choices:
1551 - 'encrypted'
1552 - 'corrupted'
1553 - 'partiallycorrupted'
1554 - 'multipart'
1555 - 'nested'
1556 - 'mailbomb'
1557 - 'timeout'
1558 - 'unhandled'
1559 - 'fileslimit'
1560 archive_log:
1561 description:
1562 - Select the archive types to log.
1563 type: list
1564 elements: str
1565 choices:
1566 - 'encrypted'
1567 - 'corrupted'
1568 - 'partiallycorrupted'
1569 - 'multipart'
1570 - 'nested'
1571 - 'mailbomb'
1572 - 'timeout'
1573 - 'unhandled'
1574 - 'fileslimit'
1575 av_scan:
1576 description:
1577 - Enable AntiVirus scan service.
1578 type: str
1579 choices:
1580 - 'disable'
1581 - 'block'
1582 - 'monitor'
1583 emulator:
1584 description:
1585 - Enable/disable the virus emulator.
1586 type: str
1587 choices:
1588 - 'enable'
1589 - 'disable'
1590 external_blocklist:
1591 description:
1592 - Enable external-blocklist. Analyzes files including the content of archives.
1593 type: str
1594 choices:
1595 - 'disable'
1596 - 'block'
1597 - 'monitor'
1598 fortiai:
1599 description:
1600 - Enable/disable scanning of files by FortiAI.
1601 type: str
1602 choices:
1603 - 'disable'
1604 - 'block'
1605 - 'monitor'
1606 fortindr:
1607 description:
1608 - Enable scanning of files by FortiNDR.
1609 type: str
1610 choices:
1611 - 'disable'
1612 - 'block'
1613 - 'monitor'
1614 fortisandbox:
1615 description:
1616 - Enable scanning of files by FortiSandbox.
1617 type: str
1618 choices:
1619 - 'disable'
1620 - 'block'
1621 - 'monitor'
1622 malware_stream:
1623 description:
1624 - Enable 0-day malware-stream scanning. Analyzes files including the content of archives.
1625 type: str
1626 choices:
1627 - 'disable'
1628 - 'block'
1629 - 'monitor'
1630 options:
1631 description:
1632 - Enable/disable SFTP and SCP AntiVirus scanning, monitoring, and quarantine.
1633 type: list
1634 elements: str
1635 choices:
1636 - 'scan'
1637 - 'avmonitor'
1638 - 'quarantine'
1639 outbreak_prevention:
1640 description:
1641 - Enable virus outbreak prevention service.
1642 type: str
1643 choices:
1644 - 'disable'
1645 - 'block'
1646 - 'monitor'
1647 - 'disabled'
1648 - 'files'
1649 - 'full-archive'
1650 quarantine:
1651 description:
1652 - Enable/disable quarantine for infected files.
1653 type: str
1654 choices:
1655 - 'disable'
1656 - 'enable'
1657 """
1658
1659 EXAMPLES = """
1660 - name: Configure AntiVirus profiles.
1661 fortinet.fortios.fortios_antivirus_profile:
1662 vdom: "{{ vdom }}"
1663 state: "present"
1664 access_token: "<your_own_value>"
1665 antivirus_profile:
1666 analytics_accept_filetype: "0"
1667 analytics_bl_filetype: "2147483647"
1668 analytics_db: "disable"
1669 analytics_ignore_filetype: "0"
1670 analytics_max_upload: "10"
1671 analytics_wl_filetype: "2147483647"
1672 av_block_log: "enable"
1673 av_virus_log: "enable"
1674 cifs:
1675 archive_block: "encrypted"
1676 archive_log: "encrypted"
1677 av_scan: "disable"
1678 emulator: "enable"
1679 external_blocklist: "disable"
1680 fortiai: "disable"
1681 fortindr: "disable"
1682 fortisandbox: "disable"
1683 malware_stream: "disable"
1684 options: "scan"
1685 outbreak_prevention: "disable"
1686 quarantine: "disable"
1687 comment: "Comment."
1688 content_disarm:
1689 analytics_suspicious: "disable"
1690 cover_page: "disable"
1691 detect_only: "disable"
1692 error_action: "block"
1693 office_action: "disable"
1694 office_dde: "disable"
1695 office_embed: "disable"
1696 office_hylink: "disable"
1697 office_linked: "disable"
1698 office_macro: "disable"
1699 original_file_destination: "fortisandbox"
1700 pdf_act_form: "disable"
1701 pdf_act_gotor: "disable"
1702 pdf_act_java: "disable"
1703 pdf_act_launch: "disable"
1704 pdf_act_movie: "disable"
1705 pdf_act_sound: "disable"
1706 pdf_embedfile: "disable"
1707 pdf_hyperlink: "disable"
1708 pdf_javacode: "disable"
1709 ems_threat_feed: "disable"
1710 extended_log: "enable"
1711 external_blocklist:
1712 -
1713 name: "default_name_49 (source system.external-resource.name)"
1714 external_blocklist_archive_scan: "disable"
1715 external_blocklist_enable_all: "disable"
1716 feature_set: "flow"
1717 fortiai_error_action: "log-only"
1718 fortiai_timeout_action: "log-only"
1719 fortindr_error_action: "log-only"
1720 fortindr_timeout_action: "log-only"
1721 fortisandbox_error_action: "log-only"
1722 fortisandbox_max_upload: "10"
1723 fortisandbox_mode: "inline"
1724 fortisandbox_scan_timeout: "60"
1725 fortisandbox_timeout_action: "log-only"
1726 ftgd_analytics: "disable"
1727 ftp:
1728 archive_block: "encrypted"
1729 archive_log: "encrypted"
1730 av_scan: "disable"
1731 emulator: "enable"
1732 external_blocklist: "disable"
1733 fortiai: "disable"
1734 fortindr: "disable"
1735 fortisandbox: "disable"
1736 malware_stream: "disable"
1737 options: "scan"
1738 outbreak_prevention: "disable"
1739 quarantine: "disable"
1740 http:
1741 archive_block: "encrypted"
1742 archive_log: "encrypted"
1743 av_scan: "disable"
1744 content_disarm: "disable"
1745 emulator: "enable"
1746 external_blocklist: "disable"
1747 fortiai: "disable"
1748 fortindr: "disable"
1749 fortisandbox: "disable"
1750 malware_stream: "disable"
1751 options: "scan"
1752 outbreak_prevention: "disable"
1753 quarantine: "disable"
1754 unknown_content_encoding: "block"
1755 imap:
1756 archive_block: "encrypted"
1757 archive_log: "encrypted"
1758 av_scan: "disable"
1759 content_disarm: "disable"
1760 emulator: "enable"
1761 executables: "default"
1762 external_blocklist: "disable"
1763 fortiai: "disable"
1764 fortindr: "disable"
1765 fortisandbox: "disable"
1766 malware_stream: "disable"
1767 options: "scan"
1768 outbreak_prevention: "disable"
1769 quarantine: "disable"
1770 inspection_mode: "proxy"
1771 mapi:
1772 archive_block: "encrypted"
1773 archive_log: "encrypted"
1774 av_scan: "disable"
1775 emulator: "enable"
1776 executables: "default"
1777 external_blocklist: "disable"
1778 fortiai: "disable"
1779 fortindr: "disable"
1780 fortisandbox: "disable"
1781 malware_stream: "disable"
1782 options: "scan"
1783 outbreak_prevention: "disable"
1784 quarantine: "disable"
1785 mobile_malware_db: "disable"
1786 nac_quar:
1787 expiry: "<your_own_value>"
1788 infected: "none"
1789 log: "enable"
1790 name: "default_name_126"
1791 nntp:
1792 archive_block: "encrypted"
1793 archive_log: "encrypted"
1794 av_scan: "disable"
1795 emulator: "enable"
1796 external_blocklist: "disable"
1797 fortiai: "disable"
1798 fortindr: "disable"
1799 fortisandbox: "disable"
1800 malware_stream: "disable"
1801 options: "scan"
1802 outbreak_prevention: "disable"
1803 quarantine: "disable"
1804 outbreak_prevention:
1805 external_blocklist: "disable"
1806 ftgd_service: "disable"
1807 outbreak_prevention_archive_scan: "disable"
1808 pop3:
1809 archive_block: "encrypted"
1810 archive_log: "encrypted"
1811 av_scan: "disable"
1812 content_disarm: "disable"
1813 emulator: "enable"
1814 executables: "default"
1815 external_blocklist: "disable"
1816 fortiai: "disable"
1817 fortindr: "disable"
1818 fortisandbox: "disable"
1819 malware_stream: "disable"
1820 options: "scan"
1821 outbreak_prevention: "disable"
1822 quarantine: "disable"
1823 replacemsg_group: "<your_own_value> (source system.replacemsg-group.name)"
1824 scan_mode: "default"
1825 smb:
1826 archive_block: "encrypted"
1827 archive_log: "encrypted"
1828 emulator: "enable"
1829 options: "scan"
1830 outbreak_prevention: "disabled"
1831 smtp:
1832 archive_block: "encrypted"
1833 archive_log: "encrypted"
1834 av_scan: "disable"
1835 content_disarm: "disable"
1836 emulator: "enable"
1837 executables: "default"
1838 external_blocklist: "disable"
1839 fortiai: "disable"
1840 fortindr: "disable"
1841 fortisandbox: "disable"
1842 malware_stream: "disable"
1843 options: "scan"
1844 outbreak_prevention: "disable"
1845 quarantine: "disable"
1846 ssh:
1847 archive_block: "encrypted"
1848 archive_log: "encrypted"
1849 av_scan: "disable"
1850 emulator: "enable"
1851 external_blocklist: "disable"
1852 fortiai: "disable"
1853 fortindr: "disable"
1854 fortisandbox: "disable"
1855 malware_stream: "disable"
1856 options: "scan"
1857 outbreak_prevention: "disable"
1858 quarantine: "disable"
1859 """
1860
1861 RETURN = """
1862 build:
1863 description: Build number of the fortigate image
1864 returned: always
1865 type: str
1866 sample: '1547'
1867 http_method:
1868 description: Last method used to provision the content into FortiGate
1869 returned: always
1870 type: str
1871 sample: 'PUT'
1872 http_status:
1873 description: Last result given by FortiGate on last operation applied
1874 returned: always
1875 type: str
1876 sample: "200"
1877 mkey:
1878 description: Master key (id) used in the last call to FortiGate
1879 returned: success
1880 type: str
1881 sample: "id"
1882 name:
1883 description: Name of the table used to fulfill the request
1884 returned: always
1885 type: str
1886 sample: "urlfilter"
1887 path:
1888 description: Path of the table used to fulfill the request
1889 returned: always
1890 type: str
1891 sample: "webfilter"
1892 revision:
1893 description: Internal revision number
1894 returned: always
1895 type: str
1896 sample: "17.0.2.10658"
1897 serial:
1898 description: Serial number of the unit
1899 returned: always
1900 type: str
1901 sample: "FGVMEVYYQT3AB5352"
1902 status:
1903 description: Indication of the operation's result
1904 returned: always
1905 type: str
1906 sample: "success"
1907 vdom:
1908 description: Virtual domain used
1909 returned: always
1910 type: str
1911 sample: "root"
1912 version:
1913 description: Version of the FortiGate
1914 returned: always
1915 type: str
1916 sample: "v5.6.3"
1917 """
1918 from ansible.module_utils.basic import AnsibleModule
1919 from ansible.module_utils.connection import Connection
1920 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.fortios import (
1921 FortiOSHandler,
1922 )
1923 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.fortios import (
1924 check_legacy_fortiosapi,
1925 )
1926 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.fortios import (
1927 schema_to_module_spec,
1928 )
1929 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.fortios import (
1930 check_schema_versioning,
1931 )
1932 from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.common import (
1933 FAIL_SOCKET_MSG,
1934 )
1935 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.data_post_processor import (
1936 remove_invalid_fields,
1937 )
1938 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.comparison import (
1939 is_same_comparison,
1940 )
1941 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.comparison import (
1942 serialize,
1943 )
1944 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.comparison import (
1945 find_current_values,
1946 )
1947 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.comparison import (
1948 unify_data_format,
1949 )
1950
1951
1952 def filter_antivirus_profile_data(json):
1953 option_list = [
1954 "analytics_accept_filetype",
1955 "analytics_bl_filetype",
1956 "analytics_db",
1957 "analytics_ignore_filetype",
1958 "analytics_max_upload",
1959 "analytics_wl_filetype",
1960 "av_block_log",
1961 "av_virus_log",
1962 "cifs",
1963 "comment",
1964 "content_disarm",
1965 "ems_threat_feed",
1966 "extended_log",
1967 "external_blocklist",
1968 "external_blocklist_archive_scan",
1969 "external_blocklist_enable_all",
1970 "feature_set",
1971 "fortiai_error_action",
1972 "fortiai_timeout_action",
1973 "fortindr_error_action",
1974 "fortindr_timeout_action",
1975 "fortisandbox_error_action",
1976 "fortisandbox_max_upload",
1977 "fortisandbox_mode",
1978 "fortisandbox_scan_timeout",
1979 "fortisandbox_timeout_action",
1980 "ftgd_analytics",
1981 "ftp",
1982 "http",
1983 "imap",
1984 "inspection_mode",
1985 "mapi",
1986 "mobile_malware_db",
1987 "nac_quar",
1988 "name",
1989 "nntp",
1990 "outbreak_prevention",
1991 "outbreak_prevention_archive_scan",
1992 "pop3",
1993 "replacemsg_group",
1994 "scan_mode",
1995 "smb",
1996 "smtp",
1997 "ssh",
1998 ]
1999
2000 json = remove_invalid_fields(json)
2001 dictionary = {}
2002
2003 for attribute in option_list:
2004 if attribute in json and json[attribute] is not None:
2005 dictionary[attribute] = json[attribute]
2006
2007 return dictionary
2008
2009
2010 def flatten_single_path(data, path, index):
2011 if (
2012 not data
2013 or index == len(path)
2014 or path[index] not in data
2015 or (not data[path[index]] and not isinstance(data[path[index]], list))
2016 ):
2017 return
2018
2019 if index == len(path) - 1:
2020 data[path[index]] = " ".join(str(elem) for elem in data[path[index]])
2021 if len(data[path[index]]) == 0:
2022 data[path[index]] = None
2023 elif isinstance(data[path[index]], list):
2024 for value in data[path[index]]:
2025 flatten_single_path(value, path, index + 1)
2026 else:
2027 flatten_single_path(data[path[index]], path, index + 1)
2028
2029
2030 def flatten_multilists_attributes(data):
2031 multilist_attrs = [
2032 ["http", "archive_block"],
2033 ["http", "archive_log"],
2034 ["http", "options"],
2035 ["ftp", "archive_block"],
2036 ["ftp", "archive_log"],
2037 ["ftp", "options"],
2038 ["imap", "archive_block"],
2039 ["imap", "archive_log"],
2040 ["imap", "options"],
2041 ["pop3", "archive_block"],
2042 ["pop3", "archive_log"],
2043 ["pop3", "options"],
2044 ["smtp", "archive_block"],
2045 ["smtp", "archive_log"],
2046 ["smtp", "options"],
2047 ["mapi", "archive_block"],
2048 ["mapi", "archive_log"],
2049 ["mapi", "options"],
2050 ["nntp", "archive_block"],
2051 ["nntp", "archive_log"],
2052 ["nntp", "options"],
2053 ["cifs", "archive_block"],
2054 ["cifs", "archive_log"],
2055 ["cifs", "options"],
2056 ["ssh", "archive_block"],
2057 ["ssh", "archive_log"],
2058 ["ssh", "options"],
2059 ]
2060
2061 for attr in multilist_attrs:
2062 flatten_single_path(data, attr, 0)
2063
2064 return data
2065
2066
2067 def underscore_to_hyphen(data):
2068 new_data = None
2069 if isinstance(data, list):
2070 new_data = []
2071 for i, elem in enumerate(data):
2072 new_data.append(underscore_to_hyphen(elem))
2073 elif isinstance(data, dict):
2074 new_data = {}
2075 for k, v in data.items():
2076 new_data[k.replace("_", "-")] = underscore_to_hyphen(v)
2077 else:
2078 return data
2079 return new_data
2080
2081
2082 def antivirus_profile(data, fos, check_mode=False):
2083
2084 state = None
2085 vdom = data["vdom"]
2086 parameters = None
2087 state = data.get("state", None)
2088 antivirus_profile_data = data["antivirus_profile"]
2089
2090 filtered_data = filter_antivirus_profile_data(antivirus_profile_data)
2091 filtered_data = flatten_multilists_attributes(filtered_data)
2092 converted_data = underscore_to_hyphen(filtered_data)
2093
2094 # check_mode starts from here
2095 if check_mode:
2096 diff = {
2097 "before": "",
2098 "after": filtered_data,
2099 }
2100 mkeyname = fos.get_mkeyname(None, None)
2101 mkey = fos.get_mkey("antivirus", "profile", filtered_data, vdom=vdom)
2102 current_data = fos.get(
2103 "antivirus", "profile", vdom=vdom, mkey=mkey, parameters=parameters
2104 )
2105 is_existed = (
2106 current_data
2107 and current_data.get("http_status") == 200
2108 and (
2109 mkeyname
2110 and isinstance(current_data.get("results"), list)
2111 and len(current_data["results"]) > 0
2112 or not mkeyname
2113 and current_data["results"] # global object response
2114 )
2115 )
2116
2117 # 2. if it exists and the state is 'present' then compare current settings with desired
2118 if state == "present" or state is True or state is None:
2119 # for non global modules, mkeyname must exist and it's a new module when mkey is None
2120 if mkeyname is not None and mkey is None:
2121 return False, True, filtered_data, diff
2122
2123 # if mkey exists then compare each other
2124 # record exits and they're matched or not
2125 copied_filtered_data = filtered_data.copy()
2126 copied_filtered_data.pop(mkeyname, None)
2127 unified_filtered_data = unify_data_format(copied_filtered_data)
2128
2129 current_data_results = current_data.get("results", {})
2130 current_config = (
2131 current_data_results[0]
2132 if mkeyname
2133 and isinstance(current_data_results, list)
2134 and len(current_data_results) > 0
2135 else current_data_results
2136 )
2137 if is_existed:
2138 unified_current_values = find_current_values(
2139 unified_filtered_data,
2140 unify_data_format(current_config),
2141 )
2142
2143 is_same = is_same_comparison(
2144 serialize(unified_current_values), serialize(unified_filtered_data)
2145 )
2146
2147 return (
2148 False,
2149 not is_same,
2150 filtered_data,
2151 {"before": unified_current_values, "after": unified_filtered_data},
2152 )
2153
2154 # record does not exist
2155 return False, True, filtered_data, diff
2156
2157 if state == "absent":
2158 if mkey is None:
2159 return (
2160 False,
2161 False,
2162 filtered_data,
2163 {"before": current_data["results"][0], "after": ""},
2164 )
2165
2166 if is_existed:
2167 return (
2168 False,
2169 True,
2170 filtered_data,
2171 {"before": current_data["results"][0], "after": ""},
2172 )
2173 return False, False, filtered_data, {}
2174
2175 return True, False, {"reason: ": "Must provide state parameter"}, {}
2176 # pass post processed data to member operations
2177 # no need to do underscore_to_hyphen since do_member_operation handles it by itself
2178 data_copy = data.copy()
2179 data_copy["antivirus_profile"] = filtered_data
2180 fos.do_member_operation(
2181 "antivirus",
2182 "profile",
2183 data_copy,
2184 )
2185
2186 if state == "present" or state is True:
2187 return fos.set(
2188 "antivirus",
2189 "profile",
2190 data=converted_data,
2191 vdom=vdom,
2192 parameters=parameters,
2193 )
2194
2195 elif state == "absent":
2196 return fos.delete(
2197 "antivirus",
2198 "profile",
2199 mkey=converted_data["name"],
2200 vdom=vdom,
2201 parameters=parameters,
2202 )
2203 else:
2204 fos._module.fail_json(msg="state must be present or absent!")
2205
2206
2207 def is_successful_status(resp):
2208 return (
2209 "status" in resp
2210 and resp["status"] == "success"
2211 or "http_status" in resp
2212 and resp["http_status"] == 200
2213 or "http_method" in resp
2214 and resp["http_method"] == "DELETE"
2215 and resp["http_status"] == 404
2216 )
2217
2218
2219 def fortios_antivirus(data, fos, check_mode):
2220
2221 if data["antivirus_profile"]:
2222 resp = antivirus_profile(data, fos, check_mode)
2223 else:
2224 fos._module.fail_json(msg="missing task body: %s" % ("antivirus_profile"))
2225 if isinstance(resp, tuple) and len(resp) == 4:
2226 return resp
2227 return (
2228 not is_successful_status(resp),
2229 is_successful_status(resp)
2230 and (resp["revision_changed"] if "revision_changed" in resp else True),
2231 resp,
2232 {},
2233 )
2234
2235
2236 versioned_schema = {
2237 "type": "list",
2238 "elements": "dict",
2239 "children": {
2240 "name": {"v_range": [["v6.0.0", ""]], "type": "string", "required": True},
2241 "comment": {"v_range": [["v6.0.0", ""]], "type": "string"},
2242 "replacemsg_group": {"v_range": [["v6.0.0", ""]], "type": "string"},
2243 "feature_set": {
2244 "v_range": [["v6.4.0", ""]],
2245 "type": "string",
2246 "options": [{"value": "flow"}, {"value": "proxy"}],
2247 },
2248 "fortisandbox_mode": {
2249 "v_range": [["v7.2.0", ""]],
2250 "type": "string",
2251 "options": [
2252 {"value": "inline"},
2253 {"value": "analytics-suspicious"},
2254 {"value": "analytics-everything"},
2255 ],
2256 },
2257 "fortisandbox_max_upload": {"v_range": [["v7.2.0", ""]], "type": "integer"},
2258 "analytics_ignore_filetype": {"v_range": [["v7.0.0", ""]], "type": "integer"},
2259 "analytics_accept_filetype": {"v_range": [["v7.0.0", ""]], "type": "integer"},
2260 "analytics_db": {
2261 "v_range": [["v6.0.0", ""]],
2262 "type": "string",
2263 "options": [{"value": "disable"}, {"value": "enable"}],
2264 },
2265 "mobile_malware_db": {
2266 "v_range": [["v6.0.0", ""]],
2267 "type": "string",
2268 "options": [{"value": "disable"}, {"value": "enable"}],
2269 },
2270 "http": {
2271 "v_range": [["v6.0.0", ""]],
2272 "type": "dict",
2273 "children": {
2274 "av_scan": {
2275 "v_range": [["v7.0.0", ""]],
2276 "type": "string",
2277 "options": [
2278 {"value": "disable"},
2279 {"value": "block"},
2280 {"value": "monitor"},
2281 ],
2282 },
2283 "outbreak_prevention": {
2284 "v_range": [["v6.0.0", ""]],
2285 "type": "string",
2286 "options": [
2287 {"value": "disable", "v_range": [["v7.0.0", ""]]},
2288 {"value": "block", "v_range": [["v7.0.0", ""]]},
2289 {"value": "monitor", "v_range": [["v7.0.0", ""]]},
2290 {"value": "disabled", "v_range": [["v6.0.0", "v6.4.4"]]},
2291 {"value": "files", "v_range": [["v6.0.0", "v6.4.4"]]},
2292 {"value": "full-archive", "v_range": [["v6.0.0", "v6.4.4"]]},
2293 ],
2294 },
2295 "external_blocklist": {
2296 "v_range": [["v7.0.0", ""]],
2297 "type": "string",
2298 "options": [
2299 {"value": "disable"},
2300 {"value": "block"},
2301 {"value": "monitor"},
2302 ],
2303 },
2304 "malware_stream": {
2305 "v_range": [["v7.6.3", ""]],
2306 "type": "string",
2307 "options": [
2308 {"value": "disable"},
2309 {"value": "block"},
2310 {"value": "monitor"},
2311 ],
2312 },
2313 "fortindr": {
2314 "v_range": [["v7.0.8", ""]],
2315 "type": "string",
2316 "options": [
2317 {"value": "disable"},
2318 {"value": "block"},
2319 {"value": "monitor"},
2320 ],
2321 },
2322 "fortisandbox": {
2323 "v_range": [["v7.2.0", ""]],
2324 "type": "string",
2325 "options": [
2326 {"value": "disable"},
2327 {"value": "block"},
2328 {"value": "monitor"},
2329 ],
2330 },
2331 "quarantine": {
2332 "v_range": [["v7.0.0", ""]],
2333 "type": "string",
2334 "options": [{"value": "disable"}, {"value": "enable"}],
2335 },
2336 "archive_block": {
2337 "v_range": [["v6.0.0", ""]],
2338 "type": "list",
2339 "options": [
2340 {"value": "encrypted"},
2341 {"value": "corrupted"},
2342 {"value": "partiallycorrupted"},
2343 {"value": "multipart"},
2344 {"value": "nested"},
2345 {"value": "mailbomb"},
2346 {"value": "timeout"},
2347 {"value": "unhandled"},
2348 {"value": "fileslimit", "v_range": [["v6.0.0", "v7.0.1"]]},
2349 ],
2350 "multiple_values": True,
2351 "elements": "str",
2352 },
2353 "archive_log": {
2354 "v_range": [["v6.0.0", ""]],
2355 "type": "list",
2356 "options": [
2357 {"value": "encrypted"},
2358 {"value": "corrupted"},
2359 {"value": "partiallycorrupted"},
2360 {"value": "multipart"},
2361 {"value": "nested"},
2362 {"value": "mailbomb"},
2363 {"value": "timeout"},
2364 {"value": "unhandled"},
2365 {"value": "fileslimit", "v_range": [["v6.0.0", "v7.0.1"]]},
2366 ],
2367 "multiple_values": True,
2368 "elements": "str",
2369 },
2370 "emulator": {
2371 "v_range": [["v6.0.0", ""]],
2372 "type": "string",
2373 "options": [{"value": "enable"}, {"value": "disable"}],
2374 },
2375 "content_disarm": {
2376 "v_range": [["v6.0.0", ""]],
2377 "type": "string",
2378 "options": [{"value": "disable"}, {"value": "enable"}],
2379 },
2380 "unknown_content_encoding": {
2381 "v_range": [["v7.0.8", "v7.0.12"], ["v7.2.1", "v7.2.2"]],
2382 "type": "string",
2383 "options": [
2384 {"value": "block"},
2385 {"value": "inspect"},
2386 {"value": "bypass"},
2387 ],
2388 },
2389 "fortiai": {
2390 "v_range": [["v7.0.1", "v7.0.7"]],
2391 "type": "string",
2392 "options": [
2393 {"value": "disable"},
2394 {"value": "block"},
2395 {"value": "monitor"},
2396 ],
2397 },
2398 "options": {
2399 "v_range": [["v6.0.0", "v6.4.4"]],
2400 "type": "list",
2401 "options": [
2402 {"value": "scan"},
2403 {"value": "avmonitor"},
2404 {"value": "quarantine"},
2405 ],
2406 "multiple_values": True,
2407 "elements": "str",
2408 },
2409 },
2410 },
2411 "ftp": {
2412 "v_range": [["v6.0.0", ""]],
2413 "type": "dict",
2414 "children": {
2415 "av_scan": {
2416 "v_range": [["v7.0.0", ""]],
2417 "type": "string",
2418 "options": [
2419 {"value": "disable"},
2420 {"value": "block"},
2421 {"value": "monitor"},
2422 ],
2423 },
2424 "outbreak_prevention": {
2425 "v_range": [["v6.0.0", ""]],
2426 "type": "string",
2427 "options": [
2428 {"value": "disable", "v_range": [["v7.0.0", ""]]},
2429 {"value": "block", "v_range": [["v7.0.0", ""]]},
2430 {"value": "monitor", "v_range": [["v7.0.0", ""]]},
2431 {"value": "disabled", "v_range": [["v6.0.0", "v6.4.4"]]},
2432 {"value": "files", "v_range": [["v6.0.0", "v6.4.4"]]},
2433 {"value": "full-archive", "v_range": [["v6.0.0", "v6.4.4"]]},
2434 ],
2435 },
2436 "external_blocklist": {
2437 "v_range": [["v7.0.0", ""]],
2438 "type": "string",
2439 "options": [
2440 {"value": "disable"},
2441 {"value": "block"},
2442 {"value": "monitor"},
2443 ],
2444 },
2445 "malware_stream": {
2446 "v_range": [["v7.6.3", ""]],
2447 "type": "string",
2448 "options": [
2449 {"value": "disable"},
2450 {"value": "block"},
2451 {"value": "monitor"},
2452 ],
2453 },
2454 "fortindr": {
2455 "v_range": [["v7.0.8", ""]],
2456 "type": "string",
2457 "options": [
2458 {"value": "disable"},
2459 {"value": "block"},
2460 {"value": "monitor"},
2461 ],
2462 },
2463 "fortisandbox": {
2464 "v_range": [["v7.2.0", ""]],
2465 "type": "string",
2466 "options": [
2467 {"value": "disable"},
2468 {"value": "block"},
2469 {"value": "monitor"},
2470 ],
2471 },
2472 "quarantine": {
2473 "v_range": [["v7.0.0", ""]],
2474 "type": "string",
2475 "options": [{"value": "disable"}, {"value": "enable"}],
2476 },
2477 "archive_block": {
2478 "v_range": [["v6.0.0", ""]],
2479 "type": "list",
2480 "options": [
2481 {"value": "encrypted"},
2482 {"value": "corrupted"},
2483 {"value": "partiallycorrupted"},
2484 {"value": "multipart"},
2485 {"value": "nested"},
2486 {"value": "mailbomb"},
2487 {"value": "timeout"},
2488 {"value": "unhandled"},
2489 {"value": "fileslimit", "v_range": [["v6.0.0", "v7.0.1"]]},
2490 ],
2491 "multiple_values": True,
2492 "elements": "str",
2493 },
2494 "archive_log": {
2495 "v_range": [["v6.0.0", ""]],
2496 "type": "list",
2497 "options": [
2498 {"value": "encrypted"},
2499 {"value": "corrupted"},
2500 {"value": "partiallycorrupted"},
2501 {"value": "multipart"},
2502 {"value": "nested"},
2503 {"value": "mailbomb"},
2504 {"value": "timeout"},
2505 {"value": "unhandled"},
2506 {"value": "fileslimit", "v_range": [["v6.0.0", "v7.0.1"]]},
2507 ],
2508 "multiple_values": True,
2509 "elements": "str",
2510 },
2511 "emulator": {
2512 "v_range": [["v6.0.0", ""]],
2513 "type": "string",
2514 "options": [{"value": "enable"}, {"value": "disable"}],
2515 },
2516 "fortiai": {
2517 "v_range": [["v7.0.1", "v7.0.7"]],
2518 "type": "string",
2519 "options": [
2520 {"value": "disable"},
2521 {"value": "block"},
2522 {"value": "monitor"},
2523 ],
2524 },
2525 "options": {
2526 "v_range": [["v6.0.0", "v6.4.4"]],
2527 "type": "list",
2528 "options": [
2529 {"value": "scan"},
2530 {"value": "avmonitor"},
2531 {"value": "quarantine"},
2532 ],
2533 "multiple_values": True,
2534 "elements": "str",
2535 },
2536 },
2537 },
2538 "imap": {
2539 "v_range": [["v6.0.0", ""]],
2540 "type": "dict",
2541 "children": {
2542 "av_scan": {
2543 "v_range": [["v7.0.0", ""]],
2544 "type": "string",
2545 "options": [
2546 {"value": "disable"},
2547 {"value": "block"},
2548 {"value": "monitor"},
2549 ],
2550 },
2551 "outbreak_prevention": {
2552 "v_range": [["v6.0.0", ""]],
2553 "type": "string",
2554 "options": [
2555 {"value": "disable", "v_range": [["v7.0.0", ""]]},
2556 {"value": "block", "v_range": [["v7.0.0", ""]]},
2557 {"value": "monitor", "v_range": [["v7.0.0", ""]]},
2558 {"value": "disabled", "v_range": [["v6.0.0", "v6.4.4"]]},
2559 {"value": "files", "v_range": [["v6.0.0", "v6.4.4"]]},
2560 {"value": "full-archive", "v_range": [["v6.0.0", "v6.4.4"]]},
2561 ],
2562 },
2563 "external_blocklist": {
2564 "v_range": [["v7.0.0", ""]],
2565 "type": "string",
2566 "options": [
2567 {"value": "disable"},
2568 {"value": "block"},
2569 {"value": "monitor"},
2570 ],
2571 },
2572 "malware_stream": {
2573 "v_range": [["v7.6.3", ""]],
2574 "type": "string",
2575 "options": [
2576 {"value": "disable"},
2577 {"value": "block"},
2578 {"value": "monitor"},
2579 ],
2580 },
2581 "fortindr": {
2582 "v_range": [["v7.0.8", ""]],
2583 "type": "string",
2584 "options": [
2585 {"value": "disable"},
2586 {"value": "block"},
2587 {"value": "monitor"},
2588 ],
2589 },
2590 "fortisandbox": {
2591 "v_range": [["v7.2.0", ""]],
2592 "type": "string",
2593 "options": [
2594 {"value": "disable"},
2595 {"value": "block"},
2596 {"value": "monitor"},
2597 ],
2598 },
2599 "quarantine": {
2600 "v_range": [["v7.0.0", ""]],
2601 "type": "string",
2602 "options": [{"value": "disable"}, {"value": "enable"}],
2603 },
2604 "archive_block": {
2605 "v_range": [["v6.0.0", ""]],
2606 "type": "list",
2607 "options": [
2608 {"value": "encrypted"},
2609 {"value": "corrupted"},
2610 {"value": "partiallycorrupted"},
2611 {"value": "multipart"},
2612 {"value": "nested"},
2613 {"value": "mailbomb"},
2614 {"value": "timeout"},
2615 {"value": "unhandled"},
2616 {"value": "fileslimit", "v_range": [["v6.0.0", "v7.0.1"]]},
2617 ],
2618 "multiple_values": True,
2619 "elements": "str",
2620 },
2621 "archive_log": {
2622 "v_range": [["v6.0.0", ""]],
2623 "type": "list",
2624 "options": [
2625 {"value": "encrypted"},
2626 {"value": "corrupted"},
2627 {"value": "partiallycorrupted"},
2628 {"value": "multipart"},
2629 {"value": "nested"},
2630 {"value": "mailbomb"},
2631 {"value": "timeout"},
2632 {"value": "unhandled"},
2633 {"value": "fileslimit", "v_range": [["v6.0.0", "v7.0.1"]]},
2634 ],
2635 "multiple_values": True,
2636 "elements": "str",
2637 },
2638 "emulator": {
2639 "v_range": [["v6.0.0", ""]],
2640 "type": "string",
2641 "options": [{"value": "enable"}, {"value": "disable"}],
2642 },
2643 "executables": {
2644 "v_range": [["v6.0.0", ""]],
2645 "type": "string",
2646 "options": [{"value": "default"}, {"value": "virus"}],
2647 },
2648 "content_disarm": {
2649 "v_range": [["v6.0.0", ""]],
2650 "type": "string",
2651 "options": [{"value": "disable"}, {"value": "enable"}],
2652 },
2653 "fortiai": {
2654 "v_range": [["v7.0.1", "v7.0.7"]],
2655 "type": "string",
2656 "options": [
2657 {"value": "disable"},
2658 {"value": "block"},
2659 {"value": "monitor"},
2660 ],
2661 },
2662 "options": {
2663 "v_range": [["v6.0.0", "v6.4.4"]],
2664 "type": "list",
2665 "options": [
2666 {"value": "scan"},
2667 {"value": "avmonitor"},
2668 {"value": "quarantine"},
2669 ],
2670 "multiple_values": True,
2671 "elements": "str",
2672 },
2673 },
2674 },
2675 "pop3": {
2676 "v_range": [["v6.0.0", ""]],
2677 "type": "dict",
2678 "children": {
2679 "av_scan": {
2680 "v_range": [["v7.0.0", ""]],
2681 "type": "string",
2682 "options": [
2683 {"value": "disable"},
2684 {"value": "block"},
2685 {"value": "monitor"},
2686 ],
2687 },
2688 "outbreak_prevention": {
2689 "v_range": [["v6.0.0", ""]],
2690 "type": "string",
2691 "options": [
2692 {"value": "disable", "v_range": [["v7.0.0", ""]]},
2693 {"value": "block", "v_range": [["v7.0.0", ""]]},
2694 {"value": "monitor", "v_range": [["v7.0.0", ""]]},
2695 {"value": "disabled", "v_range": [["v6.0.0", "v6.4.4"]]},
2696 {"value": "files", "v_range": [["v6.0.0", "v6.4.4"]]},
2697 {"value": "full-archive", "v_range": [["v6.0.0", "v6.4.4"]]},
2698 ],
2699 },
2700 "external_blocklist": {
2701 "v_range": [["v7.0.0", ""]],
2702 "type": "string",
2703 "options": [
2704 {"value": "disable"},
2705 {"value": "block"},
2706 {"value": "monitor"},
2707 ],
2708 },
2709 "malware_stream": {
2710 "v_range": [["v7.6.3", ""]],
2711 "type": "string",
2712 "options": [
2713 {"value": "disable"},
2714 {"value": "block"},
2715 {"value": "monitor"},
2716 ],
2717 },
2718 "fortindr": {
2719 "v_range": [["v7.0.8", ""]],
2720 "type": "string",
2721 "options": [
2722 {"value": "disable"},
2723 {"value": "block"},
2724 {"value": "monitor"},
2725 ],
2726 },
2727 "fortisandbox": {
2728 "v_range": [["v7.2.0", ""]],
2729 "type": "string",
2730 "options": [
2731 {"value": "disable"},
2732 {"value": "block"},
2733 {"value": "monitor"},
2734 ],
2735 },
2736 "quarantine": {
2737 "v_range": [["v7.0.0", ""]],
2738 "type": "string",
2739 "options": [{"value": "disable"}, {"value": "enable"}],
2740 },
2741 "archive_block": {
2742 "v_range": [["v6.0.0", ""]],
2743 "type": "list",
2744 "options": [
2745 {"value": "encrypted"},
2746 {"value": "corrupted"},
2747 {"value": "partiallycorrupted"},
2748 {"value": "multipart"},
2749 {"value": "nested"},
2750 {"value": "mailbomb"},
2751 {"value": "timeout"},
2752 {"value": "unhandled"},
2753 {"value": "fileslimit", "v_range": [["v6.0.0", "v7.0.1"]]},
2754 ],
2755 "multiple_values": True,
2756 "elements": "str",
2757 },
2758 "archive_log": {
2759 "v_range": [["v6.0.0", ""]],
2760 "type": "list",
2761 "options": [
2762 {"value": "encrypted"},
2763 {"value": "corrupted"},
2764 {"value": "partiallycorrupted"},
2765 {"value": "multipart"},
2766 {"value": "nested"},
2767 {"value": "mailbomb"},
2768 {"value": "timeout"},
2769 {"value": "unhandled"},
2770 {"value": "fileslimit", "v_range": [["v6.0.0", "v7.0.1"]]},
2771 ],
2772 "multiple_values": True,
2773 "elements": "str",
2774 },
2775 "emulator": {
2776 "v_range": [["v6.0.0", ""]],
2777 "type": "string",
2778 "options": [{"value": "enable"}, {"value": "disable"}],
2779 },
2780 "executables": {
2781 "v_range": [["v6.0.0", ""]],
2782 "type": "string",
2783 "options": [{"value": "default"}, {"value": "virus"}],
2784 },
2785 "content_disarm": {
2786 "v_range": [["v6.0.0", ""]],
2787 "type": "string",
2788 "options": [{"value": "disable"}, {"value": "enable"}],
2789 },
2790 "fortiai": {
2791 "v_range": [["v7.0.1", "v7.0.7"]],
2792 "type": "string",
2793 "options": [
2794 {"value": "disable"},
2795 {"value": "block"},
2796 {"value": "monitor"},
2797 ],
2798 },
2799 "options": {
2800 "v_range": [["v6.0.0", "v6.4.4"]],
2801 "type": "list",
2802 "options": [
2803 {"value": "scan"},
2804 {"value": "avmonitor"},
2805 {"value": "quarantine"},
2806 ],
2807 "multiple_values": True,
2808 "elements": "str",
2809 },
2810 },
2811 },
2812 "smtp": {
2813 "v_range": [["v6.0.0", ""]],
2814 "type": "dict",
2815 "children": {
2816 "av_scan": {
2817 "v_range": [["v7.0.0", ""]],
2818 "type": "string",
2819 "options": [
2820 {"value": "disable"},
2821 {"value": "block"},
2822 {"value": "monitor"},
2823 ],
2824 },
2825 "outbreak_prevention": {
2826 "v_range": [["v6.0.0", ""]],
2827 "type": "string",
2828 "options": [
2829 {"value": "disable", "v_range": [["v7.0.0", ""]]},
2830 {"value": "block", "v_range": [["v7.0.0", ""]]},
2831 {"value": "monitor", "v_range": [["v7.0.0", ""]]},
2832 {"value": "disabled", "v_range": [["v6.0.0", "v6.4.4"]]},
2833 {"value": "files", "v_range": [["v6.0.0", "v6.4.4"]]},
2834 {"value": "full-archive", "v_range": [["v6.0.0", "v6.4.4"]]},
2835 ],
2836 },
2837 "external_blocklist": {
2838 "v_range": [["v7.0.0", ""]],
2839 "type": "string",
2840 "options": [
2841 {"value": "disable"},
2842 {"value": "block"},
2843 {"value": "monitor"},
2844 ],
2845 },
2846 "malware_stream": {
2847 "v_range": [["v7.6.3", ""]],
2848 "type": "string",
2849 "options": [
2850 {"value": "disable"},
2851 {"value": "block"},
2852 {"value": "monitor"},
2853 ],
2854 },
2855 "fortindr": {
2856 "v_range": [["v7.0.8", ""]],
2857 "type": "string",
2858 "options": [
2859 {"value": "disable"},
2860 {"value": "block"},
2861 {"value": "monitor"},
2862 ],
2863 },
2864 "fortisandbox": {
2865 "v_range": [["v7.2.0", ""]],
2866 "type": "string",
2867 "options": [
2868 {"value": "disable"},
2869 {"value": "block"},
2870 {"value": "monitor"},
2871 ],
2872 },
2873 "quarantine": {
2874 "v_range": [["v7.0.0", ""]],
2875 "type": "string",
2876 "options": [{"value": "disable"}, {"value": "enable"}],
2877 },
2878 "archive_block": {
2879 "v_range": [["v6.0.0", ""]],
2880 "type": "list",
2881 "options": [
2882 {"value": "encrypted"},
2883 {"value": "corrupted"},
2884 {"value": "partiallycorrupted"},
2885 {"value": "multipart"},
2886 {"value": "nested"},
2887 {"value": "mailbomb"},
2888 {"value": "timeout"},
2889 {"value": "unhandled"},
2890 {"value": "fileslimit", "v_range": [["v6.0.0", "v7.0.1"]]},
2891 ],
2892 "multiple_values": True,
2893 "elements": "str",
2894 },
2895 "archive_log": {
2896 "v_range": [["v6.0.0", ""]],
2897 "type": "list",
2898 "options": [
2899 {"value": "encrypted"},
2900 {"value": "corrupted"},
2901 {"value": "partiallycorrupted"},
2902 {"value": "multipart"},
2903 {"value": "nested"},
2904 {"value": "mailbomb"},
2905 {"value": "timeout"},
2906 {"value": "unhandled"},
2907 {"value": "fileslimit", "v_range": [["v6.0.0", "v7.0.1"]]},
2908 ],
2909 "multiple_values": True,
2910 "elements": "str",
2911 },
2912 "emulator": {
2913 "v_range": [["v6.0.0", ""]],
2914 "type": "string",
2915 "options": [{"value": "enable"}, {"value": "disable"}],
2916 },
2917 "executables": {
2918 "v_range": [["v6.0.0", ""]],
2919 "type": "string",
2920 "options": [{"value": "default"}, {"value": "virus"}],
2921 },
2922 "content_disarm": {
2923 "v_range": [["v6.0.0", ""]],
2924 "type": "string",
2925 "options": [{"value": "disable"}, {"value": "enable"}],
2926 },
2927 "fortiai": {
2928 "v_range": [["v7.0.1", "v7.0.7"]],
2929 "type": "string",
2930 "options": [
2931 {"value": "disable"},
2932 {"value": "block"},
2933 {"value": "monitor"},
2934 ],
2935 },
2936 "options": {
2937 "v_range": [["v6.0.0", "v6.4.4"]],
2938 "type": "list",
2939 "options": [
2940 {"value": "scan"},
2941 {"value": "avmonitor"},
2942 {"value": "quarantine"},
2943 ],
2944 "multiple_values": True,
2945 "elements": "str",
2946 },
2947 },
2948 },
2949 "mapi": {
2950 "v_range": [["v6.0.0", ""]],
2951 "type": "dict",
2952 "children": {
2953 "av_scan": {
2954 "v_range": [["v7.0.0", ""]],
2955 "type": "string",
2956 "options": [
2957 {"value": "disable"},
2958 {"value": "block"},
2959 {"value": "monitor"},
2960 ],
2961 },
2962 "outbreak_prevention": {
2963 "v_range": [["v6.0.0", ""]],
2964 "type": "string",
2965 "options": [
2966 {"value": "disable", "v_range": [["v7.0.0", ""]]},
2967 {"value": "block", "v_range": [["v7.0.0", ""]]},
2968 {"value": "monitor", "v_range": [["v7.0.0", ""]]},
2969 {"value": "disabled", "v_range": [["v6.0.0", "v6.4.4"]]},
2970 {"value": "files", "v_range": [["v6.0.0", "v6.4.4"]]},
2971 {"value": "full-archive", "v_range": [["v6.0.0", "v6.4.4"]]},
2972 ],
2973 },
2974 "external_blocklist": {
2975 "v_range": [["v7.0.0", ""]],
2976 "type": "string",
2977 "options": [
2978 {"value": "disable"},
2979 {"value": "block"},
2980 {"value": "monitor"},
2981 ],
2982 },
2983 "malware_stream": {
2984 "v_range": [["v7.6.3", ""]],
2985 "type": "string",
2986 "options": [
2987 {"value": "disable"},
2988 {"value": "block"},
2989 {"value": "monitor"},
2990 ],
2991 },
2992 "fortindr": {
2993 "v_range": [["v7.2.0", ""]],
2994 "type": "string",
2995 "options": [
2996 {"value": "disable"},
2997 {"value": "block"},
2998 {"value": "monitor"},
2999 ],
3000 },
3001 "fortisandbox": {
3002 "v_range": [["v7.2.0", ""]],
3003 "type": "string",
3004 "options": [
3005 {"value": "disable"},
3006 {"value": "block"},
3007 {"value": "monitor"},
3008 ],
3009 },
3010 "quarantine": {
3011 "v_range": [["v7.0.0", ""]],
3012 "type": "string",
3013 "options": [{"value": "disable"}, {"value": "enable"}],
3014 },
3015 "archive_block": {
3016 "v_range": [["v6.0.0", ""]],
3017 "type": "list",
3018 "options": [
3019 {"value": "encrypted"},
3020 {"value": "corrupted"},
3021 {"value": "partiallycorrupted"},
3022 {"value": "multipart"},
3023 {"value": "nested"},
3024 {"value": "mailbomb"},
3025 {"value": "timeout"},
3026 {"value": "unhandled"},
3027 {"value": "fileslimit", "v_range": [["v6.0.0", "v7.0.1"]]},
3028 ],
3029 "multiple_values": True,
3030 "elements": "str",
3031 },
3032 "archive_log": {
3033 "v_range": [["v6.0.0", ""]],
3034 "type": "list",
3035 "options": [
3036 {"value": "encrypted"},
3037 {"value": "corrupted"},
3038 {"value": "partiallycorrupted"},
3039 {"value": "multipart"},
3040 {"value": "nested"},
3041 {"value": "mailbomb"},
3042 {"value": "timeout"},
3043 {"value": "unhandled"},
3044 {"value": "fileslimit", "v_range": [["v6.0.0", "v7.0.1"]]},
3045 ],
3046 "multiple_values": True,
3047 "elements": "str",
3048 },
3049 "emulator": {
3050 "v_range": [["v6.0.0", ""]],
3051 "type": "string",
3052 "options": [{"value": "enable"}, {"value": "disable"}],
3053 },
3054 "executables": {
3055 "v_range": [["v6.0.0", ""]],
3056 "type": "string",
3057 "options": [{"value": "default"}, {"value": "virus"}],
3058 },
3059 "fortiai": {
3060 "v_range": [["v7.0.1", "v7.0.7"]],
3061 "type": "string",
3062 "options": [
3063 {"value": "disable"},
3064 {"value": "block"},
3065 {"value": "monitor"},
3066 ],
3067 },
3068 "options": {
3069 "v_range": [["v6.0.0", "v6.4.4"]],
3070 "type": "list",
3071 "options": [
3072 {"value": "scan"},
3073 {"value": "avmonitor"},
3074 {"value": "quarantine"},
3075 ],
3076 "multiple_values": True,
3077 "elements": "str",
3078 },
3079 },
3080 },
3081 "nntp": {
3082 "v_range": [["v6.0.0", ""]],
3083 "type": "dict",
3084 "children": {
3085 "av_scan": {
3086 "v_range": [["v7.0.0", ""]],
3087 "type": "string",
3088 "options": [
3089 {"value": "disable"},
3090 {"value": "block"},
3091 {"value": "monitor"},
3092 ],
3093 },
3094 "outbreak_prevention": {
3095 "v_range": [["v6.0.0", ""]],
3096 "type": "string",
3097 "options": [
3098 {"value": "disable", "v_range": [["v7.0.0", ""]]},
3099 {"value": "block", "v_range": [["v7.0.0", ""]]},
3100 {"value": "monitor", "v_range": [["v7.0.0", ""]]},
3101 {"value": "disabled", "v_range": [["v6.0.0", "v6.4.4"]]},
3102 {"value": "files", "v_range": [["v6.0.0", "v6.4.4"]]},
3103 {"value": "full-archive", "v_range": [["v6.0.0", "v6.4.4"]]},
3104 ],
3105 },
3106 "external_blocklist": {
3107 "v_range": [["v7.0.0", ""]],
3108 "type": "string",
3109 "options": [
3110 {"value": "disable"},
3111 {"value": "block"},
3112 {"value": "monitor"},
3113 ],
3114 },
3115 "malware_stream": {
3116 "v_range": [["v7.6.3", ""]],
3117 "type": "string",
3118 "options": [
3119 {"value": "disable"},
3120 {"value": "block"},
3121 {"value": "monitor"},
3122 ],
3123 },
3124 "fortindr": {
3125 "v_range": [["v7.0.8", ""]],
3126 "type": "string",
3127 "options": [
3128 {"value": "disable"},
3129 {"value": "block"},
3130 {"value": "monitor"},
3131 ],
3132 },
3133 "fortisandbox": {
3134 "v_range": [["v7.2.0", ""]],
3135 "type": "string",
3136 "options": [
3137 {"value": "disable"},
3138 {"value": "block"},
3139 {"value": "monitor"},
3140 ],
3141 },
3142 "quarantine": {
3143 "v_range": [["v7.0.0", ""]],
3144 "type": "string",
3145 "options": [{"value": "disable"}, {"value": "enable"}],
3146 },
3147 "archive_block": {
3148 "v_range": [["v6.0.0", ""]],
3149 "type": "list",
3150 "options": [
3151 {"value": "encrypted"},
3152 {"value": "corrupted"},
3153 {"value": "partiallycorrupted"},
3154 {"value": "multipart"},
3155 {"value": "nested"},
3156 {"value": "mailbomb"},
3157 {"value": "timeout"},
3158 {"value": "unhandled"},
3159 {"value": "fileslimit", "v_range": [["v6.0.0", "v7.0.1"]]},
3160 ],
3161 "multiple_values": True,
3162 "elements": "str",
3163 },
3164 "archive_log": {
3165 "v_range": [["v6.0.0", ""]],
3166 "type": "list",
3167 "options": [
3168 {"value": "encrypted"},
3169 {"value": "corrupted"},
3170 {"value": "partiallycorrupted"},
3171 {"value": "multipart"},
3172 {"value": "nested"},
3173 {"value": "mailbomb"},
3174 {"value": "timeout"},
3175 {"value": "unhandled"},
3176 {"value": "fileslimit", "v_range": [["v6.0.0", "v7.0.1"]]},
3177 ],
3178 "multiple_values": True,
3179 "elements": "str",
3180 },
3181 "emulator": {
3182 "v_range": [["v6.0.0", ""]],
3183 "type": "string",
3184 "options": [{"value": "enable"}, {"value": "disable"}],
3185 },
3186 "fortiai": {
3187 "v_range": [["v7.0.1", "v7.0.7"]],
3188 "type": "string",
3189 "options": [
3190 {"value": "disable"},
3191 {"value": "block"},
3192 {"value": "monitor"},
3193 ],
3194 },
3195 "options": {
3196 "v_range": [["v6.0.0", "v6.4.4"]],
3197 "type": "list",
3198 "options": [
3199 {"value": "scan"},
3200 {"value": "avmonitor"},
3201 {"value": "quarantine"},
3202 ],
3203 "multiple_values": True,
3204 "elements": "str",
3205 },
3206 },
3207 },
3208 "cifs": {
3209 "v_range": [["v6.2.0", ""]],
3210 "type": "dict",
3211 "children": {
3212 "av_scan": {
3213 "v_range": [["v7.0.0", ""]],
3214 "type": "string",
3215 "options": [
3216 {"value": "disable"},
3217 {"value": "block"},
3218 {"value": "monitor"},
3219 ],
3220 },
3221 "outbreak_prevention": {
3222 "v_range": [["v6.2.0", ""]],
3223 "type": "string",
3224 "options": [
3225 {"value": "disable", "v_range": [["v7.0.0", ""]]},
3226 {"value": "block", "v_range": [["v7.0.0", ""]]},
3227 {"value": "monitor", "v_range": [["v7.0.0", ""]]},
3228 {"value": "disabled", "v_range": [["v6.2.0", "v6.4.4"]]},
3229 {"value": "files", "v_range": [["v6.2.0", "v6.4.4"]]},
3230 {"value": "full-archive", "v_range": [["v6.2.0", "v6.4.4"]]},
3231 ],
3232 },
3233 "external_blocklist": {
3234 "v_range": [["v7.0.0", ""]],
3235 "type": "string",
3236 "options": [
3237 {"value": "disable"},
3238 {"value": "block"},
3239 {"value": "monitor"},
3240 ],
3241 },
3242 "malware_stream": {
3243 "v_range": [["v7.6.3", ""]],
3244 "type": "string",
3245 "options": [
3246 {"value": "disable"},
3247 {"value": "block"},
3248 {"value": "monitor"},
3249 ],
3250 },
3251 "fortindr": {
3252 "v_range": [["v7.0.8", ""]],
3253 "type": "string",
3254 "options": [
3255 {"value": "disable"},
3256 {"value": "block"},
3257 {"value": "monitor"},
3258 ],
3259 },
3260 "fortisandbox": {
3261 "v_range": [["v7.2.0", ""]],
3262 "type": "string",
3263 "options": [
3264 {"value": "disable"},
3265 {"value": "block"},
3266 {"value": "monitor"},
3267 ],
3268 },
3269 "quarantine": {
3270 "v_range": [["v7.0.0", ""]],
3271 "type": "string",
3272 "options": [{"value": "disable"}, {"value": "enable"}],
3273 },
3274 "archive_block": {
3275 "v_range": [["v6.2.0", ""]],
3276 "type": "list",
3277 "options": [
3278 {"value": "encrypted"},
3279 {"value": "corrupted"},
3280 {"value": "partiallycorrupted"},
3281 {"value": "multipart"},
3282 {"value": "nested"},
3283 {"value": "mailbomb"},
3284 {"value": "timeout"},
3285 {"value": "unhandled"},
3286 {"value": "fileslimit", "v_range": [["v6.2.0", "v7.0.1"]]},
3287 ],
3288 "multiple_values": True,
3289 "elements": "str",
3290 },
3291 "archive_log": {
3292 "v_range": [["v6.2.0", ""]],
3293 "type": "list",
3294 "options": [
3295 {"value": "encrypted"},
3296 {"value": "corrupted"},
3297 {"value": "partiallycorrupted"},
3298 {"value": "multipart"},
3299 {"value": "nested"},
3300 {"value": "mailbomb"},
3301 {"value": "timeout"},
3302 {"value": "unhandled"},
3303 {"value": "fileslimit", "v_range": [["v6.2.0", "v7.0.1"]]},
3304 ],
3305 "multiple_values": True,
3306 "elements": "str",
3307 },
3308 "emulator": {
3309 "v_range": [["v6.2.0", ""]],
3310 "type": "string",
3311 "options": [{"value": "enable"}, {"value": "disable"}],
3312 },
3313 "fortiai": {
3314 "v_range": [["v7.0.1", "v7.0.7"]],
3315 "type": "string",
3316 "options": [
3317 {"value": "disable"},
3318 {"value": "block"},
3319 {"value": "monitor"},
3320 ],
3321 },
3322 "options": {
3323 "v_range": [["v6.2.0", "v6.4.4"]],
3324 "type": "list",
3325 "options": [
3326 {"value": "scan"},
3327 {"value": "avmonitor"},
3328 {"value": "quarantine"},
3329 ],
3330 "multiple_values": True,
3331 "elements": "str",
3332 },
3333 },
3334 },
3335 "ssh": {
3336 "v_range": [["v6.2.0", ""]],
3337 "type": "dict",
3338 "children": {
3339 "av_scan": {
3340 "v_range": [["v7.0.0", ""]],
3341 "type": "string",
3342 "options": [
3343 {"value": "disable"},
3344 {"value": "block"},
3345 {"value": "monitor"},
3346 ],
3347 },
3348 "outbreak_prevention": {
3349 "v_range": [["v6.2.0", ""]],
3350 "type": "string",
3351 "options": [
3352 {"value": "disable", "v_range": [["v7.0.0", ""]]},
3353 {"value": "block", "v_range": [["v7.0.0", ""]]},
3354 {"value": "monitor", "v_range": [["v7.0.0", ""]]},
3355 {"value": "disabled", "v_range": [["v6.2.0", "v6.4.4"]]},
3356 {"value": "files", "v_range": [["v6.2.0", "v6.4.4"]]},
3357 {"value": "full-archive", "v_range": [["v6.2.0", "v6.4.4"]]},
3358 ],
3359 },
3360 "external_blocklist": {
3361 "v_range": [["v7.0.0", ""]],
3362 "type": "string",
3363 "options": [
3364 {"value": "disable"},
3365 {"value": "block"},
3366 {"value": "monitor"},
3367 ],
3368 },
3369 "malware_stream": {
3370 "v_range": [["v7.6.3", ""]],
3371 "type": "string",
3372 "options": [
3373 {"value": "disable"},
3374 {"value": "block"},
3375 {"value": "monitor"},
3376 ],
3377 },
3378 "fortindr": {
3379 "v_range": [["v7.0.8", ""]],
3380 "type": "string",
3381 "options": [
3382 {"value": "disable"},
3383 {"value": "block"},
3384 {"value": "monitor"},
3385 ],
3386 },
3387 "fortisandbox": {
3388 "v_range": [["v7.2.0", ""]],
3389 "type": "string",
3390 "options": [
3391 {"value": "disable"},
3392 {"value": "block"},
3393 {"value": "monitor"},
3394 ],
3395 },
3396 "quarantine": {
3397 "v_range": [["v7.0.0", ""]],
3398 "type": "string",
3399 "options": [{"value": "disable"}, {"value": "enable"}],
3400 },
3401 "archive_block": {
3402 "v_range": [["v6.2.0", ""]],
3403 "type": "list",
3404 "options": [
3405 {"value": "encrypted"},
3406 {"value": "corrupted"},
3407 {"value": "partiallycorrupted"},
3408 {"value": "multipart"},
3409 {"value": "nested"},
3410 {"value": "mailbomb"},
3411 {"value": "timeout"},
3412 {"value": "unhandled"},
3413 {"value": "fileslimit", "v_range": [["v6.2.0", "v7.0.1"]]},
3414 ],
3415 "multiple_values": True,
3416 "elements": "str",
3417 },
3418 "archive_log": {
3419 "v_range": [["v6.2.0", ""]],
3420 "type": "list",
3421 "options": [
3422 {"value": "encrypted"},
3423 {"value": "corrupted"},
3424 {"value": "partiallycorrupted"},
3425 {"value": "multipart"},
3426 {"value": "nested"},
3427 {"value": "mailbomb"},
3428 {"value": "timeout"},
3429 {"value": "unhandled"},
3430 {"value": "fileslimit", "v_range": [["v6.2.0", "v7.0.1"]]},
3431 ],
3432 "multiple_values": True,
3433 "elements": "str",
3434 },
3435 "emulator": {
3436 "v_range": [["v6.2.0", ""]],
3437 "type": "string",
3438 "options": [{"value": "enable"}, {"value": "disable"}],
3439 },
3440 "fortiai": {
3441 "v_range": [["v7.0.1", "v7.0.7"]],
3442 "type": "string",
3443 "options": [
3444 {"value": "disable"},
3445 {"value": "block"},
3446 {"value": "monitor"},
3447 ],
3448 },
3449 "options": {
3450 "v_range": [["v6.2.0", "v6.4.4"]],
3451 "type": "list",
3452 "options": [
3453 {"value": "scan"},
3454 {"value": "avmonitor"},
3455 {"value": "quarantine"},
3456 ],
3457 "multiple_values": True,
3458 "elements": "str",
3459 },
3460 },
3461 },
3462 "nac_quar": {
3463 "v_range": [["v6.0.0", ""]],
3464 "type": "dict",
3465 "children": {
3466 "infected": {
3467 "v_range": [["v6.0.0", ""]],
3468 "type": "string",
3469 "options": [{"value": "none"}, {"value": "quar-src-ip"}],
3470 },
3471 "expiry": {"v_range": [["v6.0.0", ""]], "type": "string"},
3472 "log": {
3473 "v_range": [["v6.0.0", ""]],
3474 "type": "string",
3475 "options": [{"value": "enable"}, {"value": "disable"}],
3476 },
3477 },
3478 },
3479 "content_disarm": {
3480 "v_range": [["v6.0.0", ""]],
3481 "type": "dict",
3482 "children": {
3483 "analytics_suspicious": {
3484 "v_range": [["v7.6.0", ""]],
3485 "type": "string",
3486 "options": [{"value": "disable"}, {"value": "enable"}],
3487 },
3488 "original_file_destination": {
3489 "v_range": [["v6.0.0", ""]],
3490 "type": "string",
3491 "options": [
3492 {"value": "fortisandbox"},
3493 {"value": "quarantine"},
3494 {"value": "discard"},
3495 ],
3496 },
3497 "error_action": {
3498 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
3499 "type": "string",
3500 "options": [
3501 {"value": "block"},
3502 {"value": "log-only"},
3503 {"value": "ignore"},
3504 ],
3505 },
3506 "office_macro": {
3507 "v_range": [["v6.0.0", ""]],
3508 "type": "string",
3509 "options": [{"value": "disable"}, {"value": "enable"}],
3510 },
3511 "office_hylink": {
3512 "v_range": [["v6.0.0", ""]],
3513 "type": "string",
3514 "options": [{"value": "disable"}, {"value": "enable"}],
3515 },
3516 "office_linked": {
3517 "v_range": [["v6.0.0", ""]],
3518 "type": "string",
3519 "options": [{"value": "disable"}, {"value": "enable"}],
3520 },
3521 "office_embed": {
3522 "v_range": [["v6.0.0", ""]],
3523 "type": "string",
3524 "options": [{"value": "disable"}, {"value": "enable"}],
3525 },
3526 "office_dde": {
3527 "v_range": [["v6.2.0", ""]],
3528 "type": "string",
3529 "options": [{"value": "disable"}, {"value": "enable"}],
3530 },
3531 "office_action": {
3532 "v_range": [["v6.2.0", ""]],
3533 "type": "string",
3534 "options": [{"value": "disable"}, {"value": "enable"}],
3535 },
3536 "pdf_javacode": {
3537 "v_range": [["v6.0.0", ""]],
3538 "type": "string",
3539 "options": [{"value": "disable"}, {"value": "enable"}],
3540 },
3541 "pdf_embedfile": {
3542 "v_range": [["v6.0.0", ""]],
3543 "type": "string",
3544 "options": [{"value": "disable"}, {"value": "enable"}],
3545 },
3546 "pdf_hyperlink": {
3547 "v_range": [["v6.0.0", ""]],
3548 "type": "string",
3549 "options": [{"value": "disable"}, {"value": "enable"}],
3550 },
3551 "pdf_act_gotor": {
3552 "v_range": [["v6.0.0", ""]],
3553 "type": "string",
3554 "options": [{"value": "disable"}, {"value": "enable"}],
3555 },
3556 "pdf_act_launch": {
3557 "v_range": [["v6.0.0", ""]],
3558 "type": "string",
3559 "options": [{"value": "disable"}, {"value": "enable"}],
3560 },
3561 "pdf_act_sound": {
3562 "v_range": [["v6.0.0", ""]],
3563 "type": "string",
3564 "options": [{"value": "disable"}, {"value": "enable"}],
3565 },
3566 "pdf_act_movie": {
3567 "v_range": [["v6.0.0", ""]],
3568 "type": "string",
3569 "options": [{"value": "disable"}, {"value": "enable"}],
3570 },
3571 "pdf_act_java": {
3572 "v_range": [["v6.0.0", ""]],
3573 "type": "string",
3574 "options": [{"value": "disable"}, {"value": "enable"}],
3575 },
3576 "pdf_act_form": {
3577 "v_range": [["v6.0.0", ""]],
3578 "type": "string",
3579 "options": [{"value": "disable"}, {"value": "enable"}],
3580 },
3581 "cover_page": {
3582 "v_range": [["v6.0.0", ""]],
3583 "type": "string",
3584 "options": [{"value": "disable"}, {"value": "enable"}],
3585 },
3586 "detect_only": {
3587 "v_range": [["v6.0.0", ""]],
3588 "type": "string",
3589 "options": [{"value": "disable"}, {"value": "enable"}],
3590 },
3591 },
3592 },
3593 "outbreak_prevention_archive_scan": {
3594 "v_range": [["v7.0.0", ""]],
3595 "type": "string",
3596 "options": [{"value": "disable"}, {"value": "enable"}],
3597 },
3598 "external_blocklist_enable_all": {
3599 "v_range": [["v7.0.0", ""]],
3600 "type": "string",
3601 "options": [{"value": "disable"}, {"value": "enable"}],
3602 },
3603 "external_blocklist": {
3604 "type": "list",
3605 "elements": "dict",
3606 "children": {
3607 "name": {
3608 "v_range": [["v7.0.0", ""]],
3609 "type": "string",
3610 "required": True,
3611 }
3612 },
3613 "v_range": [["v7.0.0", ""]],
3614 },
3615 "ems_threat_feed": {
3616 "v_range": [["v7.0.0", ""]],
3617 "type": "string",
3618 "options": [{"value": "disable"}, {"value": "enable"}],
3619 },
3620 "fortindr_error_action": {
3621 "v_range": [["v7.0.8", ""]],
3622 "type": "string",
3623 "options": [{"value": "log-only"}, {"value": "block"}, {"value": "ignore"}],
3624 },
3625 "fortindr_timeout_action": {
3626 "v_range": [["v7.0.8", ""]],
3627 "type": "string",
3628 "options": [{"value": "log-only"}, {"value": "block"}, {"value": "ignore"}],
3629 },
3630 "fortisandbox_scan_timeout": {"v_range": [["v7.6.5", ""]], "type": "integer"},
3631 "fortisandbox_error_action": {
3632 "v_range": [["v7.2.0", ""]],
3633 "type": "string",
3634 "options": [{"value": "log-only"}, {"value": "block"}, {"value": "ignore"}],
3635 },
3636 "fortisandbox_timeout_action": {
3637 "v_range": [["v7.2.0", ""]],
3638 "type": "string",
3639 "options": [{"value": "log-only"}, {"value": "block"}, {"value": "ignore"}],
3640 },
3641 "av_virus_log": {
3642 "v_range": [["v6.0.0", ""]],
3643 "type": "string",
3644 "options": [{"value": "enable"}, {"value": "disable"}],
3645 },
3646 "extended_log": {
3647 "v_range": [["v6.0.0", ""]],
3648 "type": "string",
3649 "options": [{"value": "enable"}, {"value": "disable"}],
3650 },
3651 "scan_mode": {
3652 "v_range": [["v6.0.0", ""]],
3653 "type": "string",
3654 "options": [
3655 {"value": "default", "v_range": [["v6.2.0", ""]]},
3656 {"value": "legacy", "v_range": [["v6.2.0", ""]]},
3657 {"value": "quick", "v_range": [["v6.0.0", "v6.0.11"]]},
3658 {"value": "full", "v_range": [["v6.0.0", "v6.0.11"]]},
3659 ],
3660 },
3661 "av_block_log": {
3662 "v_range": [["v6.0.0", "v7.2.4"]],
3663 "type": "string",
3664 "options": [{"value": "enable"}, {"value": "disable"}],
3665 },
3666 "ftgd_analytics": {
3667 "v_range": [["v6.0.0", "v7.0.12"]],
3668 "type": "string",
3669 "options": [
3670 {"value": "disable"},
3671 {"value": "suspicious"},
3672 {"value": "everything"},
3673 ],
3674 },
3675 "analytics_max_upload": {"v_range": [["v6.0.0", "v7.0.12"]], "type": "integer"},
3676 "fortiai_error_action": {
3677 "v_range": [["v7.0.1", "v7.0.7"]],
3678 "type": "string",
3679 "options": [{"value": "log-only"}, {"value": "block"}, {"value": "ignore"}],
3680 },
3681 "fortiai_timeout_action": {
3682 "v_range": [["v7.0.2", "v7.0.7"]],
3683 "type": "string",
3684 "options": [{"value": "log-only"}, {"value": "block"}, {"value": "ignore"}],
3685 },
3686 "external_blocklist_archive_scan": {
3687 "v_range": [["v7.0.0", "v7.0.0"]],
3688 "type": "string",
3689 "options": [{"value": "disable"}, {"value": "enable"}],
3690 },
3691 "analytics_wl_filetype": {"v_range": [["v6.0.0", "v6.4.4"]], "type": "integer"},
3692 "analytics_bl_filetype": {"v_range": [["v6.0.0", "v6.4.4"]], "type": "integer"},
3693 "outbreak_prevention": {
3694 "v_range": [["v6.2.0", "v6.4.4"]],
3695 "type": "dict",
3696 "children": {
3697 "ftgd_service": {
3698 "v_range": [["v6.2.0", "v6.4.4"]],
3699 "type": "string",
3700 "options": [{"value": "disable"}, {"value": "enable"}],
3701 },
3702 "external_blocklist": {
3703 "v_range": [["v6.2.0", "v6.4.4"]],
3704 "type": "string",
3705 "options": [{"value": "disable"}, {"value": "enable"}],
3706 },
3707 },
3708 },
3709 "inspection_mode": {
3710 "v_range": [["v6.0.0", "v6.0.11"]],
3711 "type": "string",
3712 "options": [{"value": "proxy"}, {"value": "flow-based"}],
3713 },
3714 "smb": {
3715 "v_range": [["v6.0.0", "v6.0.11"]],
3716 "type": "dict",
3717 "children": {
3718 "options": {
3719 "v_range": [["v6.0.0", "v6.0.11"]],
3720 "type": "string",
3721 "options": [
3722 {"value": "scan"},
3723 {"value": "avmonitor"},
3724 {"value": "quarantine"},
3725 ],
3726 },
3727 "archive_block": {
3728 "v_range": [["v6.0.0", "v6.0.11"]],
3729 "type": "string",
3730 "options": [
3731 {"value": "encrypted"},
3732 {"value": "corrupted"},
3733 {"value": "partiallycorrupted"},
3734 {"value": "multipart"},
3735 {"value": "nested"},
3736 {"value": "mailbomb"},
3737 {"value": "fileslimit"},
3738 {"value": "timeout"},
3739 {"value": "unhandled"},
3740 ],
3741 },
3742 "archive_log": {
3743 "v_range": [["v6.0.0", "v6.0.11"]],
3744 "type": "string",
3745 "options": [
3746 {"value": "encrypted"},
3747 {"value": "corrupted"},
3748 {"value": "partiallycorrupted"},
3749 {"value": "multipart"},
3750 {"value": "nested"},
3751 {"value": "mailbomb"},
3752 {"value": "fileslimit"},
3753 {"value": "timeout"},
3754 {"value": "unhandled"},
3755 ],
3756 },
3757 "emulator": {
3758 "v_range": [["v6.0.0", "v6.0.11"]],
3759 "type": "string",
3760 "options": [{"value": "enable"}, {"value": "disable"}],
3761 },
3762 "outbreak_prevention": {
3763 "v_range": [["v6.0.0", "v6.0.11"]],
3764 "type": "string",
3765 "options": [
3766 {"value": "disabled"},
3767 {"value": "files"},
3768 {"value": "full-archive"},
3769 ],
3770 },
3771 },
3772 },
3773 },
3774 "v_range": [["v6.0.0", ""]],
3775 }
3776
3777
3778 def main():
3779 module_spec = schema_to_module_spec(versioned_schema)
3780 mkeyname = "name"
3781 fields = {
3782 "access_token": {"required": False, "type": "str", "no_log": True},
3783 "enable_log": {"required": False, "type": "bool", "default": False},
3784 "vdom": {"required": False, "type": "str", "default": "root"},
3785 "member_path": {"required": False, "type": "str"},
3786 "member_state": {
3787 "type": "str",
3788 "required": False,
3789 "choices": ["present", "absent"],
3790 },
3791 "state": {"required": True, "type": "str", "choices": ["present", "absent"]},
3792 "antivirus_profile": {
3793 "required": False,
3794 "type": "dict",
3795 "default": None,
3796 "options": {},
3797 },
3798 }
3799 for attribute_name in module_spec["options"]:
3800 fields["antivirus_profile"]["options"][attribute_name] = module_spec["options"][
3801 attribute_name
3802 ]
3803 if mkeyname and mkeyname == attribute_name:
3804 fields["antivirus_profile"]["options"][attribute_name]["required"] = True
3805
3806 module = AnsibleModule(argument_spec=fields, supports_check_mode=True)
3807 check_legacy_fortiosapi(module)
3808
3809 is_error = False
3810 has_changed = False
3811 result = None
3812 diff = None
3813
3814 versions_check_result = None
3815 if module._socket_path:
3816 connection = Connection(module._socket_path)
3817 if "access_token" in module.params:
3818 connection.set_custom_option("access_token", module.params["access_token"])
3819
3820 if "enable_log" in module.params:
3821 connection.set_custom_option("enable_log", module.params["enable_log"])
3822 else:
3823 connection.set_custom_option("enable_log", False)
3824 fos = FortiOSHandler(connection, module, mkeyname, admin_passwd_header=False)
3825 versions_check_result = check_schema_versioning(
3826 fos, versioned_schema, "antivirus_profile"
3827 )
3828
3829 is_error, has_changed, result, diff = fortios_antivirus(
3830 module.params, fos, module.check_mode
3831 )
3832
3833 else:
3834 module.fail_json(**FAIL_SOCKET_MSG)
3835
3836 if versions_check_result and versions_check_result["matched"] is False:
3837 module.warn(
3838 "Ansible has detected version mismatch between FortOS system and your playbook, see more details by specifying option -vvv"
3839 )
3840
3841 if not is_error:
3842 if versions_check_result and versions_check_result["matched"] is False:
3843 module.exit_json(
3844 changed=has_changed,
3845 version_check_warning=versions_check_result,
3846 meta=result,
3847 diff=diff,
3848 )
3849 else:
3850 module.exit_json(changed=has_changed, meta=result, diff=diff)
3851 else:
3852 if versions_check_result and versions_check_result["matched"] is False:
3853 module.fail_json(
3854 msg="Error in repo",
3855 version_check_warning=versions_check_result,
3856 meta=result,
3857 )
3858 else:
3859 module.fail_json(msg="Error in repo", meta=result)
3860
3861
3862 if __name__ == "__main__":
3863 main()