Cofense Feed
Use the Cofense Feed Integration to fetch indicators from the feed.
Data Enrichment & Threat Intelligence · Cofense Feed · Feed
Details
| ID | Cofense Feed |
|---|---|
| Provider | Cofense |
| Category | Data Enrichment & Threat Intelligence |
| From Version | 5.5.0 |
| Docker Image | demisto/python3:3.12.13.10116658 |
| Supported Modules | Agentix XSIAM |
README
Use the Cofense Feed Integration to fetch indicators from the feed.
This integration was integrated and tested with version 1 of Cofense Feed
Configure Cofense Feed in Cortex
| Parameter | Description | Required |
|---|---|---|
| Username | False | |
| Password | False | |
| Fetch indicators | False | |
| Indicator Reputation | Indicators from this integration instance will be marked with this reputation | False |
| Source Reliability | Reliability of the source providing the intelligence data | True |
| Traffic Light Protocol Color | The Traffic Light Protocol (TLP) designation to apply to indicators fetched from the feed | False |
| feedExpirationPolicy | False | |
| feedExpirationInterval | False | |
| Feed Fetch Interval | False | |
| Tags | Supports CSV values. | False |
| Bypass exclusion list | When selected, the exclusion list is ignored for indicators from this feed. This means that if an indicator from this feed is on the exclusion list, the indicator might still be added to the system. | False |
| The threat type for which to fetch indicators | To fetch malware and phishing indicators select “all”. | False |
| First fetch time range (<number> <time unit>, e.g., 1 hour, 30 minutes) | This value also will be used as an expiration time - all indicators before the given time will not be fetched. | False |
| Trust any certificate (not secure) | False | |
| Use system proxy settings | False |
Commands
You can execute these commands from the CLI, as part of an automation, or in a playbook.
After you successfully execute a command, a DBot message appears in the War Room with the command details.
cofense-get-indicators
Gets indicators from the feed.
Base Command
cofense-get-indicators
Input
| Argument Name | Description | Required |
|---|---|---|
| limit | The maximum number of context indicators to return. The default value is 10. Default is 10. | Optional |
| from_time | The time period (previous) for which to fetch indicators. For example, a value of 3 days will return indicators from the previous three days. Default is 3 days. | Optional |
Context Output
There is no context output for this command.
Command Example
!cofense-get-indicators limit=2
Human Readable Output
Results from Cofense Feed:
| threat_id | type | value | impact | confidence | roleDescription |
|---|---|---|---|---|---|
| 218956 | URL | https://r-gk8.online/main/main.php | Major | 100 | Credential Phishing |
| 218956 | URL | https://notification.ba.com/LinkTracking?id=17174577&url=https://r-gk8.online?e= | Major | 100 | Credential Phishing |
Configuration parameters
credentials— Usernamefeed— Fetch indicatorsfeedReputation— Indicator ReputationfeedReliability— Source Reliability (required)tlp_color— Traffic Light Protocol ColorfeedExpirationPolicy—feedExpirationInterval—feedFetchInterval— Feed Fetch IntervalfeedTags— TagsfeedBypassExclusionList— Bypass exclusion listthreat_type— The threat type for which to fetch indicatorsfetch_time— First fetch time range (<number> <time unit>, e.g., 1 hour, 30 minutes)insecure— Trust any certificate (not secure)proxy— Use system proxy settings
Commands (1)
-
cofense-get-indicatorsGets indicators from the feed.
import json import pytest from FeedCofense import Client, fetch_indicators_command from CommonServerPython import FeedIndicatorType with open("test_data/search_output.json") as f: raw: dict = json.load(f) data = raw["data"] threats = data["threats"] client = Client("https://www.threathq.com", ("username", "password"), tags=["tag1", "tag2"], tlp_color="RED") class TestFetchIndicators: process_items_params = [ (threats[0], "https://example.com/mal.exe", FeedIndicatorType.URL, 0, 5), (threats[0], "example.com", FeedIndicatorType.Domain, 3, 5), (threats[0], "*example.com", FeedIndicatorType.DomainGlob, 4, 5), ({}, "", "", 0, 0), ] @pytest.mark.parametrize("threat, value, _type, indicator_index, length", process_items_params) def test_process_item(self, threat, value, _type, indicator_index, length): """ Test process_item function for success cases. Given - A valid response When - run process_item function Then - Verify value, type, tags and tlp for indicator """ ans = client.process_item(threat) if length: first_obj = ans[indicator_index] assert len(ans) == length assert first_obj["value"] == value assert first_obj["type"] == _type assert first_obj["fields"]["tags"] == client.tags assert first_obj["fields"]["trafficlightprotocol"] == client.tlp_color else: assert not ans fetch_items_params = [ (threats, ["https://example.com/mal.exe"], ["URL"], 1), ( threats, [ "https://example.com/mal.exe", "127.0.0.1", "https://example.com/raw/malp", "example.com", "*example.com", "randommd5", "randommd5", "6ad00a19ab3e47e4b54b2792a7b47a13", "d2c65700c107b637eafe34b203b6f712", "user@example.com", "random md5", ], [ FeedIndicatorType.URL, FeedIndicatorType.IP, FeedIndicatorType.URL, FeedIndicatorType.Domain, FeedIndicatorType.DomainGlob, FeedIndicatorType.File, FeedIndicatorType.File, FeedIndicatorType.File, FeedIndicatorType.File, FeedIndicatorType.Email, FeedIndicatorType.File, ], None, ), ([], [], [], 100), ] @pytest.mark.parametrize( "iterator_value, expected_value, expected_type, limit", fetch_items_params, ) def test_fetch_indicators_command(self, mocker, iterator_value, expected_value, expected_type, limit): """ Test fetch_indicators_command for success cases. Given - A valid response When - run fetch_indicators_command Then - Verify value, type, tags and tlp for indicator """ mocker.patch.object(Client, "build_iterator", return_value=iterator_value) results = fetch_indicators_command(client, limit=limit) if expected_value and expected_type: for i, res in enumerate(results): assert expected_value[i] in res["value"] assert expected_type[i] in res["type"] assert res["fields"]["tags"] == client.tags assert res["fields"]["trafficlightprotocol"] == client.tlp_color else: assert not results process_items_params = [ # noqa: PIE794 (threats[0], "randommd5", FeedIndicatorType.File, 0, 4), (threats[0], "6ad00a19ab3e47e4b54b2792a7b47a13", FeedIndicatorType.File, 2, 4), ({}, "", "", 0, 0), ] @pytest.mark.parametrize("threat, value, _type, indicator_index, length", process_items_params) def test_process_file_item(self, threat, value, _type, indicator_index, length): """ Test process_file_item function for success cases. Given - A valid response When - run process_file_item function Then - Verify value, type, tags and tlp for indicator """ ans = client.process_file_item(threat) if length: first_obj = ans[indicator_index] assert len(ans) == length assert first_obj["value"] == value assert first_obj["type"] == _type assert first_obj["fields"]["tags"] == client.tags assert first_obj["fields"]["trafficlightprotocol"] == client.tlp_color else: assert not ans def test_indicator_fields_for_fetch_indicators_command(self, mocker): """ Test indicator fields for fetch_indicators_command. Given - A valid response When - run fetch_indicators_command Then - Verify indicator fields """ with open("test_data/fetch_indicators.json") as file: indicators = json.load(file) mocker.patch.object(Client, "build_iterator", return_value=[threats[1]]) results = fetch_indicators_command(client) assert results == indicators["indicators"]