forked from Azure/Azure-Sentinel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
407 changed files
with
33,172 additions
and
9,403 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
name: Solution Integration Testing | ||
run-name: Running Solution Integration Testing on ${{ github.ref_name }} | ||
|
||
on: | ||
pull_request_target: | ||
types: [opened, edited, reopened, synchronize] | ||
branches: | ||
- master | ||
paths: | ||
- 'Solutions/**/Package/mainTemplate.json' | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
Run-solutionIntegration-Testimio: | ||
name: Solution Integration Testing - Testim.io | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout pull request branch | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
# persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. | ||
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. | ||
|
||
- name: Setup git config | ||
run: | | ||
git config --local user.name "github-actions[bot]" | ||
git config --local user.email "<>" | ||
- name: Azure Login to Dev Account | ||
uses: azure/login@a65d910e8af852a8061c627c456678983e180302 | ||
with: | ||
client-id: ${{ secrets.AZURE_SOLUTIONTESTING_DEV_CLIENT_ID }} | ||
tenant-id: ${{ secrets.AZURE_SOLUTIONTESTING_DEV_TENANT_ID }} | ||
allow-no-subscriptions: true | ||
|
||
- name: Whitelist Runner IP | ||
run: | | ||
agentIP=$(curl -s https://api.ipify.org/) | ||
az keyvault network-rule add --name e2e-solIntegTesting-KV --ip-address $agentIP --query properties.networkAcls.ipRules | ||
- name: Delete Scripts from branch | ||
run: | | ||
if [ -f "./evaluateAndExtractTemplate.py" ]; then rm ./evaluateAndExtractTemplate.py; fi | ||
if [ -f "./runUITests.py" ]; then rm ./runUITests.py; fi | ||
if [ -f "./requirements.txt" ]; then rm ./requirements.txt; fi | ||
if [ -f "./config.json" ]; then rm ./config.json; fi | ||
- name: Download files from ADO | ||
run: | | ||
curl -u :$(az account get-access-token -o tsv --query accessToken) \ | ||
-o evaluateAndExtractTemplate.py \ | ||
"https://dev.azure.com/msazure/One/_apis/git/repositories/Sentinel-CATUtilities/items?path=/SolutionIntegrationTesting/.scripts/evaluateAndExtractTemplate.py&api-version=6.0" \ | ||
-o runUITests.py \ | ||
"https://dev.azure.com/msazure/One/_apis/git/repositories/Sentinel-CATUtilities/items?path=/SolutionIntegrationTesting/.scripts/runUITests.py&api-version=6.0" \ | ||
-o requirements.txt \ | ||
"https://dev.azure.com/msazure/One/_apis/git/repositories/Sentinel-CATUtilities/items?path=/SolutionIntegrationTesting/requirements.txt&api-version=6.0" \ | ||
-o config.json \ | ||
"https://dev.azure.com/msazure/One/_apis/git/repositories/Sentinel-CATUtilities/items?path=/SolutionIntegrationTesting/config.json&api-version=6.0" | ||
- name: Setup Python Environment | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Get Test Tenant Client ID and Tenant ID | ||
run: | | ||
echo "AZURE_TEST_CLIENT_ID=$(az keyvault secret show --name ClientId-Test --vault-name e2e-solIntegTesting-KV --query value -o tsv)" >> $GITHUB_ENV | ||
echo "AZURE_TEST_TENANT_ID=$(az keyvault secret show --name TenantId-Test --vault-name e2e-solIntegTesting-KV --query value -o tsv)" >> $GITHUB_ENV | ||
- name: Azure Login to Test Tenant Account | ||
uses: azure/login@a65d910e8af852a8061c627c456678983e180302 | ||
with: | ||
client-id: ${{ env.AZURE_TEST_CLIENT_ID }} | ||
tenant-id: ${{ env.AZURE_TEST_TENANT_ID }} | ||
allow-no-subscriptions: true | ||
|
||
- name: Get Test Tenant Subscription | ||
run: | | ||
echo "TEST_TENANT_SUBSCRIPTION_ID=$(az account show --query id -o tsv)" >> $GITHUB_ENV | ||
- name: Deploy Solution to Workspace, Evaluate and Extract Template Files | ||
continue-on-error: true # Continues even after failing so as to not block the PR | ||
run: | | ||
filePath="evaluateAndExtractTemplate.py" | ||
python $filePath | ||
- name: Azure Login to Dev Account | ||
uses: azure/login@a65d910e8af852a8061c627c456678983e180302 | ||
if: '!cancelled()' | ||
with: | ||
client-id: ${{ secrets.AZURE_SOLUTIONTESTING_DEV_CLIENT_ID }} | ||
tenant-id: ${{ secrets.AZURE_SOLUTIONTESTING_DEV_TENANT_ID }} | ||
allow-no-subscriptions: true | ||
|
||
- name: Execute Tests on Testim | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_REPOSITORY: ${{ github.repository }} | ||
PR_NUMBER: ${{ github.event.pull_request.number }} | ||
continue-on-error: true # Continues even after failing so as to not block the PR | ||
run: | | ||
filePath="runUITests.py" | ||
python $filePath | ||
- name: Delist Runner IP | ||
if: '!cancelled()' | ||
run: | | ||
agentIP=$(curl -s https://api.ipify.org/) | ||
az keyvault network-rule remove --name e2e-solIntegTesting-KV --ip-address $agentIP --query properties.networkAcls.ipRules |
53 changes: 53 additions & 0 deletions
53
.script/tests/KqlvalidationsTests/CustomTables/IllumioSyslogAuditEvents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"name": "IllumioSyslogAuditEvents", | ||
"Properties": [ | ||
{ | ||
"name": "TimeGenerated", | ||
"type": "datetime" | ||
}, | ||
{ | ||
"Name": "href", | ||
"Type": "String" | ||
}, | ||
{ | ||
"Name": "pce_fqdn", | ||
"Type": "String" | ||
}, | ||
{ | ||
"Name": "created_by", | ||
"Type": "dynamic" | ||
}, | ||
{ | ||
"Name": "event_type", | ||
"Type": "String" | ||
}, | ||
{ | ||
"Name": "status", | ||
"Type": "String" | ||
}, | ||
{ | ||
"Name": "severity", | ||
"Type": "String" | ||
}, | ||
{ | ||
"Name": "action", | ||
"Type": "dynamic" | ||
}, | ||
{ | ||
"Name": "resource_changes", | ||
"Type": "dynamic" | ||
}, | ||
{ | ||
"Name": "notifications", | ||
"Type": "dynamic" | ||
}, | ||
{ | ||
"Name": "version", | ||
"Type": "Int" | ||
}, | ||
{ | ||
"Name": "Type", | ||
"Type": "String" | ||
} | ||
] | ||
} |
117 changes: 117 additions & 0 deletions
117
.script/tests/KqlvalidationsTests/CustomTables/IllumioSyslogNetworkTrafficEvents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
{ | ||
"name": "IllumioSyslogNetworkTrafficEvents", | ||
"Properties": [ | ||
{ | ||
"name": "TimeGenerated", | ||
"type": "datetime" | ||
}, | ||
{ | ||
"name": "tdms", | ||
"type": "int" | ||
}, | ||
{ | ||
"name": "ddms", | ||
"type": "int" | ||
}, | ||
{ | ||
"name": "pn", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "un", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "sn", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "src_ip", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "dst_ip", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "class", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "proto", | ||
"type": "int" | ||
}, | ||
{ | ||
"name": "dst_port", | ||
"type": "int" | ||
}, | ||
{ | ||
"name": "flow_count", | ||
"type": "int" | ||
}, | ||
{ | ||
"name": "dir", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "org_id", | ||
"type": "int" | ||
}, | ||
{ | ||
"name": "state", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "pd_qualifier", | ||
"type": "int" | ||
}, | ||
{ | ||
"name": "pd", | ||
"type": "int" | ||
}, | ||
{ | ||
"name": "src_hostname", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "src_href", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "dst_hostname", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "dst_href", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "network", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "src_labels", | ||
"type": "dynamic" | ||
}, | ||
{ | ||
"name": "dst_labels", | ||
"type": "dynamic" | ||
}, | ||
{ | ||
"name": "interval_sec", | ||
"type": "int" | ||
}, | ||
{ | ||
"name": "pce_fqdn", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "version", | ||
"type": "int" | ||
}, | ||
{ | ||
"Name": "Type", | ||
"Type": "String" | ||
} | ||
] | ||
} |
33 changes: 33 additions & 0 deletions
33
.script/tests/KqlvalidationsTests/CustomTables/Ipinfo_ASN_CL.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"Name": "Ipinfo_ASN_CL", | ||
"Properties": [ | ||
{ | ||
"Name": "TimeGenerated", | ||
"Type": "datetime" | ||
}, | ||
{ | ||
"Name": "asn", | ||
"Type": "String" | ||
}, | ||
{ | ||
"Name": "name", | ||
"Type": "String" | ||
}, | ||
{ | ||
"Name": "domain", | ||
"Type": "String" | ||
}, | ||
{ | ||
"Name": "route", | ||
"Type": "String" | ||
}, | ||
{ | ||
"Name": "asn_type", | ||
"Type": "String" | ||
}, | ||
{ | ||
"Name": "range", | ||
"Type": "String" | ||
} | ||
] | ||
} |
37 changes: 37 additions & 0 deletions
37
.script/tests/KqlvalidationsTests/CustomTables/Ipinfo_Abuse_CL.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"Name": "Ipinfo_Abuse_CL", | ||
"Properties": [ | ||
{ | ||
"Name": "TimeGenerated", | ||
"Type": "datetime" | ||
}, | ||
{ | ||
"Name": "name", | ||
"Type": "String" | ||
}, | ||
{ | ||
"Name": "email", | ||
"Type": "String" | ||
}, | ||
{ | ||
"Name": "address", | ||
"Type": "String" | ||
}, | ||
{ | ||
"Name": "country", | ||
"Type": "String" | ||
}, | ||
{ | ||
"Name": "phone", | ||
"Type": "String" | ||
}, | ||
{ | ||
"Name": "network", | ||
"Type": "String" | ||
}, | ||
{ | ||
"Name": "range", | ||
"Type": "String" | ||
} | ||
] | ||
} |
Oops, something went wrong.