FPDeleteRule

Deletes a rule in Forcepoint Triton.

python · Forcepoint Web Security

Details

IDFPDeleteRule
Languagepython
From Version5.0.0
Docker Imagedemisto/python3:3.12.13.10116658
Tagsforcepoint triton

README

Generates a password and allows various parameters to customize the properties of the password depending on the use case. For example, password complexity requirements. The default behavior is to generate a password of random length including all four character classes (upper, lower, digits, symbols) with at least five and at most ten characters per class.

The min_* values all default to 0. This means that if the command is executed in this way:
!GeneratePassword max_lcase=10.
It is possible that a password of length zero could be generated. It is therefore recommended to always include a min_* parameter that matches.

The debug parameter will print certain properties of the command into the War Room for easy diagnostics.

Script Data


Name Description
Script Type javascript
Tags Utility

Inputs


Argument Name Description
min_lcase The minimum number of lower case characters to include in password.
max_lcase The maximum number of lower case characters to include in password.
min_ucase The minimum number of upper case characters to include in password.
max_ucase The maximum number of upper case characters to include in password.
min_digits The minimum number of digits to include in password.
max_digits The maximum number of digits to include in password.
min_symbols The minimum number of symbols to include in password.
max_symbols The maximum number of symbols to include in password.
debug Enable this to see various values as they pass through the function.

Outputs


Path Description Type
NEW_PASSWORD The new password generated for the user. Unknown
import demistomock as demisto  # noqa: F401
from CommonServerPython import *  # noqa: F401


def test_delete_rule_error(mocker):
    """
    Given:
        - The script args.
    When:
        - Running delete_rule function.
    Then:
        - Validating the outputs as expected.
    """
    from FPDeleteRule import delete_rule

    results_mock = mocker.patch.object(demisto, "results")
    delete_rule("wrong_type")
    assert (
        'Type argument must be "dest_domain", "dest_ip", "dest_host" or "url_regex". Invalid value: '
        in results_mock.call_args[0][0]["Contents"]
    )


def test_delete_rule(mocker):
    """
    Given:
        - The script args.
    When:
        - Running delete_rule function.
    Then:
        - Validating the outputs as expected.
    """
    from FPDeleteRule import delete_rule

    mocker.patch.object(demisto, "args", return_value={"tritonsystem": "tritonsystem", "value": "system"})
    execute_command_res = [{"Type": 1, "Contents": {"success": "true"}}]
    execute_mock = mocker.patch.object(demisto, "executeCommand", return_value=execute_command_res)
    results_mock = mocker.patch.object(demisto, "results")
    delete_rule("dest_domain")
    assert execute_mock.call_count == 1
    assert "Command executed successfully." in results_mock.call_args[0][0]