diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/_security_center.py index 342c5d61f0e1..03f4764ee113 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/_security_center.py @@ -17,14 +17,11 @@ from .operations import PricingsOperations from .operations import AlertsOperations from .operations import SettingsOperations -from .operations import IoTSecuritySolutionsOperations -from .operations import IoTSecuritySolutionsResourceGroupOperations +from .operations import DeviceSecurityGroupsOperations from .operations import IotSecuritySolutionOperations -from .operations import IoTSecuritySolutionsAnalyticsOperations -from .operations import IoTSecuritySolutionsAnalyticsAggregatedAlertsOperations -from .operations import IoTSecuritySolutionsAnalyticsAggregatedAlertOperations -from .operations import IoTSecuritySolutionsAnalyticsRecommendationOperations -from .operations import IoTSecuritySolutionsAnalyticsRecommendationsOperations +from .operations import IotSecuritySolutionAnalyticsOperations +from .operations import IotSecuritySolutionsAnalyticsAggregatedAlertOperations +from .operations import IotSecuritySolutionsAnalyticsRecommendationOperations from .operations import AllowedConnectionsOperations from .operations import DiscoveredSecuritySolutionsOperations from .operations import ExternalSecuritySolutionsOperations @@ -61,22 +58,16 @@ class SecurityCenter(SDKClient): :vartype alerts: azure.mgmt.security.operations.AlertsOperations :ivar settings: Settings operations :vartype settings: azure.mgmt.security.operations.SettingsOperations - :ivar io_tsecurity_solutions: IoTSecuritySolutions operations - :vartype io_tsecurity_solutions: azure.mgmt.security.operations.IoTSecuritySolutionsOperations - :ivar io_tsecurity_solutions_resource_group: IoTSecuritySolutionsResourceGroup operations - :vartype io_tsecurity_solutions_resource_group: azure.mgmt.security.operations.IoTSecuritySolutionsResourceGroupOperations + :ivar device_security_groups: DeviceSecurityGroups operations + :vartype device_security_groups: azure.mgmt.security.operations.DeviceSecurityGroupsOperations :ivar iot_security_solution: IotSecuritySolution operations :vartype iot_security_solution: azure.mgmt.security.operations.IotSecuritySolutionOperations - :ivar io_tsecurity_solutions_analytics: IoTSecuritySolutionsAnalytics operations - :vartype io_tsecurity_solutions_analytics: azure.mgmt.security.operations.IoTSecuritySolutionsAnalyticsOperations - :ivar io_tsecurity_solutions_analytics_aggregated_alerts: IoTSecuritySolutionsAnalyticsAggregatedAlerts operations - :vartype io_tsecurity_solutions_analytics_aggregated_alerts: azure.mgmt.security.operations.IoTSecuritySolutionsAnalyticsAggregatedAlertsOperations - :ivar io_tsecurity_solutions_analytics_aggregated_alert: IoTSecuritySolutionsAnalyticsAggregatedAlert operations - :vartype io_tsecurity_solutions_analytics_aggregated_alert: azure.mgmt.security.operations.IoTSecuritySolutionsAnalyticsAggregatedAlertOperations - :ivar io_tsecurity_solutions_analytics_recommendation: IoTSecuritySolutionsAnalyticsRecommendation operations - :vartype io_tsecurity_solutions_analytics_recommendation: azure.mgmt.security.operations.IoTSecuritySolutionsAnalyticsRecommendationOperations - :ivar io_tsecurity_solutions_analytics_recommendations: IoTSecuritySolutionsAnalyticsRecommendations operations - :vartype io_tsecurity_solutions_analytics_recommendations: azure.mgmt.security.operations.IoTSecuritySolutionsAnalyticsRecommendationsOperations + :ivar iot_security_solution_analytics: IotSecuritySolutionAnalytics operations + :vartype iot_security_solution_analytics: azure.mgmt.security.operations.IotSecuritySolutionAnalyticsOperations + :ivar iot_security_solutions_analytics_aggregated_alert: IotSecuritySolutionsAnalyticsAggregatedAlert operations + :vartype iot_security_solutions_analytics_aggregated_alert: azure.mgmt.security.operations.IotSecuritySolutionsAnalyticsAggregatedAlertOperations + :ivar iot_security_solutions_analytics_recommendation: IotSecuritySolutionsAnalyticsRecommendation operations + :vartype iot_security_solutions_analytics_recommendation: azure.mgmt.security.operations.IotSecuritySolutionsAnalyticsRecommendationOperations :ivar allowed_connections: AllowedConnections operations :vartype allowed_connections: azure.mgmt.security.operations.AllowedConnectionsOperations :ivar discovered_security_solutions: DiscoveredSecuritySolutions operations @@ -145,21 +136,15 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.settings = SettingsOperations( self._client, self.config, self._serialize, self._deserialize) - self.io_tsecurity_solutions = IoTSecuritySolutionsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.io_tsecurity_solutions_resource_group = IoTSecuritySolutionsResourceGroupOperations( + self.device_security_groups = DeviceSecurityGroupsOperations( self._client, self.config, self._serialize, self._deserialize) self.iot_security_solution = IotSecuritySolutionOperations( self._client, self.config, self._serialize, self._deserialize) - self.io_tsecurity_solutions_analytics = IoTSecuritySolutionsAnalyticsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.io_tsecurity_solutions_analytics_aggregated_alerts = IoTSecuritySolutionsAnalyticsAggregatedAlertsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.io_tsecurity_solutions_analytics_aggregated_alert = IoTSecuritySolutionsAnalyticsAggregatedAlertOperations( + self.iot_security_solution_analytics = IotSecuritySolutionAnalyticsOperations( self._client, self.config, self._serialize, self._deserialize) - self.io_tsecurity_solutions_analytics_recommendation = IoTSecuritySolutionsAnalyticsRecommendationOperations( + self.iot_security_solutions_analytics_aggregated_alert = IotSecuritySolutionsAnalyticsAggregatedAlertOperations( self._client, self.config, self._serialize, self._deserialize) - self.io_tsecurity_solutions_analytics_recommendations = IoTSecuritySolutionsAnalyticsRecommendationsOperations( + self.iot_security_solutions_analytics_recommendation = IotSecuritySolutionsAnalyticsRecommendationOperations( self._client, self.config, self._serialize, self._deserialize) self.allowed_connections = AllowedConnectionsOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/__init__.py index b09be32d96b1..d0c40691dc6b 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/__init__.py @@ -18,6 +18,7 @@ from ._models_py3 import AlertConfidenceReason from ._models_py3 import AlertEntity from ._models_py3 import AllowedConnectionsResource + from ._models_py3 import AllowlistCustomAlertRule from ._models_py3 import AppWhitelistingGroup from ._models_py3 import AppWhitelistingGroups from ._models_py3 import AppWhitelistingIssueSummary @@ -34,7 +35,10 @@ from ._models_py3 import ConnectableResource from ._models_py3 import ConnectedResource from ._models_py3 import ConnectedWorkspace + from ._models_py3 import CustomAlertRule from ._models_py3 import DataExportSetting + from ._models_py3 import DenylistCustomAlertRule + from ._models_py3 import DeviceSecurityGroup from ._models_py3 import DiscoveredSecuritySolution from ._models_py3 import ExternalSecuritySolution from ._models_py3 import ExternalSecuritySolutionKind1 @@ -45,11 +49,8 @@ from ._models_py3 import IoTSecurityAggregatedAlert from ._models_py3 import IoTSecurityAggregatedRecommendation from ._models_py3 import IoTSecurityAlertedDevice - from ._models_py3 import IoTSecurityAlertedDevicesList from ._models_py3 import IoTSecurityDeviceAlert - from ._models_py3 import IoTSecurityDeviceAlertsList from ._models_py3 import IoTSecurityDeviceRecommendation - from ._models_py3 import IoTSecurityDeviceRecommendationsList from ._models_py3 import IoTSecuritySolutionAnalyticsModel from ._models_py3 import IoTSecuritySolutionAnalyticsModelList from ._models_py3 import IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem @@ -65,6 +66,7 @@ from ._models_py3 import JitNetworkAccessRequestPort from ._models_py3 import JitNetworkAccessRequestVirtualMachine from ._models_py3 import Kind + from ._models_py3 import ListCustomAlertRule from ._models_py3 import Location from ._models_py3 import Operation from ._models_py3 import OperationDisplay @@ -86,6 +88,8 @@ from ._models_py3 import Setting from ._models_py3 import SettingResource from ._models_py3 import TagsResource + from ._models_py3 import ThresholdCustomAlertRule + from ._models_py3 import TimeWindowCustomAlertRule from ._models_py3 import TopologyResource from ._models_py3 import TopologySingleResource from ._models_py3 import TopologySingleResourceChild @@ -104,6 +108,7 @@ from ._models import AlertConfidenceReason from ._models import AlertEntity from ._models import AllowedConnectionsResource + from ._models import AllowlistCustomAlertRule from ._models import AppWhitelistingGroup from ._models import AppWhitelistingGroups from ._models import AppWhitelistingIssueSummary @@ -120,7 +125,10 @@ from ._models import ConnectableResource from ._models import ConnectedResource from ._models import ConnectedWorkspace + from ._models import CustomAlertRule from ._models import DataExportSetting + from ._models import DenylistCustomAlertRule + from ._models import DeviceSecurityGroup from ._models import DiscoveredSecuritySolution from ._models import ExternalSecuritySolution from ._models import ExternalSecuritySolutionKind1 @@ -131,11 +139,8 @@ from ._models import IoTSecurityAggregatedAlert from ._models import IoTSecurityAggregatedRecommendation from ._models import IoTSecurityAlertedDevice - from ._models import IoTSecurityAlertedDevicesList from ._models import IoTSecurityDeviceAlert - from ._models import IoTSecurityDeviceAlertsList from ._models import IoTSecurityDeviceRecommendation - from ._models import IoTSecurityDeviceRecommendationsList from ._models import IoTSecuritySolutionAnalyticsModel from ._models import IoTSecuritySolutionAnalyticsModelList from ._models import IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem @@ -151,6 +156,7 @@ from ._models import JitNetworkAccessRequestPort from ._models import JitNetworkAccessRequestVirtualMachine from ._models import Kind + from ._models import ListCustomAlertRule from ._models import Location from ._models import Operation from ._models import OperationDisplay @@ -172,6 +178,8 @@ from ._models import Setting from ._models import SettingResource from ._models import TagsResource + from ._models import ThresholdCustomAlertRule + from ._models import TimeWindowCustomAlertRule from ._models import TopologyResource from ._models import TopologySingleResource from ._models import TopologySingleResourceChild @@ -187,6 +195,7 @@ from ._paged_models import AutoProvisioningSettingPaged from ._paged_models import CompliancePaged from ._paged_models import ComplianceResultPaged +from ._paged_models import DeviceSecurityGroupPaged from ._paged_models import DiscoveredSecuritySolutionPaged from ._paged_models import ExternalSecuritySolutionPaged from ._paged_models import InformationProtectionPolicyPaged @@ -208,6 +217,7 @@ PricingTier, ReportedSeverity, SettingKind, + ValueType, SecuritySolutionStatus, ExportData, DataSource, @@ -235,6 +245,7 @@ 'AlertConfidenceReason', 'AlertEntity', 'AllowedConnectionsResource', + 'AllowlistCustomAlertRule', 'AppWhitelistingGroup', 'AppWhitelistingGroups', 'AppWhitelistingIssueSummary', @@ -251,7 +262,10 @@ 'ConnectableResource', 'ConnectedResource', 'ConnectedWorkspace', + 'CustomAlertRule', 'DataExportSetting', + 'DenylistCustomAlertRule', + 'DeviceSecurityGroup', 'DiscoveredSecuritySolution', 'ExternalSecuritySolution', 'ExternalSecuritySolutionKind1', @@ -262,11 +276,8 @@ 'IoTSecurityAggregatedAlert', 'IoTSecurityAggregatedRecommendation', 'IoTSecurityAlertedDevice', - 'IoTSecurityAlertedDevicesList', 'IoTSecurityDeviceAlert', - 'IoTSecurityDeviceAlertsList', 'IoTSecurityDeviceRecommendation', - 'IoTSecurityDeviceRecommendationsList', 'IoTSecuritySolutionAnalyticsModel', 'IoTSecuritySolutionAnalyticsModelList', 'IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem', @@ -282,6 +293,7 @@ 'JitNetworkAccessRequestPort', 'JitNetworkAccessRequestVirtualMachine', 'Kind', + 'ListCustomAlertRule', 'Location', 'Operation', 'OperationDisplay', @@ -303,6 +315,8 @@ 'Setting', 'SettingResource', 'TagsResource', + 'ThresholdCustomAlertRule', + 'TimeWindowCustomAlertRule', 'TopologyResource', 'TopologySingleResource', 'TopologySingleResourceChild', @@ -315,6 +329,7 @@ 'ComplianceResultPaged', 'AlertPaged', 'SettingPaged', + 'DeviceSecurityGroupPaged', 'IoTSecuritySolutionModelPaged', 'IoTSecurityAggregatedAlertPaged', 'IoTSecurityAggregatedRecommendationPaged', @@ -338,6 +353,7 @@ 'PricingTier', 'ReportedSeverity', 'SettingKind', + 'ValueType', 'SecuritySolutionStatus', 'ExportData', 'DataSource', diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models.py index 814deff5ee6b..89600c9fb8d6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models.py @@ -492,6 +492,136 @@ def __init__(self, **kwargs): self.connectable_resources = None +class CustomAlertRule(Model): + """A custom alert rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomAlertRule, self).__init__(**kwargs) + self.display_name = None + self.description = None + self.is_enabled = kwargs.get('is_enabled', None) + self.rule_type = kwargs.get('rule_type', None) + + +class ListCustomAlertRule(CustomAlertRule): + """A List custom alert rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :ivar value_type: The value type of the items in the list. Possible values + include: 'IpCidr', 'String' + :vartype value_type: str or ~azure.mgmt.security.models.ValueType + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'value_type': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'value_type': {'key': 'valueType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListCustomAlertRule, self).__init__(**kwargs) + self.value_type = None + + +class AllowlistCustomAlertRule(ListCustomAlertRule): + """A custom alert rule that checks if a value (depends on the custom alert + type) is allowed. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :ivar value_type: The value type of the items in the list. Possible values + include: 'IpCidr', 'String' + :vartype value_type: str or ~azure.mgmt.security.models.ValueType + :param allowlist_values: Required. The values to allow. The format of the + values depends on the rule type. + :type allowlist_values: list[str] + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'value_type': {'readonly': True}, + 'allowlist_values': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'value_type': {'key': 'valueType', 'type': 'str'}, + 'allowlist_values': {'key': 'allowlistValues', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(AllowlistCustomAlertRule, self).__init__(**kwargs) + self.allowlist_values = kwargs.get('allowlist_values', None) + + class AppWhitelistingGroup(Model): """AppWhitelistingGroup. @@ -1254,6 +1384,104 @@ def __init__(self, **kwargs): self.enabled = kwargs.get('enabled', None) +class DenylistCustomAlertRule(ListCustomAlertRule): + """A custom alert rule that checks if a value (depends on the custom alert + type) is denied. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :ivar value_type: The value type of the items in the list. Possible values + include: 'IpCidr', 'String' + :vartype value_type: str or ~azure.mgmt.security.models.ValueType + :param denylist_values: Required. The values to deny. The format of the + values depends on the rule type. + :type denylist_values: list[str] + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'value_type': {'readonly': True}, + 'denylist_values': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'value_type': {'key': 'valueType', 'type': 'str'}, + 'denylist_values': {'key': 'denylistValues', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(DenylistCustomAlertRule, self).__init__(**kwargs) + self.denylist_values = kwargs.get('denylist_values', None) + + +class DeviceSecurityGroup(Resource): + """The device security group resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param threshold_rules: The list of custom alert threshold rules. + :type threshold_rules: + list[~azure.mgmt.security.models.ThresholdCustomAlertRule] + :param time_window_rules: The list of custom alert time-window rules. + :type time_window_rules: + list[~azure.mgmt.security.models.TimeWindowCustomAlertRule] + :param allowlist_rules: The allow-list custom alert rules. + :type allowlist_rules: + list[~azure.mgmt.security.models.AllowlistCustomAlertRule] + :param denylist_rules: The deny-list custom alert rules. + :type denylist_rules: + list[~azure.mgmt.security.models.DenylistCustomAlertRule] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'threshold_rules': {'key': 'properties.thresholdRules', 'type': '[ThresholdCustomAlertRule]'}, + 'time_window_rules': {'key': 'properties.timeWindowRules', 'type': '[TimeWindowCustomAlertRule]'}, + 'allowlist_rules': {'key': 'properties.allowlistRules', 'type': '[AllowlistCustomAlertRule]'}, + 'denylist_rules': {'key': 'properties.denylistRules', 'type': '[DenylistCustomAlertRule]'}, + } + + def __init__(self, **kwargs): + super(DeviceSecurityGroup, self).__init__(**kwargs) + self.threshold_rules = kwargs.get('threshold_rules', None) + self.time_window_rules = kwargs.get('time_window_rules', None) + self.allowlist_rules = kwargs.get('allowlist_rules', None) + self.denylist_rules = kwargs.get('denylist_rules', None) + + class DiscoveredSecuritySolution(Model): """DiscoveredSecuritySolution. @@ -1459,35 +1687,34 @@ class IoTSecurityAggregatedAlert(Model): :vartype type: str :param tags: Resource tags :type tags: dict[str, str] - :ivar alert_type: Name of the alert type + :ivar alert_type: Name of the alert type. :vartype alert_type: str - :ivar alert_display_name: Display name of the alert type + :ivar alert_display_name: Display name of the alert type. :vartype alert_display_name: str - :ivar aggregated_date_utc: The date the incidents were detected by the - vendor + :ivar aggregated_date_utc: Date of detection. :vartype aggregated_date_utc: date - :ivar vendor_name: Name of the vendor that discovered the incident + :ivar vendor_name: Name of the organization that raised the alert. :vartype vendor_name: str - :ivar reported_severity: Estimated severity of this alert. Possible values - include: 'Informational', 'Low', 'Medium', 'High' + :ivar reported_severity: Assessed alert severity. Possible values include: + 'Informational', 'Low', 'Medium', 'High' :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity - :ivar remediation_steps: Recommended steps for remediation + :ivar remediation_steps: Recommended steps for remediation. :vartype remediation_steps: str - :ivar description: Description of the incident and what it means + :ivar description: Description of the suspected vulnerability and meaning. :vartype description: str - :ivar count: Occurrence number of the alert within the aggregated date + :ivar count: Number of alerts occurrences within the aggregated time + window. :vartype count: int - :ivar effected_resource_type: Azure resource ID of the resource that got - the alerts + :ivar effected_resource_type: Azure resource ID of the resource that + received the alerts. :vartype effected_resource_type: str - :ivar system_source: The type of the alerted resource (Azure, Non-Azure) + :ivar system_source: The type of the alerted resource (Azure, Non-Azure). :vartype system_source: str - :ivar action_taken: The action that was taken as a response to the alert - (Active, Blocked etc.) + :ivar action_taken: IoT Security solution alert response. :vartype action_taken: str - :ivar log_analytics_query: query in log analytics to get the list of - affected devices/alerts + :ivar log_analytics_query: Log analytics query for getting the list of + affected devices/alerts. :vartype log_analytics_query: str """ @@ -1549,7 +1776,7 @@ def __init__(self, **kwargs): class IoTSecurityAggregatedRecommendation(Model): - """Security Solution Recommendation Information. + """IoT Security solution recommendation information. Variables are only populated by the server, and will be ignored when sending a request. @@ -1562,31 +1789,31 @@ class IoTSecurityAggregatedRecommendation(Model): :vartype type: str :param tags: Resource tags :type tags: dict[str, str] - :param recommendation_name: Name of the recommendation + :param recommendation_name: Name of the recommendation. :type recommendation_name: str :ivar recommendation_display_name: Display name of the recommendation type. :vartype recommendation_display_name: str - :ivar description: Description of the incident and what it means + :ivar description: Description of the suspected vulnerability and meaning. :vartype description: str - :ivar recommendation_type_id: The recommendation-type GUID. + :ivar recommendation_type_id: Recommendation-type GUID. :vartype recommendation_type_id: str - :ivar detected_by: Name of the vendor that discovered the issue + :ivar detected_by: Name of the organization that made the recommendation. :vartype detected_by: str :ivar remediation_steps: Recommended steps for remediation :vartype remediation_steps: str - :ivar reported_severity: Estimated severity of this recommendation. - Possible values include: 'Informational', 'Low', 'Medium', 'High' + :ivar reported_severity: Assessed recommendation severity. Possible values + include: 'Informational', 'Low', 'Medium', 'High' :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity - :ivar healthy_devices: the number of the healthy devices within the - solution + :ivar healthy_devices: Number of healthy devices within the IoT Security + solution. :vartype healthy_devices: int - :ivar unhealthy_device_count: the number of the unhealthy devices within - the solution + :ivar unhealthy_device_count: Number of unhealthy devices within the IoT + Security solution. :vartype unhealthy_device_count: int - :ivar log_analytics_query: query in log analytics to get the list of - affected devices/alerts + :ivar log_analytics_query: Log analytics query for getting the list of + affected devices/alerts. :vartype log_analytics_query: str """ @@ -1641,15 +1868,15 @@ def __init__(self, **kwargs): class IoTSecurityAlertedDevice(Model): - """Statistic information about the number of alerts per device during the last - period. + """Statistical information about the number of alerts per device during last + set number of days. Variables are only populated by the server, and will be ignored when sending a request. - :ivar device_id: Name of the alert type + :ivar device_id: Device identifier. :vartype device_id: str - :ivar alerts_count: the number of alerts raised for this device + :ivar alerts_count: Number of alerts raised for this device. :vartype alerts_count: int """ @@ -1669,42 +1896,20 @@ def __init__(self, **kwargs): self.alerts_count = None -class IoTSecurityAlertedDevicesList(Model): - """List of devices with the count of raised alerts. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of aggregated alerts data - :type value: list[~azure.mgmt.security.models.IoTSecurityAlertedDevice] - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[IoTSecurityAlertedDevice]'}, - } - - def __init__(self, **kwargs): - super(IoTSecurityAlertedDevicesList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - class IoTSecurityDeviceAlert(Model): - """Statistic information about the number of alerts per alert type during the - last period. + """Statistical information about the number of alerts per alert type during + last set number of days. Variables are only populated by the server, and will be ignored when sending a request. :ivar alert_display_name: Display name of the alert :vartype alert_display_name: str - :ivar reported_severity: Estimated severity of this alert. Possible values - include: 'Informational', 'Low', 'Medium', 'High' + :ivar reported_severity: Assessed Alert severity. Possible values include: + 'Informational', 'Low', 'Medium', 'High' :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity - :ivar alerts_count: the number of alerts raised for this alert type + :ivar alerts_count: Number of alerts raised for this alert type. :vartype alerts_count: int """ @@ -1727,50 +1932,20 @@ def __init__(self, **kwargs): self.alerts_count = None -class IoTSecurityDeviceAlertsList(Model): - """List of alerts with the count of raised alerts. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of top alerts data - :type value: list[~azure.mgmt.security.models.IoTSecurityDeviceAlert] - :ivar next_link: The URI to fetch the next page. - :vartype next_link: str - """ - - _validation = { - 'value': {'required': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[IoTSecurityDeviceAlert]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(IoTSecurityDeviceAlertsList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - class IoTSecurityDeviceRecommendation(Model): - """Statistic information about the number of recommendations per + """Statistical information about the number of recommendations per device, per recommendation type. Variables are only populated by the server, and will be ignored when sending a request. - :ivar recommendation_display_name: Display name of the recommendation + :ivar recommendation_display_name: Display name of the recommendation. :vartype recommendation_display_name: str - :ivar reported_severity: Estimated severity of this recommendation. - Possible values include: 'Informational', 'Low', 'Medium', 'High' + :ivar reported_severity: Assessed recommendation severity. Possible values + include: 'Informational', 'Low', 'Medium', 'High' :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity - :ivar devices_count: the number of device with this recommendation + :ivar devices_count: Number of devices with this recommendation. :vartype devices_count: int """ @@ -1793,31 +1968,8 @@ def __init__(self, **kwargs): self.devices_count = None -class IoTSecurityDeviceRecommendationsList(Model): - """List of recommendations with the count of devices. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of aggregated recommendation data - :type value: - list[~azure.mgmt.security.models.IoTSecurityDeviceRecommendation] - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[IoTSecurityDeviceRecommendation]'}, - } - - def __init__(self, **kwargs): - super(IoTSecurityDeviceRecommendationsList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - class IoTSecuritySolutionAnalyticsModel(Resource): - """Security Analytics of a security solution. + """Security analytics of your IoT Security solution. Variables are only populated by the server, and will be ignored when sending a request. @@ -1828,24 +1980,25 @@ class IoTSecuritySolutionAnalyticsModel(Resource): :vartype name: str :ivar type: Resource type :vartype type: str - :ivar metrics: Security Analytics of a security solution + :ivar metrics: Security analytics of your IoT Security solution. :vartype metrics: ~azure.mgmt.security.models.IoTSeverityMetrics - :ivar unhealthy_device_count: number of unhealthy devices + :ivar unhealthy_device_count: Number of unhealthy devices within your IoT + Security solution. :vartype unhealthy_device_count: int - :ivar devices_metrics: The list of devices metrics by the aggregated date. + :ivar devices_metrics: List of device metrics by the aggregation date. :vartype devices_metrics: list[~azure.mgmt.security.models.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem] - :param top_alerted_devices: The list of top 3 devices with the most - attacked. + :param top_alerted_devices: List of the 3 devices with the most alerts. :type top_alerted_devices: - ~azure.mgmt.security.models.IoTSecurityAlertedDevicesList - :param most_prevalent_device_alerts: The list of most prevalent 3 alerts. + list[~azure.mgmt.security.models.IoTSecurityAlertedDevice] + :param most_prevalent_device_alerts: List of the 3 most prevalent device + alerts. :type most_prevalent_device_alerts: - ~azure.mgmt.security.models.IoTSecurityDeviceAlertsList - :param most_prevalent_device_recommendations: The list of most prevalent 3 - recommendations. + list[~azure.mgmt.security.models.IoTSecurityDeviceAlert] + :param most_prevalent_device_recommendations: List of the 3 most prevalent + device recommendations. :type most_prevalent_device_recommendations: - ~azure.mgmt.security.models.IoTSecurityDeviceRecommendationsList + list[~azure.mgmt.security.models.IoTSecurityDeviceRecommendation] """ _validation = { @@ -1864,9 +2017,9 @@ class IoTSecuritySolutionAnalyticsModel(Resource): 'metrics': {'key': 'properties.metrics', 'type': 'IoTSeverityMetrics'}, 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'int'}, 'devices_metrics': {'key': 'properties.devicesMetrics', 'type': '[IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem]'}, - 'top_alerted_devices': {'key': 'properties.topAlertedDevices', 'type': 'IoTSecurityAlertedDevicesList'}, - 'most_prevalent_device_alerts': {'key': 'properties.mostPrevalentDeviceAlerts', 'type': 'IoTSecurityDeviceAlertsList'}, - 'most_prevalent_device_recommendations': {'key': 'properties.mostPrevalentDeviceRecommendations', 'type': 'IoTSecurityDeviceRecommendationsList'}, + 'top_alerted_devices': {'key': 'properties.topAlertedDevices', 'type': '[IoTSecurityAlertedDevice]'}, + 'most_prevalent_device_alerts': {'key': 'properties.mostPrevalentDeviceAlerts', 'type': '[IoTSecurityDeviceAlert]'}, + 'most_prevalent_device_recommendations': {'key': 'properties.mostPrevalentDeviceRecommendations', 'type': '[IoTSecurityDeviceRecommendation]'}, } def __init__(self, **kwargs): @@ -1880,17 +2033,19 @@ def __init__(self, **kwargs): class IoTSecuritySolutionAnalyticsModelList(Model): - """List of Security Analytics of a security solution. + """List of Security analytics of your IoT Security solution. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param value: Required. List of Security Analytics of a security solution + :param value: Required. List of Security analytics of your IoT Security + solution :type value: list[~azure.mgmt.security.models.IoTSecuritySolutionAnalyticsModel] - :ivar next_link: The URI to fetch the next page. + :ivar next_link: When there is too much alert data for one page, use this + URI to fetch the next page. :vartype next_link: str """ @@ -1913,9 +2068,10 @@ def __init__(self, **kwargs): class IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem(Model): """IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem. - :param date_property: the date of the metrics + :param date_property: Aggregation of IoT Security solution device alert + metrics by date. :type date_property: datetime - :param devices_metrics: devices alerts count by severity. + :param devices_metrics: Device alert count by severity. :type devices_metrics: ~azure.mgmt.security.models.IoTSeverityMetrics """ @@ -1931,7 +2087,7 @@ def __init__(self, **kwargs): class IoTSecuritySolutionModel(Model): - """Security Solution. + """IoT Security solution configuration and resource information. Variables are only populated by the server, and will be ignored when sending a request. @@ -1952,10 +2108,10 @@ class IoTSecuritySolutionModel(Model): :type workspace: str :param display_name: Required. Resource display name. :type display_name: str - :param status: Security solution status. Possible values include: - 'Enabled', 'Disabled'. Default value: "Enabled" . + :param status: Status of the IoT Security solution. Possible values + include: 'Enabled', 'Disabled'. Default value: "Enabled" . :type status: str or ~azure.mgmt.security.models.SecuritySolutionStatus - :param export: List of additional export to workspace data options + :param export: List of additional options for exporting to workspace data. :type export: list[str or ~azure.mgmt.security.models.ExportData] :param disabled_data_sources: Disabled data sources. Disabling these data sources compromises the system. @@ -2020,13 +2176,13 @@ def __init__(self, **kwargs): class IoTSeverityMetrics(Model): - """Severity metrics. + """IoT Security solution analytics severity metrics. - :param high: count of high severity items + :param high: Count of high severity alerts/recommendations. :type high: int - :param medium: count of medium severity items + :param medium: Count of medium severity alerts/recommendations. :type medium: int - :param low: count of low severity items + :param low: Count of low severity alerts/recommendations. :type low: int """ @@ -2549,7 +2705,10 @@ def __init__(self, **kwargs): class Pricing(Resource): - """Pricing tier will be applied for the scope based on the resource ID. + """Azure Security Center is provided in two pricing tiers: free and standard, + with the standard tier available with a trial period. The standard tier + offers advanced security capabilities, while the free tier offers basic + security features. Variables are only populated by the server, and will be ignored when sending a request. @@ -2651,15 +2810,15 @@ def __init__(self, **kwargs): class RecommendationConfigurationProperties(Model): - """Recommendation configuration. + """The type of IoT Security recommendation. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param recommendation_type: Required. The recommendation type. Possible - values include: 'IoT_ACRAuthentication', + :param recommendation_type: Required. The type of IoT Security + recommendation. Possible values include: 'IoT_ACRAuthentication', 'IoT_AgentSendsUnutilizedMessages', 'IoT_Baseline', 'IoT_EdgeHubMemOptimize', 'IoT_EdgeLoggingOptions', 'IoT_InconsistentModuleSettings', 'IoT_InstallAgent', @@ -2671,9 +2830,9 @@ class RecommendationConfigurationProperties(Model): ~azure.mgmt.security.models.RecommendationType :ivar name: :vartype name: str - :param status: Required. Recommendation status. The recommendation is not - generated when the status is disabled. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . + :param status: Required. Recommendation status. When the recommendation + status is disabled recommendations are not generated. Possible values + include: 'Disabled', 'Enabled'. Default value: "Enabled" . :type status: str or ~azure.mgmt.security.models.RecommendationConfigStatus """ @@ -3128,6 +3287,103 @@ def __init__(self, **kwargs): self.tags = kwargs.get('tags', None) +class ThresholdCustomAlertRule(CustomAlertRule): + """A custom alert rule that checks if a value (depends on the custom alert + type) is within the given range. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :param min_threshold: Required. The minimum threshold. + :type min_threshold: int + :param max_threshold: Required. The maximum threshold. + :type max_threshold: int + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'min_threshold': {'required': True}, + 'max_threshold': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'min_threshold': {'key': 'minThreshold', 'type': 'int'}, + 'max_threshold': {'key': 'maxThreshold', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ThresholdCustomAlertRule, self).__init__(**kwargs) + self.min_threshold = kwargs.get('min_threshold', None) + self.max_threshold = kwargs.get('max_threshold', None) + + +class TimeWindowCustomAlertRule(ThresholdCustomAlertRule): + """A custom alert rule that checks if the number of activities (depends on the + custom alert type) in a time window is within the given range. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :param min_threshold: Required. The minimum threshold. + :type min_threshold: int + :param max_threshold: Required. The maximum threshold. + :type max_threshold: int + :param time_window_size: Required. The time window size in iso8601 format. + :type time_window_size: timedelta + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'min_threshold': {'required': True}, + 'max_threshold': {'required': True}, + 'time_window_size': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'min_threshold': {'key': 'minThreshold', 'type': 'int'}, + 'max_threshold': {'key': 'maxThreshold', 'type': 'int'}, + 'time_window_size': {'key': 'timeWindowSize', 'type': 'duration'}, + } + + def __init__(self, **kwargs): + super(TimeWindowCustomAlertRule, self).__init__(**kwargs) + self.time_window_size = kwargs.get('time_window_size', None) + + class TopologyResource(Model): """TopologyResource. @@ -3306,8 +3562,8 @@ class UpdateIotSecuritySolutionData(TagsResource): _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, - 'user_defined_resources': {'key': 'userDefinedResources', 'type': 'UserDefinedResourcesProperties'}, - 'recommendations_configuration': {'key': 'recommendationsConfiguration', 'type': '[RecommendationConfigurationProperties]'}, + 'user_defined_resources': {'key': 'properties.userDefinedResources', 'type': 'UserDefinedResourcesProperties'}, + 'recommendations_configuration': {'key': 'properties.recommendationsConfiguration', 'type': '[RecommendationConfigurationProperties]'}, } def __init__(self, **kwargs): @@ -3317,7 +3573,7 @@ def __init__(self, **kwargs): class UserDefinedResourcesProperties(Model): - """Properties of the solution's user defined resources. + """Properties of the IoT Security solution's user defined resources. All required parameters must be populated in order to send to Azure. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models_py3.py index 55592fee92b4..0ec2a932124b 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models_py3.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models_py3.py @@ -492,6 +492,136 @@ def __init__(self, **kwargs) -> None: self.connectable_resources = None +class CustomAlertRule(Model): + """A custom alert rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + } + + def __init__(self, *, is_enabled: bool, rule_type: str, **kwargs) -> None: + super(CustomAlertRule, self).__init__(**kwargs) + self.display_name = None + self.description = None + self.is_enabled = is_enabled + self.rule_type = rule_type + + +class ListCustomAlertRule(CustomAlertRule): + """A List custom alert rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :ivar value_type: The value type of the items in the list. Possible values + include: 'IpCidr', 'String' + :vartype value_type: str or ~azure.mgmt.security.models.ValueType + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'value_type': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'value_type': {'key': 'valueType', 'type': 'str'}, + } + + def __init__(self, *, is_enabled: bool, rule_type: str, **kwargs) -> None: + super(ListCustomAlertRule, self).__init__(is_enabled=is_enabled, rule_type=rule_type, **kwargs) + self.value_type = None + + +class AllowlistCustomAlertRule(ListCustomAlertRule): + """A custom alert rule that checks if a value (depends on the custom alert + type) is allowed. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :ivar value_type: The value type of the items in the list. Possible values + include: 'IpCidr', 'String' + :vartype value_type: str or ~azure.mgmt.security.models.ValueType + :param allowlist_values: Required. The values to allow. The format of the + values depends on the rule type. + :type allowlist_values: list[str] + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'value_type': {'readonly': True}, + 'allowlist_values': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'value_type': {'key': 'valueType', 'type': 'str'}, + 'allowlist_values': {'key': 'allowlistValues', 'type': '[str]'}, + } + + def __init__(self, *, is_enabled: bool, rule_type: str, allowlist_values, **kwargs) -> None: + super(AllowlistCustomAlertRule, self).__init__(is_enabled=is_enabled, rule_type=rule_type, **kwargs) + self.allowlist_values = allowlist_values + + class AppWhitelistingGroup(Model): """AppWhitelistingGroup. @@ -1254,6 +1384,104 @@ def __init__(self, *, kind, enabled: bool, **kwargs) -> None: self.enabled = enabled +class DenylistCustomAlertRule(ListCustomAlertRule): + """A custom alert rule that checks if a value (depends on the custom alert + type) is denied. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :ivar value_type: The value type of the items in the list. Possible values + include: 'IpCidr', 'String' + :vartype value_type: str or ~azure.mgmt.security.models.ValueType + :param denylist_values: Required. The values to deny. The format of the + values depends on the rule type. + :type denylist_values: list[str] + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'value_type': {'readonly': True}, + 'denylist_values': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'value_type': {'key': 'valueType', 'type': 'str'}, + 'denylist_values': {'key': 'denylistValues', 'type': '[str]'}, + } + + def __init__(self, *, is_enabled: bool, rule_type: str, denylist_values, **kwargs) -> None: + super(DenylistCustomAlertRule, self).__init__(is_enabled=is_enabled, rule_type=rule_type, **kwargs) + self.denylist_values = denylist_values + + +class DeviceSecurityGroup(Resource): + """The device security group resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param threshold_rules: The list of custom alert threshold rules. + :type threshold_rules: + list[~azure.mgmt.security.models.ThresholdCustomAlertRule] + :param time_window_rules: The list of custom alert time-window rules. + :type time_window_rules: + list[~azure.mgmt.security.models.TimeWindowCustomAlertRule] + :param allowlist_rules: The allow-list custom alert rules. + :type allowlist_rules: + list[~azure.mgmt.security.models.AllowlistCustomAlertRule] + :param denylist_rules: The deny-list custom alert rules. + :type denylist_rules: + list[~azure.mgmt.security.models.DenylistCustomAlertRule] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'threshold_rules': {'key': 'properties.thresholdRules', 'type': '[ThresholdCustomAlertRule]'}, + 'time_window_rules': {'key': 'properties.timeWindowRules', 'type': '[TimeWindowCustomAlertRule]'}, + 'allowlist_rules': {'key': 'properties.allowlistRules', 'type': '[AllowlistCustomAlertRule]'}, + 'denylist_rules': {'key': 'properties.denylistRules', 'type': '[DenylistCustomAlertRule]'}, + } + + def __init__(self, *, threshold_rules=None, time_window_rules=None, allowlist_rules=None, denylist_rules=None, **kwargs) -> None: + super(DeviceSecurityGroup, self).__init__(**kwargs) + self.threshold_rules = threshold_rules + self.time_window_rules = time_window_rules + self.allowlist_rules = allowlist_rules + self.denylist_rules = denylist_rules + + class DiscoveredSecuritySolution(Model): """DiscoveredSecuritySolution. @@ -1459,35 +1687,34 @@ class IoTSecurityAggregatedAlert(Model): :vartype type: str :param tags: Resource tags :type tags: dict[str, str] - :ivar alert_type: Name of the alert type + :ivar alert_type: Name of the alert type. :vartype alert_type: str - :ivar alert_display_name: Display name of the alert type + :ivar alert_display_name: Display name of the alert type. :vartype alert_display_name: str - :ivar aggregated_date_utc: The date the incidents were detected by the - vendor + :ivar aggregated_date_utc: Date of detection. :vartype aggregated_date_utc: date - :ivar vendor_name: Name of the vendor that discovered the incident + :ivar vendor_name: Name of the organization that raised the alert. :vartype vendor_name: str - :ivar reported_severity: Estimated severity of this alert. Possible values - include: 'Informational', 'Low', 'Medium', 'High' + :ivar reported_severity: Assessed alert severity. Possible values include: + 'Informational', 'Low', 'Medium', 'High' :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity - :ivar remediation_steps: Recommended steps for remediation + :ivar remediation_steps: Recommended steps for remediation. :vartype remediation_steps: str - :ivar description: Description of the incident and what it means + :ivar description: Description of the suspected vulnerability and meaning. :vartype description: str - :ivar count: Occurrence number of the alert within the aggregated date + :ivar count: Number of alerts occurrences within the aggregated time + window. :vartype count: int - :ivar effected_resource_type: Azure resource ID of the resource that got - the alerts + :ivar effected_resource_type: Azure resource ID of the resource that + received the alerts. :vartype effected_resource_type: str - :ivar system_source: The type of the alerted resource (Azure, Non-Azure) + :ivar system_source: The type of the alerted resource (Azure, Non-Azure). :vartype system_source: str - :ivar action_taken: The action that was taken as a response to the alert - (Active, Blocked etc.) + :ivar action_taken: IoT Security solution alert response. :vartype action_taken: str - :ivar log_analytics_query: query in log analytics to get the list of - affected devices/alerts + :ivar log_analytics_query: Log analytics query for getting the list of + affected devices/alerts. :vartype log_analytics_query: str """ @@ -1549,7 +1776,7 @@ def __init__(self, *, tags=None, **kwargs) -> None: class IoTSecurityAggregatedRecommendation(Model): - """Security Solution Recommendation Information. + """IoT Security solution recommendation information. Variables are only populated by the server, and will be ignored when sending a request. @@ -1562,31 +1789,31 @@ class IoTSecurityAggregatedRecommendation(Model): :vartype type: str :param tags: Resource tags :type tags: dict[str, str] - :param recommendation_name: Name of the recommendation + :param recommendation_name: Name of the recommendation. :type recommendation_name: str :ivar recommendation_display_name: Display name of the recommendation type. :vartype recommendation_display_name: str - :ivar description: Description of the incident and what it means + :ivar description: Description of the suspected vulnerability and meaning. :vartype description: str - :ivar recommendation_type_id: The recommendation-type GUID. + :ivar recommendation_type_id: Recommendation-type GUID. :vartype recommendation_type_id: str - :ivar detected_by: Name of the vendor that discovered the issue + :ivar detected_by: Name of the organization that made the recommendation. :vartype detected_by: str :ivar remediation_steps: Recommended steps for remediation :vartype remediation_steps: str - :ivar reported_severity: Estimated severity of this recommendation. - Possible values include: 'Informational', 'Low', 'Medium', 'High' + :ivar reported_severity: Assessed recommendation severity. Possible values + include: 'Informational', 'Low', 'Medium', 'High' :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity - :ivar healthy_devices: the number of the healthy devices within the - solution + :ivar healthy_devices: Number of healthy devices within the IoT Security + solution. :vartype healthy_devices: int - :ivar unhealthy_device_count: the number of the unhealthy devices within - the solution + :ivar unhealthy_device_count: Number of unhealthy devices within the IoT + Security solution. :vartype unhealthy_device_count: int - :ivar log_analytics_query: query in log analytics to get the list of - affected devices/alerts + :ivar log_analytics_query: Log analytics query for getting the list of + affected devices/alerts. :vartype log_analytics_query: str """ @@ -1641,15 +1868,15 @@ def __init__(self, *, tags=None, recommendation_name: str=None, **kwargs) -> Non class IoTSecurityAlertedDevice(Model): - """Statistic information about the number of alerts per device during the last - period. + """Statistical information about the number of alerts per device during last + set number of days. Variables are only populated by the server, and will be ignored when sending a request. - :ivar device_id: Name of the alert type + :ivar device_id: Device identifier. :vartype device_id: str - :ivar alerts_count: the number of alerts raised for this device + :ivar alerts_count: Number of alerts raised for this device. :vartype alerts_count: int """ @@ -1669,42 +1896,20 @@ def __init__(self, **kwargs) -> None: self.alerts_count = None -class IoTSecurityAlertedDevicesList(Model): - """List of devices with the count of raised alerts. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of aggregated alerts data - :type value: list[~azure.mgmt.security.models.IoTSecurityAlertedDevice] - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[IoTSecurityAlertedDevice]'}, - } - - def __init__(self, *, value, **kwargs) -> None: - super(IoTSecurityAlertedDevicesList, self).__init__(**kwargs) - self.value = value - - class IoTSecurityDeviceAlert(Model): - """Statistic information about the number of alerts per alert type during the - last period. + """Statistical information about the number of alerts per alert type during + last set number of days. Variables are only populated by the server, and will be ignored when sending a request. :ivar alert_display_name: Display name of the alert :vartype alert_display_name: str - :ivar reported_severity: Estimated severity of this alert. Possible values - include: 'Informational', 'Low', 'Medium', 'High' + :ivar reported_severity: Assessed Alert severity. Possible values include: + 'Informational', 'Low', 'Medium', 'High' :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity - :ivar alerts_count: the number of alerts raised for this alert type + :ivar alerts_count: Number of alerts raised for this alert type. :vartype alerts_count: int """ @@ -1727,50 +1932,20 @@ def __init__(self, **kwargs) -> None: self.alerts_count = None -class IoTSecurityDeviceAlertsList(Model): - """List of alerts with the count of raised alerts. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of top alerts data - :type value: list[~azure.mgmt.security.models.IoTSecurityDeviceAlert] - :ivar next_link: The URI to fetch the next page. - :vartype next_link: str - """ - - _validation = { - 'value': {'required': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[IoTSecurityDeviceAlert]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__(self, *, value, **kwargs) -> None: - super(IoTSecurityDeviceAlertsList, self).__init__(**kwargs) - self.value = value - self.next_link = None - - class IoTSecurityDeviceRecommendation(Model): - """Statistic information about the number of recommendations per + """Statistical information about the number of recommendations per device, per recommendation type. Variables are only populated by the server, and will be ignored when sending a request. - :ivar recommendation_display_name: Display name of the recommendation + :ivar recommendation_display_name: Display name of the recommendation. :vartype recommendation_display_name: str - :ivar reported_severity: Estimated severity of this recommendation. - Possible values include: 'Informational', 'Low', 'Medium', 'High' + :ivar reported_severity: Assessed recommendation severity. Possible values + include: 'Informational', 'Low', 'Medium', 'High' :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity - :ivar devices_count: the number of device with this recommendation + :ivar devices_count: Number of devices with this recommendation. :vartype devices_count: int """ @@ -1793,31 +1968,8 @@ def __init__(self, **kwargs) -> None: self.devices_count = None -class IoTSecurityDeviceRecommendationsList(Model): - """List of recommendations with the count of devices. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of aggregated recommendation data - :type value: - list[~azure.mgmt.security.models.IoTSecurityDeviceRecommendation] - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[IoTSecurityDeviceRecommendation]'}, - } - - def __init__(self, *, value, **kwargs) -> None: - super(IoTSecurityDeviceRecommendationsList, self).__init__(**kwargs) - self.value = value - - class IoTSecuritySolutionAnalyticsModel(Resource): - """Security Analytics of a security solution. + """Security analytics of your IoT Security solution. Variables are only populated by the server, and will be ignored when sending a request. @@ -1828,24 +1980,25 @@ class IoTSecuritySolutionAnalyticsModel(Resource): :vartype name: str :ivar type: Resource type :vartype type: str - :ivar metrics: Security Analytics of a security solution + :ivar metrics: Security analytics of your IoT Security solution. :vartype metrics: ~azure.mgmt.security.models.IoTSeverityMetrics - :ivar unhealthy_device_count: number of unhealthy devices + :ivar unhealthy_device_count: Number of unhealthy devices within your IoT + Security solution. :vartype unhealthy_device_count: int - :ivar devices_metrics: The list of devices metrics by the aggregated date. + :ivar devices_metrics: List of device metrics by the aggregation date. :vartype devices_metrics: list[~azure.mgmt.security.models.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem] - :param top_alerted_devices: The list of top 3 devices with the most - attacked. + :param top_alerted_devices: List of the 3 devices with the most alerts. :type top_alerted_devices: - ~azure.mgmt.security.models.IoTSecurityAlertedDevicesList - :param most_prevalent_device_alerts: The list of most prevalent 3 alerts. + list[~azure.mgmt.security.models.IoTSecurityAlertedDevice] + :param most_prevalent_device_alerts: List of the 3 most prevalent device + alerts. :type most_prevalent_device_alerts: - ~azure.mgmt.security.models.IoTSecurityDeviceAlertsList - :param most_prevalent_device_recommendations: The list of most prevalent 3 - recommendations. + list[~azure.mgmt.security.models.IoTSecurityDeviceAlert] + :param most_prevalent_device_recommendations: List of the 3 most prevalent + device recommendations. :type most_prevalent_device_recommendations: - ~azure.mgmt.security.models.IoTSecurityDeviceRecommendationsList + list[~azure.mgmt.security.models.IoTSecurityDeviceRecommendation] """ _validation = { @@ -1864,9 +2017,9 @@ class IoTSecuritySolutionAnalyticsModel(Resource): 'metrics': {'key': 'properties.metrics', 'type': 'IoTSeverityMetrics'}, 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'int'}, 'devices_metrics': {'key': 'properties.devicesMetrics', 'type': '[IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem]'}, - 'top_alerted_devices': {'key': 'properties.topAlertedDevices', 'type': 'IoTSecurityAlertedDevicesList'}, - 'most_prevalent_device_alerts': {'key': 'properties.mostPrevalentDeviceAlerts', 'type': 'IoTSecurityDeviceAlertsList'}, - 'most_prevalent_device_recommendations': {'key': 'properties.mostPrevalentDeviceRecommendations', 'type': 'IoTSecurityDeviceRecommendationsList'}, + 'top_alerted_devices': {'key': 'properties.topAlertedDevices', 'type': '[IoTSecurityAlertedDevice]'}, + 'most_prevalent_device_alerts': {'key': 'properties.mostPrevalentDeviceAlerts', 'type': '[IoTSecurityDeviceAlert]'}, + 'most_prevalent_device_recommendations': {'key': 'properties.mostPrevalentDeviceRecommendations', 'type': '[IoTSecurityDeviceRecommendation]'}, } def __init__(self, *, top_alerted_devices=None, most_prevalent_device_alerts=None, most_prevalent_device_recommendations=None, **kwargs) -> None: @@ -1880,17 +2033,19 @@ def __init__(self, *, top_alerted_devices=None, most_prevalent_device_alerts=Non class IoTSecuritySolutionAnalyticsModelList(Model): - """List of Security Analytics of a security solution. + """List of Security analytics of your IoT Security solution. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param value: Required. List of Security Analytics of a security solution + :param value: Required. List of Security analytics of your IoT Security + solution :type value: list[~azure.mgmt.security.models.IoTSecuritySolutionAnalyticsModel] - :ivar next_link: The URI to fetch the next page. + :ivar next_link: When there is too much alert data for one page, use this + URI to fetch the next page. :vartype next_link: str """ @@ -1913,9 +2068,10 @@ def __init__(self, *, value, **kwargs) -> None: class IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem(Model): """IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem. - :param date_property: the date of the metrics + :param date_property: Aggregation of IoT Security solution device alert + metrics by date. :type date_property: datetime - :param devices_metrics: devices alerts count by severity. + :param devices_metrics: Device alert count by severity. :type devices_metrics: ~azure.mgmt.security.models.IoTSeverityMetrics """ @@ -1931,7 +2087,7 @@ def __init__(self, *, date_property=None, devices_metrics=None, **kwargs) -> Non class IoTSecuritySolutionModel(Model): - """Security Solution. + """IoT Security solution configuration and resource information. Variables are only populated by the server, and will be ignored when sending a request. @@ -1952,10 +2108,10 @@ class IoTSecuritySolutionModel(Model): :type workspace: str :param display_name: Required. Resource display name. :type display_name: str - :param status: Security solution status. Possible values include: - 'Enabled', 'Disabled'. Default value: "Enabled" . + :param status: Status of the IoT Security solution. Possible values + include: 'Enabled', 'Disabled'. Default value: "Enabled" . :type status: str or ~azure.mgmt.security.models.SecuritySolutionStatus - :param export: List of additional export to workspace data options + :param export: List of additional options for exporting to workspace data. :type export: list[str or ~azure.mgmt.security.models.ExportData] :param disabled_data_sources: Disabled data sources. Disabling these data sources compromises the system. @@ -2020,13 +2176,13 @@ def __init__(self, *, workspace: str, display_name: str, iot_hubs, tags=None, lo class IoTSeverityMetrics(Model): - """Severity metrics. + """IoT Security solution analytics severity metrics. - :param high: count of high severity items + :param high: Count of high severity alerts/recommendations. :type high: int - :param medium: count of medium severity items + :param medium: Count of medium severity alerts/recommendations. :type medium: int - :param low: count of low severity items + :param low: Count of low severity alerts/recommendations. :type low: int """ @@ -2549,7 +2705,10 @@ def __init__(self, *, path: str=None, action=None, type=None, publisher_info=Non class Pricing(Resource): - """Pricing tier will be applied for the scope based on the resource ID. + """Azure Security Center is provided in two pricing tiers: free and standard, + with the standard tier available with a trial period. The standard tier + offers advanced security capabilities, while the free tier offers basic + security features. Variables are only populated by the server, and will be ignored when sending a request. @@ -2651,15 +2810,15 @@ def __init__(self, *, publisher_name: str=None, product_name: str=None, binary_n class RecommendationConfigurationProperties(Model): - """Recommendation configuration. + """The type of IoT Security recommendation. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param recommendation_type: Required. The recommendation type. Possible - values include: 'IoT_ACRAuthentication', + :param recommendation_type: Required. The type of IoT Security + recommendation. Possible values include: 'IoT_ACRAuthentication', 'IoT_AgentSendsUnutilizedMessages', 'IoT_Baseline', 'IoT_EdgeHubMemOptimize', 'IoT_EdgeLoggingOptions', 'IoT_InconsistentModuleSettings', 'IoT_InstallAgent', @@ -2671,9 +2830,9 @@ class RecommendationConfigurationProperties(Model): ~azure.mgmt.security.models.RecommendationType :ivar name: :vartype name: str - :param status: Required. Recommendation status. The recommendation is not - generated when the status is disabled. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . + :param status: Required. Recommendation status. When the recommendation + status is disabled recommendations are not generated. Possible values + include: 'Disabled', 'Enabled'. Default value: "Enabled" . :type status: str or ~azure.mgmt.security.models.RecommendationConfigStatus """ @@ -3128,6 +3287,103 @@ def __init__(self, *, tags=None, **kwargs) -> None: self.tags = tags +class ThresholdCustomAlertRule(CustomAlertRule): + """A custom alert rule that checks if a value (depends on the custom alert + type) is within the given range. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :param min_threshold: Required. The minimum threshold. + :type min_threshold: int + :param max_threshold: Required. The maximum threshold. + :type max_threshold: int + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'min_threshold': {'required': True}, + 'max_threshold': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'min_threshold': {'key': 'minThreshold', 'type': 'int'}, + 'max_threshold': {'key': 'maxThreshold', 'type': 'int'}, + } + + def __init__(self, *, is_enabled: bool, rule_type: str, min_threshold: int, max_threshold: int, **kwargs) -> None: + super(ThresholdCustomAlertRule, self).__init__(is_enabled=is_enabled, rule_type=rule_type, **kwargs) + self.min_threshold = min_threshold + self.max_threshold = max_threshold + + +class TimeWindowCustomAlertRule(ThresholdCustomAlertRule): + """A custom alert rule that checks if the number of activities (depends on the + custom alert type) in a time window is within the given range. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :param min_threshold: Required. The minimum threshold. + :type min_threshold: int + :param max_threshold: Required. The maximum threshold. + :type max_threshold: int + :param time_window_size: Required. The time window size in iso8601 format. + :type time_window_size: timedelta + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'min_threshold': {'required': True}, + 'max_threshold': {'required': True}, + 'time_window_size': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'min_threshold': {'key': 'minThreshold', 'type': 'int'}, + 'max_threshold': {'key': 'maxThreshold', 'type': 'int'}, + 'time_window_size': {'key': 'timeWindowSize', 'type': 'duration'}, + } + + def __init__(self, *, is_enabled: bool, rule_type: str, min_threshold: int, max_threshold: int, time_window_size, **kwargs) -> None: + super(TimeWindowCustomAlertRule, self).__init__(is_enabled=is_enabled, rule_type=rule_type, min_threshold=min_threshold, max_threshold=max_threshold, **kwargs) + self.time_window_size = time_window_size + + class TopologyResource(Model): """TopologyResource. @@ -3306,8 +3562,8 @@ class UpdateIotSecuritySolutionData(TagsResource): _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, - 'user_defined_resources': {'key': 'userDefinedResources', 'type': 'UserDefinedResourcesProperties'}, - 'recommendations_configuration': {'key': 'recommendationsConfiguration', 'type': '[RecommendationConfigurationProperties]'}, + 'user_defined_resources': {'key': 'properties.userDefinedResources', 'type': 'UserDefinedResourcesProperties'}, + 'recommendations_configuration': {'key': 'properties.recommendationsConfiguration', 'type': '[RecommendationConfigurationProperties]'}, } def __init__(self, *, tags=None, user_defined_resources=None, recommendations_configuration=None, **kwargs) -> None: @@ -3317,7 +3573,7 @@ def __init__(self, *, tags=None, user_defined_resources=None, recommendations_co class UserDefinedResourcesProperties(Model): - """Properties of the solution's user defined resources. + """Properties of the IoT Security solution's user defined resources. All required parameters must be populated in order to send to Azure. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_paged_models.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_paged_models.py index 362a777bdc8c..f0eb60a62a7a 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_paged_models.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_paged_models.py @@ -51,6 +51,19 @@ class SettingPaged(Paged): def __init__(self, *args, **kwargs): super(SettingPaged, self).__init__(*args, **kwargs) +class DeviceSecurityGroupPaged(Paged): + """ + A paging container for iterating over a list of :class:`DeviceSecurityGroup ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DeviceSecurityGroup]'} + } + + def __init__(self, *args, **kwargs): + + super(DeviceSecurityGroupPaged, self).__init__(*args, **kwargs) class IoTSecuritySolutionModelPaged(Paged): """ A paging container for iterating over a list of :class:`IoTSecuritySolutionModel ` object diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_security_center_enums.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_security_center_enums.py index 09cf991ceb06..684dbfad43da 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_security_center_enums.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_security_center_enums.py @@ -40,6 +40,12 @@ class SettingKind(str, Enum): alert_suppression_setting = "AlertSuppressionSetting" +class ValueType(str, Enum): + + ip_cidr = "IpCidr" #: An IP range in CIDR format (e.g. '192.168.0.1/8'). + string = "String" #: Any string value. + + class SecuritySolutionStatus(str, Enum): enabled = "Enabled" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/__init__.py index 2044043fcb95..f4efc5f7a4c7 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/__init__.py @@ -13,14 +13,11 @@ from ._pricings_operations import PricingsOperations from ._alerts_operations import AlertsOperations from ._settings_operations import SettingsOperations -from ._io_tsecurity_solutions_operations import IoTSecuritySolutionsOperations -from ._io_tsecurity_solutions_resource_group_operations import IoTSecuritySolutionsResourceGroupOperations +from ._device_security_groups_operations import DeviceSecurityGroupsOperations from ._iot_security_solution_operations import IotSecuritySolutionOperations -from ._io_tsecurity_solutions_analytics_operations import IoTSecuritySolutionsAnalyticsOperations -from ._io_tsecurity_solutions_analytics_aggregated_alerts_operations import IoTSecuritySolutionsAnalyticsAggregatedAlertsOperations -from ._io_tsecurity_solutions_analytics_aggregated_alert_operations import IoTSecuritySolutionsAnalyticsAggregatedAlertOperations -from ._io_tsecurity_solutions_analytics_recommendation_operations import IoTSecuritySolutionsAnalyticsRecommendationOperations -from ._io_tsecurity_solutions_analytics_recommendations_operations import IoTSecuritySolutionsAnalyticsRecommendationsOperations +from ._iot_security_solution_analytics_operations import IotSecuritySolutionAnalyticsOperations +from ._iot_security_solutions_analytics_aggregated_alert_operations import IotSecuritySolutionsAnalyticsAggregatedAlertOperations +from ._iot_security_solutions_analytics_recommendation_operations import IotSecuritySolutionsAnalyticsRecommendationOperations from ._allowed_connections_operations import AllowedConnectionsOperations from ._discovered_security_solutions_operations import DiscoveredSecuritySolutionsOperations from ._external_security_solutions_operations import ExternalSecuritySolutionsOperations @@ -46,14 +43,11 @@ 'PricingsOperations', 'AlertsOperations', 'SettingsOperations', - 'IoTSecuritySolutionsOperations', - 'IoTSecuritySolutionsResourceGroupOperations', + 'DeviceSecurityGroupsOperations', 'IotSecuritySolutionOperations', - 'IoTSecuritySolutionsAnalyticsOperations', - 'IoTSecuritySolutionsAnalyticsAggregatedAlertsOperations', - 'IoTSecuritySolutionsAnalyticsAggregatedAlertOperations', - 'IoTSecuritySolutionsAnalyticsRecommendationOperations', - 'IoTSecuritySolutionsAnalyticsRecommendationsOperations', + 'IotSecuritySolutionAnalyticsOperations', + 'IotSecuritySolutionsAnalyticsAggregatedAlertOperations', + 'IotSecuritySolutionsAnalyticsRecommendationOperations', 'AllowedConnectionsOperations', 'DiscoveredSecuritySolutionsOperations', 'ExternalSecuritySolutionsOperations', diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_device_security_groups_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_device_security_groups_operations.py new file mode 100644 index 000000000000..581733e3c324 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_device_security_groups_operations.py @@ -0,0 +1,298 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class DeviceSecurityGroupsOperations(object): + """DeviceSecurityGroupsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2019-08-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-08-01" + + self.config = config + + def list( + self, resource_id, custom_headers=None, raw=False, **operation_config): + """Use this method get the list of device security groups for the + specified IoT Hub resource. + + :param resource_id: The identifier of the resource. + :type resource_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DeviceSecurityGroup + :rtype: + ~azure.mgmt.security.models.DeviceSecurityGroupPaged[~azure.mgmt.security.models.DeviceSecurityGroup] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeviceSecurityGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups'} + + def get( + self, resource_id, device_security_group_name, custom_headers=None, raw=False, **operation_config): + """Use this method to get the device security group for the specified IoT + Hub resource. + + :param resource_id: The identifier of the resource. + :type resource_id: str + :param device_security_group_name: The name of the device security + group. Note that the name of the device security group is case + insensitive. + :type device_security_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeviceSecurityGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.DeviceSecurityGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, 'str'), + 'deviceSecurityGroupName': self._serialize.url("device_security_group_name", device_security_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeviceSecurityGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}'} + + def create_or_update( + self, resource_id, device_security_group_name, device_security_group, custom_headers=None, raw=False, **operation_config): + """Use this method to creates or updates the device security group on a + specified IoT Hub resource. + + :param resource_id: The identifier of the resource. + :type resource_id: str + :param device_security_group_name: The name of the device security + group. Note that the name of the device security group is case + insensitive. + :type device_security_group_name: str + :param device_security_group: Security group object. + :type device_security_group: + ~azure.mgmt.security.models.DeviceSecurityGroup + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeviceSecurityGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.DeviceSecurityGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, 'str'), + 'deviceSecurityGroupName': self._serialize.url("device_security_group_name", device_security_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(device_security_group, 'DeviceSecurityGroup') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeviceSecurityGroup', response) + if response.status_code == 201: + deserialized = self._deserialize('DeviceSecurityGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}'} + + def delete( + self, resource_id, device_security_group_name, custom_headers=None, raw=False, **operation_config): + """User this method to deletes the device security group. + + :param resource_id: The identifier of the resource. + :type resource_id: str + :param device_security_group_name: The name of the device security + group. Note that the name of the device security group is case + insensitive. + :type device_security_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, 'str'), + 'deviceSecurityGroupName': self._serialize.url("device_security_group_name", device_security_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_aggregated_alerts_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_aggregated_alerts_operations.py deleted file mode 100644 index 8e47ea54d879..000000000000 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_aggregated_alerts_operations.py +++ /dev/null @@ -1,117 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class IoTSecuritySolutionsAnalyticsAggregatedAlertsOperations(object): - """IoTSecuritySolutionsAnalyticsAggregatedAlertsOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2019-08-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-08-01" - - self.config = config - - def list( - self, resource_group_name, solution_name, top=None, custom_headers=None, raw=False, **operation_config): - """Security Analytics of a security solution. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param solution_name: The solution manager name - :type solution_name: str - :param top: The number of results to retrieve. - :type top: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of IoTSecurityAggregatedAlert - :rtype: - ~azure.mgmt.security.models.IoTSecurityAggregatedAlertPaged[~azure.mgmt.security.models.IoTSecurityAggregatedAlert] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'solutionName': self._serialize.url("solution_name", solution_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.IoTSecurityAggregatedAlertPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_recommendation_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_recommendation_operations.py deleted file mode 100644 index 3e251e9f060e..000000000000 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_recommendation_operations.py +++ /dev/null @@ -1,108 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class IoTSecuritySolutionsAnalyticsRecommendationOperations(object): - """IoTSecuritySolutionsAnalyticsRecommendationOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2019-08-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-08-01" - - self.config = config - - def get( - self, resource_group_name, solution_name, aggregated_recommendation_name, custom_headers=None, raw=False, **operation_config): - """Security Analytics of a security solution. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param solution_name: The solution manager name - :type solution_name: str - :param aggregated_recommendation_name: Identifier of the aggregated - recommendation - :type aggregated_recommendation_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: IoTSecurityAggregatedRecommendation or ClientRawResponse if - raw=true - :rtype: - ~azure.mgmt.security.models.IoTSecurityAggregatedRecommendation or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'solutionName': self._serialize.url("solution_name", solution_name, 'str'), - 'aggregatedRecommendationName': self._serialize.url("aggregated_recommendation_name", aggregated_recommendation_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('IoTSecurityAggregatedRecommendation', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName}'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_operations.py deleted file mode 100644 index b3f222701615..000000000000 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_operations.py +++ /dev/null @@ -1,111 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class IoTSecuritySolutionsOperations(object): - """IoTSecuritySolutionsOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2019-08-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-08-01" - - self.config = config - - def list( - self, filter=None, custom_headers=None, raw=False, **operation_config): - """List of security solutions. - - :param filter: filter the Security Solution with OData syntax. - supporting filter by iotHubs - :type filter: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of IoTSecuritySolutionModel - :rtype: - ~azure.mgmt.security.models.IoTSecuritySolutionModelPaged[~azure.mgmt.security.models.IoTSecuritySolutionModel] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.IoTSecuritySolutionModelPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotSecuritySolutions'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_resource_group_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_resource_group_operations.py deleted file mode 100644 index 1536a6eb452c..000000000000 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_resource_group_operations.py +++ /dev/null @@ -1,115 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class IoTSecuritySolutionsResourceGroupOperations(object): - """IoTSecuritySolutionsResourceGroupOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2019-08-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-08-01" - - self.config = config - - def list( - self, resource_group_name, filter=None, custom_headers=None, raw=False, **operation_config): - """List of security solutions. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param filter: filter the Security Solution with OData syntax. - supporting filter by iotHubs - :type filter: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of IoTSecuritySolutionModel - :rtype: - ~azure.mgmt.security.models.IoTSecuritySolutionModelPaged[~azure.mgmt.security.models.IoTSecuritySolutionModel] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.IoTSecuritySolutionModelPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solution_analytics_operations.py similarity index 89% rename from sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_operations.py rename to sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solution_analytics_operations.py index 70e6b43692b5..a7ee65858d04 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solution_analytics_operations.py @@ -16,8 +16,8 @@ from .. import models -class IoTSecuritySolutionsAnalyticsOperations(object): - """IoTSecuritySolutionsAnalyticsOperations operations. +class IotSecuritySolutionAnalyticsOperations(object): + """IotSecuritySolutionAnalyticsOperations operations. You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. @@ -39,14 +39,14 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def get_all( + def list( self, resource_group_name, solution_name, custom_headers=None, raw=False, **operation_config): - """Security Analytics of a security solution. + """Use this method to get IoT security Analytics metrics in an array. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. :type resource_group_name: str - :param solution_name: The solution manager name + :param solution_name: The name of the IoT Security solution. :type solution_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -61,7 +61,7 @@ def get_all( :raises: :class:`CloudError` """ # Construct URL - url = self.get_all.metadata['url'] + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -101,16 +101,16 @@ def get_all( return client_raw_response return deserialized - get_all.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels'} - def get_default( + def get( self, resource_group_name, solution_name, custom_headers=None, raw=False, **operation_config): - """Security Analytics of a security solution. + """Use this method to get IoT Security Analytics metrics. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. :type resource_group_name: str - :param solution_name: The solution manager name + :param solution_name: The name of the IoT Security solution. :type solution_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -124,7 +124,7 @@ def get_default( :raises: :class:`CloudError` """ # Construct URL - url = self.get_default.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -164,4 +164,4 @@ def get_default( return client_raw_response return deserialized - get_default.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solution_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solution_operations.py index 3a3c15481184..8a820da44265 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solution_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solution_operations.py @@ -39,14 +39,163 @@ def __init__(self, client, config, serializer, deserializer): self.config = config + def list_by_subscription( + self, filter=None, custom_headers=None, raw=False, **operation_config): + """Use this method to get the list of IoT Security solutions by + subscription. + + :param filter: Filter the IoT Security solution with OData syntax. + Supports filtering by iotHubs. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of IoTSecuritySolutionModel + :rtype: + ~azure.mgmt.security.models.IoTSecuritySolutionModelPaged[~azure.mgmt.security.models.IoTSecuritySolutionModel] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.IoTSecuritySolutionModelPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotSecuritySolutions'} + + def list_by_resource_group( + self, resource_group_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Use this method to get the list IoT Security solutions organized by + resource group. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param filter: Filter the IoT Security solution with OData syntax. + Supports filtering by iotHubs. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of IoTSecuritySolutionModel + :rtype: + ~azure.mgmt.security.models.IoTSecuritySolutionModelPaged[~azure.mgmt.security.models.IoTSecuritySolutionModel] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.IoTSecuritySolutionModelPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions'} + def get( self, resource_group_name, solution_name, custom_headers=None, raw=False, **operation_config): - """Details of a specific iot security solution. + """User this method to get details of a specific IoT Security solution + based on solution name. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. :type resource_group_name: str - :param solution_name: The solution manager name + :param solution_name: The name of the IoT Security solution. :type solution_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -101,14 +250,14 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}'} - def create( + def create_or_update( self, resource_group_name, solution_name, iot_security_solution_data, custom_headers=None, raw=False, **operation_config): - """Create new solution manager. + """Use this method to create or update yours IoT Security solution. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. :type resource_group_name: str - :param solution_name: The solution manager name + :param solution_name: The name of the IoT Security solution. :type solution_name: str :param iot_security_solution_data: The security solution data :type iot_security_solution_data: @@ -124,7 +273,7 @@ def create( :raises: :class:`CloudError` """ # Construct URL - url = self.create.metadata['url'] + url = self.create_or_update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -170,17 +319,18 @@ def create( return client_raw_response return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}'} def update( self, resource_group_name, solution_name, update_iot_security_solution_data, custom_headers=None, raw=False, **operation_config): - """update existing Security Solution tags or user defined resources. To - update other fields use the CreateOrUpdate method. + """Use this method to update existing IoT Security solution tags or user + defined resources. To update other fields use the CreateOrUpdate + method. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. :type resource_group_name: str - :param solution_name: The solution manager name + :param solution_name: The name of the IoT Security solution. :type solution_name: str :param update_iot_security_solution_data: The security solution data :type update_iot_security_solution_data: @@ -244,12 +394,12 @@ def update( def delete( self, resource_group_name, solution_name, custom_headers=None, raw=False, **operation_config): - """Create new solution manager. + """Use this method to delete yours IoT Security solution. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. :type resource_group_name: str - :param solution_name: The solution manager name + :param solution_name: The name of the IoT Security solution. :type solution_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_aggregated_alert_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solutions_analytics_aggregated_alert_operations.py similarity index 63% rename from sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_aggregated_alert_operations.py rename to sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solutions_analytics_aggregated_alert_operations.py index b4a3340cf7e6..327bbbd5f397 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_aggregated_alert_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solutions_analytics_aggregated_alert_operations.py @@ -16,8 +16,8 @@ from .. import models -class IoTSecuritySolutionsAnalyticsAggregatedAlertOperations(object): - """IoTSecuritySolutionsAnalyticsAggregatedAlertOperations operations. +class IotSecuritySolutionsAnalyticsAggregatedAlertOperations(object): + """IotSecuritySolutionsAnalyticsAggregatedAlertOperations operations. You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. @@ -39,16 +39,95 @@ def __init__(self, client, config, serializer, deserializer): self.config = config + def list( + self, resource_group_name, solution_name, top=None, custom_headers=None, raw=False, **operation_config): + """Use this method to get the aggregated alert list of yours IoT Security + solution. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param solution_name: The name of the IoT Security solution. + :type solution_name: str + :param top: Number of results to retrieve. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of IoTSecurityAggregatedAlert + :rtype: + ~azure.mgmt.security.models.IoTSecurityAggregatedAlertPaged[~azure.mgmt.security.models.IoTSecurityAggregatedAlert] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'solutionName': self._serialize.url("solution_name", solution_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.IoTSecurityAggregatedAlertPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts'} + def get( self, resource_group_name, solution_name, aggregated_alert_name, custom_headers=None, raw=False, **operation_config): - """Security Analytics of a security solution. + """Use this method to get a single the aggregated alert of yours IoT + Security solution. This aggregation is performed by alert name. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. :type resource_group_name: str - :param solution_name: The solution manager name + :param solution_name: The name of the IoT Security solution. :type solution_name: str - :param aggregated_alert_name: Identifier of the aggregated alert + :param aggregated_alert_name: Identifier of the aggregated alert. :type aggregated_alert_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -106,14 +185,14 @@ def get( def dismiss( self, resource_group_name, solution_name, aggregated_alert_name, custom_headers=None, raw=False, **operation_config): - """Security Analytics of a security solution. + """Use this method to dismiss an aggregated IoT Security Solution Alert. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. :type resource_group_name: str - :param solution_name: The solution manager name + :param solution_name: The name of the IoT Security solution. :type solution_name: str - :param aggregated_alert_name: Identifier of the aggregated alert + :param aggregated_alert_name: Identifier of the aggregated alert. :type aggregated_alert_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_recommendations_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solutions_analytics_recommendation_operations.py similarity index 54% rename from sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_recommendations_operations.py rename to sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solutions_analytics_recommendation_operations.py index 3276e998ec1a..57dbc1031ce4 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_recommendations_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solutions_analytics_recommendation_operations.py @@ -16,8 +16,8 @@ from .. import models -class IoTSecuritySolutionsAnalyticsRecommendationsOperations(object): - """IoTSecuritySolutionsAnalyticsRecommendationsOperations operations. +class IotSecuritySolutionsAnalyticsRecommendationOperations(object): + """IotSecuritySolutionsAnalyticsRecommendationOperations operations. You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. @@ -39,16 +39,87 @@ def __init__(self, client, config, serializer, deserializer): self.config = config + def get( + self, resource_group_name, solution_name, aggregated_recommendation_name, custom_headers=None, raw=False, **operation_config): + """Use this method to get the aggregated security analytics recommendation + of yours IoT Security solution. This aggregation is performed by + recommendation name. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param solution_name: The name of the IoT Security solution. + :type solution_name: str + :param aggregated_recommendation_name: Name of the recommendation + aggregated for this query. + :type aggregated_recommendation_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: IoTSecurityAggregatedRecommendation or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.security.models.IoTSecurityAggregatedRecommendation or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'solutionName': self._serialize.url("solution_name", solution_name, 'str'), + 'aggregatedRecommendationName': self._serialize.url("aggregated_recommendation_name", aggregated_recommendation_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IoTSecurityAggregatedRecommendation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName}'} + def list( self, resource_group_name, solution_name, top=None, custom_headers=None, raw=False, **operation_config): - """Security Analytics of a security solution. + """Use this method to get the list of aggregated security analytics + recommendations of yours IoT Security solution. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. :type resource_group_name: str - :param solution_name: The solution manager name + :param solution_name: The name of the IoT Security solution. :type solution_name: str - :param top: The number of results to retrieve. + :param top: Number of results to retrieve. :type top: int :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_pricings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_pricings_operations.py index 02e06e34875c..e7d4637ae20b 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_pricings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_pricings_operations.py @@ -41,10 +41,7 @@ def __init__(self, client, config, serializer, deserializer): def list( self, custom_headers=None, raw=False, **operation_config): - """A given security pricing configuration in the subscription. Azure - Security Center is available in two pricing tiers: Free and Standard, - on multiple resource types, including Virtual machines, SQL Servers, - App service plans and Storage accounts. + """Lists Security Center pricing configurations in the subscription. :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -99,10 +96,8 @@ def list( def get( self, pricing_name, custom_headers=None, raw=False, **operation_config): - """A given security pricing configuration in the subscription. Azure - Security Center is available in two pricing tiers: Free and Standard, - on multiple resource types, including Virtual machines, SQL Servers, - App service plans and Storage accounts. + """Gets a provided Security Center pricing configuration in the + subscription. :param pricing_name: name of the pricing configuration :type pricing_name: str @@ -160,10 +155,8 @@ def get( def update( self, pricing_name, pricing_tier, custom_headers=None, raw=False, **operation_config): - """A given security pricing configuration in the subscription. Azure - Security Center is available in two pricing tiers: Free and Standard, - on multiple resource types, including Virtual machines, SQL Servers, - App service plans and Storage accounts. + """Updates a provided Security Center pricing configuration in the + subscription. :param pricing_name: name of the pricing configuration :type pricing_name: str