Skip to content

Commit 858186c

Browse files
author
SDKAuto
committed
CodeGen from PR 12123 in Azure/azure-rest-api-specs
Merge d368d09fff141fab0e92b71c7885be1cccb4c7ec into 97bf9c2
1 parent 958d9f2 commit 858186c

Some content is hidden

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

55 files changed

+20487
-0
lines changed

src/securityinsight/HISTORY.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.. :changelog:
2+
3+
Release History
4+
===============
5+
6+
0.1.0
7+
++++++
8+
* Initial release.

src/securityinsight/README.md

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
# Azure CLI sentinel Extension #
2+
This is the extension for sentinel
3+
4+
### How to use ###
5+
Install this extension using the below CLI command
6+
```
7+
az extension add --name sentinel
8+
```
9+
10+
### Included Features ###
11+
#### sentinel alert-rule ####
12+
##### Create #####
13+
```
14+
az sentinel alert-rule create --etag "\\"0300bf09-0000-0000-0000-5c37296e0000\\"" \
15+
--logic-app-resource-id "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.Logic/workflows/MyAlerts" \
16+
--trigger-uri "https://prod-31.northcentralus.logic.azure.com:443/workflows/cd3765391efd48549fd7681ded1d48d7/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=signature" \
17+
--action-id "912bec42-cb66-4c03-ac63-1761b6898c3e" --resource-group "myRg" \
18+
--rule-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --workspace-name "myWorkspace"
19+
```
20+
##### Show #####
21+
```
22+
az sentinel alert-rule show --resource-group "myRg" --rule-id "myFirstFusionRule" --workspace-name "myWorkspace"
23+
```
24+
##### Show #####
25+
```
26+
az sentinel alert-rule show --resource-group "myRg" --rule-id "microsoftSecurityIncidentCreationRuleExample" \
27+
--workspace-name "myWorkspace"
28+
```
29+
##### Show #####
30+
```
31+
az sentinel alert-rule show --resource-group "myRg" --rule-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" \
32+
--workspace-name "myWorkspace"
33+
```
34+
##### List #####
35+
```
36+
az sentinel alert-rule list --resource-group "myRg" --workspace-name "myWorkspace"
37+
```
38+
##### Get-action #####
39+
```
40+
az sentinel alert-rule get-action --action-id "912bec42-cb66-4c03-ac63-1761b6898c3e" --resource-group "myRg" \
41+
--rule-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --workspace-name "myWorkspace"
42+
```
43+
##### Delete #####
44+
```
45+
az sentinel alert-rule delete --action-id "912bec42-cb66-4c03-ac63-1761b6898c3e" --resource-group "myRg" \
46+
--rule-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --workspace-name "myWorkspace"
47+
```
48+
#### sentinel action ####
49+
##### List #####
50+
```
51+
az sentinel action list --resource-group "myRg" --rule-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" \
52+
--workspace-name "myWorkspace"
53+
```
54+
#### sentinel alert-rule-template ####
55+
##### List #####
56+
```
57+
az sentinel alert-rule-template list --resource-group "myRg" --workspace-name "myWorkspace"
58+
```
59+
##### Show #####
60+
```
61+
az sentinel alert-rule-template show --alert-rule-template-id "65360bb0-8986-4ade-a89d-af3cf44d28aa" \
62+
--resource-group "myRg" --workspace-name "myWorkspace"
63+
```
64+
#### sentinel bookmark ####
65+
##### Create #####
66+
```
67+
az sentinel bookmark create --etag "\\"0300bf09-0000-0000-0000-5c37296e0000\\"" --created "2019-01-01T13:15:30Z" \
68+
--display-name "My bookmark" --labels "Tag1" --labels "Tag2" --notes "Found a suspicious activity" \
69+
--query "SecurityEvent | where TimeGenerated > ago(1d) and TimeGenerated < ago(2d)" \
70+
--query-result "Security Event query result" --updated "2019-01-01T13:15:30Z" \
71+
--bookmark-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --resource-group "myRg" --workspace-name "myWorkspace"
72+
```
73+
##### Show #####
74+
```
75+
az sentinel bookmark show --bookmark-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --resource-group "myRg" \
76+
--workspace-name "myWorkspace"
77+
```
78+
##### List #####
79+
```
80+
az sentinel bookmark list --resource-group "myRg" --workspace-name "myWorkspace"
81+
```
82+
##### Delete #####
83+
```
84+
az sentinel bookmark delete --bookmark-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --resource-group "myRg" \
85+
--workspace-name "myWorkspace"
86+
```
87+
#### sentinel data-connector ####
88+
##### Create #####
89+
```
90+
az sentinel data-connector create \
91+
--office-data-connector etag="\\"0300bf09-0000-0000-0000-5c37296e0000\\"" tenant-id="2070ecc9-b4d5-4ae4-adaa-936fa1954fa8" \
92+
--data-connector-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --resource-group "myRg" --workspace-name "myWorkspace"
93+
```
94+
##### Show #####
95+
```
96+
az sentinel data-connector show --data-connector-id "763f9fa1-c2d3-4fa2-93e9-bccd4899aa12" --resource-group "myRg" \
97+
--workspace-name "myWorkspace"
98+
```
99+
##### Show #####
100+
```
101+
az sentinel data-connector show --data-connector-id "b96d014d-b5c2-4a01-9aba-a8058f629d42" --resource-group "myRg" \
102+
--workspace-name "myWorkspace"
103+
```
104+
##### Show #####
105+
```
106+
az sentinel data-connector show --data-connector-id "06b3ccb8-1384-4bcc-aec7-852f6d57161b" --resource-group "myRg" \
107+
--workspace-name "myWorkspace"
108+
```
109+
##### Show #####
110+
```
111+
az sentinel data-connector show --data-connector-id "c345bf40-8509-4ed2-b947-50cb773aaf04" --resource-group "myRg" \
112+
--workspace-name "myWorkspace"
113+
```
114+
##### Show #####
115+
```
116+
az sentinel data-connector show --data-connector-id "f0cd27d2-5f03-4c06-ba31-d2dc82dcb51d" --resource-group "myRg" \
117+
--workspace-name "myWorkspace"
118+
```
119+
##### Show #####
120+
```
121+
az sentinel data-connector show --data-connector-id "07e42cb3-e658-4e90-801c-efa0f29d3d44" --resource-group "myRg" \
122+
--workspace-name "myWorkspace"
123+
```
124+
##### Show #####
125+
```
126+
az sentinel data-connector show --data-connector-id "c345bf40-8509-4ed2-b947-50cb773aaf04" --resource-group "myRg" \
127+
--workspace-name "myWorkspace"
128+
```
129+
##### Show #####
130+
```
131+
az sentinel data-connector show --data-connector-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --resource-group "myRg" \
132+
--workspace-name "myWorkspace"
133+
```
134+
##### List #####
135+
```
136+
az sentinel data-connector list --resource-group "myRg" --workspace-name "myWorkspace"
137+
```
138+
##### Delete #####
139+
```
140+
az sentinel data-connector delete --data-connector-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --resource-group "myRg" \
141+
--workspace-name "myWorkspace"
142+
```
143+
#### sentinel incident ####
144+
##### Create #####
145+
```
146+
az sentinel incident create --etag "\\"0300bf09-0000-0000-0000-5c37296e0000\\"" \
147+
--description "This is a demo incident" --classification "FalsePositive" \
148+
--classification-comment "Not a malicious activity" --classification-reason "IncorrectAlertLogic" \
149+
--first-activity-time-utc "2019-01-01T13:00:30Z" --last-activity-time-utc "2019-01-01T13:05:30Z" \
150+
--owner object-id="2046feea-040d-4a46-9e2b-91c2941bfa70" --severity "High" --status "Closed" --title "My incident" \
151+
--incident-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --resource-group "myRg" --workspace-name "myWorkspace"
152+
```
153+
##### Show #####
154+
```
155+
az sentinel incident show --incident-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --resource-group "myRg" \
156+
--workspace-name "myWorkspace"
157+
```
158+
##### List #####
159+
```
160+
az sentinel incident list --orderby "properties/createdTimeUtc desc" --top 1 --resource-group "myRg" \
161+
--workspace-name "myWorkspace"
162+
```
163+
##### Delete #####
164+
```
165+
az sentinel incident delete --incident-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --resource-group "myRg" \
166+
--workspace-name "myWorkspace"
167+
```
168+
#### sentinel incident-comment ####
169+
##### Create #####
170+
```
171+
az sentinel incident-comment create --message "Some message" \
172+
--incident-comment-id "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014" --incident-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" \
173+
--resource-group "myRg" --workspace-name "myWorkspace"
174+
```
175+
##### Show #####
176+
```
177+
az sentinel incident-comment show --incident-comment-id "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014" \
178+
--incident-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --resource-group "myRg" --workspace-name "myWorkspace"
179+
```
180+
##### List #####
181+
```
182+
az sentinel incident-comment list --incident-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --resource-group "myRg" \
183+
--workspace-name "myWorkspace"
184+
```
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
10+
11+
from azure.cli.core import AzCommandsLoader
12+
from azext_sentinel.generated._help import helps # pylint: disable=unused-import
13+
try:
14+
from azext_sentinel.manual._help import helps # pylint: disable=reimported
15+
except ImportError:
16+
pass
17+
18+
19+
class SecurityInsightsCommandsLoader(AzCommandsLoader):
20+
21+
def __init__(self, cli_ctx=None):
22+
from azure.cli.core.commands import CliCommandType
23+
from azext_sentinel.generated._client_factory import cf_sentinel_cl
24+
sentinel_custom = CliCommandType(
25+
operations_tmpl='azext_sentinel.custom#{}',
26+
client_factory=cf_sentinel_cl)
27+
parent = super(SecurityInsightsCommandsLoader, self)
28+
parent.__init__(cli_ctx=cli_ctx, custom_command_type=sentinel_custom)
29+
30+
def load_command_table(self, args):
31+
from azext_sentinel.generated.commands import load_command_table
32+
load_command_table(self, args)
33+
try:
34+
from azext_sentinel.manual.commands import load_command_table as load_command_table_manual
35+
load_command_table_manual(self, args)
36+
except ImportError:
37+
pass
38+
return self.command_table
39+
40+
def load_arguments(self, command):
41+
from azext_sentinel.generated._params import load_arguments
42+
load_arguments(self, command)
43+
try:
44+
from azext_sentinel.manual._params import load_arguments as load_arguments_manual
45+
load_arguments_manual(self, command)
46+
except ImportError:
47+
pass
48+
49+
50+
COMMAND_LOADER_CLS = SecurityInsightsCommandsLoader
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
10+
# pylint: disable=wildcard-import
11+
# pylint: disable=unused-wildcard-import
12+
13+
from .generated.action import * # noqa: F403
14+
try:
15+
from .manual.action import * # noqa: F403
16+
except ImportError:
17+
pass
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"azext.isExperimental": true,
3+
"azext.minCliCoreVersion": "2.11.0"
4+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
10+
# pylint: disable=wildcard-import
11+
# pylint: disable=unused-wildcard-import
12+
13+
from .generated.custom import * # noqa: F403
14+
try:
15+
from .manual.custom import * # noqa: F403
16+
except ImportError:
17+
pass
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
10+
11+
12+
def cf_sentinel_cl(cli_ctx, *_):
13+
from azure.cli.core.commands.client_factory import get_mgmt_service_client
14+
from ..vendored_sdks.securityinsight import SecurityInsights
15+
return get_mgmt_service_client(cli_ctx,
16+
SecurityInsights)
17+
18+
19+
def cf_alert_rule(cli_ctx, *_):
20+
return cf_sentinel_cl(cli_ctx).alert_rule
21+
22+
23+
def cf_action(cli_ctx, *_):
24+
return cf_sentinel_cl(cli_ctx).action
25+
26+
27+
def cf_alert_rule_template(cli_ctx, *_):
28+
return cf_sentinel_cl(cli_ctx).alert_rule_template
29+
30+
31+
def cf_bookmark(cli_ctx, *_):
32+
return cf_sentinel_cl(cli_ctx).bookmark
33+
34+
35+
def cf_data_connector(cli_ctx, *_):
36+
return cf_sentinel_cl(cli_ctx).data_connector
37+
38+
39+
def cf_incident(cli_ctx, *_):
40+
return cf_sentinel_cl(cli_ctx).incident
41+
42+
43+
def cf_incident_comment(cli_ctx, *_):
44+
return cf_sentinel_cl(cli_ctx).incident_comment

0 commit comments

Comments
 (0)