From ccb8e95ccca923e9be98e4092c8a78ca12baa737 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 12 Apr 2021 08:18:18 +0000 Subject: [PATCH] CodeGen from PR 13883 in Azure/azure-rest-api-specs Merge 3952e2e9465055419a9332194696d998bb064256 into f5e595b986c7dc546ea4a27f6e0f9be500babfea --- sdk/security/azure-mgmt-security/MANIFEST.in | 1 + sdk/security/azure-mgmt-security/_meta.json | 8 + .../azure/mgmt/security/_security_center.py | 15 +- .../azure/mgmt/security/models/__init__.py | 75 +- .../azure/mgmt/security/models/_models.py | 719 +++++++++++++---- .../azure/mgmt/security/models/_models_py3.py | 731 ++++++++++++++---- .../mgmt/security/models/_paged_models.py | 26 +- .../security/models/_security_center_enums.py | 138 +++- .../mgmt/security/operations/__init__.py | 6 +- .../security/operations/_alerts_operations.py | 136 +++- .../_iot_defender_settings_operations.py | 71 +- .../operations/_iot_sensors_operations.py | 148 +++- .../operations/_iot_sites_operations.py | 276 +++++++ .../_on_premise_iot_sensors_operations.py | 68 ++ ...ver_vulnerability_assessment_operations.py | 74 +- 15 files changed, 2086 insertions(+), 406 deletions(-) create mode 100644 sdk/security/azure-mgmt-security/_meta.json create mode 100644 sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sites_operations.py diff --git a/sdk/security/azure-mgmt-security/MANIFEST.in b/sdk/security/azure-mgmt-security/MANIFEST.in index a3cb07df87658..3a9b6517412bc 100644 --- a/sdk/security/azure-mgmt-security/MANIFEST.in +++ b/sdk/security/azure-mgmt-security/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/security/azure-mgmt-security/_meta.json b/sdk/security/azure-mgmt-security/_meta.json new file mode 100644 index 0000000000000..f062bcb095d31 --- /dev/null +++ b/sdk/security/azure-mgmt-security/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "V2", + "use": "@microsoft.azure/autorest.python@~4.0.71", + "commit": "6fdb9e8f2a565fd88801d25a61ff89971f453a08", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/security/resource-manager/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2", + "readme": "specification/security/resource-manager/readme.md" +} \ No newline at end of file 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 de0ae7d443e35..72ae2f71b9e95 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 @@ -47,7 +47,6 @@ from .operations import AdaptiveNetworkHardeningsOperations from .operations import AllowedConnectionsOperations from .operations import TopologyOperations -from .operations import AlertsOperations from .operations import JitNetworkAccessPoliciesOperations from .operations import DiscoveredSecuritySolutionsOperations from .operations import SecuritySolutionsReferenceDataOperations @@ -66,6 +65,8 @@ from .operations import DevicesForHubOperations from .operations import DeviceOperations from .operations import OnPremiseIotSensorsOperations +from .operations import IotSitesOperations +from .operations import AlertsOperations from . import models @@ -143,8 +144,6 @@ class SecurityCenter(SDKClient): :vartype allowed_connections: azure.mgmt.security.operations.AllowedConnectionsOperations :ivar topology: Topology operations :vartype topology: azure.mgmt.security.operations.TopologyOperations - :ivar alerts: Alerts operations - :vartype alerts: azure.mgmt.security.operations.AlertsOperations :ivar jit_network_access_policies: JitNetworkAccessPolicies operations :vartype jit_network_access_policies: azure.mgmt.security.operations.JitNetworkAccessPoliciesOperations :ivar discovered_security_solutions: DiscoveredSecuritySolutions operations @@ -181,6 +180,10 @@ class SecurityCenter(SDKClient): :vartype device: azure.mgmt.security.operations.DeviceOperations :ivar on_premise_iot_sensors: OnPremiseIotSensors operations :vartype on_premise_iot_sensors: azure.mgmt.security.operations.OnPremiseIotSensorsOperations + :ivar iot_sites: IotSites operations + :vartype iot_sites: azure.mgmt.security.operations.IotSitesOperations + :ivar alerts: Alerts operations + :vartype alerts: azure.mgmt.security.operations.AlertsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -271,8 +274,6 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.topology = TopologyOperations( self._client, self.config, self._serialize, self._deserialize) - self.alerts = AlertsOperations( - self._client, self.config, self._serialize, self._deserialize) self.jit_network_access_policies = JitNetworkAccessPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) self.discovered_security_solutions = DiscoveredSecuritySolutionsOperations( @@ -309,3 +310,7 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.on_premise_iot_sensors = OnPremiseIotSensorsOperations( self._client, self.config, self._serialize, self._deserialize) + self.iot_sites = IotSitesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.alerts = AlertsOperations( + 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 f182e6ae46be7..a32d79809d137 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 @@ -20,9 +20,13 @@ from ._models_py3 import AdaptiveNetworkHardening from ._models_py3 import AdaptiveNetworkHardeningEnforceRequest from ._models_py3 import AdditionalData + from ._models_py3 import AdditionalWorkspacesProperties from ._models_py3 import AdvancedThreatProtectionSetting from ._models_py3 import Alert from ._models_py3 import AlertEntity + from ._models_py3 import AlertSimulatorBundlesRequestProperties + from ._models_py3 import AlertSimulatorRequestBody + from ._models_py3 import AlertSimulatorRequestProperties from ._models_py3 import AlertsSuppressionRule from ._models_py3 import AllowedConnectionsResource from ._models_py3 import AllowlistCustomAlertRule @@ -63,6 +67,7 @@ from ._models_py3 import ConnectableResource from ._models_py3 import ConnectedResource from ._models_py3 import ConnectedWorkspace + from ._models_py3 import ConnectionFromIpNotAllowed from ._models_py3 import ConnectionToIpNotAllowed from ._models_py3 import ConnectorSetting from ._models_py3 import ContainerRegistryVulnerabilityProperties @@ -76,6 +81,7 @@ from ._models_py3 import DirectMethodInvokesNotInAllowedRange from ._models_py3 import DiscoveredSecuritySolution from ._models_py3 import EffectiveNetworkSecurityGroups + from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ETag from ._models_py3 import ExternalSecuritySolution from ._models_py3 import ExternalSecuritySolutionKind1 @@ -111,9 +117,11 @@ from ._models_py3 import IoTSecuritySolutionAnalyticsModelList from ._models_py3 import IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem from ._models_py3 import IoTSecuritySolutionModel - from ._models_py3 import IotSensor from ._models_py3 import IotSensorsList + from ._models_py3 import IotSensorsModel from ._models_py3 import IoTSeverityMetrics + from ._models_py3 import IotSitesList + from ._models_py3 import IotSitesModel from ._models_py3 import IpAddress from ._models_py3 import JitNetworkAccessPolicy from ._models_py3 import JitNetworkAccessPolicyInitiatePort @@ -148,7 +156,6 @@ from ._models_py3 import PackageDownloadsSensor from ._models_py3 import PackageDownloadsSensorFull from ._models_py3 import PackageDownloadsSensorFullOvf - from ._models_py3 import PackageDownloadsThreatIntelligence from ._models_py3 import PathRecommendation from ._models_py3 import Pricing from ._models_py3 import PricingList @@ -164,6 +171,7 @@ from ._models_py3 import RegulatoryComplianceControl from ._models_py3 import RegulatoryComplianceStandard from ._models_py3 import Remediation + from ._models_py3 import ResetPasswordInput from ._models_py3 import Resource from ._models_py3 import ResourceDetails from ._models_py3 import ResourceIdentifier @@ -204,11 +212,11 @@ from ._models_py3 import ServerVulnerabilityProperties from ._models_py3 import ServicePrincipalProperties from ._models_py3 import Setting - from ._models_py3 import SettingResource from ._models_py3 import Site from ._models_py3 import SqlServerVulnerabilityProperties from ._models_py3 import SubAssessmentStatus from ._models_py3 import SuppressionAlertsScope + from ._models_py3 import SystemData from ._models_py3 import Tags from ._models_py3 import TagsResource from ._models_py3 import ThresholdCustomAlertRule @@ -221,6 +229,7 @@ from ._models_py3 import TwinUpdatesNotInAllowedRange from ._models_py3 import UnauthorizedOperationsNotInAllowedRange from ._models_py3 import UpdateIotSecuritySolutionData + from ._models_py3 import UpgradePackageDownloadInfo from ._models_py3 import UserDefinedResourcesProperties from ._models_py3 import UserRecommendation from ._models_py3 import VaRule @@ -238,9 +247,13 @@ from ._models import AdaptiveNetworkHardening from ._models import AdaptiveNetworkHardeningEnforceRequest from ._models import AdditionalData + from ._models import AdditionalWorkspacesProperties from ._models import AdvancedThreatProtectionSetting from ._models import Alert from ._models import AlertEntity + from ._models import AlertSimulatorBundlesRequestProperties + from ._models import AlertSimulatorRequestBody + from ._models import AlertSimulatorRequestProperties from ._models import AlertsSuppressionRule from ._models import AllowedConnectionsResource from ._models import AllowlistCustomAlertRule @@ -281,6 +294,7 @@ from ._models import ConnectableResource from ._models import ConnectedResource from ._models import ConnectedWorkspace + from ._models import ConnectionFromIpNotAllowed from ._models import ConnectionToIpNotAllowed from ._models import ConnectorSetting from ._models import ContainerRegistryVulnerabilityProperties @@ -294,6 +308,7 @@ from ._models import DirectMethodInvokesNotInAllowedRange from ._models import DiscoveredSecuritySolution from ._models import EffectiveNetworkSecurityGroups + from ._models import ErrorAdditionalInfo from ._models import ETag from ._models import ExternalSecuritySolution from ._models import ExternalSecuritySolutionKind1 @@ -329,9 +344,11 @@ from ._models import IoTSecuritySolutionAnalyticsModelList from ._models import IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem from ._models import IoTSecuritySolutionModel - from ._models import IotSensor from ._models import IotSensorsList + from ._models import IotSensorsModel from ._models import IoTSeverityMetrics + from ._models import IotSitesList + from ._models import IotSitesModel from ._models import IpAddress from ._models import JitNetworkAccessPolicy from ._models import JitNetworkAccessPolicyInitiatePort @@ -366,7 +383,6 @@ from ._models import PackageDownloadsSensor from ._models import PackageDownloadsSensorFull from ._models import PackageDownloadsSensorFullOvf - from ._models import PackageDownloadsThreatIntelligence from ._models import PathRecommendation from ._models import Pricing from ._models import PricingList @@ -382,6 +398,7 @@ from ._models import RegulatoryComplianceControl from ._models import RegulatoryComplianceStandard from ._models import Remediation + from ._models import ResetPasswordInput from ._models import Resource from ._models import ResourceDetails from ._models import ResourceIdentifier @@ -422,11 +439,11 @@ from ._models import ServerVulnerabilityProperties from ._models import ServicePrincipalProperties from ._models import Setting - from ._models import SettingResource from ._models import Site from ._models import SqlServerVulnerabilityProperties from ._models import SubAssessmentStatus from ._models import SuppressionAlertsScope + from ._models import SystemData from ._models import Tags from ._models import TagsResource from ._models import ThresholdCustomAlertRule @@ -439,6 +456,7 @@ from ._models import TwinUpdatesNotInAllowedRange from ._models import UnauthorizedOperationsNotInAllowedRange from ._models import UpdateIotSecuritySolutionData + from ._models import UpgradePackageDownloadInfo from ._models import UserDefinedResourcesProperties from ._models import UserRecommendation from ._models import VaRule @@ -494,6 +512,9 @@ RecommendationType, RecommendationConfigStatus, UnmaskedIpLoggingStatus, + AdditionalWorkspaceType, + AdditionalWorkspaceDataType, + CreatedByType, ReportedSeverity, AlertSeverity, AlertIntent, @@ -509,7 +530,7 @@ PropertyType, Operator, RuleState, - Category, + Categories, UserImpact, ImplementationEffort, Threats, @@ -517,8 +538,6 @@ AssessmentStatusCode, Direction, TransportProtocol, - Intent, - AlertStatus, Protocol, Status, StatusReason, @@ -535,7 +554,11 @@ RuleStatus, RuleSeverity, RuleType, + OnboardingKind, VersionKind, + SensorStatus, + TiStatus, + SensorType, MacSignificance, RelationToIpStatus, ManagementState, @@ -545,6 +568,9 @@ ProgrammingState, ScanningFunctionality, DeviceStatus, + Intent, + AlertStatus, + BundleType, ExpandEnum, ConnectionType, ExpandControlsEnum, @@ -561,9 +587,13 @@ 'AdaptiveNetworkHardening', 'AdaptiveNetworkHardeningEnforceRequest', 'AdditionalData', + 'AdditionalWorkspacesProperties', 'AdvancedThreatProtectionSetting', 'Alert', 'AlertEntity', + 'AlertSimulatorBundlesRequestProperties', + 'AlertSimulatorRequestBody', + 'AlertSimulatorRequestProperties', 'AlertsSuppressionRule', 'AllowedConnectionsResource', 'AllowlistCustomAlertRule', @@ -604,6 +634,7 @@ 'ConnectableResource', 'ConnectedResource', 'ConnectedWorkspace', + 'ConnectionFromIpNotAllowed', 'ConnectionToIpNotAllowed', 'ConnectorSetting', 'ContainerRegistryVulnerabilityProperties', @@ -617,6 +648,7 @@ 'DirectMethodInvokesNotInAllowedRange', 'DiscoveredSecuritySolution', 'EffectiveNetworkSecurityGroups', + 'ErrorAdditionalInfo', 'ETag', 'ExternalSecuritySolution', 'ExternalSecuritySolutionKind1', @@ -652,9 +684,11 @@ 'IoTSecuritySolutionAnalyticsModelList', 'IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem', 'IoTSecuritySolutionModel', - 'IotSensor', 'IotSensorsList', + 'IotSensorsModel', 'IoTSeverityMetrics', + 'IotSitesList', + 'IotSitesModel', 'IpAddress', 'JitNetworkAccessPolicy', 'JitNetworkAccessPolicyInitiatePort', @@ -689,7 +723,6 @@ 'PackageDownloadsSensor', 'PackageDownloadsSensorFull', 'PackageDownloadsSensorFullOvf', - 'PackageDownloadsThreatIntelligence', 'PathRecommendation', 'Pricing', 'PricingList', @@ -705,6 +738,7 @@ 'RegulatoryComplianceControl', 'RegulatoryComplianceStandard', 'Remediation', + 'ResetPasswordInput', 'Resource', 'ResourceDetails', 'ResourceIdentifier', @@ -745,11 +779,11 @@ 'ServerVulnerabilityProperties', 'ServicePrincipalProperties', 'Setting', - 'SettingResource', 'Site', 'SqlServerVulnerabilityProperties', 'SubAssessmentStatus', 'SuppressionAlertsScope', + 'SystemData', 'Tags', 'TagsResource', 'ThresholdCustomAlertRule', @@ -762,6 +796,7 @@ 'TwinUpdatesNotInAllowedRange', 'UnauthorizedOperationsNotInAllowedRange', 'UpdateIotSecuritySolutionData', + 'UpgradePackageDownloadInfo', 'UserDefinedResourcesProperties', 'UserRecommendation', 'VaRule', @@ -797,7 +832,6 @@ 'AdaptiveNetworkHardeningPaged', 'AllowedConnectionsResourcePaged', 'TopologyResourcePaged', - 'AlertPaged', 'JitNetworkAccessPolicyPaged', 'DiscoveredSecuritySolutionPaged', 'ExternalSecuritySolutionPaged', @@ -807,6 +841,7 @@ 'SecuritySolutionPaged', 'ConnectorSettingPaged', 'DevicePaged', + 'AlertPaged', 'ResourceStatus', 'PricingTier', 'ValueType', @@ -816,6 +851,9 @@ 'RecommendationType', 'RecommendationConfigStatus', 'UnmaskedIpLoggingStatus', + 'AdditionalWorkspaceType', + 'AdditionalWorkspaceDataType', + 'CreatedByType', 'ReportedSeverity', 'AlertSeverity', 'AlertIntent', @@ -831,7 +869,7 @@ 'PropertyType', 'Operator', 'RuleState', - 'Category', + 'Categories', 'UserImpact', 'ImplementationEffort', 'Threats', @@ -839,8 +877,6 @@ 'AssessmentStatusCode', 'Direction', 'TransportProtocol', - 'Intent', - 'AlertStatus', 'Protocol', 'Status', 'StatusReason', @@ -857,7 +893,11 @@ 'RuleStatus', 'RuleSeverity', 'RuleType', + 'OnboardingKind', 'VersionKind', + 'SensorStatus', + 'TiStatus', + 'SensorType', 'MacSignificance', 'RelationToIpStatus', 'ManagementState', @@ -867,6 +907,9 @@ 'ProgrammingState', 'ScanningFunctionality', 'DeviceStatus', + 'Intent', + 'AlertStatus', + 'BundleType', 'ExpandEnum', 'ConnectionType', 'ExpandControlsEnum', 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 941c6b8b9bde2..be5de246b01d0 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 @@ -643,6 +643,32 @@ def __init__(self, **kwargs): self.assessed_resource_type = None +class AdditionalWorkspacesProperties(Model): + """Properties of the additional workspaces. + + :param workspace: Workspace resource id + :type workspace: str + :param type: Workspace type. Possible values include: 'Sentinel'. Default + value: "Sentinel" . + :type type: str or ~azure.mgmt.security.models.AdditionalWorkspaceType + :param data_types: List of data types sent to workspace + :type data_types: list[str or + ~azure.mgmt.security.models.AdditionalWorkspaceDataType] + """ + + _attribute_map = { + 'workspace': {'key': 'workspace', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data_types': {'key': 'dataTypes', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(AdditionalWorkspacesProperties, self).__init__(**kwargs) + self.workspace = kwargs.get('workspace', None) + self.type = kwargs.get('type', "Sentinel") + self.data_types = kwargs.get('data_types', None) + + class AdvancedThreatProtectionSetting(Resource): """The Advanced Threat Protection resource. @@ -878,6 +904,87 @@ def __init__(self, **kwargs): self.type = None +class AlertSimulatorRequestProperties(Model): + """Describes properties of an alert simulation request. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AlertSimulatorBundlesRequestProperties + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Bundles': 'AlertSimulatorBundlesRequestProperties'} + } + + def __init__(self, **kwargs): + super(AlertSimulatorRequestProperties, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.kind = None + + +class AlertSimulatorBundlesRequestProperties(AlertSimulatorRequestProperties): + """Simulate alerts according to this bundles. + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param kind: Required. Constant filled by server. + :type kind: str + :param bundles: Bundles list. + :type bundles: list[str or ~azure.mgmt.security.models.BundleType] + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'bundles': {'key': 'bundles', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(AlertSimulatorBundlesRequestProperties, self).__init__(**kwargs) + self.bundles = kwargs.get('bundles', None) + self.kind = 'Bundles' + + +class AlertSimulatorRequestBody(Model): + """Alert Simulator request body. + + :param properties: Alert Simulator request body data. + :type properties: + ~azure.mgmt.security.models.AlertSimulatorRequestProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'AlertSimulatorRequestProperties'}, + } + + def __init__(self, **kwargs): + super(AlertSimulatorRequestBody, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + class AlertsSuppressionRule(Resource): """Describes the suppression rule. @@ -1053,8 +1160,8 @@ class AllowlistCustomAlertRule(ListCustomAlertRule): type) is allowed. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ConnectionToIpNotAllowed, LocalUserNotAllowed, - ProcessNotAllowed + sub-classes are: ConnectionToIpNotAllowed, ConnectionFromIpNotAllowed, + LocalUserNotAllowed, ProcessNotAllowed Variables are only populated by the server, and will be ignored when sending a request. @@ -1096,7 +1203,7 @@ class AllowlistCustomAlertRule(ListCustomAlertRule): } _subtype_map = { - 'rule_type': {'ConnectionToIpNotAllowed': 'ConnectionToIpNotAllowed', 'LocalUserNotAllowed': 'LocalUserNotAllowed', 'ProcessNotAllowed': 'ProcessNotAllowed'} + 'rule_type': {'ConnectionToIpNotAllowed': 'ConnectionToIpNotAllowed', 'ConnectionFromIpNotAllowed': 'ConnectionFromIpNotAllowed', 'LocalUserNotAllowed': 'LocalUserNotAllowed', 'ProcessNotAllowed': 'ProcessNotAllowed'} } def __init__(self, **kwargs): @@ -1797,7 +1904,10 @@ class AutomationSource(Model): https://aka.ms/ASCAutomationSchemas. :param event_source: A valid event source type. Possible values include: - 'Assessments', 'SubAssessments', 'Alerts' + 'Assessments', 'SubAssessments', 'Alerts', 'SecureScores', + 'SecureScoresSnapshot', 'SecureScoreControls', + 'SecureScoreControlsSnapshot', 'RegulatoryComplianceAssessment', + 'RegulatoryComplianceAssessmentSnapshot' :type event_source: str or ~azure.mgmt.security.models.EventSource :param rule_sets: A set of rules which evaluate upon event interception. A logical disjunction is applied between defined rule sets (logical 'or'). @@ -2335,33 +2445,49 @@ def __init__(self, **kwargs): class CloudError(Model): - """Error response structure. + """Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: An identifier for the error. Codes are invariant and are - intended to be consumed programmatically. + :ivar code: The error code. :vartype code: str - :ivar message: A message describing the error, intended to be suitable for - display in a user interface. + :ivar message: The error message. :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.security.models.CloudErrorBody] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.security.models.ErrorAdditionalInfo] """ _validation = { 'code': {'readonly': True}, 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, } _attribute_map = { 'code': {'key': 'error.code', 'type': 'str'}, 'message': {'key': 'error.message', 'type': 'str'}, + 'target': {'key': 'error.target', 'type': 'str'}, + 'details': {'key': 'error.details', 'type': '[CloudErrorBody]'}, + 'additional_info': {'key': 'error.additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } def __init__(self, **kwargs): super(CloudError, self).__init__(**kwargs) self.code = None self.message = None + self.target = None + self.details = None + self.additional_info = None class CloudErrorException(HttpOperationError): @@ -2376,6 +2502,50 @@ def __init__(self, deserialize, response, *args): super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) +class CloudErrorBody(Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.security.models.CloudErrorBody] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.security.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + class Compliance(Resource): """Compliance of a scope. @@ -2580,6 +2750,54 @@ def __init__(self, **kwargs): self.id = kwargs.get('id', None) +class ConnectionFromIpNotAllowed(AllowlistCustomAlertRule): + """Inbound connection from an ip that isn't allowed. Allow list consists of + ipv4 or ipv6 range in CIDR notation. + + 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. Constant filled by server. + :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(ConnectionFromIpNotAllowed, self).__init__(**kwargs) + self.rule_type = 'ConnectionFromIpNotAllowed' + + class ConnectionToIpNotAllowed(AllowlistCustomAlertRule): """Outbound connection to an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation. @@ -2789,54 +3007,9 @@ def __init__(self, **kwargs): self.base = None -class SettingResource(Resource): +class Setting(Resource): """The kind of the security setting. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Setting - - 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 id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param kind: Required. Constant filled by server. - :type kind: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - } - - _subtype_map = { - 'kind': {'Setting': 'Setting'} - } - - def __init__(self, **kwargs): - super(SettingResource, self).__init__(**kwargs) - self.kind = None - self.kind = 'SettingResource' - - -class Setting(SettingResource): - """Represents a security setting in Azure Security Center. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: DataExportSettings @@ -2875,6 +3048,7 @@ class Setting(SettingResource): def __init__(self, **kwargs): super(Setting, self).__init__(**kwargs) + self.kind = None self.kind = 'Setting' @@ -3309,6 +3483,34 @@ def __init__(self, **kwargs): self.network_security_groups = kwargs.get('network_security_groups', None) +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + class ETag(Model): """Entity tag is used for comparing two or more entities from the same requested resource. @@ -3922,12 +4124,18 @@ def __init__(self, **kwargs): self.keywords = kwargs.get('keywords', None) -class IotAlert(Model): +class IotAlert(Resource): """IoT alert. 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 :ivar system_alert_id: Holds the product canonical identifier of the alert within the scope of a product :vartype system_alert_id: str @@ -3950,6 +4158,9 @@ class IotAlert(Model): """ _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, 'system_alert_id': {'readonly': True}, 'compromised_entity': {'readonly': True}, 'alert_type': {'readonly': True}, @@ -3958,6 +4169,9 @@ class IotAlert(Model): } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, 'system_alert_id': {'key': 'properties.systemAlertId', 'type': 'str'}, 'compromised_entity': {'key': 'properties.compromisedEntity', 'type': 'str'}, 'alert_type': {'key': 'properties.alertType', 'type': 'str'}, @@ -3978,12 +4192,18 @@ def __init__(self, **kwargs): self.extended_properties = kwargs.get('extended_properties', None) -class IotAlertModel(Model): +class IotAlertModel(Resource): """IoT alert. 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 :ivar system_alert_id: Holds the product canonical identifier of the alert within the scope of a product :vartype system_alert_id: str @@ -4006,6 +4226,9 @@ class IotAlertModel(Model): """ _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, 'system_alert_id': {'readonly': True}, 'compromised_entity': {'readonly': True}, 'alert_type': {'readonly': True}, @@ -4014,6 +4237,9 @@ class IotAlertModel(Model): } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, 'system_alert_id': {'key': 'properties.systemAlertId', 'type': 'str'}, 'compromised_entity': {'key': 'properties.compromisedEntity', 'type': 'str'}, 'alert_type': {'key': 'properties.alertType', 'type': 'str'}, @@ -4177,6 +4403,9 @@ class IotDefenderSettingsModel(Resource): :param sentinel_workspace_resource_ids: Required. Sentinel Workspace Resource Ids :type sentinel_workspace_resource_ids: list[str] + :param onboarding_kind: Required. The kind of onboarding for the + subscription. Possible values include: 'Default', 'MigratedToAzure' + :type onboarding_kind: str or ~azure.mgmt.security.models.OnboardingKind """ _validation = { @@ -4185,6 +4414,7 @@ class IotDefenderSettingsModel(Resource): 'type': {'readonly': True}, 'device_quota': {'required': True, 'minimum': 1000}, 'sentinel_workspace_resource_ids': {'required': True}, + 'onboarding_kind': {'required': True}, } _attribute_map = { @@ -4193,12 +4423,14 @@ class IotDefenderSettingsModel(Resource): 'type': {'key': 'type', 'type': 'str'}, 'device_quota': {'key': 'properties.deviceQuota', 'type': 'int'}, 'sentinel_workspace_resource_ids': {'key': 'properties.sentinelWorkspaceResourceIds', 'type': '[str]'}, + 'onboarding_kind': {'key': 'properties.onboardingKind', 'type': 'str'}, } def __init__(self, **kwargs): super(IotDefenderSettingsModel, self).__init__(**kwargs) self.device_quota = kwargs.get('device_quota', None) self.sentinel_workspace_resource_ids = kwargs.get('sentinel_workspace_resource_ids', None) + self.onboarding_kind = kwargs.get('onboarding_kind', None) class IotRecommendation(Resource): @@ -4430,7 +4662,7 @@ class IoTSecurityAggregatedAlert(Model): :vartype description: str :ivar count: Number of alerts occurrences within the aggregated time window. - :vartype count: int + :vartype count: long :ivar effected_resource_type: Azure resource ID of the resource that received the alerts. :vartype effected_resource_type: str @@ -4478,7 +4710,7 @@ class IoTSecurityAggregatedAlert(Model): 'reported_severity': {'key': 'properties.reportedSeverity', 'type': 'str'}, 'remediation_steps': {'key': 'properties.remediationSteps', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, + 'count': {'key': 'properties.count', 'type': 'long'}, 'effected_resource_type': {'key': 'properties.effectedResourceType', 'type': 'str'}, 'system_source': {'key': 'properties.systemSource', 'type': 'str'}, 'action_taken': {'key': 'properties.actionTaken', 'type': 'str'}, @@ -4516,7 +4748,7 @@ class IoTSecurityAggregatedAlertPropertiesTopDevicesListItem(Model): :ivar device_id: Name of the device. :vartype device_id: str :ivar alerts_count: Number of alerts raised for this device. - :vartype alerts_count: int + :vartype alerts_count: long :ivar last_occurrence: Most recent time this alert was raised for this device, on this day. :vartype last_occurrence: str @@ -4530,7 +4762,7 @@ class IoTSecurityAggregatedAlertPropertiesTopDevicesListItem(Model): _attribute_map = { 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'alerts_count': {'key': 'alertsCount', 'type': 'int'}, + 'alerts_count': {'key': 'alertsCount', 'type': 'long'}, 'last_occurrence': {'key': 'lastOccurrence', 'type': 'str'}, } @@ -4574,10 +4806,10 @@ class IoTSecurityAggregatedRecommendation(Model): ~azure.mgmt.security.models.ReportedSeverity :ivar healthy_devices: Number of healthy devices within the IoT Security solution. - :vartype healthy_devices: int + :vartype healthy_devices: long :ivar unhealthy_device_count: Number of unhealthy devices within the IoT Security solution. - :vartype unhealthy_device_count: int + :vartype unhealthy_device_count: long :ivar log_analytics_query: Log analytics query for getting the list of affected devices/alerts. :vartype log_analytics_query: str @@ -4610,8 +4842,8 @@ class IoTSecurityAggregatedRecommendation(Model): 'detected_by': {'key': 'properties.detectedBy', 'type': 'str'}, 'remediation_steps': {'key': 'properties.remediationSteps', 'type': 'str'}, 'reported_severity': {'key': 'properties.reportedSeverity', 'type': 'str'}, - 'healthy_devices': {'key': 'properties.healthyDevices', 'type': 'int'}, - 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'int'}, + 'healthy_devices': {'key': 'properties.healthyDevices', 'type': 'long'}, + 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'long'}, 'log_analytics_query': {'key': 'properties.logAnalyticsQuery', 'type': 'str'}, } @@ -4643,7 +4875,7 @@ class IoTSecurityAlertedDevice(Model): :ivar device_id: Device identifier. :vartype device_id: str :ivar alerts_count: Number of alerts raised for this device. - :vartype alerts_count: int + :vartype alerts_count: long """ _validation = { @@ -4653,7 +4885,7 @@ class IoTSecurityAlertedDevice(Model): _attribute_map = { 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'alerts_count': {'key': 'alertsCount', 'type': 'int'}, + 'alerts_count': {'key': 'alertsCount', 'type': 'long'}, } def __init__(self, **kwargs): @@ -4676,7 +4908,7 @@ class IoTSecurityDeviceAlert(Model): :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity :ivar alerts_count: Number of alerts raised for this alert type. - :vartype alerts_count: int + :vartype alerts_count: long """ _validation = { @@ -4688,7 +4920,7 @@ class IoTSecurityDeviceAlert(Model): _attribute_map = { 'alert_display_name': {'key': 'alertDisplayName', 'type': 'str'}, 'reported_severity': {'key': 'reportedSeverity', 'type': 'str'}, - 'alerts_count': {'key': 'alertsCount', 'type': 'int'}, + 'alerts_count': {'key': 'alertsCount', 'type': 'long'}, } def __init__(self, **kwargs): @@ -4712,7 +4944,7 @@ class IoTSecurityDeviceRecommendation(Model): :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity :ivar devices_count: Number of devices with this recommendation. - :vartype devices_count: int + :vartype devices_count: long """ _validation = { @@ -4724,7 +4956,7 @@ class IoTSecurityDeviceRecommendation(Model): _attribute_map = { 'recommendation_display_name': {'key': 'recommendationDisplayName', 'type': 'str'}, 'reported_severity': {'key': 'reportedSeverity', 'type': 'str'}, - 'devices_count': {'key': 'devicesCount', 'type': 'int'}, + 'devices_count': {'key': 'devicesCount', 'type': 'long'}, } def __init__(self, **kwargs): @@ -4750,7 +4982,7 @@ class IoTSecuritySolutionAnalyticsModel(Resource): :vartype metrics: ~azure.mgmt.security.models.IoTSeverityMetrics :ivar unhealthy_device_count: Number of unhealthy devices within your IoT Security solution. - :vartype unhealthy_device_count: int + :vartype unhealthy_device_count: long :ivar devices_metrics: List of device metrics by the aggregation date. :vartype devices_metrics: list[~azure.mgmt.security.models.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem] @@ -4781,7 +5013,7 @@ class IoTSecuritySolutionAnalyticsModel(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'metrics': {'key': 'properties.metrics', 'type': 'IoTSeverityMetrics'}, - 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'int'}, + 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'long'}, 'devices_metrics': {'key': 'properties.devicesMetrics', 'type': '[IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem]'}, 'top_alerted_devices': {'key': 'properties.topAlertedDevices', 'type': '[IoTSecurityAlertedDevice]'}, 'most_prevalent_device_alerts': {'key': 'properties.mostPrevalentDeviceAlerts', 'type': '[IoTSecurityDeviceAlert]'}, @@ -4899,6 +5131,12 @@ class IoTSecuritySolutionModel(Model): . :type unmasked_ip_logging_status: str or ~azure.mgmt.security.models.UnmaskedIpLoggingStatus + :param additional_workspaces: List of additional workspaces + :type additional_workspaces: + list[~azure.mgmt.security.models.AdditionalWorkspacesProperties] + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: ~azure.mgmt.security.models.SystemData """ _validation = { @@ -4908,6 +5146,7 @@ class IoTSecuritySolutionModel(Model): 'display_name': {'required': True}, 'iot_hubs': {'required': True}, 'auto_discovered_resources': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -4926,6 +5165,8 @@ class IoTSecuritySolutionModel(Model): 'auto_discovered_resources': {'key': 'properties.autoDiscoveredResources', 'type': '[str]'}, 'recommendations_configuration': {'key': 'properties.recommendationsConfiguration', 'type': '[RecommendationConfigurationProperties]'}, 'unmasked_ip_logging_status': {'key': 'properties.unmaskedIpLoggingStatus', 'type': 'str'}, + 'additional_workspaces': {'key': 'properties.additionalWorkspaces', 'type': '[AdditionalWorkspacesProperties]'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__(self, **kwargs): @@ -4945,10 +5186,35 @@ def __init__(self, **kwargs): self.auto_discovered_resources = None self.recommendations_configuration = kwargs.get('recommendations_configuration', None) self.unmasked_ip_logging_status = kwargs.get('unmasked_ip_logging_status', "Disabled") + self.additional_workspaces = kwargs.get('additional_workspaces', None) + self.system_data = None -class IotSensor(Resource): - """IoT sensor. +class IotSensorsList(Model): + """List of IoT sensors. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List data + :vartype value: list[~azure.mgmt.security.models.IotSensorsModel] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IotSensorsModel]'}, + } + + def __init__(self, **kwargs): + super(IotSensorsList, self).__init__(**kwargs) + self.value = None + + +class IotSensorsModel(Resource): + """IoT sensor model. Variables are only populated by the server, and will be ignored when sending a request. @@ -4959,36 +5225,111 @@ class IotSensor(Resource): :vartype name: str :ivar type: Resource type :vartype type: str - :param properties: IoT sensor properties - :type properties: object + :ivar connectivity_time: Last connectivity time of the IoT sensor + :vartype connectivity_time: str + :ivar creation_time: Creation time of the IoT sensor + :vartype creation_time: str + :ivar dynamic_learning: Dynamic mode status of the IoT sensor + :vartype dynamic_learning: bool + :ivar learning_mode: Learning mode status of the IoT sensor + :vartype learning_mode: bool + :ivar sensor_status: Status of the IoT sensor. Possible values include: + 'Ok', 'Disconnected', 'Unavailable' + :vartype sensor_status: str or ~azure.mgmt.security.models.SensorStatus + :ivar sensor_version: Version of the IoT sensor + :vartype sensor_version: str + :param ti_automatic_updates: TI Automatic mode status of the IoT sensor + :type ti_automatic_updates: bool + :ivar ti_status: TI Status of the IoT sensor. Possible values include: + 'Ok', 'Failed', 'InProgress', 'UpdateAvailable' + :vartype ti_status: str or ~azure.mgmt.security.models.TiStatus + :ivar ti_version: TI Version of the IoT sensor + :vartype ti_version: str + :param zone: Zone of the IoT sensor + :type zone: str + :param sensor_type: Type of sensor. Possible values include: 'Ot', + 'Enterprise' + :type sensor_type: str or ~azure.mgmt.security.models.SensorType """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'connectivity_time': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'dynamic_learning': {'readonly': True}, + 'learning_mode': {'readonly': True}, + 'sensor_status': {'readonly': True}, + 'sensor_version': {'readonly': True}, + 'ti_status': {'readonly': True}, + 'ti_version': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, + 'connectivity_time': {'key': 'properties.connectivityTime', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, + 'dynamic_learning': {'key': 'properties.dynamicLearning', 'type': 'bool'}, + 'learning_mode': {'key': 'properties.learningMode', 'type': 'bool'}, + 'sensor_status': {'key': 'properties.sensorStatus', 'type': 'str'}, + 'sensor_version': {'key': 'properties.sensorVersion', 'type': 'str'}, + 'ti_automatic_updates': {'key': 'properties.tiAutomaticUpdates', 'type': 'bool'}, + 'ti_status': {'key': 'properties.tiStatus', 'type': 'str'}, + 'ti_version': {'key': 'properties.tiVersion', 'type': 'str'}, + 'zone': {'key': 'properties.zone', 'type': 'str'}, + 'sensor_type': {'key': 'properties.sensorType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IotSensorsModel, self).__init__(**kwargs) + self.connectivity_time = None + self.creation_time = None + self.dynamic_learning = None + self.learning_mode = None + self.sensor_status = None + self.sensor_version = None + self.ti_automatic_updates = kwargs.get('ti_automatic_updates', None) + self.ti_status = None + self.ti_version = None + self.zone = kwargs.get('zone', None) + self.sensor_type = kwargs.get('sensor_type', None) + + +class IoTSeverityMetrics(Model): + """IoT Security solution analytics severity metrics. + + :param high: Count of high severity alerts/recommendations. + :type high: long + :param medium: Count of medium severity alerts/recommendations. + :type medium: long + :param low: Count of low severity alerts/recommendations. + :type low: long + """ + + _attribute_map = { + 'high': {'key': 'high', 'type': 'long'}, + 'medium': {'key': 'medium', 'type': 'long'}, + 'low': {'key': 'low', 'type': 'long'}, } def __init__(self, **kwargs): - super(IotSensor, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + super(IoTSeverityMetrics, self).__init__(**kwargs) + self.high = kwargs.get('high', None) + self.medium = kwargs.get('medium', None) + self.low = kwargs.get('low', None) -class IotSensorsList(Model): - """List of IoT sensors. +class IotSitesList(Model): + """List of IoT sites. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List data - :vartype value: list[~azure.mgmt.security.models.IotSensor] + :vartype value: list[~azure.mgmt.security.models.IotSitesModel] """ _validation = { @@ -4996,36 +5337,53 @@ class IotSensorsList(Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[IotSensor]'}, + 'value': {'key': 'value', 'type': '[IotSitesModel]'}, } def __init__(self, **kwargs): - super(IotSensorsList, self).__init__(**kwargs) + super(IotSitesList, self).__init__(**kwargs) self.value = None -class IoTSeverityMetrics(Model): - """IoT Security solution analytics severity metrics. +class IotSitesModel(Resource): + """IoT site model. - :param high: Count of high severity alerts/recommendations. - :type high: int - :param medium: Count of medium severity alerts/recommendations. - :type medium: int - :param low: Count of low severity alerts/recommendations. - :type low: int + 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 id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param display_name: Required. Display name of the IoT site + :type display_name: str + :param tags: Tags of the IoT site + :type tags: dict[str, str] """ + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'required': True}, + } + _attribute_map = { - 'high': {'key': 'high', 'type': 'int'}, - 'medium': {'key': 'medium', 'type': 'int'}, - 'low': {'key': 'low', 'type': 'int'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'tags': {'key': 'properties.tags', 'type': '{str}'}, } def __init__(self, **kwargs): - super(IoTSeverityMetrics, self).__init__(**kwargs) - self.high = kwargs.get('high', None) - self.medium = kwargs.get('medium', None) - self.low = kwargs.get('low', None) + super(IotSitesModel, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.tags = kwargs.get('tags', None) class IpAddress(Model): @@ -6054,19 +6412,39 @@ class PackageDownloads(Model): ~azure.mgmt.security.models.PackageDownloadsCentralManager :ivar threat_intelligence: All downloads for threat intelligence :vartype threat_intelligence: - ~azure.mgmt.security.models.PackageDownloadsThreatIntelligence + list[~azure.mgmt.security.models.PackageDownloadInfo] + :ivar snmp: SNMP Server file + :vartype snmp: list[~azure.mgmt.security.models.PackageDownloadInfo] + :ivar wmi_tool: Used for local configuration export + :vartype wmi_tool: list[~azure.mgmt.security.models.PackageDownloadInfo] + :ivar authorized_devices_import_template: Authorized devices import + template + :vartype authorized_devices_import_template: + list[~azure.mgmt.security.models.PackageDownloadInfo] + :ivar device_information_update_import_template: Authorized devices import + template + :vartype device_information_update_import_template: + list[~azure.mgmt.security.models.PackageDownloadInfo] """ _validation = { 'sensor': {'readonly': True}, 'central_manager': {'readonly': True}, 'threat_intelligence': {'readonly': True}, + 'snmp': {'readonly': True}, + 'wmi_tool': {'readonly': True}, + 'authorized_devices_import_template': {'readonly': True}, + 'device_information_update_import_template': {'readonly': True}, } _attribute_map = { 'sensor': {'key': 'sensor', 'type': 'PackageDownloadsSensor'}, 'central_manager': {'key': 'centralManager', 'type': 'PackageDownloadsCentralManager'}, - 'threat_intelligence': {'key': 'threatIntelligence', 'type': 'PackageDownloadsThreatIntelligence'}, + 'threat_intelligence': {'key': 'threatIntelligence', 'type': '[PackageDownloadInfo]'}, + 'snmp': {'key': 'snmp', 'type': '[PackageDownloadInfo]'}, + 'wmi_tool': {'key': 'wmiTool', 'type': '[PackageDownloadInfo]'}, + 'authorized_devices_import_template': {'key': 'authorizedDevicesImportTemplate', 'type': '[PackageDownloadInfo]'}, + 'device_information_update_import_template': {'key': 'deviceInformationUpdateImportTemplate', 'type': '[PackageDownloadInfo]'}, } def __init__(self, **kwargs): @@ -6074,6 +6452,10 @@ def __init__(self, **kwargs): self.sensor = None self.central_manager = None self.threat_intelligence = None + self.snmp = None + self.wmi_tool = None + self.authorized_devices_import_template = None + self.device_information_update_import_template = None class PackageDownloadsCentralManager(Model): @@ -6087,7 +6469,8 @@ class PackageDownloadsCentralManager(Model): ~azure.mgmt.security.models.PackageDownloadsCentralManagerFull :ivar upgrade: Central Manager upgrade package downloads (on existing installations) - :vartype upgrade: list[~azure.mgmt.security.models.PackageDownloadInfo] + :vartype upgrade: + list[~azure.mgmt.security.models.UpgradePackageDownloadInfo] """ _validation = { @@ -6097,7 +6480,7 @@ class PackageDownloadsCentralManager(Model): _attribute_map = { 'full': {'key': 'full', 'type': 'PackageDownloadsCentralManagerFull'}, - 'upgrade': {'key': 'upgrade', 'type': '[PackageDownloadInfo]'}, + 'upgrade': {'key': 'upgrade', 'type': '[UpgradePackageDownloadInfo]'}, } def __init__(self, **kwargs): @@ -6187,7 +6570,8 @@ class PackageDownloadsSensor(Model): :vartype full: ~azure.mgmt.security.models.PackageDownloadsSensorFull :param upgrade: Sensor upgrade package downloads (on existing installations) - :type upgrade: list[~azure.mgmt.security.models.PackageDownloadInfo] + :type upgrade: + list[~azure.mgmt.security.models.UpgradePackageDownloadInfo] """ _validation = { @@ -6196,7 +6580,7 @@ class PackageDownloadsSensor(Model): _attribute_map = { 'full': {'key': 'full', 'type': 'PackageDownloadsSensorFull'}, - 'upgrade': {'key': 'upgrade', 'type': '[PackageDownloadInfo]'}, + 'upgrade': {'key': 'upgrade', 'type': '[UpgradePackageDownloadInfo]'}, } def __init__(self, **kwargs): @@ -6266,22 +6650,6 @@ def __init__(self, **kwargs): self.line = None -class PackageDownloadsThreatIntelligence(Model): - """All downloads for threat intelligence. - - :param link: Download link - :type link: str - """ - - _attribute_map = { - 'link': {'key': 'link', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PackageDownloadsThreatIntelligence, self).__init__(**kwargs) - self.link = kwargs.get('link', None) - - class PathRecommendation(Model): """Represents a path that is recommended to be allowed and its properties. @@ -6909,6 +7277,22 @@ def __init__(self, **kwargs): self.portal_link = kwargs.get('portal_link', None) +class ResetPasswordInput(Model): + """Reset password input. + + :param appliance_id: The appliance id of the sensor. + :type appliance_id: str + """ + + _attribute_map = { + 'appliance_id': {'key': 'applianceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResetPasswordInput, self).__init__(**kwargs) + self.appliance_id = kwargs.get('appliance_id', None) + + class Rule(Model): """Describes remote addresses that is recommended to communicate with the Azure resource on some (Protocol, Port, Direction). All other remote @@ -7630,8 +8014,8 @@ class SecurityAssessmentMetadata(Resource): :param remediation_description: Human readable description of what you should do to mitigate this security issue :type remediation_description: str - :param category: - :type category: list[str or ~azure.mgmt.security.models.Category] + :param categories: + :type categories: list[str or ~azure.mgmt.security.models.Categories] :param severity: Required. The severity level of the assessment. Possible values include: 'Low', 'Medium', 'High' :type severity: str or ~azure.mgmt.security.models.Severity @@ -7675,7 +8059,7 @@ class SecurityAssessmentMetadata(Resource): 'policy_definition_id': {'key': 'properties.policyDefinitionId', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'remediation_description': {'key': 'properties.remediationDescription', 'type': 'str'}, - 'category': {'key': 'properties.category', 'type': '[str]'}, + 'categories': {'key': 'properties.categories', 'type': '[str]'}, 'severity': {'key': 'properties.severity', 'type': 'str'}, 'user_impact': {'key': 'properties.userImpact', 'type': 'str'}, 'implementation_effort': {'key': 'properties.implementationEffort', 'type': 'str'}, @@ -7691,7 +8075,7 @@ def __init__(self, **kwargs): self.policy_definition_id = None self.description = kwargs.get('description', None) self.remediation_description = kwargs.get('remediation_description', None) - self.category = kwargs.get('category', None) + self.categories = kwargs.get('categories', None) self.severity = kwargs.get('severity', None) self.user_impact = kwargs.get('user_impact', None) self.implementation_effort = kwargs.get('implementation_effort', None) @@ -7753,8 +8137,8 @@ class SecurityAssessmentMetadataProperties(Model): :param remediation_description: Human readable description of what you should do to mitigate this security issue :type remediation_description: str - :param category: - :type category: list[str or ~azure.mgmt.security.models.Category] + :param categories: + :type categories: list[str or ~azure.mgmt.security.models.Categories] :param severity: Required. The severity level of the assessment. Possible values include: 'Low', 'Medium', 'High' :type severity: str or ~azure.mgmt.security.models.Severity @@ -7792,7 +8176,7 @@ class SecurityAssessmentMetadataProperties(Model): 'policy_definition_id': {'key': 'policyDefinitionId', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'remediation_description': {'key': 'remediationDescription', 'type': 'str'}, - 'category': {'key': 'category', 'type': '[str]'}, + 'categories': {'key': 'categories', 'type': '[str]'}, 'severity': {'key': 'severity', 'type': 'str'}, 'user_impact': {'key': 'userImpact', 'type': 'str'}, 'implementation_effort': {'key': 'implementationEffort', 'type': 'str'}, @@ -7808,7 +8192,7 @@ def __init__(self, **kwargs): self.policy_definition_id = None self.description = kwargs.get('description', None) self.remediation_description = kwargs.get('remediation_description', None) - self.category = kwargs.get('category', None) + self.categories = kwargs.get('categories', None) self.severity = kwargs.get('severity', None) self.user_impact = kwargs.get('user_impact', None) self.implementation_effort = kwargs.get('implementation_effort', None) @@ -8541,6 +8925,46 @@ def __init__(self, **kwargs): self.all_of = kwargs.get('all_of', None) +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or ~azure.mgmt.security.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.security.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC) + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + class Tags(Model): """A list of key value pairs that describe the resource. @@ -8860,6 +9284,41 @@ def __init__(self, **kwargs): self.recommendations_configuration = kwargs.get('recommendations_configuration', None) +class UpgradePackageDownloadInfo(PackageDownloadInfo): + """Information on a specific package upgrade download. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar version: Version number + :vartype version: str + :param link: Download link + :type link: str + :ivar version_kind: Kind of the version. Possible values include: + 'Latest', 'Previous', 'Preview' + :vartype version_kind: str or ~azure.mgmt.security.models.VersionKind + :ivar from_version: Minimum base version for upgrade + :vartype from_version: str + """ + + _validation = { + 'version': {'readonly': True}, + 'version_kind': {'readonly': True}, + 'from_version': {'readonly': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'link': {'key': 'link', 'type': 'str'}, + 'version_kind': {'key': 'versionKind', 'type': 'str'}, + 'from_version': {'key': 'fromVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UpgradePackageDownloadInfo, self).__init__(**kwargs) + self.from_version = None + + class UserDefinedResourcesProperties(Model): """Properties of the IoT Security solution's user defined resources. 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 13585f8f34535..5d4d3a7efca9b 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 @@ -643,6 +643,32 @@ def __init__(self, **kwargs) -> None: self.assessed_resource_type = None +class AdditionalWorkspacesProperties(Model): + """Properties of the additional workspaces. + + :param workspace: Workspace resource id + :type workspace: str + :param type: Workspace type. Possible values include: 'Sentinel'. Default + value: "Sentinel" . + :type type: str or ~azure.mgmt.security.models.AdditionalWorkspaceType + :param data_types: List of data types sent to workspace + :type data_types: list[str or + ~azure.mgmt.security.models.AdditionalWorkspaceDataType] + """ + + _attribute_map = { + 'workspace': {'key': 'workspace', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data_types': {'key': 'dataTypes', 'type': '[str]'}, + } + + def __init__(self, *, workspace: str=None, type="Sentinel", data_types=None, **kwargs) -> None: + super(AdditionalWorkspacesProperties, self).__init__(**kwargs) + self.workspace = workspace + self.type = type + self.data_types = data_types + + class AdvancedThreatProtectionSetting(Resource): """The Advanced Threat Protection resource. @@ -878,6 +904,87 @@ def __init__(self, *, additional_properties=None, **kwargs) -> None: self.type = None +class AlertSimulatorRequestProperties(Model): + """Describes properties of an alert simulation request. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AlertSimulatorBundlesRequestProperties + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Bundles': 'AlertSimulatorBundlesRequestProperties'} + } + + def __init__(self, *, additional_properties=None, **kwargs) -> None: + super(AlertSimulatorRequestProperties, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.kind = None + + +class AlertSimulatorBundlesRequestProperties(AlertSimulatorRequestProperties): + """Simulate alerts according to this bundles. + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param kind: Required. Constant filled by server. + :type kind: str + :param bundles: Bundles list. + :type bundles: list[str or ~azure.mgmt.security.models.BundleType] + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'bundles': {'key': 'bundles', 'type': '[str]'}, + } + + def __init__(self, *, additional_properties=None, bundles=None, **kwargs) -> None: + super(AlertSimulatorBundlesRequestProperties, self).__init__(additional_properties=additional_properties, **kwargs) + self.bundles = bundles + self.kind = 'Bundles' + + +class AlertSimulatorRequestBody(Model): + """Alert Simulator request body. + + :param properties: Alert Simulator request body data. + :type properties: + ~azure.mgmt.security.models.AlertSimulatorRequestProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'AlertSimulatorRequestProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(AlertSimulatorRequestBody, self).__init__(**kwargs) + self.properties = properties + + class AlertsSuppressionRule(Resource): """Describes the suppression rule. @@ -1053,8 +1160,8 @@ class AllowlistCustomAlertRule(ListCustomAlertRule): type) is allowed. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ConnectionToIpNotAllowed, LocalUserNotAllowed, - ProcessNotAllowed + sub-classes are: ConnectionToIpNotAllowed, ConnectionFromIpNotAllowed, + LocalUserNotAllowed, ProcessNotAllowed Variables are only populated by the server, and will be ignored when sending a request. @@ -1096,7 +1203,7 @@ class AllowlistCustomAlertRule(ListCustomAlertRule): } _subtype_map = { - 'rule_type': {'ConnectionToIpNotAllowed': 'ConnectionToIpNotAllowed', 'LocalUserNotAllowed': 'LocalUserNotAllowed', 'ProcessNotAllowed': 'ProcessNotAllowed'} + 'rule_type': {'ConnectionToIpNotAllowed': 'ConnectionToIpNotAllowed', 'ConnectionFromIpNotAllowed': 'ConnectionFromIpNotAllowed', 'LocalUserNotAllowed': 'LocalUserNotAllowed', 'ProcessNotAllowed': 'ProcessNotAllowed'} } def __init__(self, *, is_enabled: bool, allowlist_values, **kwargs) -> None: @@ -1797,7 +1904,10 @@ class AutomationSource(Model): https://aka.ms/ASCAutomationSchemas. :param event_source: A valid event source type. Possible values include: - 'Assessments', 'SubAssessments', 'Alerts' + 'Assessments', 'SubAssessments', 'Alerts', 'SecureScores', + 'SecureScoresSnapshot', 'SecureScoreControls', + 'SecureScoreControlsSnapshot', 'RegulatoryComplianceAssessment', + 'RegulatoryComplianceAssessmentSnapshot' :type event_source: str or ~azure.mgmt.security.models.EventSource :param rule_sets: A set of rules which evaluate upon event interception. A logical disjunction is applied between defined rule sets (logical 'or'). @@ -2335,33 +2445,49 @@ def __init__(self, *, additional_properties=None, device_vendor: str=None, devic class CloudError(Model): - """Error response structure. + """Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: An identifier for the error. Codes are invariant and are - intended to be consumed programmatically. + :ivar code: The error code. :vartype code: str - :ivar message: A message describing the error, intended to be suitable for - display in a user interface. + :ivar message: The error message. :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.security.models.CloudErrorBody] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.security.models.ErrorAdditionalInfo] """ _validation = { 'code': {'readonly': True}, 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, } _attribute_map = { 'code': {'key': 'error.code', 'type': 'str'}, 'message': {'key': 'error.message', 'type': 'str'}, + 'target': {'key': 'error.target', 'type': 'str'}, + 'details': {'key': 'error.details', 'type': '[CloudErrorBody]'}, + 'additional_info': {'key': 'error.additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } def __init__(self, **kwargs) -> None: super(CloudError, self).__init__(**kwargs) self.code = None self.message = None + self.target = None + self.details = None + self.additional_info = None class CloudErrorException(HttpOperationError): @@ -2376,6 +2502,50 @@ def __init__(self, deserialize, response, *args): super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) +class CloudErrorBody(Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.security.models.CloudErrorBody] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.security.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(CloudErrorBody, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + class Compliance(Resource): """Compliance of a scope. @@ -2580,6 +2750,54 @@ def __init__(self, *, id: str=None, **kwargs) -> None: self.id = id +class ConnectionFromIpNotAllowed(AllowlistCustomAlertRule): + """Inbound connection from an ip that isn't allowed. Allow list consists of + ipv4 or ipv6 range in CIDR notation. + + 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. Constant filled by server. + :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, allowlist_values, **kwargs) -> None: + super(ConnectionFromIpNotAllowed, self).__init__(is_enabled=is_enabled, allowlist_values=allowlist_values, **kwargs) + self.rule_type = 'ConnectionFromIpNotAllowed' + + class ConnectionToIpNotAllowed(AllowlistCustomAlertRule): """Outbound connection to an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation. @@ -2789,54 +3007,9 @@ def __init__(self, **kwargs) -> None: self.base = None -class SettingResource(Resource): +class Setting(Resource): """The kind of the security setting. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Setting - - 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 id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param kind: Required. Constant filled by server. - :type kind: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - } - - _subtype_map = { - 'kind': {'Setting': 'Setting'} - } - - def __init__(self, **kwargs) -> None: - super(SettingResource, self).__init__(**kwargs) - self.kind = None - self.kind = 'SettingResource' - - -class Setting(SettingResource): - """Represents a security setting in Azure Security Center. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: DataExportSettings @@ -2875,6 +3048,7 @@ class Setting(SettingResource): def __init__(self, **kwargs) -> None: super(Setting, self).__init__(**kwargs) + self.kind = None self.kind = 'Setting' @@ -3309,6 +3483,34 @@ def __init__(self, *, network_interface: str=None, network_security_groups=None, self.network_security_groups = network_security_groups +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + class ETag(Model): """Entity tag is used for comparing two or more entities from the same requested resource. @@ -3922,12 +4124,18 @@ def __init__(self, *, display_name: str=None, description: str=None, order: int= self.keywords = keywords -class IotAlert(Model): +class IotAlert(Resource): """IoT alert. 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 :ivar system_alert_id: Holds the product canonical identifier of the alert within the scope of a product :vartype system_alert_id: str @@ -3950,6 +4158,9 @@ class IotAlert(Model): """ _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, 'system_alert_id': {'readonly': True}, 'compromised_entity': {'readonly': True}, 'alert_type': {'readonly': True}, @@ -3958,6 +4169,9 @@ class IotAlert(Model): } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, 'system_alert_id': {'key': 'properties.systemAlertId', 'type': 'str'}, 'compromised_entity': {'key': 'properties.compromisedEntity', 'type': 'str'}, 'alert_type': {'key': 'properties.alertType', 'type': 'str'}, @@ -3978,12 +4192,18 @@ def __init__(self, *, entities=None, extended_properties=None, **kwargs) -> None self.extended_properties = extended_properties -class IotAlertModel(Model): +class IotAlertModel(Resource): """IoT alert. 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 :ivar system_alert_id: Holds the product canonical identifier of the alert within the scope of a product :vartype system_alert_id: str @@ -4006,6 +4226,9 @@ class IotAlertModel(Model): """ _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, 'system_alert_id': {'readonly': True}, 'compromised_entity': {'readonly': True}, 'alert_type': {'readonly': True}, @@ -4014,6 +4237,9 @@ class IotAlertModel(Model): } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, 'system_alert_id': {'key': 'properties.systemAlertId', 'type': 'str'}, 'compromised_entity': {'key': 'properties.compromisedEntity', 'type': 'str'}, 'alert_type': {'key': 'properties.alertType', 'type': 'str'}, @@ -4177,6 +4403,9 @@ class IotDefenderSettingsModel(Resource): :param sentinel_workspace_resource_ids: Required. Sentinel Workspace Resource Ids :type sentinel_workspace_resource_ids: list[str] + :param onboarding_kind: Required. The kind of onboarding for the + subscription. Possible values include: 'Default', 'MigratedToAzure' + :type onboarding_kind: str or ~azure.mgmt.security.models.OnboardingKind """ _validation = { @@ -4185,6 +4414,7 @@ class IotDefenderSettingsModel(Resource): 'type': {'readonly': True}, 'device_quota': {'required': True, 'minimum': 1000}, 'sentinel_workspace_resource_ids': {'required': True}, + 'onboarding_kind': {'required': True}, } _attribute_map = { @@ -4193,12 +4423,14 @@ class IotDefenderSettingsModel(Resource): 'type': {'key': 'type', 'type': 'str'}, 'device_quota': {'key': 'properties.deviceQuota', 'type': 'int'}, 'sentinel_workspace_resource_ids': {'key': 'properties.sentinelWorkspaceResourceIds', 'type': '[str]'}, + 'onboarding_kind': {'key': 'properties.onboardingKind', 'type': 'str'}, } - def __init__(self, *, device_quota: int, sentinel_workspace_resource_ids, **kwargs) -> None: + def __init__(self, *, device_quota: int, sentinel_workspace_resource_ids, onboarding_kind, **kwargs) -> None: super(IotDefenderSettingsModel, self).__init__(**kwargs) self.device_quota = device_quota self.sentinel_workspace_resource_ids = sentinel_workspace_resource_ids + self.onboarding_kind = onboarding_kind class IotRecommendation(Resource): @@ -4430,7 +4662,7 @@ class IoTSecurityAggregatedAlert(Model): :vartype description: str :ivar count: Number of alerts occurrences within the aggregated time window. - :vartype count: int + :vartype count: long :ivar effected_resource_type: Azure resource ID of the resource that received the alerts. :vartype effected_resource_type: str @@ -4478,7 +4710,7 @@ class IoTSecurityAggregatedAlert(Model): 'reported_severity': {'key': 'properties.reportedSeverity', 'type': 'str'}, 'remediation_steps': {'key': 'properties.remediationSteps', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, + 'count': {'key': 'properties.count', 'type': 'long'}, 'effected_resource_type': {'key': 'properties.effectedResourceType', 'type': 'str'}, 'system_source': {'key': 'properties.systemSource', 'type': 'str'}, 'action_taken': {'key': 'properties.actionTaken', 'type': 'str'}, @@ -4516,7 +4748,7 @@ class IoTSecurityAggregatedAlertPropertiesTopDevicesListItem(Model): :ivar device_id: Name of the device. :vartype device_id: str :ivar alerts_count: Number of alerts raised for this device. - :vartype alerts_count: int + :vartype alerts_count: long :ivar last_occurrence: Most recent time this alert was raised for this device, on this day. :vartype last_occurrence: str @@ -4530,7 +4762,7 @@ class IoTSecurityAggregatedAlertPropertiesTopDevicesListItem(Model): _attribute_map = { 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'alerts_count': {'key': 'alertsCount', 'type': 'int'}, + 'alerts_count': {'key': 'alertsCount', 'type': 'long'}, 'last_occurrence': {'key': 'lastOccurrence', 'type': 'str'}, } @@ -4574,10 +4806,10 @@ class IoTSecurityAggregatedRecommendation(Model): ~azure.mgmt.security.models.ReportedSeverity :ivar healthy_devices: Number of healthy devices within the IoT Security solution. - :vartype healthy_devices: int + :vartype healthy_devices: long :ivar unhealthy_device_count: Number of unhealthy devices within the IoT Security solution. - :vartype unhealthy_device_count: int + :vartype unhealthy_device_count: long :ivar log_analytics_query: Log analytics query for getting the list of affected devices/alerts. :vartype log_analytics_query: str @@ -4610,8 +4842,8 @@ class IoTSecurityAggregatedRecommendation(Model): 'detected_by': {'key': 'properties.detectedBy', 'type': 'str'}, 'remediation_steps': {'key': 'properties.remediationSteps', 'type': 'str'}, 'reported_severity': {'key': 'properties.reportedSeverity', 'type': 'str'}, - 'healthy_devices': {'key': 'properties.healthyDevices', 'type': 'int'}, - 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'int'}, + 'healthy_devices': {'key': 'properties.healthyDevices', 'type': 'long'}, + 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'long'}, 'log_analytics_query': {'key': 'properties.logAnalyticsQuery', 'type': 'str'}, } @@ -4643,7 +4875,7 @@ class IoTSecurityAlertedDevice(Model): :ivar device_id: Device identifier. :vartype device_id: str :ivar alerts_count: Number of alerts raised for this device. - :vartype alerts_count: int + :vartype alerts_count: long """ _validation = { @@ -4653,7 +4885,7 @@ class IoTSecurityAlertedDevice(Model): _attribute_map = { 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'alerts_count': {'key': 'alertsCount', 'type': 'int'}, + 'alerts_count': {'key': 'alertsCount', 'type': 'long'}, } def __init__(self, **kwargs) -> None: @@ -4676,7 +4908,7 @@ class IoTSecurityDeviceAlert(Model): :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity :ivar alerts_count: Number of alerts raised for this alert type. - :vartype alerts_count: int + :vartype alerts_count: long """ _validation = { @@ -4688,7 +4920,7 @@ class IoTSecurityDeviceAlert(Model): _attribute_map = { 'alert_display_name': {'key': 'alertDisplayName', 'type': 'str'}, 'reported_severity': {'key': 'reportedSeverity', 'type': 'str'}, - 'alerts_count': {'key': 'alertsCount', 'type': 'int'}, + 'alerts_count': {'key': 'alertsCount', 'type': 'long'}, } def __init__(self, **kwargs) -> None: @@ -4712,7 +4944,7 @@ class IoTSecurityDeviceRecommendation(Model): :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity :ivar devices_count: Number of devices with this recommendation. - :vartype devices_count: int + :vartype devices_count: long """ _validation = { @@ -4724,7 +4956,7 @@ class IoTSecurityDeviceRecommendation(Model): _attribute_map = { 'recommendation_display_name': {'key': 'recommendationDisplayName', 'type': 'str'}, 'reported_severity': {'key': 'reportedSeverity', 'type': 'str'}, - 'devices_count': {'key': 'devicesCount', 'type': 'int'}, + 'devices_count': {'key': 'devicesCount', 'type': 'long'}, } def __init__(self, **kwargs) -> None: @@ -4750,7 +4982,7 @@ class IoTSecuritySolutionAnalyticsModel(Resource): :vartype metrics: ~azure.mgmt.security.models.IoTSeverityMetrics :ivar unhealthy_device_count: Number of unhealthy devices within your IoT Security solution. - :vartype unhealthy_device_count: int + :vartype unhealthy_device_count: long :ivar devices_metrics: List of device metrics by the aggregation date. :vartype devices_metrics: list[~azure.mgmt.security.models.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem] @@ -4781,7 +5013,7 @@ class IoTSecuritySolutionAnalyticsModel(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'metrics': {'key': 'properties.metrics', 'type': 'IoTSeverityMetrics'}, - 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'int'}, + 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'long'}, 'devices_metrics': {'key': 'properties.devicesMetrics', 'type': '[IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem]'}, 'top_alerted_devices': {'key': 'properties.topAlertedDevices', 'type': '[IoTSecurityAlertedDevice]'}, 'most_prevalent_device_alerts': {'key': 'properties.mostPrevalentDeviceAlerts', 'type': '[IoTSecurityDeviceAlert]'}, @@ -4899,6 +5131,12 @@ class IoTSecuritySolutionModel(Model): . :type unmasked_ip_logging_status: str or ~azure.mgmt.security.models.UnmaskedIpLoggingStatus + :param additional_workspaces: List of additional workspaces + :type additional_workspaces: + list[~azure.mgmt.security.models.AdditionalWorkspacesProperties] + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: ~azure.mgmt.security.models.SystemData """ _validation = { @@ -4908,6 +5146,7 @@ class IoTSecuritySolutionModel(Model): 'display_name': {'required': True}, 'iot_hubs': {'required': True}, 'auto_discovered_resources': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -4926,9 +5165,11 @@ class IoTSecuritySolutionModel(Model): 'auto_discovered_resources': {'key': 'properties.autoDiscoveredResources', 'type': '[str]'}, 'recommendations_configuration': {'key': 'properties.recommendationsConfiguration', 'type': '[RecommendationConfigurationProperties]'}, 'unmasked_ip_logging_status': {'key': 'properties.unmaskedIpLoggingStatus', 'type': 'str'}, + 'additional_workspaces': {'key': 'properties.additionalWorkspaces', 'type': '[AdditionalWorkspacesProperties]'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } - def __init__(self, *, display_name: str, iot_hubs, tags=None, location: str=None, workspace: str=None, status="Enabled", export=None, disabled_data_sources=None, user_defined_resources=None, recommendations_configuration=None, unmasked_ip_logging_status="Disabled", **kwargs) -> None: + def __init__(self, *, display_name: str, iot_hubs, tags=None, location: str=None, workspace: str=None, status="Enabled", export=None, disabled_data_sources=None, user_defined_resources=None, recommendations_configuration=None, unmasked_ip_logging_status="Disabled", additional_workspaces=None, **kwargs) -> None: super(IoTSecuritySolutionModel, self).__init__(**kwargs) self.id = None self.name = None @@ -4945,10 +5186,35 @@ def __init__(self, *, display_name: str, iot_hubs, tags=None, location: str=None self.auto_discovered_resources = None self.recommendations_configuration = recommendations_configuration self.unmasked_ip_logging_status = unmasked_ip_logging_status + self.additional_workspaces = additional_workspaces + self.system_data = None -class IotSensor(Resource): - """IoT sensor. +class IotSensorsList(Model): + """List of IoT sensors. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List data + :vartype value: list[~azure.mgmt.security.models.IotSensorsModel] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IotSensorsModel]'}, + } + + def __init__(self, **kwargs) -> None: + super(IotSensorsList, self).__init__(**kwargs) + self.value = None + + +class IotSensorsModel(Resource): + """IoT sensor model. Variables are only populated by the server, and will be ignored when sending a request. @@ -4959,36 +5225,111 @@ class IotSensor(Resource): :vartype name: str :ivar type: Resource type :vartype type: str - :param properties: IoT sensor properties - :type properties: object + :ivar connectivity_time: Last connectivity time of the IoT sensor + :vartype connectivity_time: str + :ivar creation_time: Creation time of the IoT sensor + :vartype creation_time: str + :ivar dynamic_learning: Dynamic mode status of the IoT sensor + :vartype dynamic_learning: bool + :ivar learning_mode: Learning mode status of the IoT sensor + :vartype learning_mode: bool + :ivar sensor_status: Status of the IoT sensor. Possible values include: + 'Ok', 'Disconnected', 'Unavailable' + :vartype sensor_status: str or ~azure.mgmt.security.models.SensorStatus + :ivar sensor_version: Version of the IoT sensor + :vartype sensor_version: str + :param ti_automatic_updates: TI Automatic mode status of the IoT sensor + :type ti_automatic_updates: bool + :ivar ti_status: TI Status of the IoT sensor. Possible values include: + 'Ok', 'Failed', 'InProgress', 'UpdateAvailable' + :vartype ti_status: str or ~azure.mgmt.security.models.TiStatus + :ivar ti_version: TI Version of the IoT sensor + :vartype ti_version: str + :param zone: Zone of the IoT sensor + :type zone: str + :param sensor_type: Type of sensor. Possible values include: 'Ot', + 'Enterprise' + :type sensor_type: str or ~azure.mgmt.security.models.SensorType """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'connectivity_time': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'dynamic_learning': {'readonly': True}, + 'learning_mode': {'readonly': True}, + 'sensor_status': {'readonly': True}, + 'sensor_version': {'readonly': True}, + 'ti_status': {'readonly': True}, + 'ti_version': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, + 'connectivity_time': {'key': 'properties.connectivityTime', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, + 'dynamic_learning': {'key': 'properties.dynamicLearning', 'type': 'bool'}, + 'learning_mode': {'key': 'properties.learningMode', 'type': 'bool'}, + 'sensor_status': {'key': 'properties.sensorStatus', 'type': 'str'}, + 'sensor_version': {'key': 'properties.sensorVersion', 'type': 'str'}, + 'ti_automatic_updates': {'key': 'properties.tiAutomaticUpdates', 'type': 'bool'}, + 'ti_status': {'key': 'properties.tiStatus', 'type': 'str'}, + 'ti_version': {'key': 'properties.tiVersion', 'type': 'str'}, + 'zone': {'key': 'properties.zone', 'type': 'str'}, + 'sensor_type': {'key': 'properties.sensorType', 'type': 'str'}, + } + + def __init__(self, *, ti_automatic_updates: bool=None, zone: str=None, sensor_type=None, **kwargs) -> None: + super(IotSensorsModel, self).__init__(**kwargs) + self.connectivity_time = None + self.creation_time = None + self.dynamic_learning = None + self.learning_mode = None + self.sensor_status = None + self.sensor_version = None + self.ti_automatic_updates = ti_automatic_updates + self.ti_status = None + self.ti_version = None + self.zone = zone + self.sensor_type = sensor_type + + +class IoTSeverityMetrics(Model): + """IoT Security solution analytics severity metrics. + + :param high: Count of high severity alerts/recommendations. + :type high: long + :param medium: Count of medium severity alerts/recommendations. + :type medium: long + :param low: Count of low severity alerts/recommendations. + :type low: long + """ + + _attribute_map = { + 'high': {'key': 'high', 'type': 'long'}, + 'medium': {'key': 'medium', 'type': 'long'}, + 'low': {'key': 'low', 'type': 'long'}, } - def __init__(self, *, properties=None, **kwargs) -> None: - super(IotSensor, self).__init__(**kwargs) - self.properties = properties + def __init__(self, *, high: int=None, medium: int=None, low: int=None, **kwargs) -> None: + super(IoTSeverityMetrics, self).__init__(**kwargs) + self.high = high + self.medium = medium + self.low = low -class IotSensorsList(Model): - """List of IoT sensors. +class IotSitesList(Model): + """List of IoT sites. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List data - :vartype value: list[~azure.mgmt.security.models.IotSensor] + :vartype value: list[~azure.mgmt.security.models.IotSitesModel] """ _validation = { @@ -4996,36 +5337,53 @@ class IotSensorsList(Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[IotSensor]'}, + 'value': {'key': 'value', 'type': '[IotSitesModel]'}, } def __init__(self, **kwargs) -> None: - super(IotSensorsList, self).__init__(**kwargs) + super(IotSitesList, self).__init__(**kwargs) self.value = None -class IoTSeverityMetrics(Model): - """IoT Security solution analytics severity metrics. +class IotSitesModel(Resource): + """IoT site model. - :param high: Count of high severity alerts/recommendations. - :type high: int - :param medium: Count of medium severity alerts/recommendations. - :type medium: int - :param low: Count of low severity alerts/recommendations. - :type low: int + 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 id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param display_name: Required. Display name of the IoT site + :type display_name: str + :param tags: Tags of the IoT site + :type tags: dict[str, str] """ + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'required': True}, + } + _attribute_map = { - 'high': {'key': 'high', 'type': 'int'}, - 'medium': {'key': 'medium', 'type': 'int'}, - 'low': {'key': 'low', 'type': 'int'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'tags': {'key': 'properties.tags', 'type': '{str}'}, } - def __init__(self, *, high: int=None, medium: int=None, low: int=None, **kwargs) -> None: - super(IoTSeverityMetrics, self).__init__(**kwargs) - self.high = high - self.medium = medium - self.low = low + def __init__(self, *, display_name: str, tags=None, **kwargs) -> None: + super(IotSitesModel, self).__init__(**kwargs) + self.display_name = display_name + self.tags = tags class IpAddress(Model): @@ -6054,19 +6412,39 @@ class PackageDownloads(Model): ~azure.mgmt.security.models.PackageDownloadsCentralManager :ivar threat_intelligence: All downloads for threat intelligence :vartype threat_intelligence: - ~azure.mgmt.security.models.PackageDownloadsThreatIntelligence + list[~azure.mgmt.security.models.PackageDownloadInfo] + :ivar snmp: SNMP Server file + :vartype snmp: list[~azure.mgmt.security.models.PackageDownloadInfo] + :ivar wmi_tool: Used for local configuration export + :vartype wmi_tool: list[~azure.mgmt.security.models.PackageDownloadInfo] + :ivar authorized_devices_import_template: Authorized devices import + template + :vartype authorized_devices_import_template: + list[~azure.mgmt.security.models.PackageDownloadInfo] + :ivar device_information_update_import_template: Authorized devices import + template + :vartype device_information_update_import_template: + list[~azure.mgmt.security.models.PackageDownloadInfo] """ _validation = { 'sensor': {'readonly': True}, 'central_manager': {'readonly': True}, 'threat_intelligence': {'readonly': True}, + 'snmp': {'readonly': True}, + 'wmi_tool': {'readonly': True}, + 'authorized_devices_import_template': {'readonly': True}, + 'device_information_update_import_template': {'readonly': True}, } _attribute_map = { 'sensor': {'key': 'sensor', 'type': 'PackageDownloadsSensor'}, 'central_manager': {'key': 'centralManager', 'type': 'PackageDownloadsCentralManager'}, - 'threat_intelligence': {'key': 'threatIntelligence', 'type': 'PackageDownloadsThreatIntelligence'}, + 'threat_intelligence': {'key': 'threatIntelligence', 'type': '[PackageDownloadInfo]'}, + 'snmp': {'key': 'snmp', 'type': '[PackageDownloadInfo]'}, + 'wmi_tool': {'key': 'wmiTool', 'type': '[PackageDownloadInfo]'}, + 'authorized_devices_import_template': {'key': 'authorizedDevicesImportTemplate', 'type': '[PackageDownloadInfo]'}, + 'device_information_update_import_template': {'key': 'deviceInformationUpdateImportTemplate', 'type': '[PackageDownloadInfo]'}, } def __init__(self, **kwargs) -> None: @@ -6074,6 +6452,10 @@ def __init__(self, **kwargs) -> None: self.sensor = None self.central_manager = None self.threat_intelligence = None + self.snmp = None + self.wmi_tool = None + self.authorized_devices_import_template = None + self.device_information_update_import_template = None class PackageDownloadsCentralManager(Model): @@ -6087,7 +6469,8 @@ class PackageDownloadsCentralManager(Model): ~azure.mgmt.security.models.PackageDownloadsCentralManagerFull :ivar upgrade: Central Manager upgrade package downloads (on existing installations) - :vartype upgrade: list[~azure.mgmt.security.models.PackageDownloadInfo] + :vartype upgrade: + list[~azure.mgmt.security.models.UpgradePackageDownloadInfo] """ _validation = { @@ -6097,7 +6480,7 @@ class PackageDownloadsCentralManager(Model): _attribute_map = { 'full': {'key': 'full', 'type': 'PackageDownloadsCentralManagerFull'}, - 'upgrade': {'key': 'upgrade', 'type': '[PackageDownloadInfo]'}, + 'upgrade': {'key': 'upgrade', 'type': '[UpgradePackageDownloadInfo]'}, } def __init__(self, **kwargs) -> None: @@ -6187,7 +6570,8 @@ class PackageDownloadsSensor(Model): :vartype full: ~azure.mgmt.security.models.PackageDownloadsSensorFull :param upgrade: Sensor upgrade package downloads (on existing installations) - :type upgrade: list[~azure.mgmt.security.models.PackageDownloadInfo] + :type upgrade: + list[~azure.mgmt.security.models.UpgradePackageDownloadInfo] """ _validation = { @@ -6196,7 +6580,7 @@ class PackageDownloadsSensor(Model): _attribute_map = { 'full': {'key': 'full', 'type': 'PackageDownloadsSensorFull'}, - 'upgrade': {'key': 'upgrade', 'type': '[PackageDownloadInfo]'}, + 'upgrade': {'key': 'upgrade', 'type': '[UpgradePackageDownloadInfo]'}, } def __init__(self, *, upgrade=None, **kwargs) -> None: @@ -6266,22 +6650,6 @@ def __init__(self, **kwargs) -> None: self.line = None -class PackageDownloadsThreatIntelligence(Model): - """All downloads for threat intelligence. - - :param link: Download link - :type link: str - """ - - _attribute_map = { - 'link': {'key': 'link', 'type': 'str'}, - } - - def __init__(self, *, link: str=None, **kwargs) -> None: - super(PackageDownloadsThreatIntelligence, self).__init__(**kwargs) - self.link = link - - class PathRecommendation(Model): """Represents a path that is recommended to be allowed and its properties. @@ -6909,6 +7277,22 @@ def __init__(self, *, description: str=None, scripts=None, automated: bool=None, self.portal_link = portal_link +class ResetPasswordInput(Model): + """Reset password input. + + :param appliance_id: The appliance id of the sensor. + :type appliance_id: str + """ + + _attribute_map = { + 'appliance_id': {'key': 'applianceId', 'type': 'str'}, + } + + def __init__(self, *, appliance_id: str=None, **kwargs) -> None: + super(ResetPasswordInput, self).__init__(**kwargs) + self.appliance_id = appliance_id + + class Rule(Model): """Describes remote addresses that is recommended to communicate with the Azure resource on some (Protocol, Port, Direction). All other remote @@ -7630,8 +8014,8 @@ class SecurityAssessmentMetadata(Resource): :param remediation_description: Human readable description of what you should do to mitigate this security issue :type remediation_description: str - :param category: - :type category: list[str or ~azure.mgmt.security.models.Category] + :param categories: + :type categories: list[str or ~azure.mgmt.security.models.Categories] :param severity: Required. The severity level of the assessment. Possible values include: 'Low', 'Medium', 'High' :type severity: str or ~azure.mgmt.security.models.Severity @@ -7675,7 +8059,7 @@ class SecurityAssessmentMetadata(Resource): 'policy_definition_id': {'key': 'properties.policyDefinitionId', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'remediation_description': {'key': 'properties.remediationDescription', 'type': 'str'}, - 'category': {'key': 'properties.category', 'type': '[str]'}, + 'categories': {'key': 'properties.categories', 'type': '[str]'}, 'severity': {'key': 'properties.severity', 'type': 'str'}, 'user_impact': {'key': 'properties.userImpact', 'type': 'str'}, 'implementation_effort': {'key': 'properties.implementationEffort', 'type': 'str'}, @@ -7685,13 +8069,13 @@ class SecurityAssessmentMetadata(Resource): 'partner_data': {'key': 'properties.partnerData', 'type': 'SecurityAssessmentMetadataPartnerData'}, } - def __init__(self, *, display_name: str, severity, assessment_type, description: str=None, remediation_description: str=None, category=None, user_impact=None, implementation_effort=None, threats=None, preview: bool=None, partner_data=None, **kwargs) -> None: + def __init__(self, *, display_name: str, severity, assessment_type, description: str=None, remediation_description: str=None, categories=None, user_impact=None, implementation_effort=None, threats=None, preview: bool=None, partner_data=None, **kwargs) -> None: super(SecurityAssessmentMetadata, self).__init__(**kwargs) self.display_name = display_name self.policy_definition_id = None self.description = description self.remediation_description = remediation_description - self.category = category + self.categories = categories self.severity = severity self.user_impact = user_impact self.implementation_effort = implementation_effort @@ -7753,8 +8137,8 @@ class SecurityAssessmentMetadataProperties(Model): :param remediation_description: Human readable description of what you should do to mitigate this security issue :type remediation_description: str - :param category: - :type category: list[str or ~azure.mgmt.security.models.Category] + :param categories: + :type categories: list[str or ~azure.mgmt.security.models.Categories] :param severity: Required. The severity level of the assessment. Possible values include: 'Low', 'Medium', 'High' :type severity: str or ~azure.mgmt.security.models.Severity @@ -7792,7 +8176,7 @@ class SecurityAssessmentMetadataProperties(Model): 'policy_definition_id': {'key': 'policyDefinitionId', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'remediation_description': {'key': 'remediationDescription', 'type': 'str'}, - 'category': {'key': 'category', 'type': '[str]'}, + 'categories': {'key': 'categories', 'type': '[str]'}, 'severity': {'key': 'severity', 'type': 'str'}, 'user_impact': {'key': 'userImpact', 'type': 'str'}, 'implementation_effort': {'key': 'implementationEffort', 'type': 'str'}, @@ -7802,13 +8186,13 @@ class SecurityAssessmentMetadataProperties(Model): 'partner_data': {'key': 'partnerData', 'type': 'SecurityAssessmentMetadataPartnerData'}, } - def __init__(self, *, display_name: str, severity, assessment_type, description: str=None, remediation_description: str=None, category=None, user_impact=None, implementation_effort=None, threats=None, preview: bool=None, partner_data=None, **kwargs) -> None: + def __init__(self, *, display_name: str, severity, assessment_type, description: str=None, remediation_description: str=None, categories=None, user_impact=None, implementation_effort=None, threats=None, preview: bool=None, partner_data=None, **kwargs) -> None: super(SecurityAssessmentMetadataProperties, self).__init__(**kwargs) self.display_name = display_name self.policy_definition_id = None self.description = description self.remediation_description = remediation_description - self.category = category + self.categories = categories self.severity = severity self.user_impact = user_impact self.implementation_effort = implementation_effort @@ -8541,6 +8925,46 @@ def __init__(self, *, all_of, **kwargs) -> None: self.all_of = all_of +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or ~azure.mgmt.security.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.security.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC) + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, *, created_by: str=None, created_by_type=None, created_at=None, last_modified_by: str=None, last_modified_by_type=None, last_modified_at=None, **kwargs) -> None: + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + class Tags(Model): """A list of key value pairs that describe the resource. @@ -8860,6 +9284,41 @@ def __init__(self, *, tags=None, user_defined_resources=None, recommendations_co self.recommendations_configuration = recommendations_configuration +class UpgradePackageDownloadInfo(PackageDownloadInfo): + """Information on a specific package upgrade download. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar version: Version number + :vartype version: str + :param link: Download link + :type link: str + :ivar version_kind: Kind of the version. Possible values include: + 'Latest', 'Previous', 'Preview' + :vartype version_kind: str or ~azure.mgmt.security.models.VersionKind + :ivar from_version: Minimum base version for upgrade + :vartype from_version: str + """ + + _validation = { + 'version': {'readonly': True}, + 'version_kind': {'readonly': True}, + 'from_version': {'readonly': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'link': {'key': 'link', 'type': 'str'}, + 'version_kind': {'key': 'versionKind', 'type': 'str'}, + 'from_version': {'key': 'fromVersion', 'type': 'str'}, + } + + def __init__(self, *, link: str=None, **kwargs) -> None: + super(UpgradePackageDownloadInfo, self).__init__(link=link, **kwargs) + self.from_version = None + + class UserDefinedResourcesProperties(Model): """Properties of the IoT Security solution's user defined resources. 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 5dcf2e2766af5..b0e7134f2b7d2 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 @@ -389,19 +389,6 @@ class TopologyResourcePaged(Paged): def __init__(self, *args, **kwargs): super(TopologyResourcePaged, self).__init__(*args, **kwargs) -class AlertPaged(Paged): - """ - A paging container for iterating over a list of :class:`Alert ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Alert]'} - } - - def __init__(self, *args, **kwargs): - - super(AlertPaged, self).__init__(*args, **kwargs) class JitNetworkAccessPolicyPaged(Paged): """ A paging container for iterating over a list of :class:`JitNetworkAccessPolicy ` object @@ -519,3 +506,16 @@ class DevicePaged(Paged): def __init__(self, *args, **kwargs): super(DevicePaged, self).__init__(*args, **kwargs) +class AlertPaged(Paged): + """ + A paging container for iterating over a list of :class:`Alert ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Alert]'} + } + + def __init__(self, *args, **kwargs): + + super(AlertPaged, self).__init__(*args, **kwargs) 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 651c39085b1f0..496d73adf4211 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 @@ -80,6 +80,25 @@ class UnmaskedIpLoggingStatus(str, Enum): enabled = "Enabled" #: Unmasked IP logging is enabled +class AdditionalWorkspaceType(str, Enum): + + sentinel = "Sentinel" + + +class AdditionalWorkspaceDataType(str, Enum): + + alerts = "Alerts" + raw_events = "RawEvents" + + +class CreatedByType(str, Enum): + + user = "User" + application = "Application" + managed_identity = "ManagedIdentity" + key = "Key" + + class ReportedSeverity(str, Enum): informational = "Informational" @@ -181,6 +200,12 @@ class EventSource(str, Enum): assessments = "Assessments" sub_assessments = "SubAssessments" alerts = "Alerts" + secure_scores = "SecureScores" + secure_scores_snapshot = "SecureScoresSnapshot" + secure_score_controls = "SecureScoreControls" + secure_score_controls_snapshot = "SecureScoreControlsSnapshot" + regulatory_compliance_assessment = "RegulatoryComplianceAssessment" + regulatory_compliance_assessment_snapshot = "RegulatoryComplianceAssessmentSnapshot" class PropertyType(str, Enum): @@ -193,15 +218,15 @@ class PropertyType(str, Enum): class Operator(str, Enum): - equals = "Equals" - greater_than = "GreaterThan" - greater_than_or_equal_to = "GreaterThanOrEqualTo" - lesser_than = "LesserThan" - lesser_than_or_equal_to = "LesserThanOrEqualTo" - not_equals = "NotEquals" - contains = "Contains" - starts_with = "StartsWith" - ends_with = "EndsWith" + equals = "Equals" #: Applies for decimal and non-decimal operands + greater_than = "GreaterThan" #: Applies only for decimal operands + greater_than_or_equal_to = "GreaterThanOrEqualTo" #: Applies only for decimal operands + lesser_than = "LesserThan" #: Applies only for decimal operands + lesser_than_or_equal_to = "LesserThanOrEqualTo" #: Applies only for decimal operands + not_equals = "NotEquals" #: Applies for decimal and non-decimal operands + contains = "Contains" #: Applies only for non-decimal operands + starts_with = "StartsWith" #: Applies only for non-decimal operands + ends_with = "EndsWith" #: Applies only for non-decimal operands class RuleState(str, Enum): @@ -211,7 +236,7 @@ class RuleState(str, Enum): expired = "Expired" -class Category(str, Enum): +class Categories(str, Enum): compute = "Compute" networking = "Networking" @@ -273,33 +298,6 @@ class TransportProtocol(str, Enum): udp = "UDP" -class Intent(str, Enum): - - unknown = "Unknown" #: Unknown - pre_attack = "PreAttack" #: PreAttack could be either an attempt to access a certain resource regardless of a malicious intent, or a failed attempt to gain access to a target system to gather information prior to exploitation. This step is usually detected as an attempt, originating from outside the network, to scan the target system and find a way in. Further details on the PreAttack stage can be read in [MITRE Pre-Att&ck matrix](https://attack.mitre.org/matrices/pre/). - initial_access = "InitialAccess" #: InitialAccess is the stage where an attacker manages to get foothold on the attacked resource. - persistence = "Persistence" #: Persistence is any access, action, or configuration change to a system that gives a threat actor a persistent presence on that system. - privilege_escalation = "PrivilegeEscalation" #: Privilege escalation is the result of actions that allow an adversary to obtain a higher level of permissions on a system or network. - defense_evasion = "DefenseEvasion" #: Defense evasion consists of techniques an adversary may use to evade detection or avoid other defenses. - credential_access = "CredentialAccess" #: Credential access represents techniques resulting in access to or control over system, domain, or service credentials that are used within an enterprise environment. - discovery = "Discovery" #: Discovery consists of techniques that allow the adversary to gain knowledge about the system and internal network. - lateral_movement = "LateralMovement" #: Lateral movement consists of techniques that enable an adversary to access and control remote systems on a network and could, but does not necessarily, include execution of tools on remote systems. - execution = "Execution" #: The execution tactic represents techniques that result in execution of adversary-controlled code on a local or remote system. - collection = "Collection" #: Collection consists of techniques used to identify and gather information, such as sensitive files, from a target network prior to exfiltration. - exfiltration = "Exfiltration" #: Exfiltration refers to techniques and attributes that result or aid in the adversary removing files and information from a target network. - command_and_control = "CommandAndControl" #: The command and control tactic represents how adversaries communicate with systems under their control within a target network. - impact = "Impact" #: Impact events primarily try to directly reduce the availability or integrity of a system, service, or network; including manipulation of data to impact a business or operational process. - probing = "Probing" #: Probing could be either an attempt to access a certain resource regardless of a malicious intent, or a failed attempt to gain access to a target system to gather information prior to exploitation. - exploitation = "Exploitation" #: Exploitation is the stage where an attacker manages to get a foothold on the attacked resource. This stage is relevant for compute hosts and resources such as user accounts, certificates etc. - - -class AlertStatus(str, Enum): - - active = "Active" #: An alert which doesn't specify a value is assigned the status 'Active' - resolved = "Resolved" #: Alert closed after handling - dismissed = "Dismissed" #: Alert dismissed as false positive - - class Protocol(str, Enum): tcp = "TCP" @@ -416,6 +414,12 @@ class RuleType(str, Enum): negative_list = "NegativeList" #: NegativeList +class OnboardingKind(str, Enum): + + default = "Default" + migrated_to_azure = "MigratedToAzure" + + class VersionKind(str, Enum): latest = "Latest" @@ -423,6 +427,27 @@ class VersionKind(str, Enum): preview = "Preview" +class SensorStatus(str, Enum): + + ok = "Ok" + disconnected = "Disconnected" + unavailable = "Unavailable" + + +class TiStatus(str, Enum): + + ok = "Ok" + failed = "Failed" + in_progress = "InProgress" + update_available = "UpdateAvailable" + + +class SensorType(str, Enum): + + ot = "Ot" + enterprise = "Enterprise" + + class MacSignificance(str, Enum): primary = "Primary" @@ -478,6 +503,45 @@ class DeviceStatus(str, Enum): removed = "Removed" +class Intent(str, Enum): + + unknown = "Unknown" #: Unknown + pre_attack = "PreAttack" #: PreAttack could be either an attempt to access a certain resource regardless of a malicious intent, or a failed attempt to gain access to a target system to gather information prior to exploitation. This step is usually detected as an attempt, originating from outside the network, to scan the target system and find a way in. Further details on the PreAttack stage can be read in [MITRE Pre-Att&ck matrix](https://attack.mitre.org/matrices/pre/). + initial_access = "InitialAccess" #: InitialAccess is the stage where an attacker manages to get foothold on the attacked resource. + persistence = "Persistence" #: Persistence is any access, action, or configuration change to a system that gives a threat actor a persistent presence on that system. + privilege_escalation = "PrivilegeEscalation" #: Privilege escalation is the result of actions that allow an adversary to obtain a higher level of permissions on a system or network. + defense_evasion = "DefenseEvasion" #: Defense evasion consists of techniques an adversary may use to evade detection or avoid other defenses. + credential_access = "CredentialAccess" #: Credential access represents techniques resulting in access to or control over system, domain, or service credentials that are used within an enterprise environment. + discovery = "Discovery" #: Discovery consists of techniques that allow the adversary to gain knowledge about the system and internal network. + lateral_movement = "LateralMovement" #: Lateral movement consists of techniques that enable an adversary to access and control remote systems on a network and could, but does not necessarily, include execution of tools on remote systems. + execution = "Execution" #: The execution tactic represents techniques that result in execution of adversary-controlled code on a local or remote system. + collection = "Collection" #: Collection consists of techniques used to identify and gather information, such as sensitive files, from a target network prior to exfiltration. + exfiltration = "Exfiltration" #: Exfiltration refers to techniques and attributes that result or aid in the adversary removing files and information from a target network. + command_and_control = "CommandAndControl" #: The command and control tactic represents how adversaries communicate with systems under their control within a target network. + impact = "Impact" #: Impact events primarily try to directly reduce the availability or integrity of a system, service, or network; including manipulation of data to impact a business or operational process. + probing = "Probing" #: Probing could be either an attempt to access a certain resource regardless of a malicious intent, or a failed attempt to gain access to a target system to gather information prior to exploitation. + exploitation = "Exploitation" #: Exploitation is the stage where an attacker manages to get a foothold on the attacked resource. This stage is relevant for compute hosts and resources such as user accounts, certificates etc. + + +class AlertStatus(str, Enum): + + active = "Active" #: An alert which doesn't specify a value is assigned the status 'Active' + resolved = "Resolved" #: Alert closed after handling + dismissed = "Dismissed" #: Alert dismissed as false positive + + +class BundleType(str, Enum): + + app_services = "AppServices" + dns = "DNS" + key_vaults = "KeyVaults" + kubernetes_service = "KubernetesService" + resource_manager = "ResourceManager" + sql_servers = "SqlServers" + storage_accounts = "StorageAccounts" + virtual_machines = "VirtualMachines" + + class ExpandEnum(str, Enum): links = "links" #: All links associated with an assessment 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 751d0d5098d5f..6b4668bd9cb37 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 @@ -43,7 +43,6 @@ from ._adaptive_network_hardenings_operations import AdaptiveNetworkHardeningsOperations from ._allowed_connections_operations import AllowedConnectionsOperations from ._topology_operations import TopologyOperations -from ._alerts_operations import AlertsOperations from ._jit_network_access_policies_operations import JitNetworkAccessPoliciesOperations from ._discovered_security_solutions_operations import DiscoveredSecuritySolutionsOperations from ._security_solutions_reference_data_operations import SecuritySolutionsReferenceDataOperations @@ -62,6 +61,8 @@ from ._devices_for_hub_operations import DevicesForHubOperations from ._device_operations import DeviceOperations from ._on_premise_iot_sensors_operations import OnPremiseIotSensorsOperations +from ._iot_sites_operations import IotSitesOperations +from ._alerts_operations import AlertsOperations __all__ = [ 'ComplianceResultsOperations', @@ -98,7 +99,6 @@ 'AdaptiveNetworkHardeningsOperations', 'AllowedConnectionsOperations', 'TopologyOperations', - 'AlertsOperations', 'JitNetworkAccessPoliciesOperations', 'DiscoveredSecuritySolutionsOperations', 'SecuritySolutionsReferenceDataOperations', @@ -117,4 +117,6 @@ 'DevicesForHubOperations', 'DeviceOperations', 'OnPremiseIotSensorsOperations', + 'IotSitesOperations', + 'AlertsOperations', ] diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_alerts_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_alerts_operations.py index 3c069f9610fbf..e15d81e6e5754 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_alerts_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_alerts_operations.py @@ -12,6 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -25,7 +27,7 @@ class AlertsOperations(object): :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: "2020-01-01". + :ivar api_version: API version for the operation. Constant value: "2021-01-01". """ models = models @@ -35,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-01-01" + self.api_version = "2021-01-01" self.config = config @@ -175,7 +177,7 @@ def internal_paging(next_link=None): return deserialized list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts'} - def list_subscription_level_alerts_by_region( + def list_subscription_level_by_region( self, custom_headers=None, raw=False, **operation_config): """List all the alerts that are associated with the subscription that are stored in a specific location. @@ -193,7 +195,7 @@ def list_subscription_level_alerts_by_region( def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_subscription_level_alerts_by_region.metadata['url'] + url = self.list_subscription_level_by_region.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}$'), 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str') @@ -241,9 +243,9 @@ def internal_paging(next_link=None): deserialized = models.AlertPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_subscription_level_alerts_by_region.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts'} + list_subscription_level_by_region.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts'} - def list_resource_group_level_alerts_by_region( + def list_resource_group_level_by_region( self, resource_group_name, custom_headers=None, raw=False, **operation_config): """List all the alerts that are associated with the resource group that are stored in a specific location. @@ -264,7 +266,7 @@ def list_resource_group_level_alerts_by_region( def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_resource_group_level_alerts_by_region.metadata['url'] + url = self.list_resource_group_level_by_region.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}$'), 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), @@ -313,9 +315,9 @@ def internal_paging(next_link=None): deserialized = models.AlertPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_resource_group_level_alerts_by_region.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts'} + list_resource_group_level_by_region.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts'} - def get_subscription_level_alert( + def get_subscription_level( self, alert_name, custom_headers=None, raw=False, **operation_config): """Get an alert that is associated with a subscription. @@ -332,7 +334,7 @@ def get_subscription_level_alert( :raises: :class:`CloudError` """ # Construct URL - url = self.get_subscription_level_alert.metadata['url'] + url = self.get_subscription_level.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}$'), 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), @@ -372,9 +374,9 @@ def get_subscription_level_alert( return client_raw_response return deserialized - get_subscription_level_alert.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}'} + get_subscription_level.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}'} - def get_resource_group_level_alerts( + def get_resource_group_level( self, alert_name, resource_group_name, custom_headers=None, raw=False, **operation_config): """Get an alert that is associated a resource group or a resource in a resource group. @@ -395,7 +397,7 @@ def get_resource_group_level_alerts( :raises: :class:`CloudError` """ # Construct URL - url = self.get_resource_group_level_alerts.metadata['url'] + url = self.get_resource_group_level.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}$'), 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), @@ -436,9 +438,9 @@ def get_resource_group_level_alerts( return client_raw_response return deserialized - get_resource_group_level_alerts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}'} + get_resource_group_level.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}'} - def update_subscription_level_alert_state_to_dismiss( + def update_subscription_level_state_to_dismiss( self, alert_name, custom_headers=None, raw=False, **operation_config): """Update the alert's state. @@ -454,7 +456,7 @@ def update_subscription_level_alert_state_to_dismiss( :raises: :class:`CloudError` """ # Construct URL - url = self.update_subscription_level_alert_state_to_dismiss.metadata['url'] + url = self.update_subscription_level_state_to_dismiss.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}$'), 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), @@ -487,7 +489,7 @@ def update_subscription_level_alert_state_to_dismiss( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - update_subscription_level_alert_state_to_dismiss.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss'} + update_subscription_level_state_to_dismiss.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss'} def update_subscription_level_state_to_resolve( self, alert_name, custom_headers=None, raw=False, **operation_config): @@ -540,7 +542,7 @@ def update_subscription_level_state_to_resolve( return client_raw_response update_subscription_level_state_to_resolve.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve'} - def update_subscription_level_alert_state_to_reactivate( + def update_subscription_level_state_to_activate( self, alert_name, custom_headers=None, raw=False, **operation_config): """Update the alert's state. @@ -556,7 +558,7 @@ def update_subscription_level_alert_state_to_reactivate( :raises: :class:`CloudError` """ # Construct URL - url = self.update_subscription_level_alert_state_to_reactivate.metadata['url'] + url = self.update_subscription_level_state_to_activate.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}$'), 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), @@ -589,7 +591,7 @@ def update_subscription_level_alert_state_to_reactivate( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - update_subscription_level_alert_state_to_reactivate.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate'} + update_subscription_level_state_to_activate.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate'} def update_resource_group_level_state_to_resolve( self, alert_name, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -646,7 +648,7 @@ def update_resource_group_level_state_to_resolve( return client_raw_response update_resource_group_level_state_to_resolve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve'} - def update_resource_group_level_alert_state_to_dismiss( + def update_resource_group_level_state_to_dismiss( self, alert_name, resource_group_name, custom_headers=None, raw=False, **operation_config): """Update the alert's state. @@ -665,7 +667,7 @@ def update_resource_group_level_alert_state_to_dismiss( :raises: :class:`CloudError` """ # Construct URL - url = self.update_resource_group_level_alert_state_to_dismiss.metadata['url'] + url = self.update_resource_group_level_state_to_dismiss.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}$'), 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), @@ -699,9 +701,9 @@ def update_resource_group_level_alert_state_to_dismiss( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - update_resource_group_level_alert_state_to_dismiss.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss'} + update_resource_group_level_state_to_dismiss.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss'} - def update_resource_group_level_alert_state_to_reactivate( + def update_resource_group_level_state_to_activate( self, alert_name, resource_group_name, custom_headers=None, raw=False, **operation_config): """Update the alert's state. @@ -720,7 +722,7 @@ def update_resource_group_level_alert_state_to_reactivate( :raises: :class:`CloudError` """ # Construct URL - url = self.update_resource_group_level_alert_state_to_reactivate.metadata['url'] + url = self.update_resource_group_level_state_to_activate.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}$'), 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), @@ -754,4 +756,86 @@ def update_resource_group_level_alert_state_to_reactivate( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - update_resource_group_level_alert_state_to_reactivate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate'} + update_resource_group_level_state_to_activate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate'} + + + def _simulate_initial( + self, properties=None, custom_headers=None, raw=False, **operation_config): + alert_simulator_request_body = models.AlertSimulatorRequestBody(properties=properties) + + # Construct URL + url = self.simulate.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}$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, '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['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(alert_simulator_request_body, 'AlertSimulatorRequestBody') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202]: + 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 + + def simulate( + self, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Simulate security alerts. + + :param properties: Alert Simulator request body data. + :type properties: + ~azure.mgmt.security.models.AlertSimulatorRequestProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._simulate_initial( + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + simulate.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_defender_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_defender_settings_operations.py index 679341957e379..4c796db0a056e 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_defender_settings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_defender_settings_operations.py @@ -150,16 +150,12 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default'} def create_or_update( - self, device_quota, sentinel_workspace_resource_ids, custom_headers=None, raw=False, **operation_config): + self, iot_defender_settings_model, custom_headers=None, raw=False, **operation_config): """Create or update IoT Defender settings. - :param device_quota: Size of the device quota (as a opposed to a Pay - as You Go billing model). Value is required to be in multiples of - 1000. - :type device_quota: int - :param sentinel_workspace_resource_ids: Sentinel Workspace Resource - Ids - :type sentinel_workspace_resource_ids: list[str] + :param iot_defender_settings_model: The IoT defender settings model + :type iot_defender_settings_model: + ~azure.mgmt.security.models.IotDefenderSettingsModel :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -170,8 +166,6 @@ def create_or_update( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - iot_defender_settings_model = models.IotDefenderSettingsModel(device_quota=device_quota, sentinel_workspace_resource_ids=sentinel_workspace_resource_ids) - # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -320,3 +314,60 @@ def package_downloads_method( return deserialized package_downloads_method.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default/packageDownloads'} + + def download_manager_activation( + self, custom_headers=None, raw=False, callback=None, **operation_config): + """Download manager activation data defined for this subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param callback: When specified, will be called with each chunk of + data that is streamed. The callback should take two arguments, the + bytes of the current chunk of data and the response object. If the + data is uploading, response will be None. + :type callback: Callable[Bytes, response=None] + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.download_manager_activation.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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/zip' + 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=True, **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 = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + download_manager_activation.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default/downloadManagerActivation'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sensors_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sensors_operations.py index 0565ee6ba734c..5557bba21f9d3 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sensors_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sensors_operations.py @@ -111,8 +111,8 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: IotSensor or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotSensor or + :return: IotSensorsModel or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IotSensorsModel or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -149,7 +149,7 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('IotSensor', response) + deserialized = self._deserialize('IotSensorsModel', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -159,7 +159,7 @@ def get( get.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}'} def create_or_update( - self, scope, iot_sensor_name, custom_headers=None, raw=False, **operation_config): + self, scope, iot_sensor_name, iot_sensors_model, custom_headers=None, raw=False, **operation_config): """Create or update IoT sensor. :param scope: Scope of the query (IoT Hub, @@ -167,13 +167,15 @@ def create_or_update( :type scope: str :param iot_sensor_name: Name of the IoT sensor :type iot_sensor_name: str + :param iot_sensors_model: The IoT sensor model + :type iot_sensors_model: ~azure.mgmt.security.models.IotSensorsModel :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: IotSensor or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotSensor or + :return: IotSensorsModel or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IotSensorsModel or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -192,6 +194,7 @@ def create_or_update( # 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: @@ -199,8 +202,11 @@ def create_or_update( 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(iot_sensors_model, 'IotSensorsModel') + # Construct and send request - request = self._client.put(url, query_parameters, header_parameters) + 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]: @@ -210,9 +216,9 @@ def create_or_update( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('IotSensor', response) + deserialized = self._deserialize('IotSensorsModel', response) if response.status_code == 201: - deserialized = self._deserialize('IotSensor', response) + deserialized = self._deserialize('IotSensorsModel', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -336,3 +342,127 @@ def download_activation( return deserialized download_activation.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}/downloadActivation'} + + def download_reset_password( + self, scope, iot_sensor_name, appliance_id=None, custom_headers=None, raw=False, callback=None, **operation_config): + """Download file for reset password of the sensor. + + :param scope: Scope of the query (IoT Hub, + /providers/Microsoft.Devices/iotHubs/myHub) + :type scope: str + :param iot_sensor_name: Name of the IoT sensor + :type iot_sensor_name: str + :param appliance_id: The appliance id of the sensor. + :type appliance_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 callback: When specified, will be called with each chunk of + data that is streamed. The callback should take two arguments, the + bytes of the current chunk of data and the response object. If the + data is uploading, response will be None. + :type callback: Callable[Bytes, response=None] + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + body = models.ResetPasswordInput(appliance_id=appliance_id) + + # Construct URL + url = self.download_reset_password.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'iotSensorName': self._serialize.url("iot_sensor_name", iot_sensor_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/zip' + 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(body, 'ResetPasswordInput') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=True, **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 = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + download_reset_password.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}/downloadResetPassword'} + + def trigger_ti_package_update( + self, scope, iot_sensor_name, custom_headers=None, raw=False, **operation_config): + """Trigger threat intelligence package update. + + :param scope: Scope of the query (IoT Hub, + /providers/Microsoft.Devices/iotHubs/myHub) + :type scope: str + :param iot_sensor_name: Name of the IoT sensor + :type iot_sensor_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.trigger_ti_package_update.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'iotSensorName': self._serialize.url("iot_sensor_name", iot_sensor_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.post(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 + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + trigger_ti_package_update.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}/triggerTiPackageUpdate'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sites_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sites_operations.py new file mode 100644 index 0000000000000..3f275513d9485 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sites_operations.py @@ -0,0 +1,276 @@ +# 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 IotSitesOperations(object): + """IotSitesOperations 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: "2020-08-06-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-08-06-preview" + + self.config = config + + def list( + self, scope, custom_headers=None, raw=False, **operation_config): + """List IoT sites. + + :param scope: Scope of the query (IoT Hub, + /providers/Microsoft.Devices/iotHubs/myHub) + :type scope: 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: IotSitesList or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IotSitesList or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + 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('IotSitesList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSites'} + + def get( + self, scope, custom_headers=None, raw=False, **operation_config): + """Get IoT site. + + :param scope: Scope of the query (IoT Hub, + /providers/Microsoft.Devices/iotHubs/myHub) + :type scope: 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: IotSitesModel or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IotSitesModel or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + 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('IotSitesModel', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSites/default'} + + def create_or_update( + self, scope, display_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Create or update IoT site. + + :param scope: Scope of the query (IoT Hub, + /providers/Microsoft.Devices/iotHubs/myHub) + :type scope: str + :param display_name: Display name of the IoT site + :type display_name: str + :param tags: Tags of the IoT site + :type tags: dict[str, 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: IotSitesModel or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IotSitesModel or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + iot_sites_model = models.IotSitesModel(display_name=display_name, tags=tags) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + 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(iot_sites_model, 'IotSitesModel') + + # 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('IotSitesModel', response) + if response.status_code == 201: + deserialized = self._deserialize('IotSitesModel', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSites/default'} + + def delete( + self, scope, custom_headers=None, raw=False, **operation_config): + """Delete IoT site. + + :param scope: Scope of the query (IoT Hub, + /providers/Microsoft.Devices/iotHubs/myHub) + :type scope: 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 = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + 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': '/{scope}/providers/Microsoft.Security/iotSites/default'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_on_premise_iot_sensors_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_on_premise_iot_sensors_operations.py index bd5c73f7dcd8d..234ea698cd85c 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_on_premise_iot_sensors_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_on_premise_iot_sensors_operations.py @@ -321,3 +321,71 @@ def download_activation( return deserialized download_activation.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}/downloadActivation'} + + def download_reset_password( + self, on_premise_iot_sensor_name, appliance_id=None, custom_headers=None, raw=False, callback=None, **operation_config): + """Download file for reset password of the sensor. + + :param on_premise_iot_sensor_name: Name of the on-premise IoT sensor + :type on_premise_iot_sensor_name: str + :param appliance_id: The appliance id of the sensor. + :type appliance_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 callback: When specified, will be called with each chunk of + data that is streamed. The callback should take two arguments, the + bytes of the current chunk of data and the response object. If the + data is uploading, response will be None. + :type callback: Callable[Bytes, response=None] + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + body = models.ResetPasswordInput(appliance_id=appliance_id) + + # Construct URL + url = self.download_reset_password.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}$'), + 'onPremiseIotSensorName': self._serialize.url("on_premise_iot_sensor_name", on_premise_iot_sensor_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/zip' + 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(body, 'ResetPasswordInput') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=True, **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 = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + download_reset_password.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}/downloadResetPassword'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_server_vulnerability_assessment_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_server_vulnerability_assessment_operations.py index b3e51771853c6..841109ee0ce6e 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_server_vulnerability_assessment_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_server_vulnerability_assessment_operations.py @@ -12,6 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -253,28 +255,9 @@ def create_or_update( return deserialized create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}'} - def delete( - self, resource_group_name, resource_namespace, resource_type, resource_name, custom_headers=None, raw=False, **operation_config): - """Removing server vulnerability assessment from a resource. - :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 resource_namespace: The Namespace of the resource. - :type resource_namespace: str - :param resource_type: The type of the resource. - :type resource_type: str - :param resource_name: Name of the resource. - :type resource_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` - """ + def _delete_initial( + self, resource_group_name, resource_namespace, resource_type, resource_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.delete.metadata['url'] path_format_arguments = { @@ -304,7 +287,7 @@ def delete( 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]: + if response.status_code not in [200, 202, 204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -312,4 +295,51 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + + def delete( + self, resource_group_name, resource_namespace, resource_type, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Removing server vulnerability assessment from a resource. + + :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 resource_namespace: The Namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_namespace=resource_namespace, + resource_type=resource_type, + resource_name=resource_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}'}