Skip to content
This repository was archived by the owner on Aug 28, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/securityinsight/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. :changelog:

Release History
===============

0.1.0
++++++
* Initial release.
5 changes: 5 additions & 0 deletions src/securityinsight/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Microsoft Azure CLI 'securityinsight' Extension
==========================================

This package is for the 'securityinsight' extension.
i.e. 'az securityinsight'
46 changes: 46 additions & 0 deletions src/securityinsight/azext_securityinsight/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader
from azext_securityinsight.generated._help import helps # pylint: disable=unused-import


class SecurityInsightsCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
from azext_securityinsight.generated._client_factory import cf_securityinsight
securityinsight_custom = CliCommandType(
operations_tmpl='azext_securityinsight.custom#{}',
client_factory=cf_securityinsight)
super(SecurityInsightsCommandsLoader, self).__init__(cli_ctx=cli_ctx,
custom_command_type=securityinsight_custom)

def load_command_table(self, args):
from azext_securityinsight.generated.commands import load_command_table
load_command_table(self, args)
try:
from azext_securityinsight.manual.commands import load_command_table as load_command_table_manual
load_command_table_manual(self, args)
except ImportError:
pass
return self.command_table

def load_arguments(self, command):
from azext_securityinsight.generated._params import load_arguments
load_arguments(self, command)
try:
from azext_securityinsight.manual._params import load_arguments as load_arguments_manual
load_arguments_manual(self, command)
except ImportError:
pass


COMMAND_LOADER_CLS = SecurityInsightsCommandsLoader
17 changes: 17 additions & 0 deletions src/securityinsight/azext_securityinsight/action.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import

from .generated.action import * # noqa: F403
try:
from .manual.action import * # noqa: F403
except ImportError:
pass
4 changes: 4 additions & 0 deletions src/securityinsight/azext_securityinsight/azext_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"azext.isExperimental": true,
"azext.minCliCoreVersion": "2.3.1"
}
17 changes: 17 additions & 0 deletions src/securityinsight/azext_securityinsight/custom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import

from .generated.custom import * # noqa: F403
try:
from .manual.custom import * # noqa: F403
except ImportError:
pass
12 changes: 12 additions & 0 deletions src/securityinsight/azext_securityinsight/generated/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------


def cf_securityinsight(cli_ctx, *_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from ..vendored_sdks.securityinsight import SecurityInsights
return get_mgmt_service_client(cli_ctx, SecurityInsights)


def cf_alert_rule(cli_ctx, *_):
return cf_securityinsight(cli_ctx).alert_rule


def cf_action(cli_ctx, *_):
return cf_securityinsight(cli_ctx).action


def cf_data_connector(cli_ctx, *_):
return cf_securityinsight(cli_ctx).data_connector
160 changes: 160 additions & 0 deletions src/securityinsight/azext_securityinsight/generated/_help.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=too-many-lines

from knack.help_files import helps


helps['securityinsight alert-rule'] = """
type: group
short-summary: securityinsight alert-rule
"""

helps['securityinsight alert-rule list'] = """
type: command
short-summary: Gets all alert rules.
examples:
- name: Get all alert rules.
text: |-
az securityinsight alert-rule list --resource-group "myRg" --workspace-name "myWorkspace"
"""

helps['securityinsight alert-rule show'] = """
type: command
short-summary: Gets the alert rule.
examples:
- name: Get an action of alert rule.
text: |-
az securityinsight alert-rule show --action-id "912bec42-cb66-4c03-ac63-1761b6898c3e" --resource-group "\
myRg" --rule-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --workspace-name "myWorkspace"
"""

helps['securityinsight alert-rule create'] = """
type: command
short-summary: Creates or updates the alert rule.
examples:
- name: Creates or updates an action of alert rule.
text: |-
az securityinsight alert-rule create --etag "\\"0300bf09-0000-0000-0000-5c37296e0000\\"" --logic-app-res\
ource-id "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.Logic/workflows/M\
yAlerts" --trigger-uri "https://prod-31.northcentralus.logic.azure.com:443/workflows/cd3765391efd48549fd7681ded1d48d7/t\
riggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=signature" --action-id "912\
bec42-cb66-4c03-ac63-1761b6898c3e" --resource-group "myRg" --rule-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --workspace\
-name "myWorkspace"
"""

helps['securityinsight alert-rule delete'] = """
type: command
short-summary: Delete the alert rule.
examples:
- name: Delete an action of alert rule.
text: |-
az securityinsight alert-rule delete --action-id "912bec42-cb66-4c03-ac63-1761b6898c3e" --resource-group\
"myRg" --rule-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --workspace-name "myWorkspace"
"""

helps['securityinsight action'] = """
type: group
short-summary: securityinsight action
"""

helps['securityinsight action list'] = """
type: command
short-summary: Gets all actions of alert rule.
examples:
- name: Get all actions of alert rule.
text: |-
az securityinsight action list --resource-group "myRg" --rule-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" \
--workspace-name "myWorkspace"
"""

helps['securityinsight data-connector'] = """
type: group
short-summary: securityinsight data-connector
"""

helps['securityinsight data-connector list'] = """
type: command
short-summary: Gets all data connectors.
examples:
- name: Get all data connectors.
text: |-
az securityinsight data-connector list --resource-group "myRg" --workspace-name "myWorkspace"
"""

helps['securityinsight data-connector show'] = """
type: command
short-summary: Gets a data connector.
examples:
- name: Get a ASC data connector.
text: |-
az securityinsight data-connector show --data-connector-id "763f9fa1-c2d3-4fa2-93e9-bccd4899aa12" --reso\
urce-group "myRg" --workspace-name "myWorkspace"
- name: Get a MCAS data connector.
text: |-
az securityinsight data-connector show --data-connector-id "b96d014d-b5c2-4a01-9aba-a8058f629d42" --reso\
urce-group "myRg" --workspace-name "myWorkspace"
- name: Get a MDATP data connector
text: |-
az securityinsight data-connector show --data-connector-id "06b3ccb8-1384-4bcc-aec7-852f6d57161b" --reso\
urce-group "myRg" --workspace-name "myWorkspace"
- name: Get a TI data connector.
text: |-
az securityinsight data-connector show --data-connector-id "c345bf40-8509-4ed2-b947-50cb773aaf04" --reso\
urce-group "myRg" --workspace-name "myWorkspace"
- name: Get an AAD data connector.
text: |-
az securityinsight data-connector show --data-connector-id "f0cd27d2-5f03-4c06-ba31-d2dc82dcb51d" --reso\
urce-group "myRg" --workspace-name "myWorkspace"
- name: Get an AATP data connector.
text: |-
az securityinsight data-connector show --data-connector-id "07e42cb3-e658-4e90-801c-efa0f29d3d44" --reso\
urce-group "myRg" --workspace-name "myWorkspace"
- name: Get an AwsCloudTrail data connector.
text: |-
az securityinsight data-connector show --data-connector-id "c345bf40-8509-4ed2-b947-50cb773aaf04" --reso\
urce-group "myRg" --workspace-name "myWorkspace"
- name: Get an Office365 data connector.
text: |-
az securityinsight data-connector show --data-connector-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --reso\
urce-group "myRg" --workspace-name "myWorkspace"
"""

helps['securityinsight data-connector create'] = """
type: command
short-summary: Creates or updates the data connector.
examples:
- name: Creates or updates an Office365 data connector.
text: |-
az securityinsight data-connector create --etag "\\"0300bf09-0000-0000-0000-5c37296e0000\\"" --kind "Off\
ice365" --data-connector-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --resource-group "myRg" --workspace-name "myWorkspac\
e"
"""

helps['securityinsight data-connector update'] = """
type: command
short-summary: Creates or updates the data connector.
examples:
- name: Creates or updates an Office365 data connector.
text: |-
az securityinsight data-connector update --etag "\\"0300bf09-0000-0000-0000-5c37296e0000\\"" --kind "Off\
ice365" --data-connector-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --resource-group "myRg" --workspace-name "myWorkspac\
e"
"""

helps['securityinsight data-connector delete'] = """
type: command
short-summary: Delete the data connector.
examples:
- name: Delete an Office365 data connector.
text: |-
az securityinsight data-connector delete --data-connector-id "73e01a99-5cd7-4139-a149-9f2736ff2ab5" --re\
source-group "myRg" --workspace-name "myWorkspace"
"""
85 changes: 85 additions & 0 deletions src/securityinsight/azext_securityinsight/generated/_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=too-many-lines
# pylint: disable=too-many-statements

from knack.arguments import CLIArgumentType
from azure.cli.core.commands.parameters import (
get_enum_type,
resource_group_name_type
)


def load_arguments(self, _):

with self.argument_context('securityinsight alert-rule list') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('workspace_name', help='The name of the workspace.')

with self.argument_context('securityinsight alert-rule show') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('workspace_name', help='The name of the workspace.')
c.argument('rule_id', help='Alert rule ID')
c.argument('action_id', help='Action ID')

with self.argument_context('securityinsight alert-rule create') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('workspace_name', help='The name of the workspace.')
c.argument('rule_id', help='Alert rule ID')
c.argument('action_id', help='Action ID')
c.argument('etag', help='Etag of the azure resource')
c.argument('logic_app_resource_id', help='Logic App Resource Id, providers/Microsoft.Logic/workflows/{WorkflowI'
'D}.')
c.argument('trigger_uri', help='Logic App Callback URL for this specific workflow.')
c.argument('kind', arg_type=get_enum_type(['Scheduled', 'MicrosoftSecurityIncidentCreation', 'Fusion']), help=
'The kind of the alert rule')

with self.argument_context('securityinsight alert-rule delete') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('workspace_name', help='The name of the workspace.')
c.argument('rule_id', help='Alert rule ID')
c.argument('action_id', help='Action ID')

with self.argument_context('securityinsight action list') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('workspace_name', help='The name of the workspace.')
c.argument('rule_id', help='Alert rule ID')

with self.argument_context('securityinsight data-connector list') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('workspace_name', help='The name of the workspace.')

with self.argument_context('securityinsight data-connector show') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('workspace_name', help='The name of the workspace.')
c.argument('data_connector_id', help='Connector ID')

with self.argument_context('securityinsight data-connector create') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('workspace_name', help='The name of the workspace.')
c.argument('data_connector_id', help='Connector ID')
c.argument('etag', help='Etag of the azure resource')
c.argument('kind', arg_type=get_enum_type(['AzureActiveDirectory', 'AzureSecurityCenter', 'MicrosoftCloudAppSec'
'urity', 'ThreatIntelligence', 'Office365', 'AmazonWebServicesCloudTrail', 'AzureAdvancedThreatProte'
'ction', 'MicrosoftDefenderAdvancedThreatProtection']), help='The kind of the data connector')

with self.argument_context('securityinsight data-connector update') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('workspace_name', help='The name of the workspace.')
c.argument('data_connector_id', help='Connector ID')
c.argument('etag', help='Etag of the azure resource')
c.argument('kind', arg_type=get_enum_type(['AzureActiveDirectory', 'AzureSecurityCenter', 'MicrosoftCloudAppSec'
'urity', 'ThreatIntelligence', 'Office365', 'AmazonWebServicesCloudTrail', 'AzureAdvancedThreatProte'
'ction', 'MicrosoftDefenderAdvancedThreatProtection']), help='The kind of the data connector')

with self.argument_context('securityinsight data-connector delete') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('workspace_name', help='The name of the workspace.')
c.argument('data_connector_id', help='Connector ID')
Loading