ShowCPScanInfo
Get scan info from Check Point Smart API.
Details
| ID | ShowCPScanInfo |
|---|---|
| Language | python |
| From Version | 6.9.0 |
| Docker Image | demisto/python3:3.12.13.10116658 |
README
Get scan info from Check Point Smart API.
Script Data
| Name | Description |
|---|---|
| Script Type | python3 |
| Cortex XSOAR Version | 6.9.0 |
Dependencies
This script uses the following commands and scripts.
- checkpointhec-get-scan-info
- CheckPointHEC
Inputs
There are no inputs for this script.
Outputs
There are no outputs for this script.
import json import demistomock as demisto from ShowCPScanInfo import get_scan_info def util_load_json(path): with open(path, encoding="utf-8") as f: return json.loads(f.read()) def test_get_scan_info_error(mocker): error = "Error: Entity not found" def execute_command(name, args): if name == "checkpointhec-get-scan-info": return [{"Contents": error}] raise ValueError(f"Error: Unknown command or command/argument pair: {name} {args!r}") mocker.patch.object(demisto, "executeCommand", side_effect=execute_command) success, scan_info = get_scan_info("0000", "CheckPointHEC-instance-1") assert success is False assert scan_info == error def test_get_scan_info_success(mocker): mock_response = util_load_json("./test_data/checkpointhec-get_entity.json") def execute_command(name, args): if name == "checkpointhec-get-scan-info": return [{"Contents": {"av": json.dumps(mock_response["responseData"][0]["entitySecurityResult"]["av"])}}] raise ValueError(f"Error: Unknown command or command/argument pair: {name} {args!r}") mocker.patch.object(demisto, "executeCommand", side_effect=execute_command) success, scan_info = get_scan_info("0000", "CheckPointHEC-instance-1") assert success is True assert scan_info == json.dumps({"av": mock_response["responseData"][0]["entitySecurityResult"]["av"]})