Skip to content

Commit 9a4ffa4

Browse files
authored
Ciac 10837/content path (#37898)
* InvalidMarkdownFileName - CIAC-10840 * InvalidDepthOneFolder - CIAC-10839 * InvalidIntegrationScriptFileName - CIAC-10841 * test * test * test * test * InvalidIntegrationScriptFileName - CIAC-10841 * fix paths and readme * fix paths * ignore validation * remove change * remove change added rn * added test * removed * pre-commit * pre-commit * remove rn * integration in skip
1 parent d9303c5 commit 9a4ffa4

File tree

59 files changed

+193
-231
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+193
-231
lines changed

.pre-commit-config_template.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,6 @@ repos:
221221
require_serial: true
222222
args:
223223
- validate
224-
- --skip-depth-one-folder
225-
- --skip-integration-script-file-name
226-
- --skip-markdown
227224
- --skip-suffix
228225

229226
- id: validate-conf-json

Packs/AgariPhishingDefense/Integrations/AgariPhishingDefense/CHANGELOG.md

Whitespace-only changes.

Packs/Base/Scripts/DBotPreprocessTextData/dbot_preprocess_text_data_test.py renamed to Packs/Base/Scripts/DBotPreprocessTextData/DBotPreprocessTextData_test.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ def test_replace_emails(self):
342342
args[tested_arg] = True
343343
t1 = Tokenizer(**args)
344344
res1 = t1.word_tokenize(text)
345-
assert res1['tokenizedText'] == 'my email is {}'.format(t1.email_pattern)
345+
assert res1['tokenizedText'] == f'my email is {t1.email_pattern}'
346346

347347
def test_replace_urls(self):
348348
tested_arg = 'replace_urls'
@@ -356,7 +356,7 @@ def test_replace_urls(self):
356356
args[tested_arg] = True
357357
t1 = Tokenizer(**args)
358358
res1 = t1.word_tokenize(text)
359-
assert res1['tokenizedText'] == 'my url is {}'.format(t1.url_pattern)
359+
assert res1['tokenizedText'] == f'my url is {t1.url_pattern}'
360360

361361
def test_replace_numbers(self):
362362
tested_arg = 'replace_numbers'
@@ -370,7 +370,7 @@ def test_replace_numbers(self):
370370
args[tested_arg] = True
371371
t1 = Tokenizer(**args)
372372
res1 = t1.word_tokenize(text)
373-
assert res1['tokenizedText'] == 'i am {} years old'.format(t1.number_pattern)
373+
assert res1['tokenizedText'] == f'i am {t1.number_pattern} years old'
374374

375375
def test_lemma(self):
376376
tested_arg = 'lemma'
@@ -430,7 +430,7 @@ def test_read_file(mocker):
430430
mocker.patch.object(demisto, 'getFilePath', return_value={'path': './TestData/input_json_file_test'})
431431
obj = read_file('231342@343', 'json')
432432
assert len(obj) >= 1
433-
with open('./TestData/input_json_file_test', 'r') as f:
433+
with open('./TestData/input_json_file_test') as f:
434434
obj = read_file(f.read(), 'json_string')
435435
assert len(obj) >= 1
436436

@@ -441,15 +441,15 @@ def test_read_file(mocker):
441441
assert len(obj_from_pickle) >= 1
442442

443443
mocker.patch.object(demisto, 'getFilePath', return_value={'path': './TestData/input_json_file_test'})
444-
with open('./TestData/input_json_file_test', 'r') as f:
444+
with open('./TestData/input_json_file_test') as f:
445445
obj = read_file(f.read(), 'json_string')
446446
df = pd.DataFrame.from_dict(obj)
447447
df.to_csv("./TestData/test.csv", index=False)
448448
mocker.patch.object(demisto, 'getFilePath', return_value={'path': './TestData/test.csv'})
449449
obj2 = read_file('231342@343', 'csv')
450450
assert len(obj2) == len(obj)
451451

452-
with open('./TestData/input_json_file_test', 'r') as f:
452+
with open('./TestData/input_json_file_test') as f:
453453
b64_input = base64.b64encode(f.read().encode('utf-8'))
454454
obj = read_file(b64_input, 'json_b64_string')
455455
assert len(obj) >= 1

Packs/BmcITSM/Mapper/classifier-BMC_ITSM_Outgoing_Mapper.json renamed to Packs/BmcITSM/Classifiers/classifier-BMC_ITSM_Outgoing_Mapper.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@
1010
"simple": "details"
1111
},
1212
"Impact": {
13-
"simple": "bmcimpact"
13+
"simple": "bmcitsmimpact"
1414
},
1515
"Priority": {
1616
"simple": "sourcepriority"
1717
},
1818
"RiskLevel": {
19-
"simple": "bmcrisklevel"
19+
"simple": "bmcitsmrisklevel"
2020
},
2121
"Status": {
2222
"simple": "sourcestatus"
2323
},
2424
"StatusReason": {
25-
"simple": "bmcstatusreason"
25+
"simple": "bmcitsmstatusreason"
2626
},
2727
"Summary": {
2828
"simple": "description"
@@ -39,7 +39,7 @@
3939
"simple": "details"
4040
},
4141
"Impact": {
42-
"simple": "bmcimpact"
42+
"simple": "bmcitsmimpact"
4343
},
4444
"Priority": {
4545
"simple": "sourcepriority"
@@ -48,7 +48,7 @@
4848
"simple": "sourcestatus"
4949
},
5050
"StatusReason": {
51-
"simple": "bmcstatusreason"
51+
"simple": "bmcitsmstatusreason"
5252
},
5353
"Summary": {
5454
"simple": "description"
@@ -65,7 +65,7 @@
6565
"simple": "details"
6666
},
6767
"Impact": {
68-
"simple": "bmcimpact"
68+
"simple": "bmcitsmimpact"
6969
},
7070
"Priority": {
7171
"simple": "labels.Priority"
@@ -74,7 +74,7 @@
7474
"simple": "sourcestatus"
7575
},
7676
"StatusReason": {
77-
"simple": "bmcstatusreason"
77+
"simple": "bmcitsmstatusreason"
7878
},
7979
"Summary": {
8080
"simple": "description"
@@ -91,7 +91,7 @@
9191
"simple": "details"
9292
},
9393
"Impact": {
94-
"simple": "bmcimpact"
94+
"simple": "bmcitsmimpact"
9595
},
9696
"Priority": {
9797
"simple": "sourcepriority"
@@ -100,7 +100,7 @@
100100
"simple": "sourcestatus"
101101
},
102102
"StatusReason": {
103-
"simple": "bmcstatusreason"
103+
"simple": "bmcitsmstatusreason"
104104
},
105105
"Summary": {
106106
"simple": "description"
@@ -117,13 +117,13 @@
117117
"simple": "details"
118118
},
119119
"Impact": {
120-
"simple": "bmcimpact"
120+
"simple": "bmcitsmimpact"
121121
},
122122
"Status": {
123123
"simple": "sourcestatus"
124124
},
125125
"StatusReason": {
126-
"simple": "bmcstatusreason"
126+
"simple": "bmcitsmstatusreason"
127127
},
128128
"Summary": {
129129
"simple": "description"
@@ -146,7 +146,7 @@
146146
"simple": "sourcestatus"
147147
},
148148
"StatusReason": {
149-
"simple": "bmcstatusreason"
149+
"simple": "bmcitsmstatusreason"
150150
},
151151
"Summary": {
152152
"simple": "description"

Packs/Bonusly/Integrations/Bonusly/CHANGELOG.md

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

Packs/Bonusly/Scripts/IncOwnerToBonuslyUser/CHANGELOG.md

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

Packs/CaseManagement-Generic/Scripts/TimersOnOwnerChange/CHANGELOG.md

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

Packs/CommonScripts/.secrets-ignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ [email protected]
1010
12::34
1111
1:2:3:4:5:6:7:8
1212
1:2:3:4::5
13+
https://u24529037.ct.sendgrid.net
14+
2001:db8:3333:4444:5555:6666:7777:8888
15+
192.168.0.4
16+
2002::1234:abcd:ffff:c0a8:101
17+
2002::1234:abcd:ffff:c0a8:100
1318
1::3:4:5:6:7:8
1419
1abc:2abc::4de:1
1520
10.11.12.13

Packs/CommonScripts/Scripts/AssignToMeButton/CHANGELOG.md

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

Packs/CommonScripts/Scripts/FormatURL/.secrets-ignore

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

Packs/CommonScripts/Scripts/GenerateSummaryReportButton/CHANGELOG.md

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

Packs/CommonScripts/Scripts/IPNetwork/.secrets-ignore

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

Packs/CommonScripts/Scripts/LinkIncidentsButton/CHANGELOG.md

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

Packs/CommonScripts/Scripts/LookupCSV/.secrets-ignore

Whitespace-only changes.

Packs/CommunityCommonScripts/Scripts/isArrayItemInList/IsArrayItemInList.yml renamed to Packs/CommunityCommonScripts/Scripts/isArrayItemInList/isArrayItemInList.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ comment: 'This automation is for comparing array(list) data of context to existi
1010
1111
inputArray: the context array/list data
1212
13-
listName: the XSOAR system list'
13+
listName: the XSOAR system list.'
1414
commonfields:
1515
id: isArrayItemInList
1616
version: -1

Packs/DigitalShadows/Scripts/DsSearchQueryArray/DsSearchQueryArray_test.py

Lines changed: 135 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,139 @@
11
import pytest
2-
from DsSearchQueryTestData import *
2+
3+
TEST_DATA_URL = {
4+
"url": [
5+
"https://http://GermDetectives.com/learn/risk-profiles/IMPERSONATING_DOMAIN",
6+
"http://microsoft365cpmsetup.com", # pylint: disable=W9013
7+
"http://portal-digitalshadows.com.still.valid/learn/risk-profiles/MARKED_DOCUMENT", # pylint: disable=W9013
8+
"https://http://microsoft365cpmsetup.com/triage/alerts/BGWZC",
9+
"https://http://microsoft365cpmsetup.com/api/external/resources/2de38dac-bba5-46c9-9ceb-e0fd72944a11",
10+
"https://http://microsoft365cpmsetup.com/api/external/resources/2de38dac-bba5-46c9-9ceb-e0fd72944a11",
11+
]
12+
}
13+
14+
TEST_DATA_URL_EXPECTED = [
15+
"http://microsoft365cpmsetup.com OR https://http://microsoft365cpmsetup.com/triage/alerts/BGWZC OR " # pylint: disable=W9013
16+
+ "https://http://GermDetectives.com/learn/risk-profiles/IMPERSONATING_DOMAIN OR "
17+
+ "http://portal-digitalshadows.com.still.valid/learn/risk-profiles/MARKED_DOCUMENT", # pylint: disable=W9013
18+
"https://http://microsoft365cpmsetup.com/api/external/resources/2de38dac-bba5-46c9-9ceb-e0fd72944a11",
19+
]
20+
21+
TEST_DATA_URL_SINGLE = {
22+
"url": "https://http://GermDetectives.com/learn/risk-profiles/IMPERSONATING_DOMAIN"
23+
}
24+
TEST_DATA_URL_SINGLE_EXPECTED = (
25+
["https://http://GermDetectives.com/learn/risk-profiles/IMPERSONATING_DOMAIN"]
26+
)
27+
TEST_DATA_URL_SINGLE_FILTER = {
28+
"url": "https://portal-digitalshadows.com/learn/risk-profiles/MARKED_DOCUMENT"
29+
}
30+
31+
TEST_DATA_IP = {
32+
"ip": [
33+
"192.168.0.1",
34+
"0.0.0.0",
35+
"1.1.1.1",
36+
"123.456.2.124"
37+
]
38+
}
39+
TEST_DATA_IP_EXPECTED = ["192.168.0.1 OR 1.1.1.1 OR 123.456.2.124"]
40+
41+
TEST_DATA_IP_SINGLE = {
42+
"ip": "192.168.0.1"
43+
}
44+
TEST_DATA_IP_SINGLE_EXPECTED = ["192.168.0.1"]
45+
46+
TEST_DATA_IP_SINGLE_FILTER = {
47+
"ip": "0.0.0.0"
48+
}
49+
50+
TEST_DATA_DOMAIN = {
51+
"domain": [
52+
"GermDetectives.com",
53+
"TutorialFriend.com",
54+
"LessIsFull.com",
55+
"SaveJam.com",
56+
"SaveItDay.com",
57+
"portal-digitalshadows.com.still.valid",
58+
"portal-digitalshadows.com"
59+
]
60+
}
61+
TEST_DATA_DOMAIN_EXPECTED = [
62+
"GermDetectives.com OR TutorialFriend.com OR LessIsFull.com OR SaveJam.com OR SaveItDay.com OR "
63+
+ "portal-digitalshadows.com.still.valid"
64+
]
65+
66+
TEST_DATA_DOMAIN_SINGLE = {
67+
"domain": "GermDetectives.com"
68+
}
69+
TEST_DATA_DOMAIN_SINGLE_EXPECTED = ["GermDetectives.com"]
70+
TEST_DATA_DOMAIN_FILTER = {
71+
"domain": "portal-digitalshadows.com"
72+
}
73+
74+
TEST_DATA_FILE_SHA1 = {
75+
"sha1": [
76+
"fd340743293eae593da4796e868ce57dfabf4147",
77+
"fd340743293eae593da4796e868ce57dfabf4147",
78+
"4eeff478822995573f4a5c45e746f01f93e23f28"
79+
]
80+
}
81+
TEST_DATA_FILE_SHA1_EXPECTED = [
82+
"fd340743293eae593da4796e868ce57dfabf4147 OR fd340743293eae593da4796e868ce57dfabf4147 OR "
83+
+ "4eeff478822995573f4a5c45e746f01f93e23f28"
84+
]
85+
86+
TEST_DATA_FILE_SHA1_SINGLE = {
87+
"sha1": "fd340743293eae593da4796e868ce57dfabf4147"
88+
}
89+
TEST_DATA_FILE_SHA1_SINGLE_EXPECTED = ["fd340743293eae593da4796e868ce57dfabf4147"]
90+
91+
TEST_DATA_FILE_SHA256 = {
92+
"sha256": [
93+
"57b0ed216fac388b6d99774d256fa5542d32cfdfe72a45b32fd7932ec154731d",
94+
"8dca20e35098837cc003b54f17688386aabd9a5640884f5e4397e755ca8bc606"
95+
],
96+
"md5": "57b0ed216fac388b6d99774d256fa5542d32cfdfe72a45b32fd7932ec154731d"
97+
}
98+
TEST_DATA_FILE_SHA256_EXPECTED = [
99+
"57b0ed216fac388b6d99774d256fa5542d32cfdfe72a45b32fd7932ec154731d OR "
100+
+ "8dca20e35098837cc003b54f17688386aabd9a5640884f5e4397e755ca8bc606"
101+
]
102+
103+
TEST_DATA_FILE_SHA256_SINGLE = {
104+
"sha256": "57b0ed216fac388b6d99774d256fa5542d32cfdfe72a45b32fd7932ec154731d"
105+
}
106+
TEST_DATA_FILE_SHA256_SINGLE_EXPECTED = [
107+
"57b0ed216fac388b6d99774d256fa5542d32cfdfe72a45b32fd7932ec154731d"
108+
]
109+
110+
TEST_DATA_FILE_MD5 = {
111+
"sha1": "fd8df0f90ab838325b4e442322b7343e",
112+
"md5": [
113+
"fd8df0f90ab838325b4e442322b7343e",
114+
"5f09950f7c75828ed0ea296853b518c1"
115+
]
116+
}
117+
TEST_DATA_FILE_MD5_EXPECTED = [
118+
"fd8df0f90ab838325b4e442322b7343e OR 5f09950f7c75828ed0ea296853b518c1"
119+
]
120+
121+
TEST_DATA_FILE_MD5_SINGLE = {
122+
"md5": "fd8df0f90ab838325b4e442322b7343e"
123+
}
124+
TEST_DATA_FILE_MD5_SINGLE_EXPECTED = ["fd8df0f90ab838325b4e442322b7343e"]
125+
126+
TEST_DATA_CVE = {
127+
"cve": [
128+
"CVE-2012-2311",
129+
"CVE-2012-1823",
130+
"CVE-2022-34491"
131+
]
132+
}
133+
TEST_DATA_CVE_EXPECTED = ["CVE-2012-2311 OR CVE-2012-1823 OR CVE-2022-34491"]
134+
135+
TEST_DATA_CVE_SINGLE = {"cve": "CVE-2012-2311"}
136+
TEST_DATA_CVE_SINGLE_EXPECTED = ["CVE-2012-2311"]
3137

4138

5139
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)