Skip to content

Commit def340e

Browse files
dicolanltianderturpijnwyunchi-ms
authored
New module for Security insights (Azure Sentinel) Resource Provider (#13607)
* v1 * Actions, AlertRules * Bookmarks... start incident comments * more updates * Incident Comments * major updates * fixes * more fixes * GetAlertRuleTemplates updates * Update Az.SecurityInsights.psd1 * v1 tests * tests..... * Revert "tests....." This reverts commit 4dddc6c. * Revert "Revert "tests....."" This reverts commit 7904f59. * test v2 * tests complete... starting bug fixes * bugs * Update NewBookmarks.cs Removed redundant "}" * bugs * Update NewBookmarks.cs Fixed curly bracket * updates * updates after testing * bugs.... * fix input object * Added tests for input objects * Generate Help * added examples to help files based on build failure * add online link to help files * Bug Fixes fixes for help and static analysis * Moved Set- Commands to Update- * bug fix to help docs * Updates per feedback #13607 (comment) * Update Dns.sln * Update Media.sln * Update Media.sln * Update Media.sln * Fixes per comments * remove dependacy on logic app module * Add exceptions for static analysis * Update SignatureIssues.csv * Update SignatureIssues.csv * Update SignatureIssues.csv Co-authored-by: Tiander Turpijn <[email protected]> Co-authored-by: Yunchi Wang <[email protected]>
1 parent a97d1d2 commit def340e

File tree

164 files changed

+21653
-0
lines changed

Some content is hidden

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

164 files changed

+21653
-0
lines changed

documentation/azure-powershell-modules.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ Resource Mover | `Az.ResourceMover`
102102
Resources | `Az.Resources` | [![Resources]][ResourcesGallery]
103103
Search | `Az.Search` | [![Search]][SearchGallery]
104104
Security | `Az.Security` | [![Security]][SecurityGallery]
105+
Sentinel (SecurityInsights) | `Az.SecurityInsights` | [![SecurityInsights]][SecurityInsightsGallery]
105106
Service Bus | `Az.ServiceBus` | [![ServiceBus]][ServiceBusGallery]
106107
Service Fabric | `Az.ServiceFabric` | [![ServiceFabric]][ServiceFabricGallery]
107108
SignalR | `Az.SignalR` | [![SignalR]][SignalRGallery]
@@ -218,6 +219,7 @@ Windows Iot Services | `Az.WindowsIotServices`
218219
[Resources]: https://img.shields.io/powershellgallery/v/Az.Resources.svg?style=flat-square&label=Az.Resources
219220
[Search]: https://img.shields.io/powershellgallery/v/Az.Search.svg?style=flat-square&label=Az.Search
220221
[Security]: https://img.shields.io/powershellgallery/v/Az.Security.svg?style=flat-square&label=Az.Security
222+
[SecurityInsights]: https://img.shields.io/powershellgallery/v/Az.SecurityInsights.svg?style=flat-square&label=Az.SecurityInsights
221223
[ServiceBus]: https://img.shields.io/powershellgallery/v/Az.ServiceBus.svg?style=flat-square&label=Az.ServiceBus
222224
[ServiceFabric]: https://img.shields.io/powershellgallery/v/Az.ServiceFabric.svg?style=flat-square&label=Az.ServiceFabric
223225
[SignalR]: https://img.shields.io/powershellgallery/v/Az.SignalR.svg?style=flat-square&label=Az.SignalR
@@ -332,6 +334,7 @@ Windows Iot Services | `Az.WindowsIotServices`
332334
[ResourcesGallery]: https://www.powershellgallery.com/packages/Az.Resources/
333335
[SearchGallery]: https://www.powershellgallery.com/packages/Az.Search/
334336
[SecurityGallery]: https://www.powershellgallery.com/packages/Az.Security/
337+
[SecurityInsightsGallery]: https://www.powershellgallery.com/packages/Az.SecurityInsights/
335338
[ServiceBusGallery]: https://www.powershellgallery.com/packages/Az.ServiceBus/
336339
[ServiceFabricGallery]: https://www.powershellgallery.com/packages/Az.ServiceFabric/
337340
[SignalRGallery]: https://www.powershellgallery.com/packages/Az.SignalR/
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System.Reflection;
16+
using System.Runtime.CompilerServices;
17+
using System.Runtime.InteropServices;
18+
using Xunit;
19+
20+
// General Information about an assembly is controlled through the following
21+
// set of attributes. Change these attribute values to modify the information
22+
// associated with an assembly.
23+
[assembly: AssemblyTitle("Commands.SecurityInsights.Test")]
24+
[assembly: AssemblyDescription("")]
25+
[assembly: AssemblyConfiguration("")]
26+
[assembly: AssemblyCompany("")]
27+
[assembly: AssemblyProduct("Commands.SecurityInsights.Test")]
28+
[assembly: AssemblyCopyright("Copyright © 2018")]
29+
[assembly: AssemblyTrademark("")]
30+
[assembly: AssemblyCulture("")]
31+
32+
// Setting ComVisible to false makes the types in this assembly not visible
33+
// to COM components. If you need to access a type in this assembly from
34+
// COM, set the ComVisible attribute to true on that type.
35+
[assembly: ComVisible(false)]
36+
37+
// The following GUID is for the ID of the typelib if this project is exposed to COM
38+
[assembly: Guid("CA24A45A-9D2D-4BBD-9F71-EF5599ADAD96")]
39+
40+
// Version information for an assembly consists of the following four values:
41+
//
42+
// Major Version
43+
// Minor Version
44+
// Build Number
45+
// Revision
46+
//
47+
// You can specify all the values or you can default the Build and Revision Numbers
48+
// by using the '*' as shown below:
49+
// [assembly: AssemblyVersion("1.0.*")]
50+
[assembly: AssemblyVersion("1.0.0.0")]
51+
[assembly: AssemblyFileVersion("1.0.0.0")]
52+
[assembly: CollectionBehavior(DisableTestParallelization = true)]
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.Azure.Commands.ScenarioTest;
16+
using Microsoft.Azure.ServiceManagement.Common.Models;
17+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
18+
using Xunit;
19+
20+
namespace Microsoft.Azure.Commands.SecurityInsights.Test.ScenarioTests
21+
{
22+
public class ActionsTests
23+
{
24+
private readonly XunitTracingInterceptor _logger;
25+
26+
public ActionsTests(Xunit.Abstractions.ITestOutputHelper output)
27+
{
28+
_logger = new XunitTracingInterceptor(output);
29+
XunitTracingInterceptor.AddToContext(_logger);
30+
TestExecutionHelpers.SetUpSessionAndProfile();
31+
}
32+
33+
[Fact]
34+
[Trait(Category.AcceptanceType, Category.CheckIn)]
35+
public void ListByAlertRule()
36+
{
37+
TestController.NewInstance.RunPowerShellTest(_logger, "Get-AzSentinelAlertRuleAction-ListByAlertRule");
38+
}
39+
40+
[Fact]
41+
[Trait(Category.AcceptanceType, Category.CheckIn)]
42+
public void GetAction()
43+
{
44+
TestController.NewInstance.RunPowerShellTest(_logger, "Get-AzSentinelAlertRuleAction-GetAction");
45+
}
46+
47+
[Fact]
48+
[Trait(Category.AcceptanceType, Category.CheckIn)]
49+
public void CreateAction()
50+
{
51+
TestController.NewInstance.RunPowerShellTest(_logger, "New-AzSentinelAlertRuleAction-Create");
52+
}
53+
54+
[Fact]
55+
[Trait(Category.AcceptanceType, Category.CheckIn)]
56+
public void UpdateAction()
57+
{
58+
TestController.NewInstance.RunPowerShellTest(_logger, "Update-AzSentinelAlertRuleAction-Update");
59+
}
60+
61+
[Fact]
62+
[Trait(Category.AcceptanceType, Category.CheckIn)]
63+
public void RemoveAction()
64+
{
65+
TestController.NewInstance.RunPowerShellTest(_logger, "Remove-AzSentinelAlertRuleAction-Delete");
66+
}
67+
}
68+
}
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
# ----------------------------------------------------------------------------------
2+
#
3+
# Copyright Microsoft Corporation
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ----------------------------------------------------------------------------------
14+
15+
<#
16+
.SYNOPSIS
17+
List Actions by Alert Rule
18+
#>
19+
function Get-AzSentinelAlertRuleAction-ListByAlertRule
20+
{
21+
$AlertRuleId = "1b64dc0e-4bf6-43c4-a503-52cba30b5c47"
22+
$ActionId = "cd9f21e2-1718-4b8b-871e-b8d59c65f317"
23+
$ActionId2 = "ccef9243-4f96-4ec5-8042-9df44e2df452"
24+
$LogicAppResourceId = "/subscriptions/1c61ccbf-70b3-45a3-a1fb-848ce46d70a6/resourceGroups/ndicola-azsposh/providers/Microsoft.Logic/workflows/Block-AADUser"
25+
$TriggerUri = "https://prod-13.westus.logic.azure.com:443/workflows/826a95b1b84c4ffbaf3af3dd88fe96b5/triggers/When_a_response_to_an_Azure_Sentinel_alert_is_triggered/paths/invoke?api-version=2018-07-01-preview&sp=%2Ftriggers%2FWhen_a_response_to_an_Azure_Sentinel_alert_is_triggered%2Frun&sv=1.0&sig=pK23xWl4uJT4RWs7zopxiP0Z7CpIfCDZEanL-mEyy1E"
26+
$LogicAppResourceId2 = "/subscriptions/1c61ccbf-70b3-45a3-a1fb-848ce46d70a6/resourceGroups/ndicola-azsposh/providers/Microsoft.Logic/workflows/Get-MDATPInvestigationPackage"
27+
$TriggerUri2 = "https://prod-16.westus.logic.azure.com:443/workflows/18c75599cf3742c998d14af0f89cf3b1/triggers/When_a_response_to_an_Azure_Sentinel_alert_is_triggered/paths/invoke?api-version=2018-07-01-preview&sp=%2Ftriggers%2FWhen_a_response_to_an_Azure_Sentinel_alert_is_triggered%2Frun&sv=1.0&sig=rREdJWoN3PNCmhqwMz0KRy8apQDt8DQbZZuvlm1l4Oo"
28+
29+
#Create Alert Rule
30+
$alertRule = New-AzSentinelAlertRule -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId $AlertRuleId -Scheduled -Enabled -DisplayName "PoshModuleTest" -Severity Low -Query "SecurityAlert | take 1" -QueryFrequency (New-TimeSpan -Hours 5) -QueryPeriod (New-TimeSpan -Hours 5) -TriggerThreshold 10
31+
#Create Alert Rule Action
32+
$action = New-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -ActionId $ActionId -AlertRuleId ($alertRule.Name) -LogicAppResourceId $LogicAppResourceId -TriggerUri $TriggerUri
33+
#Create Alert Rule Action
34+
$action2 = New-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -ActionId $ActionId2 -AlertRuleId ($alertRule.Name) -LogicAppResourceId $LogicAppResourceId2 -TriggerUri $TriggerUri2
35+
36+
#Get Alert Rule Actions
37+
$actions = Get-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId ($alertRule.Name)
38+
# Validate
39+
Validate-Actions $actions
40+
41+
#Cleanup
42+
Remove-AzSentinelAlertRule -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId ($alertRule.Name)
43+
}
44+
45+
<#
46+
.SYNOPSIS
47+
Get Action
48+
#>
49+
function Get-AzSentinelAlertRuleAction-GetAction
50+
{
51+
$AlertRuleId = "77def5f7-ab37-4aaf-8711-904d1ab55787"
52+
$ActionId = "27dda575-93f0-4925-92b3-039ef4d89cad"
53+
$LogicAppResourceId = "/subscriptions/1c61ccbf-70b3-45a3-a1fb-848ce46d70a6/resourceGroups/ndicola-azsposh/providers/Microsoft.Logic/workflows/Block-AADUser"
54+
$TriggerUri = "https://prod-13.westus.logic.azure.com:443/workflows/826a95b1b84c4ffbaf3af3dd88fe96b5/triggers/When_a_response_to_an_Azure_Sentinel_alert_is_triggered/paths/invoke?api-version=2018-07-01-preview&sp=%2Ftriggers%2FWhen_a_response_to_an_Azure_Sentinel_alert_is_triggered%2Frun&sv=1.0&sig=pK23xWl4uJT4RWs7zopxiP0Z7CpIfCDZEanL-mEyy1E"
55+
56+
#Create Alert Rule
57+
$alertRule = New-AzSentinelAlertRule -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId $AlertRuleId -Scheduled -Enabled -DisplayName "PoshModuleTest" -Severity Low -Query "SecurityAlert | take 1" -QueryFrequency (New-TimeSpan -Hours 5) -QueryPeriod (New-TimeSpan -Hours 5) -TriggerThreshold 10
58+
#Create Alert Rule Action
59+
$action = New-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId ($alertRule.Name) -ActionId $ActionId -LogicAppResourceId $LogicAppResourceId -TriggerUri $TriggerUri
60+
61+
#Get Alert Rule Action
62+
$action = Get-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId ($alertRule.Name) -ActionId ($action.Name)
63+
# Validate
64+
Validate-Action $action
65+
66+
#Cleanup
67+
Remove-AzSentinelAlertRule -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId ($alertRule.Name)
68+
}
69+
70+
<#
71+
.SYNOPSIS
72+
Create Action
73+
#>
74+
function New-AzSentinelAlertRuleAction-Create
75+
{
76+
$AlertRuleId = "26501c9d-8f07-419d-8bcb-f9aac8ec1a7f"
77+
$ActionId = "10d54e5f-8c03-42fc-b1d9-1bd881535af0"
78+
$LogicAppResourceId = "/subscriptions/1c61ccbf-70b3-45a3-a1fb-848ce46d70a6/resourceGroups/ndicola-azsposh/providers/Microsoft.Logic/workflows/Block-AADUser"
79+
$TriggerUri = "https://prod-13.westus.logic.azure.com:443/workflows/826a95b1b84c4ffbaf3af3dd88fe96b5/triggers/When_a_response_to_an_Azure_Sentinel_alert_is_triggered/paths/invoke?api-version=2018-07-01-preview&sp=%2Ftriggers%2FWhen_a_response_to_an_Azure_Sentinel_alert_is_triggered%2Frun&sv=1.0&sig=pK23xWl4uJT4RWs7zopxiP0Z7CpIfCDZEanL-mEyy1E"
80+
81+
#Create Alert Rule
82+
$alertRule = New-AzSentinelAlertRule -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId $AlertRuleId -Scheduled -Enabled -DisplayName "PoshModuleTest" -Severity Low -Query "SecurityAlert | take 1" -QueryFrequency (New-TimeSpan -Hours 5) -QueryPeriod (New-TimeSpan -Hours 5) -TriggerThreshold 10
83+
#Create Alert Rule Action
84+
$action = New-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId ($alertRule.Name) -ActionId $ActionId -LogicAppResourceId $LogicAppResourceId -TriggerUri $TriggerUri
85+
86+
#Validate
87+
Validate-Action $action
88+
89+
#Cleanup
90+
Remove-AzSentinelAlertRule -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId ($alertRule.Name)
91+
}
92+
93+
<#
94+
.SYNOPSIS
95+
Update Action
96+
#>
97+
function Update-AzSentinelAlertRuleAction-Update
98+
{
99+
$AlertRuleId = "1584e7a3-802c-435b-9178-5720a44be2f3"
100+
$ActionId = "91c2ea2f-f40c-4bef-ab3b-43c09e4a9699"
101+
$LogicAppResourceId = "/subscriptions/1c61ccbf-70b3-45a3-a1fb-848ce46d70a6/resourceGroups/ndicola-azsposh/providers/Microsoft.Logic/workflows/Block-AADUser"
102+
$TriggerUri = "https://prod-13.westus.logic.azure.com:443/workflows/826a95b1b84c4ffbaf3af3dd88fe96b5/triggers/When_a_response_to_an_Azure_Sentinel_alert_is_triggered/paths/invoke?api-version=2018-07-01-preview&sp=%2Ftriggers%2FWhen_a_response_to_an_Azure_Sentinel_alert_is_triggered%2Frun&sv=1.0&sig=pK23xWl4uJT4RWs7zopxiP0Z7CpIfCDZEanL-mEyy1E"
103+
$LogicAppResourceId2 = "/subscriptions/1c61ccbf-70b3-45a3-a1fb-848ce46d70a6/resourceGroups/ndicola-azsposh/providers/Microsoft.Logic/workflows/Get-MDATPInvestigationPackage"
104+
$TriggerUri2 = "https://prod-16.westus.logic.azure.com:443/workflows/18c75599cf3742c998d14af0f89cf3b1/triggers/When_a_response_to_an_Azure_Sentinel_alert_is_triggered/paths/invoke?api-version=2018-07-01-preview&sp=%2Ftriggers%2FWhen_a_response_to_an_Azure_Sentinel_alert_is_triggered%2Frun&sv=1.0&sig=rREdJWoN3PNCmhqwMz0KRy8apQDt8DQbZZuvlm1l4Oo"
105+
106+
#Create Alert Rule
107+
$alertRule = New-AzSentinelAlertRule -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId $AlertRuleId -Scheduled -Enabled -DisplayName "PoshModuleTest" -Severity Low -Query "SecurityAlert | take 1" -QueryFrequency (New-TimeSpan -Hours 5) -QueryPeriod (New-TimeSpan -Hours 5) -TriggerThreshold 10
108+
#Create Alert Rule Action
109+
$action = New-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId ($alertRule.Name) -ActionId $ActionId -LogicAppResourceId $LogicAppResourceId -TriggerUri $TriggerUri
110+
111+
#update action
112+
$action = Update-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId ($alertRule.Name) -ActionId ($action.Name) -LogicAppResourceId $LogicAppResourceId2 -TriggerUri $TriggerUri2
113+
114+
# Validate
115+
Validate-Action $action
116+
117+
#Cleanup
118+
Remove-AzSentinelAlertRule -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId ($alertRule.Name)
119+
}
120+
121+
<#
122+
.SYNOPSIS
123+
Delete Action
124+
#>
125+
function Remove-AzSentinelAlertRuleAction-Delete
126+
{
127+
$AlertRuleId = "d1ae0250-f1d8-4cd2-9806-e2375dd7c4ae"
128+
$ActionId = "4044b6d3-de80-4c37-81f2-46d96dfdd78b"
129+
$LogicAppResourceId = "/subscriptions/1c61ccbf-70b3-45a3-a1fb-848ce46d70a6/resourceGroups/ndicola-azsposh/providers/Microsoft.Logic/workflows/Block-AADUser"
130+
$TriggerUri = "https://prod-13.westus.logic.azure.com:443/workflows/826a95b1b84c4ffbaf3af3dd88fe96b5/triggers/When_a_response_to_an_Azure_Sentinel_alert_is_triggered/paths/invoke?api-version=2018-07-01-preview&sp=%2Ftriggers%2FWhen_a_response_to_an_Azure_Sentinel_alert_is_triggered%2Frun&sv=1.0&sig=pK23xWl4uJT4RWs7zopxiP0Z7CpIfCDZEanL-mEyy1E"
131+
132+
#Create Alert Rule
133+
$alertRule = New-AzSentinelAlertRule -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId $AlertRuleId -Scheduled -Enabled -DisplayName "PoshModuleTest" -Severity Low -Query "SecurityAlert | take 1" -QueryFrequency (New-TimeSpan -Hours 5) -QueryPeriod (New-TimeSpan -Hours 5) -TriggerThreshold 10
134+
#Create Alert Rule Action
135+
$action = New-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId ($alertRule.Name) -ActionId $ActionId -LogicAppResourceId $LogicAppResourceId -TriggerUri $TriggerUri
136+
#delete
137+
Remove-AzSentinelAlertRuleAction -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -ActionId ($action.Name) -AlertRuleId ($alertRule.Name)
138+
# Validate
139+
Validate-Action $action
140+
141+
#Cleanup
142+
Remove-AzSentinelAlertRule -ResourceGroupName (Get-TestResourceGroupName) -WorkspaceName (Get-TestWorkspaceName) -AlertRuleId ($alertRule.Name)
143+
}
144+
145+
<#
146+
.SYNOPSIS
147+
Validates a list of actions
148+
#>
149+
function Validate-Actions
150+
{
151+
param($actions)
152+
153+
Assert-True { $actions.Count -gt 0 }
154+
155+
Foreach($action in $actions)
156+
{
157+
Validate-Action $action
158+
}
159+
}
160+
161+
<#
162+
.SYNOPSIS
163+
Validates a single action
164+
#>
165+
function Validate-Action
166+
{
167+
param($action)
168+
169+
Assert-NotNull $action
170+
}

0 commit comments

Comments
 (0)