AlgosecGetNetworkObject

Find network objects related to IP address.

python · AlgoSec

Details

IDAlgosecGetNetworkObject
Languagepython
From Version5.0.0
Docker Imagedemisto/python3:3.12.13.10116658
TagsAlgosec

README

Finds network objects related to the IP address.

Script Data


Name Description
Script Type python
Tags Algosec

Dependencies


This script uses the following commands and scripts.

  • algosec-get-network-object

Inputs


Argument Name Description
address The IP address/Subnet to search.
type The search method for the address. The default is INTERSECT.

Outputs


There are no outputs for this script.

import demistomock as demisto


def test_algosec_get_network_object(mocker):
    """
    Given:
        - response mock.
    When:
        - running AlgosecGetNetworkObject script.
    Then:
        - Ensure that the results were built correctly.
    """
    from AlgosecGetNetworkObject import algosec_get_network_object

    ticket = [{"Type": 3, "Contents": {"some_info": {"info": "test"}}}]
    mocker.patch.object(demisto, "executeCommand", return_value=ticket)
    results_mock = mocker.patch.object(demisto, "results")
    algosec_get_network_object()
    assert results_mock.call_args[0][0]["Contents"] == [{"some_info": "info: test"}]