Skip to content

Commit 02c7d18

Browse files
committed
test(google-ti-feeds): cover files and urls in campaign orchestrator tests (#5793)
1 parent 3678f22 commit 02c7d18

2 files changed

Lines changed: 39 additions & 13 deletions

File tree

external-import/google-ti-feeds/tests/custom/debug_responses/main_campaigns_e3b0c44298fc1c14.json

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,28 @@
5656
"domains_count": 1,
5757
"malware_roles": [],
5858
"field_sources": [],
59-
"recent_activity_summary": [7, 7, 7, 14, 3, 2, 7, 6, 3, 6, 4, 3, 3, 5],
60-
"targeted_regions": ["US", "AU", "BE", "CA"],
59+
"recent_activity_summary": [
60+
7,
61+
7,
62+
7,
63+
14,
64+
3,
65+
2,
66+
7,
67+
6,
68+
3,
69+
6,
70+
4,
71+
3,
72+
3,
73+
5
74+
],
75+
"targeted_regions": [
76+
"US",
77+
"AU",
78+
"BE",
79+
"CA"
80+
],
6181
"targeted_regions_hierarchy": [
6282
{
6383
"region": "Oceania",
@@ -229,10 +249,10 @@
229249
],
230250
"campaign_type": "GLOBAL",
231251
"counters": {
232-
"files": 0,
252+
"files": 1,
233253
"domains": 1,
234254
"ip_addresses": 27,
235-
"urls": 0,
255+
"urls": 1,
236256
"iocs": 28,
237257
"subscribers": 1,
238258
"attack_techniques": 106
@@ -255,7 +275,9 @@
255275
"workarounds": [],
256276
"first_seen": 1692648309,
257277
"private": true,
258-
"alt_names": ["GLOBAL.24.007"],
278+
"alt_names": [
279+
"GLOBAL.24.007"
280+
],
259281
"vendor_fix_references": [],
260282
"threat_scape": [],
261283
"recent_activity_relative_change": 0.14925373134328357,

external-import/google-ti-feeds/tests/custom/test_orchestrator.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -359,25 +359,29 @@ def expected_campaign_log_messages() -> list[str]:
359359
"Fetched 1 vulnerabilities relationships from API - {'prefix': '[BaseFetcher]'}",
360360
"Fetched 1 threat_actors relationships from API - {'prefix': '[BaseFetcher]'}",
361361
"Fetched 1 domains relationships from API - {'prefix': '[BaseFetcher]'}",
362+
"Fetched 1 files relationships from API - {'prefix': '[BaseFetcher]'}",
363+
"Fetched 1 urls relationships from API - {'prefix': '[BaseFetcher]'}",
362364
"Fetched 1 ip_addresses relationships from API - {'prefix': '[BaseFetcher]'}",
363365
"Fetched 1 software_toolkits relationships from API - {'prefix': '[BaseFetcher]'}",
364-
"Found relationships - {'prefix': '[OrchestratorCampaign]', 'current': 1, 'total': 1, 'relationships': 'malware_families: 1, attack_techniques: 1, vulnerabilities: 1, threat_actors: 1, domains: 1, ip_addresses: 1, software_toolkits: 1'}",
366+
"Found relationships - {'prefix': '[OrchestratorCampaign]', 'current': 1, 'total': 1, 'relationships': 'malware_families: 1, attack_techniques: 1, vulnerabilities: 1, threat_actors: 1, domains: 1, files: 1, urls: 1, ip_addresses: 1, software_toolkits: 1'}",
365367
"Using ID-only approach for attack techniques (quota optimization) - {'prefix': '[OrchestratorCampaign]', 'attack_technique_count': 1}",
366368
"Converted entities to STIX format - {'prefix': '[GenericConverter]', 'count': 34, 'entity_type': 'malware families'}",
367369
"Converted entities to STIX format - {'prefix': '[GenericConverter]', 'count': 53, 'entity_type': 'vulnerabilities'}",
368370
"Converted entities to STIX format - {'prefix': '[GenericConverter]', 'count': 54, 'entity_type': 'threat actors'}",
369371
"Converted entities to STIX format - {'prefix': '[GenericConverter]', 'count': 5, 'entity_type': 'domains'}",
372+
"Converted entities to STIX format - {'prefix': '[GenericConverter]', 'count': 5, 'entity_type': 'files'}",
373+
"Converted entities to STIX format - {'prefix': '[GenericConverter]', 'count': 5, 'entity_type': 'URLs'}",
370374
"Converted entities to STIX format - {'prefix': '[GenericConverter]', 'count': 5, 'entity_type': 'IP addresses'}",
371375
"Converted entities to STIX format - {'prefix': '[GenericConverter]', 'count': 2, 'entity_type': 'software toolkits'}",
372376
"Converted entities to STIX format - {'prefix': '[GenericConverter]', 'count': 2, 'entity_type': 'attack techniques'}",
373-
"Converted to STIX entities - {'prefix': '[OrchestratorCampaign]', 'current': 1, 'total': 1, 'entities_count': 186, 'entities_summary': 'location: 23, identity: 34, campaign: 1, relationship: 92, malware: 1, vulnerability: 1, software: 24, note: 3, intrusion-set: 1, domain-name: 1, indicator: 2, ipv4-addr: 1, tool: 1, attack-pattern: 1'}",
374-
"Adding items to batch processor - {'prefix': '[GenericBatchProcessor]', 'count': 186, 'display_name': 'STIX objects'}",
375-
"Successfully added items - {'prefix': '[GenericBatchProcessor]', 'added_count': 186, 'total_count': 186, 'display_name': 'STIX objects'}",
376-
"Flushing remaining items - {'prefix': '[GenericBatchProcessor]', 'count': 188, 'display_name': 'STIX objects'}",
377-
"Processing batch - {'prefix': '[GenericBatchProcessor]', 'batch_num': 1, 'batch_size': 188, 'display_name': 'STIX objects', 'total_processed': 188}",
377+
"Converted to STIX entities - {'prefix': '[OrchestratorCampaign]', 'current': 1, 'total': 1, 'entities_count': 196, 'entities_summary': 'location: 23, identity: 34, campaign: 1, relationship: 98, malware: 1, vulnerability: 1, software: 24, note: 3, intrusion-set: 1, domain-name: 1, indicator: 4, file: 1, url: 1, ipv4-addr: 1, tool: 1, attack-pattern: 1'}",
378+
"Adding items to batch processor - {'prefix': '[GenericBatchProcessor]', 'count': 196, 'display_name': 'STIX objects'}",
379+
"Successfully added items - {'prefix': '[GenericBatchProcessor]', 'added_count': 196, 'total_count': 196, 'display_name': 'STIX objects'}",
380+
"Flushing remaining items - {'prefix': '[GenericBatchProcessor]', 'count': 198, 'display_name': 'STIX objects'}",
381+
"Processing batch - {'prefix': '[GenericBatchProcessor]', 'batch_num': 1, 'batch_size': 198, 'display_name': 'STIX objects', 'total_processed': 198}",
378382
"Sent batch to OpenCTI - {'prefix': '[GenericBatchProcessor]', 'batch_num': 1}",
379-
"Batch completed successfully - {'prefix': '[GenericBatchProcessor]', 'work_id': None, 'total_count': 188, 'type_summary': 'identity: 35, marking-definition: 1, location: 23, campaign: 1, relationship: 92, malware: 1, vulnerability: 1, software: 24, note: 3, intrusion-set: 1, domain-name: 1, indicator: 2, ipv4-addr: 1, tool: 1, attack-pattern: 1'}",
380-
"Successfully processed batch #1. Total STIX objects sent: 188 - {'prefix': '[GenericBatchProcessor]', 'batch_num': 1, 'total_items_sent': 188}",
383+
"Batch completed successfully - {'prefix': '[GenericBatchProcessor]', 'work_id': None, 'total_count': 198, 'type_summary': 'identity: 35, marking-definition: 1, location: 23, campaign: 1, relationship: 98, malware: 1, vulnerability: 1, software: 24, note: 3, intrusion-set: 1, domain-name: 1, indicator: 4, file: 1, url: 1, ipv4-addr: 1, tool: 1, attack-pattern: 1'}",
384+
"Successfully processed batch #1. Total STIX objects sent: 198 - {'prefix': '[GenericBatchProcessor]', 'batch_num': 1, 'total_items_sent': 198}",
381385
"State update: Setting next_cursor_date - {'prefix': '[GenericBatchProcessor]', 'latest_date': '2025-07-30T22:01:05+00:00'}",
382386
]
383387

0 commit comments

Comments
 (0)