sophos.sophos_firewall.sfos_web_useractivity module – Manage Web User Activities (Protect > Web > User Activities)

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

New in sophos.sophos_firewall 2.3.0

Synopsis

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

category_list

list / elements=dictionary

List of categories to apply to this User Activity.

id

string / required

Category Name

type

string / required

Category type

Choices:

  • "web category"

  • "file type"

  • "url group"

description

string

Specify a description for the User Activity.

name

string / required

Specify a name for the User Activity.

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 User Activity with web categories
  sophos.sophos_firewall.sfos_web_useractivity:
    name: "Social Media Activity"
    description: "User activity for social media monitoring"
    category_list:
      - id: "Social Networking"
        type: "web category"
      - id: "Entertainment"
        type: "web category"
    state: present

- name: Create User Activity with mixed categories
  sophos.sophos_firewall.sfos_web_useractivity:
    name: "Document Management"
    description: "User activity for document handling"
    category_list:
      - id: "Business"
        type: "web category"
      - id: "Document Files"
        type: "file type"
      - id: "Corporate URLs"
        type: "url group"
    state: present

- name: Create User Activity with only description
  sophos.sophos_firewall.sfos_web_useractivity:
    name: "Basic Activity"
    description: "Basic user activity without categories"
    state: present

- name: Query User Activity
  sophos.sophos_firewall.sfos_web_useractivity:
    name: "Social Media Activity"
    state: query

- name: Update User Activity
  sophos.sophos_firewall.sfos_web_useractivity:
    name: "Social Media Activity"
    description: "Updated social media monitoring activity"
    category_list:
      - id: "Social Networking"
        type: "web category"
      - id: "Entertainment"
        type: "web category"
      - id: "Gaming"
        type: "web category"
    state: updated

- name: Remove User Activity
  sophos.sophos_firewall.sfos_web_useractivity:
    name: "Social Media Activity"
    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)