Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft usgov support #27025

Merged
merged 84 commits into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from 83 commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
1153a87
CIAC-3854 [Email Communication] Add "Create_Incidents" parameter and …
May 16, 2023
63a4b71
mde gcc support
May 21, 2023
af5cc06
gcc support
May 24, 2023
ea6968b
gcc support
May 28, 2023
c4aa5bd
gcc support
May 28, 2023
1cba3ab
gcc support
May 28, 2023
ad506bb
gcc support
May 28, 2023
e83d436
gcc support
May 28, 2023
6c516d6
gcc support
May 28, 2023
c6fc3ee
gcc support
May 28, 2023
629daf5
Merge branch 'master' into microsoft-usgov-support
kobymeir May 28, 2023
fe8d0ec
gcc support
May 28, 2023
b52aa19
gcc support
May 28, 2023
47bc701
gcc support
May 29, 2023
c31047b
gcc support
May 29, 2023
4be2743
Merge branch 'master' into microsoft-usgov-support
kobymeir May 29, 2023
83b7fc3
gcc support
May 29, 2023
acb4874
enc_key
May 30, 2023
2490a78
Merge branch 'master' into microsoft-usgov-support
kobymeir May 30, 2023
f05671a
fix apt service endpoint
May 30, 2023
fa96f25
fix apt service endpoint and backward compatible arguments parsing
May 30, 2023
c6793c0
fix apt service endpoint and backward compatible arguments parsing
May 30, 2023
69e29e6
Merge branch 'master' into microsoft-usgov-support
kobymeir May 30, 2023
b9eca71
increase coverage
May 30, 2023
df8141d
fix custom name handling
May 30, 2023
b3e4508
Merge branch 'master' into microsoft-usgov-support
kobymeir May 31, 2023
7de889a
fix release notes conflicts
Jun 2, 2023
b827ec6
Merge branch 'master' into microsoft-usgov-support
kobymeir Jun 2, 2023
9b6ba9f
fix release notes conflicts
Jun 2, 2023
553aa71
fix release notes conflicts
Jun 2, 2023
38d9ec0
Merge branch 'master' into microsoft-usgov-support
kobymeir Jun 4, 2023
828d06a
fix release notes conflicts
Jun 4, 2023
a53584b
Merge branch 'master' into microsoft-usgov-support
kobymeir Jun 4, 2023
96de566
fix release notes conflicts
Jun 4, 2023
8f1c53b
fix client secret
Jun 5, 2023
f208c4a
changed order yml
michal-dagan Jun 5, 2023
86c60a6
fix integration instance
Jun 5, 2023
f844567
fix integration instance
Jun 5, 2023
ecbf1b4
fix integration instance
Jun 5, 2023
629a668
Merge branch 'master' into microsoft-usgov-support
kobymeir Jun 5, 2023
60cc808
fix ruff
Jun 5, 2023
efb1923
fix ruff
Jun 5, 2023
eba3e5f
Merge branch 'master' into microsoft-usgov-support
kobymeir Jun 5, 2023
c65f98a
Merge branch 'master' into microsoft-usgov-support
kobymeir Jun 5, 2023
15b0844
Merge branch 'master' into microsoft-usgov-support
kobymeir Jun 5, 2023
314a82c
sorting order for azure cloud
Jun 6, 2023
9d662d6
sorting order for azure cloud
Jun 6, 2023
ed27c1e
sorting order for azure cloud
Jun 6, 2023
550095c
typo
Jun 7, 2023
5860586
Merge branch 'master' into microsoft-usgov-support
kobymeir Jun 7, 2023
5c30997
Apply suggestions from code review
kobymeir Jun 14, 2023
ebd6b88
Apply suggestions from code review
kobymeir Jun 14, 2023
e62524f
Apply suggestions from code review
kobymeir Jun 14, 2023
22822ef
Apply suggestions from code review
kobymeir Jun 14, 2023
667ea6d
Merge branch 'master' into microsoft-usgov-support
kobymeir Jun 14, 2023
5e4769a
Nightly build XSIAM - search & install packs retry mechanism is broken.
Jun 14, 2023
9824968
Nightly build XSIAM - search & install packs retry mechanism is broken.
Jun 14, 2023
dc3b89b
Apply suggestions from code review
kobymeir Jun 15, 2023
03bd2fb
CIAC-6390 Microsoft Defender for Applications (MCAS/MDA)
Jun 15, 2023
d5b5ae7
Merged master into current branch.
Jun 15, 2023
b1ce538
Bump pack from version MicrosoftDefenderAdvancedThreatProtection to 1…
Jun 15, 2023
fdf41c4
xsoar linter errors
Jun 15, 2023
20c3386
type 15 can be null
Jun 18, 2023
f4b7b0a
Merge branch 'master' into microsoft-usgov-support
kobymeir Jun 18, 2023
a9fa123
rn
Jun 18, 2023
35f8d98
rn
Jun 18, 2023
4689e06
Merged master into current branch.
Jun 18, 2023
d3cbded
Bump pack from version MicrosoftDefenderAdvancedThreatProtection to 1…
Jun 18, 2023
eb1cbdf
Update Packs/AzureKeyVault/Integrations/AzureKeyVault/AzureKeyVault.py
kobymeir Jun 19, 2023
d25c429
Update Packs/MicrosoftDefenderAdvancedThreatProtection/Integrations/M…
kobymeir Jun 19, 2023
f67e7d6
mde
Jun 19, 2023
257f17d
Merge branch 'master' into microsoft-usgov-support
kobymeir Jun 19, 2023
b1b2c87
mde
Jun 19, 2023
18411a0
mde
Jun 19, 2023
de48940
mde
Jun 19, 2023
5b7d663
pr fixes with Michal
Jun 19, 2023
1bfe46a
Apply suggestions from code review
kobymeir Jun 19, 2023
c8184eb
pr fixes with Michal
Jun 19, 2023
b5b7563
Merge branch 'master' into microsoft-usgov-support
kobymeir Jun 20, 2023
78f5600
Merge branch 'master' into microsoft-usgov-support
kobymeir Jun 20, 2023
31411a9
pr fixes with Michal and Tal
Jun 20, 2023
10c945b
Apply suggestions from code review
kobymeir Jun 20, 2023
dd69a9e
Apply suggestions from code review
kobymeir Jun 20, 2023
2c4f4b5
pr fixes with Michal and Tal
Jun 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion Packs/ApiModules/.secrets-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -1766,4 +1766,11 @@ dummy2@gmail.com
dummy3@gmail.com
dummy4@gmail.com
dummy5@gmail.com
user1@dummy.com
user1@dummy.com
https://gallery.azure.com
https://management.core.windows.net
https://portal.azure.cn
https://portal.azure.com
https://portal.azure.us
https://vault.azure.cn
https://vault.azure.net
603 changes: 580 additions & 23 deletions Packs/ApiModules/Scripts/MicrosoftApiModule/MicrosoftApiModule.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ system: true
scripttarget: 0
dependson: {}
timeout: 0s
dockerimage: demisto/crypto:1.0.0.52480
dockerimage: demisto/crypto:1.0.0.61689
fromversion: 5.0.0
tests:
- No test
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,8 @@ def test_page_not_found_error(mocker):
mocker.patch.object(BaseClient, '_http_request', return_value=error_404)
mocker.patch.object(client, 'get_access_token')

try:
with pytest.raises(NotFoundError):
client.http_request()
except Exception as e: # Validate that a `NotFoundError` was raised
assert type(e).__name__ == 'NotFoundError'


def test_epoch_seconds(mocker):
Expand Down Expand Up @@ -394,8 +392,8 @@ def test_self_deployed_multi_resource(requests_mock, resource):
assert client.resource_to_access_token[resource] == TOKEN


@pytest.mark.parametrize('endpoint', ['com', 'gcc-high', 'dod', 'de', 'cn'])
def test_national_endpoints(mocker, endpoint):
@pytest.mark.parametrize('azure_cloud_name', ['com', 'gcc', 'gcc-high', 'dod', 'de', 'cn'])
def test_national_endpoints(mocker, azure_cloud_name):
"""
Given:
self-deployed client
Expand All @@ -408,14 +406,14 @@ def test_national_endpoints(mocker, endpoint):
auth_id = f'{AUTH_ID}@{TOKEN_URL}'
enc_key = ENC_KEY
app_name = APP_NAME
base_url = BASE_URL
ok_codes = OK_CODES
azure_cloud = AZURE_CLOUDS[azure_cloud_name]
client = MicrosoftClient(self_deployed=True, auth_id=auth_id, enc_key=enc_key, app_name=app_name,
tenant_id=tenant_id, base_url=base_url, verify=True, proxy=False, ok_codes=ok_codes,
endpoint=endpoint)
tenant_id=tenant_id, verify=True, proxy=False, ok_codes=ok_codes,
azure_cloud=azure_cloud)

assert client.azure_ad_endpoint == TOKEN_RETRIEVAL_ENDPOINTS[endpoint]
assert client.scope == f'{GRAPH_ENDPOINTS[endpoint]}/.default'
assert client.azure_ad_endpoint == TOKEN_RETRIEVAL_ENDPOINTS[client.azure_cloud.abbreviation]
assert client.scope == f'{GRAPH_ENDPOINTS[client.azure_cloud.abbreviation]}/.default'


def test_retry_on_rate_limit(requests_mock, mocker):
Expand Down Expand Up @@ -483,11 +481,8 @@ def test_fail_on_retry_on_rate_limit(requests_mock, mocker):
mocker.patch.object(sys, 'exit')
mocker.patch.object(demisto, 'callingContext', {'context': {'ExecutedCommands': [{'moduleBrand': 'msgraph'}]}})

try:
with pytest.raises(DemistoException, match=r'Rate limit reached!'):
client.http_request(method='GET', url_suffix='test_id')
assert False
except DemistoException as err:
assert 'Rate limit reached!' in err.args[0]['content']


def test_rate_limit_when_retry_is_false(requests_mock):
Expand All @@ -510,11 +505,8 @@ def test_rate_limit_when_retry_is_false(requests_mock):
json={'content': "Rate limit reached!"}
)

try:
with pytest.raises(DemistoException, match="Error in API call \[429\]"):
client.http_request(method='GET', url_suffix='test_id')
assert False
except DemistoException as err:
assert 'Error in API call [429]' in err.args[0]


@pytest.mark.parametrize('response, result', [
Expand Down Expand Up @@ -556,13 +548,11 @@ def test_general_error_metrics(requests_mock, mocker):
mocker.patch.object(demisto, 'command', return_value='testing_command')
mocker.patch.object(demisto, 'results')

try:
with pytest.raises(DemistoException):
client.http_request(method='GET', url_suffix='test_id')
assert False
except DemistoException:
metric_results = demisto.results.call_args_list[0][0][0]
assert metric_results.get('Contents') == 'Metrics reported successfully.'
assert metric_results.get('APIExecutionMetrics') == [{'Type': 'GeneralError', 'APICallsCount': 1}]
metric_results = demisto.results.call_args_list[0][0][0]
assert metric_results.get('Contents') == 'Metrics reported successfully.'
assert metric_results.get('APIExecutionMetrics') == [{'Type': 'GeneralError', 'APICallsCount': 1}]


@pytest.mark.parametrize(argnames='client_id', argvalues=['test_client_id', None])
Expand Down
76 changes: 76 additions & 0 deletions Packs/AzureKeyVault/.pack-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,79 @@ ignore=IM111

[file:AzureKeyVault.yml]
ignore=IN145

[known_words]
tkatzir marked this conversation as resolved.
Show resolved Hide resolved
AQAB
Azur
Boolean
CN
D
Encipherment
Endpoints
Issuers
K
Purgeable
Rbac
URLs
UTC
VM
Vaul
XXX
XXXX
XXXXX
XXXXXX
aa
australiacentral
australiaeast
australiasoutheast
br
brazilsouth
canadacentral
canadaeast
centralindia
centralus
deleteissuers
deletesas
eastasia
eastus
ekus
exportable
francecentral
germanywestcentral
getissuers
getsas
gt
ifica
japaneast
japanwest
jioindiawest
koreacentral
kty
listissuers
listsas
managecontacts
manageissuers
nbf
northcentralus
northeurope
norwayeast
readonly
regeneratekey
setissuers
setsas
southafricanorth
southcentralus
southeastasia
southindia
switzerlandnorth
t
uaenorth
uksouth
ukwest
westcentralus
westeurope
westindia
westus
x
GCC
n
9 changes: 8 additions & 1 deletion Packs/AzureKeyVault/.secrets-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,11 @@ https://xsoar-test-285.vault.azure.net
"https://xsoar-test-265.vault.azure.net
1.3.6.1
5.5.7.3
https://portal.azure.com
https://portal.azure.com
https://gallery.azure.com
https://management.core.windows.net
https://portal.azure.cn
https://portal.azure.com
https://portal.azure.us
https://vault.azure.cn
https://vault.azure.net