sophos.sophos_firewall.sfos_web_filetype module – Manage Web File Types (Protect > Web > File Types)

Note

This module is part of the sophos.sophos_firewall collection (version 2.3.1).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install sophos.sophos_firewall. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: sophos.sophos_firewall.sfos_web_filetype.

New in sophos.sophos_firewall 2.3.0

Synopsis

  • Manage Web File Types (Protect > Web > File Types) on Sophos Firewall

Requirements

The below requirements are needed on the host that executes this module.

  • sophosfirewall-python

  • Beginning in version 2.0.0, this module requires use of an httpapi connection plugin. See the HTTPAPI example for details.

Parameters

Parameter

Comments

description

string

Specify File Type Category description.

file_extension

list / elements=string

Enter File Extensions to be included in the Category.

mime_header

list / elements=string

Enter MIME Header to be included in the Category.

name

string / required

Specify a name to identify the File Type Category.

state

string / required

Use query to retrieve, present to create, updated to modify, or absent to remove

Choices:

  • "present"

  • "updated"

  • "query"

  • "absent"

Examples

- name: Create File Type Category with extensions and MIME headers
  sophos.sophos_firewall.sfos_web_filetype:
    name: "Custom File Type"
    description: "Custom file type category for document files"
    file_extension:
      - "pdf"
      - "doc"
      - "docx"
      - "txt"
    mime_header:
      - "application/pdf"
      - "application/msword"
      - "text/plain"
    state: present

- name: Create File Type Category with only extensions
  sophos.sophos_firewall.sfos_web_filetype:
    name: "Image Files"
    description: "Image file types"
    file_extension:
      - "jpg"
      - "jpeg"
      - "png"
      - "gif"
    state: present

- name: Query File Type Category
  sophos.sophos_firewall.sfos_web_filetype:
    name: "Custom File Type"
    state: query

- name: Update File Type Category
  sophos.sophos_firewall.sfos_web_filetype:
    name: "Custom File Type"
    description: "Updated description"
    file_extension:
      - "pdf"
      - "doc"
      - "docx"
      - "txt"
      - "rtf"
    state: updated

- name: Remove File Type Category
  sophos.sophos_firewall.sfos_web_filetype:
    name: "Custom File Type"
    state: absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

api_response

dictionary

Serialized object containing the API response.

Returned: always

Authors

  • Matt Mullen (@mamullen13316)