sophos.sophos_firewall.sfos_web_category module – Manage Web Categories (Protect > Web > Web Categories)

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_category.

New in sophos.sophos_firewall 2.3.0

Synopsis

  • Manage Web Categories (Protect > Web > Web Categories) 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

classification

string

Select classification.

Choices:

  • "Productive"

  • "Unproductive"

  • "Acceptable"

  • "Objectionable"

configurecategory

string / required

Content type configuration.

Choices:

  • "0"

  • "Local"

  • "External"

defaultdeniedmessage

string

Message (in HTML) to display when denied by default.

description

string

Category description.

domain_url

list / elements=string

Domains or URLs included in the category.

For External configuration, URLs must start with ‘http://’ or ‘ftp://’ (https:// is not supported).

For Local configuration, domain names should be provided without protocol.

keyword

list / elements=string

Keywords included in the category.

name

string / required

Specify name of the Web Category.

qospolicy

string

Select the QoS Policy for bandwidth restriction purposes.

Default: "None"

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 Web Category with Local configuration
  sophos.sophos_firewall.sfos_web_category:
    name: "Custom Category"
    classification: "Productive"
    qospolicy: "Default"
    description: "Custom web category for internal use"
    configurecategory: "Local"
    domain_url:
      - "example.com"
      - "test.org"
    keyword:
      - "productivity"
      - "business"
    state: present

- name: Create Web Category with External configuration
  sophos.sophos_firewall.sfos_web_category:
    name: "External Category"
    classification: "Unproductive"
    qospolicy: "Low Priority"
    configurecategory: "External"
    domain_url:
      - "http://custom.com"
      - "ftp://custom1.com"
    state: present

- name: Query Web Category
  sophos.sophos_firewall.sfos_web_category:
    name: "Custom Category"
    state: query

- name: Update Web Category
  sophos.sophos_firewall.sfos_web_category:
    name: "Custom Category"
    classification: "Acceptable"
    description: "Updated description"
    state: updated

- name: Remove Web Category
  sophos.sophos_firewall.sfos_web_category:
    name: "Custom Category"
    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)