CBPCatalogFindHash

Search the CBP/Bit9 file catalog for an md5 hash.

python · Carbon Black Enterprise Protection

Details

IDCBPCatalogFindHash
Languagepython
From Version5.0.0
Docker Imagedemisto/python3:3.12.13.10116658
Tagscarbon-black-protection bit9 enhancement

README

Searches the CBP/Bit9 file catalog for an MD5 hash of a file.

Script Data


Name Description
Script Type python
Tags carbon-black-protection, bit9, enhancement

Dependencies


This script uses the following commands and scripts.

  • cbp-fileCatalog-search

Inputs


Argument Name Description
md5 The MD5 hash of a file to find.

Outputs


There are no outputs for this script.

import demistomock as demisto  # noqa: F401
from CommonServerPython import *  # noqa: F401


def test_cbp_catalog_find_hash(mocker):
    from CBPCatalogFindHash import cbp_catalog_find_hash

    args = {"md5": ["md5_hash"]}
    catalog = [{"Type": 3, "Contents": {"getTicketResponse": {"some_info": {"info": "test"}}}}]
    mocker.patch.object(demisto, "executeCommand", return_value=catalog)
    mocker.patch.object(demisto, "results")
    cbp_catalog_find_hash(args)
    res = demisto.results
    content = res.call_args[0][0]
    assert content == [{"Type": 1, "ContentsFormat": "table", "Contents": ["getTicketResponse"]}]