Skip to content

Commit 9e38684

Browse files
ShahafBenYakirtkatzirdantavori
authored andcommitted
Added support for update_core_packs_list for all MPs (demisto#24154)
* Added support for update_core_packs_list for all MPs * fixes --------- Co-authored-by: tkatzir <[email protected]> Co-authored-by: Dan Tavori <[email protected]> Co-authored-by: Dan Tavori <[email protected]>
1 parent c6d1075 commit 9e38684

File tree

5 files changed

+108
-92
lines changed

5 files changed

+108
-92
lines changed
Lines changed: 44 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,44 @@
1-
[
2-
"Active_Directory_Query",
3-
"AutoFocus",
4-
"Base",
5-
"CommonDashboards",
6-
"CommonPlaybooks",
7-
"CommonReports",
8-
"CommonScripts",
9-
"CommonTypes",
10-
"CommonWidgets",
11-
"DefaultPlaybook",
12-
"DemistoLocking",
13-
"DemistoRESTAPI",
14-
"EDL",
15-
"FeedMitreAttackv2",
16-
"FeedTAXII",
17-
"FeedUnit42v2",
18-
"FiltersAndTransformers",
19-
"HelloWorld",
20-
"ImageOCR",
21-
"Palo_Alto_Networks_WildFire",
22-
"PAN-OS",
23-
"TIM_Processing",
24-
"TIM_SIEM",
25-
"ThreatIntelReports",
26-
"ThreatIntelligenceManagement",
27-
"Unit42Intel",
28-
"UrlScan",
29-
"VirusTotal",
30-
"Whois",
31-
"ipinfo",
32-
"rasterize"
33-
]
1+
{
2+
"core_packs_list": [
3+
"Active_Directory_Query",
4+
"AutoFocus",
5+
"Base",
6+
"CommonDashboards",
7+
"CommonPlaybooks",
8+
"CommonReports",
9+
"CommonScripts",
10+
"CommonTypes",
11+
"CommonWidgets",
12+
"DefaultPlaybook",
13+
"DemistoLocking",
14+
"DemistoRESTAPI",
15+
"EDL",
16+
"FeedMitreAttackv2",
17+
"FeedTAXII",
18+
"FeedUnit42v2",
19+
"FiltersAndTransformers",
20+
"HelloWorld",
21+
"ImageOCR",
22+
"Palo_Alto_Networks_WildFire",
23+
"PAN-OS",
24+
"TIM_Processing",
25+
"TIM_SIEM",
26+
"ThreatIntelReports",
27+
"ThreatIntelligenceManagement",
28+
"Unit42Intel",
29+
"UrlScan",
30+
"VirusTotal",
31+
"Whois",
32+
"ipinfo",
33+
"rasterize"
34+
],
35+
"update_core_packs_list": [
36+
"Base",
37+
"CommonScripts",
38+
"CommonPlaybooks",
39+
"CommonTypes",
40+
"CommonDashboards",
41+
"CommonReports",
42+
"CommonWidgets"
43+
]
44+
}

Tests/Marketplace/core_packs_mpv2_list.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
[
1+
{
2+
"core_packs_list": [
23
"Active_Directory_Query",
34
"AutoFocus",
45
"Base",
@@ -27,4 +28,11 @@
2728
"Whois",
2829
"ipinfo",
2930
"rasterize"
30-
]
31+
],
32+
"update_core_packs_list": [
33+
"Base",
34+
"CommonScripts",
35+
"CommonPlaybooks",
36+
"CommonTypes"
37+
]
38+
}
Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,40 @@
1-
[
2-
"AWS-EC2",
3-
"AWS-IAM",
4-
"AWS-Route53",
5-
"AWS-S3",
6-
"AccessInvestigation",
7-
"Asset",
8-
"Azure-Enrichment-Remediation",
9-
"AzureCompute",
10-
"AzureNetworkSecurityGroups",
11-
"Base",
12-
"CommonPlaybooks",
13-
"CommonScripts",
14-
"CommonTypes",
15-
"Core",
16-
"CoreAlertFields",
17-
"CortexAttackSurfaceManagement",
18-
"FiltersAndTransformers",
19-
"GCP-Enrichment-Remediation",
20-
"GCP-IAM",
21-
"GoogleCloudCompute",
22-
"GoogleKeyManagementService",
23-
"Identity",
24-
"Malware",
25-
"MicrosoftGraphIdentityandAccess",
26-
"MicrosoftGraphUser",
27-
"Nmap",
28-
"Rapid7_Nexpose",
29-
"ServiceNow",
30-
"SplunkPy",
31-
"Tenable_io"
32-
]
1+
{
2+
"core_packs_list": [
3+
"AWS-EC2",
4+
"AWS-IAM",
5+
"AWS-Route53",
6+
"AWS-S3",
7+
"AccessInvestigation",
8+
"Asset",
9+
"Azure-Enrichment-Remediation",
10+
"AzureCompute",
11+
"AzureNetworkSecurityGroups",
12+
"Base",
13+
"CommonPlaybooks",
14+
"CommonScripts",
15+
"CommonTypes",
16+
"Core",
17+
"CoreAlertFields",
18+
"CortexAttackSurfaceManagement",
19+
"FiltersAndTransformers",
20+
"GCP-Enrichment-Remediation",
21+
"GCP-IAM",
22+
"GoogleCloudCompute",
23+
"GoogleKeyManagementService",
24+
"Identity",
25+
"Malware",
26+
"MicrosoftGraphIdentityandAccess",
27+
"MicrosoftGraphUser",
28+
"Nmap",
29+
"Rapid7_Nexpose",
30+
"ServiceNow",
31+
"SplunkPy",
32+
"Tenable_io"
33+
],
34+
"update_core_packs_list": [
35+
"Base",
36+
"CommonScripts",
37+
"CommonPlaybooks",
38+
"CommonTypes"
39+
]
40+
}

Tests/Marketplace/marketplace_constants.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import os
22
import json
33
import enum
4-
from typing import List
54

65
IGNORED_FILES = ['__init__.py', 'ApiModules', 'NonSupported', 'index'] # files to ignore inside Packs folder
76
CONTENT_ROOT_PATH = os.path.abspath(os.path.join(__file__, '../../..')) # full path to content root repo
@@ -20,7 +19,6 @@
2019
}
2120
}
2221

23-
2422
SIEM_RULES_OBJECTS = ['ParsingRule', 'ModelingRule', 'CorrelationRule', 'XDRCTemplate']
2523
XSIAM_MP = "marketplacev2"
2624
XSOAR_MP = "xsoar"
@@ -89,18 +87,21 @@ class GCPConfig(object):
8987
CORE_PACK_FILE_NAME = "corepacks.json" # core packs file name
9088
BUILD_BUCKET_PACKS_ROOT_PATH = 'content/builds/{branch}/{build}/{marketplace}/content/packs'
9189

92-
with open(os.path.join(os.path.dirname(__file__), 'core_packs_list.json'), 'r') as core_packs_list_file:
93-
CORE_PACKS_LIST = json.load(core_packs_list_file)
94-
with open(os.path.join(os.path.dirname(__file__), 'core_packs_mpv2_list.json'), 'r') as core_packs_list_file:
95-
CORE_PACKS_MPV2_LIST = json.load(core_packs_list_file)
96-
with open(os.path.join(os.path.dirname(__file__), 'core_packs_xpanse_list.json'), 'r') as core_packs_list_file:
97-
CORE_PACKS_XPANSE_LIST = json.load(core_packs_list_file)
90+
with open(os.path.join(os.path.dirname(__file__), 'core_packs_list.json'), 'r') as core_packs_xsoar_list_file:
91+
packs_list = json.load(core_packs_xsoar_list_file)
92+
CORE_PACKS_LIST = packs_list.get('core_packs_list')
93+
CORE_PACKS_LIST_TO_UPDATE = packs_list.get('update_core_packs_list')
94+
95+
with open(os.path.join(os.path.dirname(__file__), 'core_packs_mpv2_list.json'), 'r') as core_packs_xsiam_list_file:
96+
packs_list_xsiam = json.load(core_packs_xsiam_list_file)
97+
CORE_PACKS_MPV2_LIST = packs_list_xsiam.get('core_packs_list')
98+
CORE_PACKS_MPV2_LIST_TO_UPDATE = packs_list_xsiam.get('update_core_packs_list')
9899

99-
with open(os.path.join(os.path.dirname(__file__), 'upgrade_core_packs_list.json'), 'r') as upgrade_core_packs_list:
100-
packs_list = json.load(upgrade_core_packs_list)
101-
CORE_PACKS_LIST_TO_UPDATE = packs_list.get("update_core_packs_list")
102-
CORE_PACKS_MPV2_LIST_TO_UPDATE: List[str] = []
103-
CORE_PACKS_XPANSE_LIST_TO_UPDATE: List[str] = []
100+
with open(os.path.join(os.path.dirname(__file__), 'core_packs_xpanse_list.json'),
101+
'r') as core_packs_xpanse_list_file:
102+
packs_list_xpanse = json.load(core_packs_xpanse_list_file)
103+
CORE_PACKS_XPANSE_LIST = packs_list_xpanse.get('core_packs_list')
104+
CORE_PACKS_XPANSE_LIST_TO_UPDATE = packs_list_xpanse.get('update_core_packs_list')
104105

105106
@classmethod
106107
def get_core_packs(cls, marketplace):
@@ -395,7 +396,6 @@ class Changelog(object):
395396
'Layout Rules': 'LayoutRules'
396397
}
397398

398-
399399
# the format is defined in issue #19786, may change in the future
400400
CONTENT_ITEM_NAME_MAPPING = {
401401
PackFolders.SCRIPTS.value: "automation",

Tests/Marketplace/upgrade_core_packs_list.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)