diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/_security_center.py index 342c5d61f0e1..0da98868f953 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/_security_center.py @@ -17,14 +17,11 @@ from .operations import PricingsOperations from .operations import AlertsOperations from .operations import SettingsOperations -from .operations import IoTSecuritySolutionsOperations -from .operations import IoTSecuritySolutionsResourceGroupOperations +from .operations import DeviceSecurityGroupsOperations from .operations import IotSecuritySolutionOperations -from .operations import IoTSecuritySolutionsAnalyticsOperations -from .operations import IoTSecuritySolutionsAnalyticsAggregatedAlertsOperations -from .operations import IoTSecuritySolutionsAnalyticsAggregatedAlertOperations -from .operations import IoTSecuritySolutionsAnalyticsRecommendationOperations -from .operations import IoTSecuritySolutionsAnalyticsRecommendationsOperations +from .operations import IotSecuritySolutionAnalyticsOperations +from .operations import IotSecuritySolutionsAnalyticsAggregatedAlertOperations +from .operations import IotSecuritySolutionsAnalyticsRecommendationOperations from .operations import AllowedConnectionsOperations from .operations import DiscoveredSecuritySolutionsOperations from .operations import ExternalSecuritySolutionsOperations @@ -44,6 +41,9 @@ from .operations import RegulatoryComplianceControlsOperations from .operations import RegulatoryComplianceAssessmentsOperations from .operations import ServerVulnerabilityAssessmentOperations +from .operations import SubAssessmentsOperations +from .operations import AssessmentsMetadataOperations +from .operations import AssessmentsMetadataSubscriptionOperations from . import models @@ -61,22 +61,16 @@ class SecurityCenter(SDKClient): :vartype alerts: azure.mgmt.security.operations.AlertsOperations :ivar settings: Settings operations :vartype settings: azure.mgmt.security.operations.SettingsOperations - :ivar io_tsecurity_solutions: IoTSecuritySolutions operations - :vartype io_tsecurity_solutions: azure.mgmt.security.operations.IoTSecuritySolutionsOperations - :ivar io_tsecurity_solutions_resource_group: IoTSecuritySolutionsResourceGroup operations - :vartype io_tsecurity_solutions_resource_group: azure.mgmt.security.operations.IoTSecuritySolutionsResourceGroupOperations + :ivar device_security_groups: DeviceSecurityGroups operations + :vartype device_security_groups: azure.mgmt.security.operations.DeviceSecurityGroupsOperations :ivar iot_security_solution: IotSecuritySolution operations :vartype iot_security_solution: azure.mgmt.security.operations.IotSecuritySolutionOperations - :ivar io_tsecurity_solutions_analytics: IoTSecuritySolutionsAnalytics operations - :vartype io_tsecurity_solutions_analytics: azure.mgmt.security.operations.IoTSecuritySolutionsAnalyticsOperations - :ivar io_tsecurity_solutions_analytics_aggregated_alerts: IoTSecuritySolutionsAnalyticsAggregatedAlerts operations - :vartype io_tsecurity_solutions_analytics_aggregated_alerts: azure.mgmt.security.operations.IoTSecuritySolutionsAnalyticsAggregatedAlertsOperations - :ivar io_tsecurity_solutions_analytics_aggregated_alert: IoTSecuritySolutionsAnalyticsAggregatedAlert operations - :vartype io_tsecurity_solutions_analytics_aggregated_alert: azure.mgmt.security.operations.IoTSecuritySolutionsAnalyticsAggregatedAlertOperations - :ivar io_tsecurity_solutions_analytics_recommendation: IoTSecuritySolutionsAnalyticsRecommendation operations - :vartype io_tsecurity_solutions_analytics_recommendation: azure.mgmt.security.operations.IoTSecuritySolutionsAnalyticsRecommendationOperations - :ivar io_tsecurity_solutions_analytics_recommendations: IoTSecuritySolutionsAnalyticsRecommendations operations - :vartype io_tsecurity_solutions_analytics_recommendations: azure.mgmt.security.operations.IoTSecuritySolutionsAnalyticsRecommendationsOperations + :ivar iot_security_solution_analytics: IotSecuritySolutionAnalytics operations + :vartype iot_security_solution_analytics: azure.mgmt.security.operations.IotSecuritySolutionAnalyticsOperations + :ivar iot_security_solutions_analytics_aggregated_alert: IotSecuritySolutionsAnalyticsAggregatedAlert operations + :vartype iot_security_solutions_analytics_aggregated_alert: azure.mgmt.security.operations.IotSecuritySolutionsAnalyticsAggregatedAlertOperations + :ivar iot_security_solutions_analytics_recommendation: IotSecuritySolutionsAnalyticsRecommendation operations + :vartype iot_security_solutions_analytics_recommendation: azure.mgmt.security.operations.IotSecuritySolutionsAnalyticsRecommendationOperations :ivar allowed_connections: AllowedConnections operations :vartype allowed_connections: azure.mgmt.security.operations.AllowedConnectionsOperations :ivar discovered_security_solutions: DiscoveredSecuritySolutions operations @@ -115,6 +109,12 @@ class SecurityCenter(SDKClient): :vartype regulatory_compliance_assessments: azure.mgmt.security.operations.RegulatoryComplianceAssessmentsOperations :ivar server_vulnerability_assessment: ServerVulnerabilityAssessment operations :vartype server_vulnerability_assessment: azure.mgmt.security.operations.ServerVulnerabilityAssessmentOperations + :ivar sub_assessments: SubAssessments operations + :vartype sub_assessments: azure.mgmt.security.operations.SubAssessmentsOperations + :ivar assessments_metadata: AssessmentsMetadata operations + :vartype assessments_metadata: azure.mgmt.security.operations.AssessmentsMetadataOperations + :ivar assessments_metadata_subscription: AssessmentsMetadataSubscription operations + :vartype assessments_metadata_subscription: azure.mgmt.security.operations.AssessmentsMetadataSubscriptionOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -145,21 +145,15 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.settings = SettingsOperations( self._client, self.config, self._serialize, self._deserialize) - self.io_tsecurity_solutions = IoTSecuritySolutionsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.io_tsecurity_solutions_resource_group = IoTSecuritySolutionsResourceGroupOperations( + self.device_security_groups = DeviceSecurityGroupsOperations( self._client, self.config, self._serialize, self._deserialize) self.iot_security_solution = IotSecuritySolutionOperations( self._client, self.config, self._serialize, self._deserialize) - self.io_tsecurity_solutions_analytics = IoTSecuritySolutionsAnalyticsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.io_tsecurity_solutions_analytics_aggregated_alerts = IoTSecuritySolutionsAnalyticsAggregatedAlertsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.io_tsecurity_solutions_analytics_aggregated_alert = IoTSecuritySolutionsAnalyticsAggregatedAlertOperations( + self.iot_security_solution_analytics = IotSecuritySolutionAnalyticsOperations( self._client, self.config, self._serialize, self._deserialize) - self.io_tsecurity_solutions_analytics_recommendation = IoTSecuritySolutionsAnalyticsRecommendationOperations( + self.iot_security_solutions_analytics_aggregated_alert = IotSecuritySolutionsAnalyticsAggregatedAlertOperations( self._client, self.config, self._serialize, self._deserialize) - self.io_tsecurity_solutions_analytics_recommendations = IoTSecuritySolutionsAnalyticsRecommendationsOperations( + self.iot_security_solutions_analytics_recommendation = IotSecuritySolutionsAnalyticsRecommendationOperations( self._client, self.config, self._serialize, self._deserialize) self.allowed_connections = AllowedConnectionsOperations( self._client, self.config, self._serialize, self._deserialize) @@ -199,3 +193,9 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.server_vulnerability_assessment = ServerVulnerabilityAssessmentOperations( self._client, self.config, self._serialize, self._deserialize) + self.sub_assessments = SubAssessmentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.assessments_metadata = AssessmentsMetadataOperations( + self._client, self.config, self._serialize, self._deserialize) + self.assessments_metadata_subscription = AssessmentsMetadataSubscriptionOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/__init__.py index b09be32d96b1..bde7a0719bf4 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 @@ -13,11 +13,13 @@ from ._models_py3 import AadConnectivityState1 from ._models_py3 import AadExternalSecuritySolution from ._models_py3 import AadSolutionProperties + from ._models_py3 import AdditionalData from ._models_py3 import AdvancedThreatProtectionSetting from ._models_py3 import Alert from ._models_py3 import AlertConfidenceReason from ._models_py3 import AlertEntity from ._models_py3 import AllowedConnectionsResource + from ._models_py3 import AllowlistCustomAlertRule from ._models_py3 import AppWhitelistingGroup from ._models_py3 import AppWhitelistingGroups from ._models_py3 import AppWhitelistingIssueSummary @@ -26,6 +28,8 @@ from ._models_py3 import AtaExternalSecuritySolution from ._models_py3 import AtaSolutionProperties from ._models_py3 import AutoProvisioningSetting + from ._models_py3 import AwsResourceDetails + from ._models_py3 import AzureResourceDetails from ._models_py3 import CefExternalSecuritySolution from ._models_py3 import CefSolutionProperties from ._models_py3 import Compliance @@ -34,7 +38,13 @@ from ._models_py3 import ConnectableResource from ._models_py3 import ConnectedResource from ._models_py3 import ConnectedWorkspace + from ._models_py3 import ContainerRegistryVulnerabilityProperties + from ._models_py3 import CustomAlertRule + from ._models_py3 import CVE + from ._models_py3 import CVSS from ._models_py3 import DataExportSetting + from ._models_py3 import DenylistCustomAlertRule + from ._models_py3 import DeviceSecurityGroup from ._models_py3 import DiscoveredSecuritySolution from ._models_py3 import ExternalSecuritySolution from ._models_py3 import ExternalSecuritySolutionKind1 @@ -43,13 +53,11 @@ from ._models_py3 import InformationProtectionPolicy from ._models_py3 import InformationType from ._models_py3 import IoTSecurityAggregatedAlert + from ._models_py3 import IoTSecurityAggregatedAlertPropertiesTopDevicesListItem from ._models_py3 import IoTSecurityAggregatedRecommendation from ._models_py3 import IoTSecurityAlertedDevice - from ._models_py3 import IoTSecurityAlertedDevicesList from ._models_py3 import IoTSecurityDeviceAlert - from ._models_py3 import IoTSecurityDeviceAlertsList from ._models_py3 import IoTSecurityDeviceRecommendation - from ._models_py3 import IoTSecurityDeviceRecommendationsList from ._models_py3 import IoTSecuritySolutionAnalyticsModel from ._models_py3 import IoTSecuritySolutionAnalyticsModelList from ._models_py3 import IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem @@ -65,27 +73,37 @@ from ._models_py3 import JitNetworkAccessRequestPort from ._models_py3 import JitNetworkAccessRequestVirtualMachine from ._models_py3 import Kind + from ._models_py3 import ListCustomAlertRule from ._models_py3 import Location from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import PathRecommendation from ._models_py3 import Pricing from ._models_py3 import PricingList + from ._models_py3 import ProtectionMode from ._models_py3 import PublisherInfo from ._models_py3 import RecommendationConfigurationProperties from ._models_py3 import RegulatoryComplianceAssessment from ._models_py3 import RegulatoryComplianceControl from ._models_py3 import RegulatoryComplianceStandard from ._models_py3 import Resource + from ._models_py3 import ResourceDetails + from ._models_py3 import SecurityAssessmentMetadata from ._models_py3 import SecurityContact + from ._models_py3 import SecuritySubAssessment from ._models_py3 import SecurityTask from ._models_py3 import SecurityTaskParameters from ._models_py3 import SensitivityLabel from ._models_py3 import ServerVulnerabilityAssessment from ._models_py3 import ServerVulnerabilityAssessmentsList + from ._models_py3 import ServerVulnerabilityProperties from ._models_py3 import Setting from ._models_py3 import SettingResource + from ._models_py3 import SqlServerVulnerabilityProperties + from ._models_py3 import SubAssessmentStatus from ._models_py3 import TagsResource + from ._models_py3 import ThresholdCustomAlertRule + from ._models_py3 import TimeWindowCustomAlertRule from ._models_py3 import TopologyResource from ._models_py3 import TopologySingleResource from ._models_py3 import TopologySingleResourceChild @@ -93,17 +111,20 @@ from ._models_py3 import UpdateIotSecuritySolutionData from ._models_py3 import UserDefinedResourcesProperties from ._models_py3 import UserRecommendation + from ._models_py3 import VendorReference from ._models_py3 import VmRecommendation from ._models_py3 import WorkspaceSetting except (SyntaxError, ImportError): from ._models import AadConnectivityState1 from ._models import AadExternalSecuritySolution from ._models import AadSolutionProperties + from ._models import AdditionalData from ._models import AdvancedThreatProtectionSetting from ._models import Alert from ._models import AlertConfidenceReason from ._models import AlertEntity from ._models import AllowedConnectionsResource + from ._models import AllowlistCustomAlertRule from ._models import AppWhitelistingGroup from ._models import AppWhitelistingGroups from ._models import AppWhitelistingIssueSummary @@ -112,6 +133,8 @@ from ._models import AtaExternalSecuritySolution from ._models import AtaSolutionProperties from ._models import AutoProvisioningSetting + from ._models import AwsResourceDetails + from ._models import AzureResourceDetails from ._models import CefExternalSecuritySolution from ._models import CefSolutionProperties from ._models import Compliance @@ -120,7 +143,13 @@ from ._models import ConnectableResource from ._models import ConnectedResource from ._models import ConnectedWorkspace + from ._models import ContainerRegistryVulnerabilityProperties + from ._models import CustomAlertRule + from ._models import CVE + from ._models import CVSS from ._models import DataExportSetting + from ._models import DenylistCustomAlertRule + from ._models import DeviceSecurityGroup from ._models import DiscoveredSecuritySolution from ._models import ExternalSecuritySolution from ._models import ExternalSecuritySolutionKind1 @@ -129,13 +158,11 @@ from ._models import InformationProtectionPolicy from ._models import InformationType from ._models import IoTSecurityAggregatedAlert + from ._models import IoTSecurityAggregatedAlertPropertiesTopDevicesListItem from ._models import IoTSecurityAggregatedRecommendation from ._models import IoTSecurityAlertedDevice - from ._models import IoTSecurityAlertedDevicesList from ._models import IoTSecurityDeviceAlert - from ._models import IoTSecurityDeviceAlertsList from ._models import IoTSecurityDeviceRecommendation - from ._models import IoTSecurityDeviceRecommendationsList from ._models import IoTSecuritySolutionAnalyticsModel from ._models import IoTSecuritySolutionAnalyticsModelList from ._models import IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem @@ -151,27 +178,37 @@ from ._models import JitNetworkAccessRequestPort from ._models import JitNetworkAccessRequestVirtualMachine from ._models import Kind + from ._models import ListCustomAlertRule from ._models import Location from ._models import Operation from ._models import OperationDisplay from ._models import PathRecommendation from ._models import Pricing from ._models import PricingList + from ._models import ProtectionMode from ._models import PublisherInfo from ._models import RecommendationConfigurationProperties from ._models import RegulatoryComplianceAssessment from ._models import RegulatoryComplianceControl from ._models import RegulatoryComplianceStandard from ._models import Resource + from ._models import ResourceDetails + from ._models import SecurityAssessmentMetadata from ._models import SecurityContact + from ._models import SecuritySubAssessment from ._models import SecurityTask from ._models import SecurityTaskParameters from ._models import SensitivityLabel from ._models import ServerVulnerabilityAssessment from ._models import ServerVulnerabilityAssessmentsList + from ._models import ServerVulnerabilityProperties from ._models import Setting from ._models import SettingResource + from ._models import SqlServerVulnerabilityProperties + from ._models import SubAssessmentStatus from ._models import TagsResource + from ._models import ThresholdCustomAlertRule + from ._models import TimeWindowCustomAlertRule from ._models import TopologyResource from ._models import TopologySingleResource from ._models import TopologySingleResourceChild @@ -179,6 +216,7 @@ from ._models import UpdateIotSecuritySolutionData from ._models import UserDefinedResourcesProperties from ._models import UserRecommendation + from ._models import VendorReference from ._models import VmRecommendation from ._models import WorkspaceSetting from ._paged_models import AlertPaged @@ -187,6 +225,7 @@ from ._paged_models import AutoProvisioningSettingPaged from ._paged_models import CompliancePaged from ._paged_models import ComplianceResultPaged +from ._paged_models import DeviceSecurityGroupPaged from ._paged_models import DiscoveredSecuritySolutionPaged from ._paged_models import ExternalSecuritySolutionPaged from ._paged_models import InformationProtectionPolicyPaged @@ -198,7 +237,9 @@ from ._paged_models import RegulatoryComplianceAssessmentPaged from ._paged_models import RegulatoryComplianceControlPaged from ._paged_models import RegulatoryComplianceStandardPaged +from ._paged_models import SecurityAssessmentMetadataPaged from ._paged_models import SecurityContactPaged +from ._paged_models import SecuritySubAssessmentPaged from ._paged_models import SecurityTaskPaged from ._paged_models import SettingPaged from ._paged_models import TopologyResourcePaged @@ -208,6 +249,7 @@ PricingTier, ReportedSeverity, SettingKind, + ValueType, SecuritySolutionStatus, ExportData, DataSource, @@ -223,6 +265,10 @@ AlertNotifications, AlertsToAdmins, State, + SubAssessmentStatusCode, + Severity, + Category, + AssessmentType, ConnectionType, ) @@ -230,11 +276,13 @@ 'AadConnectivityState1', 'AadExternalSecuritySolution', 'AadSolutionProperties', + 'AdditionalData', 'AdvancedThreatProtectionSetting', 'Alert', 'AlertConfidenceReason', 'AlertEntity', 'AllowedConnectionsResource', + 'AllowlistCustomAlertRule', 'AppWhitelistingGroup', 'AppWhitelistingGroups', 'AppWhitelistingIssueSummary', @@ -243,6 +291,8 @@ 'AtaExternalSecuritySolution', 'AtaSolutionProperties', 'AutoProvisioningSetting', + 'AwsResourceDetails', + 'AzureResourceDetails', 'CefExternalSecuritySolution', 'CefSolutionProperties', 'Compliance', @@ -251,7 +301,13 @@ 'ConnectableResource', 'ConnectedResource', 'ConnectedWorkspace', + 'ContainerRegistryVulnerabilityProperties', + 'CustomAlertRule', + 'CVE', + 'CVSS', 'DataExportSetting', + 'DenylistCustomAlertRule', + 'DeviceSecurityGroup', 'DiscoveredSecuritySolution', 'ExternalSecuritySolution', 'ExternalSecuritySolutionKind1', @@ -260,13 +316,11 @@ 'InformationProtectionPolicy', 'InformationType', 'IoTSecurityAggregatedAlert', + 'IoTSecurityAggregatedAlertPropertiesTopDevicesListItem', 'IoTSecurityAggregatedRecommendation', 'IoTSecurityAlertedDevice', - 'IoTSecurityAlertedDevicesList', 'IoTSecurityDeviceAlert', - 'IoTSecurityDeviceAlertsList', 'IoTSecurityDeviceRecommendation', - 'IoTSecurityDeviceRecommendationsList', 'IoTSecuritySolutionAnalyticsModel', 'IoTSecuritySolutionAnalyticsModelList', 'IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem', @@ -282,27 +336,37 @@ 'JitNetworkAccessRequestPort', 'JitNetworkAccessRequestVirtualMachine', 'Kind', + 'ListCustomAlertRule', 'Location', 'Operation', 'OperationDisplay', 'PathRecommendation', 'Pricing', 'PricingList', + 'ProtectionMode', 'PublisherInfo', 'RecommendationConfigurationProperties', 'RegulatoryComplianceAssessment', 'RegulatoryComplianceControl', 'RegulatoryComplianceStandard', 'Resource', + 'ResourceDetails', + 'SecurityAssessmentMetadata', 'SecurityContact', + 'SecuritySubAssessment', 'SecurityTask', 'SecurityTaskParameters', 'SensitivityLabel', 'ServerVulnerabilityAssessment', 'ServerVulnerabilityAssessmentsList', + 'ServerVulnerabilityProperties', 'Setting', 'SettingResource', + 'SqlServerVulnerabilityProperties', + 'SubAssessmentStatus', 'TagsResource', + 'ThresholdCustomAlertRule', + 'TimeWindowCustomAlertRule', 'TopologyResource', 'TopologySingleResource', 'TopologySingleResourceChild', @@ -310,11 +374,13 @@ 'UpdateIotSecuritySolutionData', 'UserDefinedResourcesProperties', 'UserRecommendation', + 'VendorReference', 'VmRecommendation', 'WorkspaceSetting', 'ComplianceResultPaged', 'AlertPaged', 'SettingPaged', + 'DeviceSecurityGroupPaged', 'IoTSecuritySolutionModelPaged', 'IoTSecurityAggregatedAlertPaged', 'IoTSecurityAggregatedRecommendationPaged', @@ -334,10 +400,13 @@ 'RegulatoryComplianceStandardPaged', 'RegulatoryComplianceControlPaged', 'RegulatoryComplianceAssessmentPaged', + 'SecuritySubAssessmentPaged', + 'SecurityAssessmentMetadataPaged', 'ResourceStatus', 'PricingTier', 'ReportedSeverity', 'SettingKind', + 'ValueType', 'SecuritySolutionStatus', 'ExportData', 'DataSource', @@ -353,5 +422,9 @@ 'AlertNotifications', 'AlertsToAdmins', 'State', + 'SubAssessmentStatusCode', + 'Severity', + 'Category', + 'AssessmentType', 'ConnectionType', ] diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models.py index 814deff5ee6b..04f7525b0f4c 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 @@ -164,6 +164,36 @@ def __init__(self, **kwargs): self.connectivity_state = kwargs.get('connectivity_state', None) +class AdditionalData(Model): + """Details of the sub-assessment. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: SqlServerVulnerabilityProperties, + ContainerRegistryVulnerabilityProperties, ServerVulnerabilityProperties + + All required parameters must be populated in order to send to Azure. + + :param assessed_resource_type: Required. Constant filled by server. + :type assessed_resource_type: str + """ + + _validation = { + 'assessed_resource_type': {'required': True}, + } + + _attribute_map = { + 'assessed_resource_type': {'key': 'assessedResourceType', 'type': 'str'}, + } + + _subtype_map = { + 'assessed_resource_type': {'SqlServerVulnerability': 'SqlServerVulnerabilityProperties', 'ContainerRegistryVulnerability': 'ContainerRegistryVulnerabilityProperties', 'ServerVulnerabilityAssessment': 'ServerVulnerabilityProperties'} + } + + def __init__(self, **kwargs): + super(AdditionalData, self).__init__(**kwargs) + self.assessed_resource_type = None + + class Resource(Model): """Describes an Azure resource. @@ -492,6 +522,136 @@ def __init__(self, **kwargs): self.connectable_resources = None +class CustomAlertRule(Model): + """A custom alert rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomAlertRule, self).__init__(**kwargs) + self.display_name = None + self.description = None + self.is_enabled = kwargs.get('is_enabled', None) + self.rule_type = kwargs.get('rule_type', None) + + +class ListCustomAlertRule(CustomAlertRule): + """A List custom alert rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :ivar value_type: The value type of the items in the list. Possible values + include: 'IpCidr', 'String' + :vartype value_type: str or ~azure.mgmt.security.models.ValueType + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'value_type': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'value_type': {'key': 'valueType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListCustomAlertRule, self).__init__(**kwargs) + self.value_type = None + + +class AllowlistCustomAlertRule(ListCustomAlertRule): + """A custom alert rule that checks if a value (depends on the custom alert + type) is allowed. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :ivar value_type: The value type of the items in the list. Possible values + include: 'IpCidr', 'String' + :vartype value_type: str or ~azure.mgmt.security.models.ValueType + :param allowlist_values: Required. The values to allow. The format of the + values depends on the rule type. + :type allowlist_values: list[str] + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'value_type': {'readonly': True}, + 'allowlist_values': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'value_type': {'key': 'valueType', 'type': 'str'}, + 'allowlist_values': {'key': 'allowlistValues', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(AllowlistCustomAlertRule, self).__init__(**kwargs) + self.allowlist_values = kwargs.get('allowlist_values', None) + + class AppWhitelistingGroup(Model): """AppWhitelistingGroup. @@ -506,8 +666,11 @@ class AppWhitelistingGroup(Model): :vartype type: str :ivar location: Location where the resource is stored :vartype location: str - :param enforcement_mode: Possible values include: 'Audit', 'Enforce' + :param enforcement_mode: Possible values include: 'Audit', 'Enforce', + 'None' :type enforcement_mode: str or ~azure.mgmt.security.models.enum + :param protection_mode: + :type protection_mode: ~azure.mgmt.security.models.ProtectionMode :param configuration_status: Possible values include: 'Configured', 'NotConfigured', 'InProgress', 'Failed', 'NoStatus' :type configuration_status: str or ~azure.mgmt.security.models.enum @@ -541,6 +704,7 @@ class AppWhitelistingGroup(Model): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'enforcement_mode': {'key': 'properties.enforcementMode', 'type': 'str'}, + 'protection_mode': {'key': 'properties.protectionMode', 'type': 'ProtectionMode'}, 'configuration_status': {'key': 'properties.configurationStatus', 'type': 'str'}, 'recommendation_status': {'key': 'properties.recommendationStatus', 'type': 'str'}, 'issues': {'key': 'properties.issues', 'type': '[AppWhitelistingIssueSummary]'}, @@ -556,6 +720,7 @@ def __init__(self, **kwargs): self.type = None self.location = None self.enforcement_mode = kwargs.get('enforcement_mode', None) + self.protection_mode = kwargs.get('protection_mode', None) self.configuration_status = kwargs.get('configuration_status', None) self.recommendation_status = kwargs.get('recommendation_status', None) self.issues = kwargs.get('issues', None) @@ -608,8 +773,14 @@ def __init__(self, **kwargs): class AppWhitelistingPutGroupData(Model): """The altered data of the recommended VM/server group policy. - :param enforcement_mode: Possible values include: 'Audit', 'Enforce' + :param enforcement_mode: The enforcement mode of the group. Can also be + defined per collection type by using ProtectionMode. Possible values + include: 'Audit', 'Enforce', 'None' :type enforcement_mode: str or ~azure.mgmt.security.models.enum + :param protection_mode: The protection mode of the group per collection + type. Can also be defined for all collection types by using + EnforcementMode + :type protection_mode: ~azure.mgmt.security.models.ProtectionMode :param vm_recommendations: :type vm_recommendations: list[~azure.mgmt.security.models.VmRecommendation] @@ -620,6 +791,7 @@ class AppWhitelistingPutGroupData(Model): _attribute_map = { 'enforcement_mode': {'key': 'enforcementMode', 'type': 'str'}, + 'protection_mode': {'key': 'protectionMode', 'type': 'ProtectionMode'}, 'vm_recommendations': {'key': 'vmRecommendations', 'type': '[VmRecommendation]'}, 'path_recommendations': {'key': 'pathRecommendations', 'type': '[PathRecommendation]'}, } @@ -627,6 +799,7 @@ class AppWhitelistingPutGroupData(Model): def __init__(self, **kwargs): super(AppWhitelistingPutGroupData, self).__init__(**kwargs) self.enforcement_mode = kwargs.get('enforcement_mode', None) + self.protection_mode = kwargs.get('protection_mode', None) self.vm_recommendations = kwargs.get('vm_recommendations', None) self.path_recommendations = kwargs.get('path_recommendations', None) @@ -806,6 +979,100 @@ def __init__(self, **kwargs): self.auto_provision = kwargs.get('auto_provision', None) +class ResourceDetails(Model): + """Details of the resource that was assessed. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureResourceDetails, AwsResourceDetails + + All required parameters must be populated in order to send to Azure. + + :param source: Required. Constant filled by server. + :type source: str + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'str'}, + } + + _subtype_map = { + 'source': {'Azure': 'AzureResourceDetails', 'Aws': 'AwsResourceDetails'} + } + + def __init__(self, **kwargs): + super(ResourceDetails, self).__init__(**kwargs) + self.source = None + + +class AwsResourceDetails(ResourceDetails): + """Details of the resource that was assessed. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. Constant filled by server. + :type source: str + :ivar account_id: AWS account ID + :vartype account_id: str + :ivar aws_resource_id: AWS resource ID. can be ARN or other + :vartype aws_resource_id: str + """ + + _validation = { + 'source': {'required': True}, + 'account_id': {'readonly': True}, + 'aws_resource_id': {'readonly': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'str'}, + 'account_id': {'key': 'accountId', 'type': 'str'}, + 'aws_resource_id': {'key': 'awsResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AwsResourceDetails, self).__init__(**kwargs) + self.account_id = None + self.aws_resource_id = None + self.source = 'Aws' + + +class AzureResourceDetails(ResourceDetails): + """Details of the resource that was assessed. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. Constant filled by server. + :type source: str + :ivar id: Azure resource ID of the assessed resource + :vartype id: str + """ + + _validation = { + 'source': {'required': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureResourceDetails, self).__init__(**kwargs) + self.id = None + self.source = 'Azure' + + class CefExternalSecuritySolution(ExternalSecuritySolution): """Represents a security solution which sends CEF logs to an OMS workspace. @@ -1134,6 +1401,125 @@ def __init__(self, **kwargs): self.id = kwargs.get('id', None) +class ContainerRegistryVulnerabilityProperties(AdditionalData): + """Additional context fields for container registry Vulnerability assessment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param assessed_resource_type: Required. Constant filled by server. + :type assessed_resource_type: str + :ivar type: Vulnerability Type. e.g: Vulnerability, Potential + Vulnerability, Information Gathered, Vulnerability + :vartype type: str + :ivar cvss: Dictionary from cvss version to cvss details object + :vartype cvss: dict[str, ~azure.mgmt.security.models.CVSS] + :ivar patchable: Indicates whether a patch is available or not + :vartype patchable: bool + :ivar cve: List of CVEs + :vartype cve: list[~azure.mgmt.security.models.CVE] + :ivar published_time: Published time + :vartype published_time: datetime + :ivar vendor_references: + :vartype vendor_references: + list[~azure.mgmt.security.models.VendorReference] + :ivar repository_name: Name of the repository which the vulnerable image + belongs to + :vartype repository_name: str + :ivar image_digest: Digest of the vulnerable image + :vartype image_digest: str + """ + + _validation = { + 'assessed_resource_type': {'required': True}, + 'type': {'readonly': True}, + 'cvss': {'readonly': True}, + 'patchable': {'readonly': True}, + 'cve': {'readonly': True}, + 'published_time': {'readonly': True}, + 'vendor_references': {'readonly': True}, + 'repository_name': {'readonly': True}, + 'image_digest': {'readonly': True}, + } + + _attribute_map = { + 'assessed_resource_type': {'key': 'assessedResourceType', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'cvss': {'key': 'cvss', 'type': '{CVSS}'}, + 'patchable': {'key': 'patchable', 'type': 'bool'}, + 'cve': {'key': 'cve', 'type': '[CVE]'}, + 'published_time': {'key': 'publishedTime', 'type': 'iso-8601'}, + 'vendor_references': {'key': 'vendorReferences', 'type': '[VendorReference]'}, + 'repository_name': {'key': 'repositoryName', 'type': 'str'}, + 'image_digest': {'key': 'imageDigest', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ContainerRegistryVulnerabilityProperties, self).__init__(**kwargs) + self.type = None + self.cvss = None + self.patchable = None + self.cve = None + self.published_time = None + self.vendor_references = None + self.repository_name = None + self.image_digest = None + self.assessed_resource_type = 'ContainerRegistryVulnerability' + + +class CVE(Model): + """CVE details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar title: CVE title + :vartype title: str + :ivar link: Link url + :vartype link: str + """ + + _validation = { + 'title': {'readonly': True}, + 'link': {'readonly': True}, + } + + _attribute_map = { + 'title': {'key': 'title', 'type': 'str'}, + 'link': {'key': 'link', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CVE, self).__init__(**kwargs) + self.title = None + self.link = None + + +class CVSS(Model): + """CVSS details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar base: CVSS base + :vartype base: float + """ + + _validation = { + 'base': {'readonly': True}, + } + + _attribute_map = { + 'base': {'key': 'base', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(CVSS, self).__init__(**kwargs) + self.base = None + + class SettingResource(Resource): """The kind of the security setting. @@ -1254,6 +1640,104 @@ def __init__(self, **kwargs): self.enabled = kwargs.get('enabled', None) +class DenylistCustomAlertRule(ListCustomAlertRule): + """A custom alert rule that checks if a value (depends on the custom alert + type) is denied. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :ivar value_type: The value type of the items in the list. Possible values + include: 'IpCidr', 'String' + :vartype value_type: str or ~azure.mgmt.security.models.ValueType + :param denylist_values: Required. The values to deny. The format of the + values depends on the rule type. + :type denylist_values: list[str] + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'value_type': {'readonly': True}, + 'denylist_values': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'value_type': {'key': 'valueType', 'type': 'str'}, + 'denylist_values': {'key': 'denylistValues', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(DenylistCustomAlertRule, self).__init__(**kwargs) + self.denylist_values = kwargs.get('denylist_values', None) + + +class DeviceSecurityGroup(Resource): + """The device security group resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param threshold_rules: The list of custom alert threshold rules. + :type threshold_rules: + list[~azure.mgmt.security.models.ThresholdCustomAlertRule] + :param time_window_rules: The list of custom alert time-window rules. + :type time_window_rules: + list[~azure.mgmt.security.models.TimeWindowCustomAlertRule] + :param allowlist_rules: The allow-list custom alert rules. + :type allowlist_rules: + list[~azure.mgmt.security.models.AllowlistCustomAlertRule] + :param denylist_rules: The deny-list custom alert rules. + :type denylist_rules: + list[~azure.mgmt.security.models.DenylistCustomAlertRule] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'threshold_rules': {'key': 'properties.thresholdRules', 'type': '[ThresholdCustomAlertRule]'}, + 'time_window_rules': {'key': 'properties.timeWindowRules', 'type': '[TimeWindowCustomAlertRule]'}, + 'allowlist_rules': {'key': 'properties.allowlistRules', 'type': '[AllowlistCustomAlertRule]'}, + 'denylist_rules': {'key': 'properties.denylistRules', 'type': '[DenylistCustomAlertRule]'}, + } + + def __init__(self, **kwargs): + super(DeviceSecurityGroup, self).__init__(**kwargs) + self.threshold_rules = kwargs.get('threshold_rules', None) + self.time_window_rules = kwargs.get('time_window_rules', None) + self.allowlist_rules = kwargs.get('allowlist_rules', None) + self.denylist_rules = kwargs.get('denylist_rules', None) + + class DiscoveredSecuritySolution(Model): """DiscoveredSecuritySolution. @@ -1459,36 +1943,39 @@ class IoTSecurityAggregatedAlert(Model): :vartype type: str :param tags: Resource tags :type tags: dict[str, str] - :ivar alert_type: Name of the alert type + :ivar alert_type: Name of the alert type. :vartype alert_type: str - :ivar alert_display_name: Display name of the alert type + :ivar alert_display_name: Display name of the alert type. :vartype alert_display_name: str - :ivar aggregated_date_utc: The date the incidents were detected by the - vendor + :ivar aggregated_date_utc: Date of detection. :vartype aggregated_date_utc: date - :ivar vendor_name: Name of the vendor that discovered the incident + :ivar vendor_name: Name of the organization that raised the alert. :vartype vendor_name: str - :ivar reported_severity: Estimated severity of this alert. Possible values - include: 'Informational', 'Low', 'Medium', 'High' + :ivar reported_severity: Assessed alert severity. Possible values include: + 'Informational', 'Low', 'Medium', 'High' :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity - :ivar remediation_steps: Recommended steps for remediation + :ivar remediation_steps: Recommended steps for remediation. :vartype remediation_steps: str - :ivar description: Description of the incident and what it means + :ivar description: Description of the suspected vulnerability and meaning. :vartype description: str - :ivar count: Occurrence number of the alert within the aggregated date + :ivar count: Number of alerts occurrences within the aggregated time + window. :vartype count: int - :ivar effected_resource_type: Azure resource ID of the resource that got - the alerts + :ivar effected_resource_type: Azure resource ID of the resource that + received the alerts. :vartype effected_resource_type: str - :ivar system_source: The type of the alerted resource (Azure, Non-Azure) + :ivar system_source: The type of the alerted resource (Azure, Non-Azure). :vartype system_source: str - :ivar action_taken: The action that was taken as a response to the alert - (Active, Blocked etc.) + :ivar action_taken: IoT Security solution alert response. :vartype action_taken: str - :ivar log_analytics_query: query in log analytics to get the list of - affected devices/alerts + :ivar log_analytics_query: Log analytics query for getting the list of + affected devices/alerts. :vartype log_analytics_query: str + :ivar top_devices_list: 10 devices with the highest number of occurrences + of this alert type, on this day. + :vartype top_devices_list: + list[~azure.mgmt.security.models.IoTSecurityAggregatedAlertPropertiesTopDevicesListItem] """ _validation = { @@ -1507,6 +1994,7 @@ class IoTSecurityAggregatedAlert(Model): 'system_source': {'readonly': True}, 'action_taken': {'readonly': True}, 'log_analytics_query': {'readonly': True}, + 'top_devices_list': {'readonly': True}, } _attribute_map = { @@ -1526,6 +2014,7 @@ class IoTSecurityAggregatedAlert(Model): 'system_source': {'key': 'properties.systemSource', 'type': 'str'}, 'action_taken': {'key': 'properties.actionTaken', 'type': 'str'}, 'log_analytics_query': {'key': 'properties.logAnalyticsQuery', 'type': 'str'}, + 'top_devices_list': {'key': 'properties.topDevicesList', 'type': '[IoTSecurityAggregatedAlertPropertiesTopDevicesListItem]'}, } def __init__(self, **kwargs): @@ -1546,10 +2035,45 @@ def __init__(self, **kwargs): self.system_source = None self.action_taken = None self.log_analytics_query = None + self.top_devices_list = None + + +class IoTSecurityAggregatedAlertPropertiesTopDevicesListItem(Model): + """IoTSecurityAggregatedAlertPropertiesTopDevicesListItem. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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 + :ivar last_occurrence: Most recent time this alert was raised for this + device, on this day. + :vartype last_occurrence: str + """ + + _validation = { + 'device_id': {'readonly': True}, + 'alerts_count': {'readonly': True}, + 'last_occurrence': {'readonly': True}, + } + + _attribute_map = { + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'alerts_count': {'key': 'alertsCount', 'type': 'int'}, + 'last_occurrence': {'key': 'lastOccurrence', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IoTSecurityAggregatedAlertPropertiesTopDevicesListItem, self).__init__(**kwargs) + self.device_id = None + self.alerts_count = None + self.last_occurrence = None class IoTSecurityAggregatedRecommendation(Model): - """Security Solution Recommendation Information. + """IoT Security solution recommendation information. Variables are only populated by the server, and will be ignored when sending a request. @@ -1562,31 +2086,31 @@ class IoTSecurityAggregatedRecommendation(Model): :vartype type: str :param tags: Resource tags :type tags: dict[str, str] - :param recommendation_name: Name of the recommendation + :param recommendation_name: Name of the recommendation. :type recommendation_name: str :ivar recommendation_display_name: Display name of the recommendation type. :vartype recommendation_display_name: str - :ivar description: Description of the incident and what it means + :ivar description: Description of the suspected vulnerability and meaning. :vartype description: str - :ivar recommendation_type_id: The recommendation-type GUID. + :ivar recommendation_type_id: Recommendation-type GUID. :vartype recommendation_type_id: str - :ivar detected_by: Name of the vendor that discovered the issue + :ivar detected_by: Name of the organization that made the recommendation. :vartype detected_by: str :ivar remediation_steps: Recommended steps for remediation :vartype remediation_steps: str - :ivar reported_severity: Estimated severity of this recommendation. - Possible values include: 'Informational', 'Low', 'Medium', 'High' + :ivar reported_severity: Assessed recommendation severity. Possible values + include: 'Informational', 'Low', 'Medium', 'High' :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity - :ivar healthy_devices: the number of the healthy devices within the - solution + :ivar healthy_devices: Number of healthy devices within the IoT Security + solution. :vartype healthy_devices: int - :ivar unhealthy_device_count: the number of the unhealthy devices within - the solution + :ivar unhealthy_device_count: Number of unhealthy devices within the IoT + Security solution. :vartype unhealthy_device_count: int - :ivar log_analytics_query: query in log analytics to get the list of - affected devices/alerts + :ivar log_analytics_query: Log analytics query for getting the list of + affected devices/alerts. :vartype log_analytics_query: str """ @@ -1641,15 +2165,15 @@ def __init__(self, **kwargs): class IoTSecurityAlertedDevice(Model): - """Statistic information about the number of alerts per device during the last - period. + """Statistical information about the number of alerts per device during last + set number of days. Variables are only populated by the server, and will be ignored when sending a request. - :ivar device_id: Name of the alert type + :ivar device_id: Device identifier. :vartype device_id: str - :ivar alerts_count: the number of alerts raised for this device + :ivar alerts_count: Number of alerts raised for this device. :vartype alerts_count: int """ @@ -1665,46 +2189,24 @@ class IoTSecurityAlertedDevice(Model): def __init__(self, **kwargs): super(IoTSecurityAlertedDevice, self).__init__(**kwargs) - self.device_id = None - self.alerts_count = None - - -class IoTSecurityAlertedDevicesList(Model): - """List of devices with the count of raised alerts. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of aggregated alerts data - :type value: list[~azure.mgmt.security.models.IoTSecurityAlertedDevice] - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[IoTSecurityAlertedDevice]'}, - } - - def __init__(self, **kwargs): - super(IoTSecurityAlertedDevicesList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + self.device_id = None + self.alerts_count = None class IoTSecurityDeviceAlert(Model): - """Statistic information about the number of alerts per alert type during the - last period. + """Statistical information about the number of alerts per alert type during + last set number of days. Variables are only populated by the server, and will be ignored when sending a request. :ivar alert_display_name: Display name of the alert :vartype alert_display_name: str - :ivar reported_severity: Estimated severity of this alert. Possible values - include: 'Informational', 'Low', 'Medium', 'High' + :ivar reported_severity: Assessed Alert severity. Possible values include: + 'Informational', 'Low', 'Medium', 'High' :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity - :ivar alerts_count: the number of alerts raised for this alert type + :ivar alerts_count: Number of alerts raised for this alert type. :vartype alerts_count: int """ @@ -1727,50 +2229,20 @@ def __init__(self, **kwargs): self.alerts_count = None -class IoTSecurityDeviceAlertsList(Model): - """List of alerts with the count of raised alerts. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of top alerts data - :type value: list[~azure.mgmt.security.models.IoTSecurityDeviceAlert] - :ivar next_link: The URI to fetch the next page. - :vartype next_link: str - """ - - _validation = { - 'value': {'required': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[IoTSecurityDeviceAlert]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(IoTSecurityDeviceAlertsList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - class IoTSecurityDeviceRecommendation(Model): - """Statistic information about the number of recommendations per + """Statistical information about the number of recommendations per device, per recommendation type. Variables are only populated by the server, and will be ignored when sending a request. - :ivar recommendation_display_name: Display name of the recommendation + :ivar recommendation_display_name: Display name of the recommendation. :vartype recommendation_display_name: str - :ivar reported_severity: Estimated severity of this recommendation. - Possible values include: 'Informational', 'Low', 'Medium', 'High' + :ivar reported_severity: Assessed recommendation severity. Possible values + include: 'Informational', 'Low', 'Medium', 'High' :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity - :ivar devices_count: the number of device with this recommendation + :ivar devices_count: Number of devices with this recommendation. :vartype devices_count: int """ @@ -1793,31 +2265,8 @@ def __init__(self, **kwargs): self.devices_count = None -class IoTSecurityDeviceRecommendationsList(Model): - """List of recommendations with the count of devices. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of aggregated recommendation data - :type value: - list[~azure.mgmt.security.models.IoTSecurityDeviceRecommendation] - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[IoTSecurityDeviceRecommendation]'}, - } - - def __init__(self, **kwargs): - super(IoTSecurityDeviceRecommendationsList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - class IoTSecuritySolutionAnalyticsModel(Resource): - """Security Analytics of a security solution. + """Security analytics of your IoT Security solution. Variables are only populated by the server, and will be ignored when sending a request. @@ -1828,24 +2277,25 @@ class IoTSecuritySolutionAnalyticsModel(Resource): :vartype name: str :ivar type: Resource type :vartype type: str - :ivar metrics: Security Analytics of a security solution + :ivar metrics: Security analytics of your IoT Security solution. :vartype metrics: ~azure.mgmt.security.models.IoTSeverityMetrics - :ivar unhealthy_device_count: number of unhealthy devices + :ivar unhealthy_device_count: Number of unhealthy devices within your IoT + Security solution. :vartype unhealthy_device_count: int - :ivar devices_metrics: The list of devices metrics by the aggregated date. + :ivar devices_metrics: List of device metrics by the aggregation date. :vartype devices_metrics: list[~azure.mgmt.security.models.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem] - :param top_alerted_devices: The list of top 3 devices with the most - attacked. + :param top_alerted_devices: List of the 3 devices with the most alerts. :type top_alerted_devices: - ~azure.mgmt.security.models.IoTSecurityAlertedDevicesList - :param most_prevalent_device_alerts: The list of most prevalent 3 alerts. + list[~azure.mgmt.security.models.IoTSecurityAlertedDevice] + :param most_prevalent_device_alerts: List of the 3 most prevalent device + alerts. :type most_prevalent_device_alerts: - ~azure.mgmt.security.models.IoTSecurityDeviceAlertsList - :param most_prevalent_device_recommendations: The list of most prevalent 3 - recommendations. + list[~azure.mgmt.security.models.IoTSecurityDeviceAlert] + :param most_prevalent_device_recommendations: List of the 3 most prevalent + device recommendations. :type most_prevalent_device_recommendations: - ~azure.mgmt.security.models.IoTSecurityDeviceRecommendationsList + list[~azure.mgmt.security.models.IoTSecurityDeviceRecommendation] """ _validation = { @@ -1864,9 +2314,9 @@ class IoTSecuritySolutionAnalyticsModel(Resource): 'metrics': {'key': 'properties.metrics', 'type': 'IoTSeverityMetrics'}, 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'int'}, 'devices_metrics': {'key': 'properties.devicesMetrics', 'type': '[IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem]'}, - 'top_alerted_devices': {'key': 'properties.topAlertedDevices', 'type': 'IoTSecurityAlertedDevicesList'}, - 'most_prevalent_device_alerts': {'key': 'properties.mostPrevalentDeviceAlerts', 'type': 'IoTSecurityDeviceAlertsList'}, - 'most_prevalent_device_recommendations': {'key': 'properties.mostPrevalentDeviceRecommendations', 'type': 'IoTSecurityDeviceRecommendationsList'}, + 'top_alerted_devices': {'key': 'properties.topAlertedDevices', 'type': '[IoTSecurityAlertedDevice]'}, + 'most_prevalent_device_alerts': {'key': 'properties.mostPrevalentDeviceAlerts', 'type': '[IoTSecurityDeviceAlert]'}, + 'most_prevalent_device_recommendations': {'key': 'properties.mostPrevalentDeviceRecommendations', 'type': '[IoTSecurityDeviceRecommendation]'}, } def __init__(self, **kwargs): @@ -1880,17 +2330,19 @@ def __init__(self, **kwargs): class IoTSecuritySolutionAnalyticsModelList(Model): - """List of Security Analytics of a security solution. + """List of Security analytics of your IoT Security solution. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param value: Required. List of Security Analytics of a security solution + :param value: Required. List of Security analytics of your IoT Security + solution :type value: list[~azure.mgmt.security.models.IoTSecuritySolutionAnalyticsModel] - :ivar next_link: The URI to fetch the next page. + :ivar next_link: When there is too much alert data for one page, use this + URI to fetch the next page. :vartype next_link: str """ @@ -1913,9 +2365,10 @@ def __init__(self, **kwargs): class IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem(Model): """IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem. - :param date_property: the date of the metrics + :param date_property: Aggregation of IoT Security solution device alert + metrics by date. :type date_property: datetime - :param devices_metrics: devices alerts count by severity. + :param devices_metrics: Device alert count by severity. :type devices_metrics: ~azure.mgmt.security.models.IoTSeverityMetrics """ @@ -1931,7 +2384,7 @@ def __init__(self, **kwargs): class IoTSecuritySolutionModel(Model): - """Security Solution. + """IoT Security solution configuration and resource information. Variables are only populated by the server, and will be ignored when sending a request. @@ -1952,10 +2405,10 @@ class IoTSecuritySolutionModel(Model): :type workspace: str :param display_name: Required. Resource display name. :type display_name: str - :param status: Security solution status. Possible values include: - 'Enabled', 'Disabled'. Default value: "Enabled" . + :param status: Status of the IoT Security solution. Possible values + include: 'Enabled', 'Disabled'. Default value: "Enabled" . :type status: str or ~azure.mgmt.security.models.SecuritySolutionStatus - :param export: List of additional export to workspace data options + :param export: List of additional options for exporting to workspace data. :type export: list[str or ~azure.mgmt.security.models.ExportData] :param disabled_data_sources: Disabled data sources. Disabling these data sources compromises the system. @@ -2020,13 +2473,13 @@ def __init__(self, **kwargs): class IoTSeverityMetrics(Model): - """Severity metrics. + """IoT Security solution analytics severity metrics. - :param high: count of high severity items + :param high: Count of high severity alerts/recommendations. :type high: int - :param medium: count of medium severity items + :param medium: Count of medium severity alerts/recommendations. :type medium: int - :param low: count of low severity items + :param low: Count of low severity alerts/recommendations. :type low: int """ @@ -2146,6 +2599,8 @@ class JitNetworkAccessPolicyInitiateRequest(Model): open access for :type virtual_machines: list[~azure.mgmt.security.models.JitNetworkAccessPolicyInitiateVirtualMachine] + :param justification: The justification for making the initiate request + :type justification: str """ _validation = { @@ -2154,11 +2609,13 @@ class JitNetworkAccessPolicyInitiateRequest(Model): _attribute_map = { 'virtual_machines': {'key': 'virtualMachines', 'type': '[JitNetworkAccessPolicyInitiateVirtualMachine]'}, + 'justification': {'key': 'justification', 'type': 'str'}, } def __init__(self, **kwargs): super(JitNetworkAccessPolicyInitiateRequest, self).__init__(**kwargs) self.virtual_machines = kwargs.get('virtual_machines', None) + self.justification = kwargs.get('justification', None) class JitNetworkAccessPolicyInitiateVirtualMachine(Model): @@ -2281,6 +2738,8 @@ class JitNetworkAccessRequest(Model): :param requestor: Required. The identity of the person who made the request :type requestor: str + :param justification: The justification for making the initiate request + :type justification: str """ _validation = { @@ -2293,6 +2752,7 @@ class JitNetworkAccessRequest(Model): 'virtual_machines': {'key': 'virtualMachines', 'type': '[JitNetworkAccessRequestVirtualMachine]'}, 'start_time_utc': {'key': 'startTimeUtc', 'type': 'iso-8601'}, 'requestor': {'key': 'requestor', 'type': 'str'}, + 'justification': {'key': 'justification', 'type': 'str'}, } def __init__(self, **kwargs): @@ -2300,6 +2760,7 @@ def __init__(self, **kwargs): self.virtual_machines = kwargs.get('virtual_machines', None) self.start_time_utc = kwargs.get('start_time_utc', None) self.requestor = kwargs.get('requestor', None) + self.justification = kwargs.get('justification', None) class JitNetworkAccessRequestPort(Model): @@ -2549,7 +3010,10 @@ def __init__(self, **kwargs): class Pricing(Resource): - """Pricing tier will be applied for the scope based on the resource ID. + """Azure Security Center is provided in two pricing tiers: free and standard, + with the standard tier available with a trial period. The standard tier + offers advanced security capabilities, while the free tier offers basic + security features. Variables are only populated by the server, and will be ignored when sending a request. @@ -2617,6 +3081,35 @@ def __init__(self, **kwargs): self.value = kwargs.get('value', None) +class ProtectionMode(Model): + """The protection mode of the collection/file types. Exe/Msi/Script are used + for Windows, Executable is used for Linux. + + :param exe: Possible values include: 'Audit', 'Enforce', 'None' + :type exe: str or ~azure.mgmt.security.models.enum + :param msi: Possible values include: 'Audit', 'Enforce', 'None' + :type msi: str or ~azure.mgmt.security.models.enum + :param script: Possible values include: 'Audit', 'Enforce', 'None' + :type script: str or ~azure.mgmt.security.models.enum + :param executable: Possible values include: 'Audit', 'Enforce', 'None' + :type executable: str or ~azure.mgmt.security.models.enum + """ + + _attribute_map = { + 'exe': {'key': 'exe', 'type': 'str'}, + 'msi': {'key': 'msi', 'type': 'str'}, + 'script': {'key': 'script', 'type': 'str'}, + 'executable': {'key': 'executable', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProtectionMode, self).__init__(**kwargs) + self.exe = kwargs.get('exe', None) + self.msi = kwargs.get('msi', None) + self.script = kwargs.get('script', None) + self.executable = kwargs.get('executable', None) + + class PublisherInfo(Model): """Represents the publisher information of a process/rule. @@ -2651,15 +3144,15 @@ def __init__(self, **kwargs): class RecommendationConfigurationProperties(Model): - """Recommendation configuration. + """The type of IoT Security recommendation. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param recommendation_type: Required. The recommendation type. Possible - values include: 'IoT_ACRAuthentication', + :param recommendation_type: Required. The type of IoT Security + recommendation. Possible values include: 'IoT_ACRAuthentication', 'IoT_AgentSendsUnutilizedMessages', 'IoT_Baseline', 'IoT_EdgeHubMemOptimize', 'IoT_EdgeLoggingOptions', 'IoT_InconsistentModuleSettings', 'IoT_InstallAgent', @@ -2671,9 +3164,9 @@ class RecommendationConfigurationProperties(Model): ~azure.mgmt.security.models.RecommendationType :ivar name: :vartype name: str - :param status: Required. Recommendation status. The recommendation is not - generated when the status is disabled. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . + :param status: Required. Recommendation status. When the recommendation + status is disabled recommendations are not generated. Possible values + include: 'Disabled', 'Enabled'. Default value: "Enabled" . :type status: str or ~azure.mgmt.security.models.RecommendationConfigStatus """ @@ -2893,6 +3386,83 @@ def __init__(self, **kwargs): self.unsupported_controls = None +class SecurityAssessmentMetadata(Resource): + """Security assessment metadata. + + 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 display_name: User friendly display name of the assessment + :vartype display_name: str + :ivar policy_definition_id: Azure resource ID of the policy definition + that turns this assessment calculation on + :vartype policy_definition_id: str + :ivar description: Human readable description of the assessment + :vartype description: str + :ivar remediation_description: Human readable description of what you + should do to mitigate this security issue + :vartype remediation_description: str + :ivar category: + :vartype category: list[str or ~azure.mgmt.security.models.Category] + :ivar severity: The severity level of the assessment. Possible values + include: 'Low', 'Medium', 'High' + :vartype severity: str or ~azure.mgmt.security.models.Severity + :ivar preview: True if this assessment is in preview release status + :vartype preview: bool + :ivar assessment_type: BuiltIn if the assessment based on built-in Azure + Policy definition, Custom if the assessment based on custom Azure Policy + definition. Possible values include: 'BuiltIn', 'CustomPolicy', + 'CustomerManaged' + :vartype assessment_type: str or + ~azure.mgmt.security.models.AssessmentType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'policy_definition_id': {'readonly': True}, + 'description': {'readonly': True}, + 'remediation_description': {'readonly': True}, + 'category': {'readonly': True}, + 'severity': {'readonly': True}, + 'preview': {'readonly': True}, + 'assessment_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + '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]'}, + 'severity': {'key': 'properties.severity', 'type': 'str'}, + 'preview': {'key': 'properties.preview', 'type': 'bool'}, + 'assessment_type': {'key': 'properties.assessmentType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SecurityAssessmentMetadata, self).__init__(**kwargs) + self.display_name = None + self.policy_definition_id = None + self.description = None + self.remediation_description = None + self.category = None + self.severity = None + self.preview = None + self.assessment_type = None + + class SecurityContact(Resource): """Contact details for security issues. @@ -2948,6 +3518,83 @@ def __init__(self, **kwargs): self.alerts_to_admins = kwargs.get('alerts_to_admins', None) +class SecuritySubAssessment(Resource): + """Security sub-assessment on a resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :ivar security_sub_assessment_id: Vulnerability ID + :vartype security_sub_assessment_id: str + :ivar display_name: User friendly display name of the sub-assessment + :vartype display_name: str + :param status: + :type status: ~azure.mgmt.security.models.SubAssessmentStatus + :ivar remediation: Information on how to remediate this sub-assessment + :vartype remediation: str + :ivar impact: Description of the impact of this sub-assessment + :vartype impact: str + :ivar category: Category of the sub-assessment + :vartype category: str + :ivar description: Human readable description of the assessment status + :vartype description: str + :ivar time_generated: The date and time the sub-assessment was generated + :vartype time_generated: datetime + :param resource_details: + :type resource_details: ~azure.mgmt.security.models.ResourceDetails + :param additional_data: + :type additional_data: ~azure.mgmt.security.models.AdditionalData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'security_sub_assessment_id': {'readonly': True}, + 'display_name': {'readonly': True}, + 'remediation': {'readonly': True}, + 'impact': {'readonly': True}, + 'category': {'readonly': True}, + 'description': {'readonly': True}, + 'time_generated': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'security_sub_assessment_id': {'key': 'properties.id', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'SubAssessmentStatus'}, + 'remediation': {'key': 'properties.remediation', 'type': 'str'}, + 'impact': {'key': 'properties.impact', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'time_generated': {'key': 'properties.timeGenerated', 'type': 'iso-8601'}, + 'resource_details': {'key': 'properties.resourceDetails', 'type': 'ResourceDetails'}, + 'additional_data': {'key': 'properties.additionalData', 'type': 'AdditionalData'}, + } + + def __init__(self, **kwargs): + super(SecuritySubAssessment, self).__init__(**kwargs) + self.security_sub_assessment_id = None + self.display_name = None + self.status = kwargs.get('status', None) + self.remediation = None + self.impact = None + self.category = None + self.description = None + self.time_generated = None + self.resource_details = kwargs.get('resource_details', None) + self.additional_data = kwargs.get('additional_data', None) + + class SecurityTask(Resource): """Security task that we recommend to do in order to strengthen security. @@ -3111,6 +3758,145 @@ def __init__(self, **kwargs): self.value = kwargs.get('value', None) +class ServerVulnerabilityProperties(AdditionalData): + """Additional context fields for server vulnerability assessment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param assessed_resource_type: Required. Constant filled by server. + :type assessed_resource_type: str + :ivar type: Vulnerability Type. e.g: Vulnerability, Potential + Vulnerability, Information Gathered + :vartype type: str + :ivar cvss: Dictionary from cvss version to cvss details object + :vartype cvss: dict[str, ~azure.mgmt.security.models.CVSS] + :ivar patchable: Indicates whether a patch is available or not + :vartype patchable: bool + :ivar cve: List of CVEs + :vartype cve: list[~azure.mgmt.security.models.CVE] + :ivar threat: Threat name + :vartype threat: str + :ivar published_time: Published time + :vartype published_time: datetime + :ivar vendor_references: + :vartype vendor_references: + list[~azure.mgmt.security.models.VendorReference] + """ + + _validation = { + 'assessed_resource_type': {'required': True}, + 'type': {'readonly': True}, + 'cvss': {'readonly': True}, + 'patchable': {'readonly': True}, + 'cve': {'readonly': True}, + 'threat': {'readonly': True}, + 'published_time': {'readonly': True}, + 'vendor_references': {'readonly': True}, + } + + _attribute_map = { + 'assessed_resource_type': {'key': 'assessedResourceType', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'cvss': {'key': 'cvss', 'type': '{CVSS}'}, + 'patchable': {'key': 'patchable', 'type': 'bool'}, + 'cve': {'key': 'cve', 'type': '[CVE]'}, + 'threat': {'key': 'threat', 'type': 'str'}, + 'published_time': {'key': 'publishedTime', 'type': 'iso-8601'}, + 'vendor_references': {'key': 'vendorReferences', 'type': '[VendorReference]'}, + } + + def __init__(self, **kwargs): + super(ServerVulnerabilityProperties, self).__init__(**kwargs) + self.type = None + self.cvss = None + self.patchable = None + self.cve = None + self.threat = None + self.published_time = None + self.vendor_references = None + self.assessed_resource_type = 'ServerVulnerabilityAssessment' + + +class SqlServerVulnerabilityProperties(AdditionalData): + """Details of the resource that was assessed. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param assessed_resource_type: Required. Constant filled by server. + :type assessed_resource_type: str + :ivar type: The resource type the sub assessment refers to in its resource + details + :vartype type: str + :ivar query: The T-SQL query that runs on your SQL database to perform the + particular check + :vartype query: str + """ + + _validation = { + 'assessed_resource_type': {'required': True}, + 'type': {'readonly': True}, + 'query': {'readonly': True}, + } + + _attribute_map = { + 'assessed_resource_type': {'key': 'assessedResourceType', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'query': {'key': 'query', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SqlServerVulnerabilityProperties, self).__init__(**kwargs) + self.type = None + self.query = None + self.assessed_resource_type = 'SqlServerVulnerability' + + +class SubAssessmentStatus(Model): + """Status of the sub-assessment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Programmatic code for the status of the assessment. Possible + values include: 'Healthy', 'Unhealthy', 'NotApplicable' + :vartype code: str or ~azure.mgmt.security.models.SubAssessmentStatusCode + :ivar cause: Programmatic code for the cause of the assessment status + :vartype cause: str + :ivar description: Human readable description of the assessment status + :vartype description: str + :ivar severity: The sub-assessment severity level. Possible values + include: 'Low', 'Medium', 'High' + :vartype severity: str or ~azure.mgmt.security.models.Severity + """ + + _validation = { + 'code': {'readonly': True}, + 'cause': {'readonly': True}, + 'description': {'readonly': True}, + 'severity': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'cause': {'key': 'cause', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SubAssessmentStatus, self).__init__(**kwargs) + self.code = None + self.cause = None + self.description = None + self.severity = None + + class TagsResource(Model): """A container holding only the Tags for a resource, allowing the user to update the tags. @@ -3128,6 +3914,103 @@ def __init__(self, **kwargs): self.tags = kwargs.get('tags', None) +class ThresholdCustomAlertRule(CustomAlertRule): + """A custom alert rule that checks if a value (depends on the custom alert + type) is within the given range. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :param min_threshold: Required. The minimum threshold. + :type min_threshold: int + :param max_threshold: Required. The maximum threshold. + :type max_threshold: int + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'min_threshold': {'required': True}, + 'max_threshold': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'min_threshold': {'key': 'minThreshold', 'type': 'int'}, + 'max_threshold': {'key': 'maxThreshold', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ThresholdCustomAlertRule, self).__init__(**kwargs) + self.min_threshold = kwargs.get('min_threshold', None) + self.max_threshold = kwargs.get('max_threshold', None) + + +class TimeWindowCustomAlertRule(ThresholdCustomAlertRule): + """A custom alert rule that checks if the number of activities (depends on the + custom alert type) in a time window is within the given range. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :param min_threshold: Required. The minimum threshold. + :type min_threshold: int + :param max_threshold: Required. The maximum threshold. + :type max_threshold: int + :param time_window_size: Required. The time window size in iso8601 format. + :type time_window_size: timedelta + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'min_threshold': {'required': True}, + 'max_threshold': {'required': True}, + 'time_window_size': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'min_threshold': {'key': 'minThreshold', 'type': 'int'}, + 'max_threshold': {'key': 'maxThreshold', 'type': 'int'}, + 'time_window_size': {'key': 'timeWindowSize', 'type': 'duration'}, + } + + def __init__(self, **kwargs): + super(TimeWindowCustomAlertRule, self).__init__(**kwargs) + self.time_window_size = kwargs.get('time_window_size', None) + + class TopologyResource(Model): """TopologyResource. @@ -3306,8 +4189,8 @@ class UpdateIotSecuritySolutionData(TagsResource): _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, - 'user_defined_resources': {'key': 'userDefinedResources', 'type': 'UserDefinedResourcesProperties'}, - 'recommendations_configuration': {'key': 'recommendationsConfiguration', 'type': '[RecommendationConfigurationProperties]'}, + 'user_defined_resources': {'key': 'properties.userDefinedResources', 'type': 'UserDefinedResourcesProperties'}, + 'recommendations_configuration': {'key': 'properties.recommendationsConfiguration', 'type': '[RecommendationConfigurationProperties]'}, } def __init__(self, **kwargs): @@ -3317,7 +4200,7 @@ def __init__(self, **kwargs): class UserDefinedResourcesProperties(Model): - """Properties of the solution's user defined resources. + """Properties of the IoT Security solution's user defined resources. All required parameters must be populated in order to send to Azure. @@ -3368,6 +4251,34 @@ def __init__(self, **kwargs): self.recommendation_action = kwargs.get('recommendation_action', None) +class VendorReference(Model): + """Vendor reference. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar title: Link title + :vartype title: str + :ivar link: Link url + :vartype link: str + """ + + _validation = { + 'title': {'readonly': True}, + 'link': {'readonly': True}, + } + + _attribute_map = { + 'title': {'key': 'title', 'type': 'str'}, + 'link': {'key': 'link', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VendorReference, self).__init__(**kwargs) + self.title = None + self.link = None + + class VmRecommendation(Model): """Represents a machine that is part of a VM/server group. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models_py3.py index 55592fee92b4..4b9cbd7293b6 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 @@ -164,6 +164,36 @@ def __init__(self, *, device_vendor: str=None, device_type: str=None, workspace= self.connectivity_state = connectivity_state +class AdditionalData(Model): + """Details of the sub-assessment. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: SqlServerVulnerabilityProperties, + ContainerRegistryVulnerabilityProperties, ServerVulnerabilityProperties + + All required parameters must be populated in order to send to Azure. + + :param assessed_resource_type: Required. Constant filled by server. + :type assessed_resource_type: str + """ + + _validation = { + 'assessed_resource_type': {'required': True}, + } + + _attribute_map = { + 'assessed_resource_type': {'key': 'assessedResourceType', 'type': 'str'}, + } + + _subtype_map = { + 'assessed_resource_type': {'SqlServerVulnerability': 'SqlServerVulnerabilityProperties', 'ContainerRegistryVulnerability': 'ContainerRegistryVulnerabilityProperties', 'ServerVulnerabilityAssessment': 'ServerVulnerabilityProperties'} + } + + def __init__(self, **kwargs) -> None: + super(AdditionalData, self).__init__(**kwargs) + self.assessed_resource_type = None + + class Resource(Model): """Describes an Azure resource. @@ -492,6 +522,136 @@ def __init__(self, **kwargs) -> None: self.connectable_resources = None +class CustomAlertRule(Model): + """A custom alert rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + } + + def __init__(self, *, is_enabled: bool, rule_type: str, **kwargs) -> None: + super(CustomAlertRule, self).__init__(**kwargs) + self.display_name = None + self.description = None + self.is_enabled = is_enabled + self.rule_type = rule_type + + +class ListCustomAlertRule(CustomAlertRule): + """A List custom alert rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :ivar value_type: The value type of the items in the list. Possible values + include: 'IpCidr', 'String' + :vartype value_type: str or ~azure.mgmt.security.models.ValueType + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'value_type': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'value_type': {'key': 'valueType', 'type': 'str'}, + } + + def __init__(self, *, is_enabled: bool, rule_type: str, **kwargs) -> None: + super(ListCustomAlertRule, self).__init__(is_enabled=is_enabled, rule_type=rule_type, **kwargs) + self.value_type = None + + +class AllowlistCustomAlertRule(ListCustomAlertRule): + """A custom alert rule that checks if a value (depends on the custom alert + type) is allowed. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :ivar value_type: The value type of the items in the list. Possible values + include: 'IpCidr', 'String' + :vartype value_type: str or ~azure.mgmt.security.models.ValueType + :param allowlist_values: Required. The values to allow. The format of the + values depends on the rule type. + :type allowlist_values: list[str] + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'value_type': {'readonly': True}, + 'allowlist_values': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'value_type': {'key': 'valueType', 'type': 'str'}, + 'allowlist_values': {'key': 'allowlistValues', 'type': '[str]'}, + } + + def __init__(self, *, is_enabled: bool, rule_type: str, allowlist_values, **kwargs) -> None: + super(AllowlistCustomAlertRule, self).__init__(is_enabled=is_enabled, rule_type=rule_type, **kwargs) + self.allowlist_values = allowlist_values + + class AppWhitelistingGroup(Model): """AppWhitelistingGroup. @@ -506,8 +666,11 @@ class AppWhitelistingGroup(Model): :vartype type: str :ivar location: Location where the resource is stored :vartype location: str - :param enforcement_mode: Possible values include: 'Audit', 'Enforce' + :param enforcement_mode: Possible values include: 'Audit', 'Enforce', + 'None' :type enforcement_mode: str or ~azure.mgmt.security.models.enum + :param protection_mode: + :type protection_mode: ~azure.mgmt.security.models.ProtectionMode :param configuration_status: Possible values include: 'Configured', 'NotConfigured', 'InProgress', 'Failed', 'NoStatus' :type configuration_status: str or ~azure.mgmt.security.models.enum @@ -541,6 +704,7 @@ class AppWhitelistingGroup(Model): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'enforcement_mode': {'key': 'properties.enforcementMode', 'type': 'str'}, + 'protection_mode': {'key': 'properties.protectionMode', 'type': 'ProtectionMode'}, 'configuration_status': {'key': 'properties.configurationStatus', 'type': 'str'}, 'recommendation_status': {'key': 'properties.recommendationStatus', 'type': 'str'}, 'issues': {'key': 'properties.issues', 'type': '[AppWhitelistingIssueSummary]'}, @@ -549,13 +713,14 @@ class AppWhitelistingGroup(Model): 'path_recommendations': {'key': 'properties.pathRecommendations', 'type': '[PathRecommendation]'}, } - def __init__(self, *, enforcement_mode=None, configuration_status=None, recommendation_status=None, issues=None, source_system=None, vm_recommendations=None, path_recommendations=None, **kwargs) -> None: + def __init__(self, *, enforcement_mode=None, protection_mode=None, configuration_status=None, recommendation_status=None, issues=None, source_system=None, vm_recommendations=None, path_recommendations=None, **kwargs) -> None: super(AppWhitelistingGroup, self).__init__(**kwargs) self.id = None self.name = None self.type = None self.location = None self.enforcement_mode = enforcement_mode + self.protection_mode = protection_mode self.configuration_status = configuration_status self.recommendation_status = recommendation_status self.issues = issues @@ -608,8 +773,14 @@ def __init__(self, *, issue=None, number_of_vms: float=None, **kwargs) -> None: class AppWhitelistingPutGroupData(Model): """The altered data of the recommended VM/server group policy. - :param enforcement_mode: Possible values include: 'Audit', 'Enforce' + :param enforcement_mode: The enforcement mode of the group. Can also be + defined per collection type by using ProtectionMode. Possible values + include: 'Audit', 'Enforce', 'None' :type enforcement_mode: str or ~azure.mgmt.security.models.enum + :param protection_mode: The protection mode of the group per collection + type. Can also be defined for all collection types by using + EnforcementMode + :type protection_mode: ~azure.mgmt.security.models.ProtectionMode :param vm_recommendations: :type vm_recommendations: list[~azure.mgmt.security.models.VmRecommendation] @@ -620,13 +791,15 @@ class AppWhitelistingPutGroupData(Model): _attribute_map = { 'enforcement_mode': {'key': 'enforcementMode', 'type': 'str'}, + 'protection_mode': {'key': 'protectionMode', 'type': 'ProtectionMode'}, 'vm_recommendations': {'key': 'vmRecommendations', 'type': '[VmRecommendation]'}, 'path_recommendations': {'key': 'pathRecommendations', 'type': '[PathRecommendation]'}, } - def __init__(self, *, enforcement_mode=None, vm_recommendations=None, path_recommendations=None, **kwargs) -> None: + def __init__(self, *, enforcement_mode=None, protection_mode=None, vm_recommendations=None, path_recommendations=None, **kwargs) -> None: super(AppWhitelistingPutGroupData, self).__init__(**kwargs) self.enforcement_mode = enforcement_mode + self.protection_mode = protection_mode self.vm_recommendations = vm_recommendations self.path_recommendations = path_recommendations @@ -806,6 +979,100 @@ def __init__(self, *, auto_provision, **kwargs) -> None: self.auto_provision = auto_provision +class ResourceDetails(Model): + """Details of the resource that was assessed. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureResourceDetails, AwsResourceDetails + + All required parameters must be populated in order to send to Azure. + + :param source: Required. Constant filled by server. + :type source: str + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'str'}, + } + + _subtype_map = { + 'source': {'Azure': 'AzureResourceDetails', 'Aws': 'AwsResourceDetails'} + } + + def __init__(self, **kwargs) -> None: + super(ResourceDetails, self).__init__(**kwargs) + self.source = None + + +class AwsResourceDetails(ResourceDetails): + """Details of the resource that was assessed. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. Constant filled by server. + :type source: str + :ivar account_id: AWS account ID + :vartype account_id: str + :ivar aws_resource_id: AWS resource ID. can be ARN or other + :vartype aws_resource_id: str + """ + + _validation = { + 'source': {'required': True}, + 'account_id': {'readonly': True}, + 'aws_resource_id': {'readonly': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'str'}, + 'account_id': {'key': 'accountId', 'type': 'str'}, + 'aws_resource_id': {'key': 'awsResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AwsResourceDetails, self).__init__(**kwargs) + self.account_id = None + self.aws_resource_id = None + self.source = 'Aws' + + +class AzureResourceDetails(ResourceDetails): + """Details of the resource that was assessed. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. Constant filled by server. + :type source: str + :ivar id: Azure resource ID of the assessed resource + :vartype id: str + """ + + _validation = { + 'source': {'required': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureResourceDetails, self).__init__(**kwargs) + self.id = None + self.source = 'Azure' + + class CefExternalSecuritySolution(ExternalSecuritySolution): """Represents a security solution which sends CEF logs to an OMS workspace. @@ -1134,6 +1401,125 @@ def __init__(self, *, id: str=None, **kwargs) -> None: self.id = id +class ContainerRegistryVulnerabilityProperties(AdditionalData): + """Additional context fields for container registry Vulnerability assessment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param assessed_resource_type: Required. Constant filled by server. + :type assessed_resource_type: str + :ivar type: Vulnerability Type. e.g: Vulnerability, Potential + Vulnerability, Information Gathered, Vulnerability + :vartype type: str + :ivar cvss: Dictionary from cvss version to cvss details object + :vartype cvss: dict[str, ~azure.mgmt.security.models.CVSS] + :ivar patchable: Indicates whether a patch is available or not + :vartype patchable: bool + :ivar cve: List of CVEs + :vartype cve: list[~azure.mgmt.security.models.CVE] + :ivar published_time: Published time + :vartype published_time: datetime + :ivar vendor_references: + :vartype vendor_references: + list[~azure.mgmt.security.models.VendorReference] + :ivar repository_name: Name of the repository which the vulnerable image + belongs to + :vartype repository_name: str + :ivar image_digest: Digest of the vulnerable image + :vartype image_digest: str + """ + + _validation = { + 'assessed_resource_type': {'required': True}, + 'type': {'readonly': True}, + 'cvss': {'readonly': True}, + 'patchable': {'readonly': True}, + 'cve': {'readonly': True}, + 'published_time': {'readonly': True}, + 'vendor_references': {'readonly': True}, + 'repository_name': {'readonly': True}, + 'image_digest': {'readonly': True}, + } + + _attribute_map = { + 'assessed_resource_type': {'key': 'assessedResourceType', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'cvss': {'key': 'cvss', 'type': '{CVSS}'}, + 'patchable': {'key': 'patchable', 'type': 'bool'}, + 'cve': {'key': 'cve', 'type': '[CVE]'}, + 'published_time': {'key': 'publishedTime', 'type': 'iso-8601'}, + 'vendor_references': {'key': 'vendorReferences', 'type': '[VendorReference]'}, + 'repository_name': {'key': 'repositoryName', 'type': 'str'}, + 'image_digest': {'key': 'imageDigest', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ContainerRegistryVulnerabilityProperties, self).__init__(**kwargs) + self.type = None + self.cvss = None + self.patchable = None + self.cve = None + self.published_time = None + self.vendor_references = None + self.repository_name = None + self.image_digest = None + self.assessed_resource_type = 'ContainerRegistryVulnerability' + + +class CVE(Model): + """CVE details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar title: CVE title + :vartype title: str + :ivar link: Link url + :vartype link: str + """ + + _validation = { + 'title': {'readonly': True}, + 'link': {'readonly': True}, + } + + _attribute_map = { + 'title': {'key': 'title', 'type': 'str'}, + 'link': {'key': 'link', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CVE, self).__init__(**kwargs) + self.title = None + self.link = None + + +class CVSS(Model): + """CVSS details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar base: CVSS base + :vartype base: float + """ + + _validation = { + 'base': {'readonly': True}, + } + + _attribute_map = { + 'base': {'key': 'base', 'type': 'float'}, + } + + def __init__(self, **kwargs) -> None: + super(CVSS, self).__init__(**kwargs) + self.base = None + + class SettingResource(Resource): """The kind of the security setting. @@ -1254,6 +1640,104 @@ def __init__(self, *, kind, enabled: bool, **kwargs) -> None: self.enabled = enabled +class DenylistCustomAlertRule(ListCustomAlertRule): + """A custom alert rule that checks if a value (depends on the custom alert + type) is denied. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :ivar value_type: The value type of the items in the list. Possible values + include: 'IpCidr', 'String' + :vartype value_type: str or ~azure.mgmt.security.models.ValueType + :param denylist_values: Required. The values to deny. The format of the + values depends on the rule type. + :type denylist_values: list[str] + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'value_type': {'readonly': True}, + 'denylist_values': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'value_type': {'key': 'valueType', 'type': 'str'}, + 'denylist_values': {'key': 'denylistValues', 'type': '[str]'}, + } + + def __init__(self, *, is_enabled: bool, rule_type: str, denylist_values, **kwargs) -> None: + super(DenylistCustomAlertRule, self).__init__(is_enabled=is_enabled, rule_type=rule_type, **kwargs) + self.denylist_values = denylist_values + + +class DeviceSecurityGroup(Resource): + """The device security group resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param threshold_rules: The list of custom alert threshold rules. + :type threshold_rules: + list[~azure.mgmt.security.models.ThresholdCustomAlertRule] + :param time_window_rules: The list of custom alert time-window rules. + :type time_window_rules: + list[~azure.mgmt.security.models.TimeWindowCustomAlertRule] + :param allowlist_rules: The allow-list custom alert rules. + :type allowlist_rules: + list[~azure.mgmt.security.models.AllowlistCustomAlertRule] + :param denylist_rules: The deny-list custom alert rules. + :type denylist_rules: + list[~azure.mgmt.security.models.DenylistCustomAlertRule] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'threshold_rules': {'key': 'properties.thresholdRules', 'type': '[ThresholdCustomAlertRule]'}, + 'time_window_rules': {'key': 'properties.timeWindowRules', 'type': '[TimeWindowCustomAlertRule]'}, + 'allowlist_rules': {'key': 'properties.allowlistRules', 'type': '[AllowlistCustomAlertRule]'}, + 'denylist_rules': {'key': 'properties.denylistRules', 'type': '[DenylistCustomAlertRule]'}, + } + + def __init__(self, *, threshold_rules=None, time_window_rules=None, allowlist_rules=None, denylist_rules=None, **kwargs) -> None: + super(DeviceSecurityGroup, self).__init__(**kwargs) + self.threshold_rules = threshold_rules + self.time_window_rules = time_window_rules + self.allowlist_rules = allowlist_rules + self.denylist_rules = denylist_rules + + class DiscoveredSecuritySolution(Model): """DiscoveredSecuritySolution. @@ -1459,36 +1943,39 @@ class IoTSecurityAggregatedAlert(Model): :vartype type: str :param tags: Resource tags :type tags: dict[str, str] - :ivar alert_type: Name of the alert type + :ivar alert_type: Name of the alert type. :vartype alert_type: str - :ivar alert_display_name: Display name of the alert type + :ivar alert_display_name: Display name of the alert type. :vartype alert_display_name: str - :ivar aggregated_date_utc: The date the incidents were detected by the - vendor + :ivar aggregated_date_utc: Date of detection. :vartype aggregated_date_utc: date - :ivar vendor_name: Name of the vendor that discovered the incident + :ivar vendor_name: Name of the organization that raised the alert. :vartype vendor_name: str - :ivar reported_severity: Estimated severity of this alert. Possible values - include: 'Informational', 'Low', 'Medium', 'High' + :ivar reported_severity: Assessed alert severity. Possible values include: + 'Informational', 'Low', 'Medium', 'High' :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity - :ivar remediation_steps: Recommended steps for remediation + :ivar remediation_steps: Recommended steps for remediation. :vartype remediation_steps: str - :ivar description: Description of the incident and what it means + :ivar description: Description of the suspected vulnerability and meaning. :vartype description: str - :ivar count: Occurrence number of the alert within the aggregated date + :ivar count: Number of alerts occurrences within the aggregated time + window. :vartype count: int - :ivar effected_resource_type: Azure resource ID of the resource that got - the alerts + :ivar effected_resource_type: Azure resource ID of the resource that + received the alerts. :vartype effected_resource_type: str - :ivar system_source: The type of the alerted resource (Azure, Non-Azure) + :ivar system_source: The type of the alerted resource (Azure, Non-Azure). :vartype system_source: str - :ivar action_taken: The action that was taken as a response to the alert - (Active, Blocked etc.) + :ivar action_taken: IoT Security solution alert response. :vartype action_taken: str - :ivar log_analytics_query: query in log analytics to get the list of - affected devices/alerts + :ivar log_analytics_query: Log analytics query for getting the list of + affected devices/alerts. :vartype log_analytics_query: str + :ivar top_devices_list: 10 devices with the highest number of occurrences + of this alert type, on this day. + :vartype top_devices_list: + list[~azure.mgmt.security.models.IoTSecurityAggregatedAlertPropertiesTopDevicesListItem] """ _validation = { @@ -1507,6 +1994,7 @@ class IoTSecurityAggregatedAlert(Model): 'system_source': {'readonly': True}, 'action_taken': {'readonly': True}, 'log_analytics_query': {'readonly': True}, + 'top_devices_list': {'readonly': True}, } _attribute_map = { @@ -1526,6 +2014,7 @@ class IoTSecurityAggregatedAlert(Model): 'system_source': {'key': 'properties.systemSource', 'type': 'str'}, 'action_taken': {'key': 'properties.actionTaken', 'type': 'str'}, 'log_analytics_query': {'key': 'properties.logAnalyticsQuery', 'type': 'str'}, + 'top_devices_list': {'key': 'properties.topDevicesList', 'type': '[IoTSecurityAggregatedAlertPropertiesTopDevicesListItem]'}, } def __init__(self, *, tags=None, **kwargs) -> None: @@ -1546,10 +2035,45 @@ def __init__(self, *, tags=None, **kwargs) -> None: self.system_source = None self.action_taken = None self.log_analytics_query = None + self.top_devices_list = None + + +class IoTSecurityAggregatedAlertPropertiesTopDevicesListItem(Model): + """IoTSecurityAggregatedAlertPropertiesTopDevicesListItem. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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 + :ivar last_occurrence: Most recent time this alert was raised for this + device, on this day. + :vartype last_occurrence: str + """ + + _validation = { + 'device_id': {'readonly': True}, + 'alerts_count': {'readonly': True}, + 'last_occurrence': {'readonly': True}, + } + + _attribute_map = { + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'alerts_count': {'key': 'alertsCount', 'type': 'int'}, + 'last_occurrence': {'key': 'lastOccurrence', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(IoTSecurityAggregatedAlertPropertiesTopDevicesListItem, self).__init__(**kwargs) + self.device_id = None + self.alerts_count = None + self.last_occurrence = None class IoTSecurityAggregatedRecommendation(Model): - """Security Solution Recommendation Information. + """IoT Security solution recommendation information. Variables are only populated by the server, and will be ignored when sending a request. @@ -1562,31 +2086,31 @@ class IoTSecurityAggregatedRecommendation(Model): :vartype type: str :param tags: Resource tags :type tags: dict[str, str] - :param recommendation_name: Name of the recommendation + :param recommendation_name: Name of the recommendation. :type recommendation_name: str :ivar recommendation_display_name: Display name of the recommendation type. :vartype recommendation_display_name: str - :ivar description: Description of the incident and what it means + :ivar description: Description of the suspected vulnerability and meaning. :vartype description: str - :ivar recommendation_type_id: The recommendation-type GUID. + :ivar recommendation_type_id: Recommendation-type GUID. :vartype recommendation_type_id: str - :ivar detected_by: Name of the vendor that discovered the issue + :ivar detected_by: Name of the organization that made the recommendation. :vartype detected_by: str :ivar remediation_steps: Recommended steps for remediation :vartype remediation_steps: str - :ivar reported_severity: Estimated severity of this recommendation. - Possible values include: 'Informational', 'Low', 'Medium', 'High' + :ivar reported_severity: Assessed recommendation severity. Possible values + include: 'Informational', 'Low', 'Medium', 'High' :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity - :ivar healthy_devices: the number of the healthy devices within the - solution + :ivar healthy_devices: Number of healthy devices within the IoT Security + solution. :vartype healthy_devices: int - :ivar unhealthy_device_count: the number of the unhealthy devices within - the solution + :ivar unhealthy_device_count: Number of unhealthy devices within the IoT + Security solution. :vartype unhealthy_device_count: int - :ivar log_analytics_query: query in log analytics to get the list of - affected devices/alerts + :ivar log_analytics_query: Log analytics query for getting the list of + affected devices/alerts. :vartype log_analytics_query: str """ @@ -1641,15 +2165,15 @@ def __init__(self, *, tags=None, recommendation_name: str=None, **kwargs) -> Non class IoTSecurityAlertedDevice(Model): - """Statistic information about the number of alerts per device during the last - period. + """Statistical information about the number of alerts per device during last + set number of days. Variables are only populated by the server, and will be ignored when sending a request. - :ivar device_id: Name of the alert type + :ivar device_id: Device identifier. :vartype device_id: str - :ivar alerts_count: the number of alerts raised for this device + :ivar alerts_count: Number of alerts raised for this device. :vartype alerts_count: int """ @@ -1663,48 +2187,26 @@ class IoTSecurityAlertedDevice(Model): 'alerts_count': {'key': 'alertsCount', 'type': 'int'}, } - def __init__(self, **kwargs) -> None: - super(IoTSecurityAlertedDevice, self).__init__(**kwargs) - self.device_id = None - self.alerts_count = None - - -class IoTSecurityAlertedDevicesList(Model): - """List of devices with the count of raised alerts. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of aggregated alerts data - :type value: list[~azure.mgmt.security.models.IoTSecurityAlertedDevice] - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[IoTSecurityAlertedDevice]'}, - } - - def __init__(self, *, value, **kwargs) -> None: - super(IoTSecurityAlertedDevicesList, self).__init__(**kwargs) - self.value = value + def __init__(self, **kwargs) -> None: + super(IoTSecurityAlertedDevice, self).__init__(**kwargs) + self.device_id = None + self.alerts_count = None class IoTSecurityDeviceAlert(Model): - """Statistic information about the number of alerts per alert type during the - last period. + """Statistical information about the number of alerts per alert type during + last set number of days. Variables are only populated by the server, and will be ignored when sending a request. :ivar alert_display_name: Display name of the alert :vartype alert_display_name: str - :ivar reported_severity: Estimated severity of this alert. Possible values - include: 'Informational', 'Low', 'Medium', 'High' + :ivar reported_severity: Assessed Alert severity. Possible values include: + 'Informational', 'Low', 'Medium', 'High' :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity - :ivar alerts_count: the number of alerts raised for this alert type + :ivar alerts_count: Number of alerts raised for this alert type. :vartype alerts_count: int """ @@ -1727,50 +2229,20 @@ def __init__(self, **kwargs) -> None: self.alerts_count = None -class IoTSecurityDeviceAlertsList(Model): - """List of alerts with the count of raised alerts. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of top alerts data - :type value: list[~azure.mgmt.security.models.IoTSecurityDeviceAlert] - :ivar next_link: The URI to fetch the next page. - :vartype next_link: str - """ - - _validation = { - 'value': {'required': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[IoTSecurityDeviceAlert]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__(self, *, value, **kwargs) -> None: - super(IoTSecurityDeviceAlertsList, self).__init__(**kwargs) - self.value = value - self.next_link = None - - class IoTSecurityDeviceRecommendation(Model): - """Statistic information about the number of recommendations per + """Statistical information about the number of recommendations per device, per recommendation type. Variables are only populated by the server, and will be ignored when sending a request. - :ivar recommendation_display_name: Display name of the recommendation + :ivar recommendation_display_name: Display name of the recommendation. :vartype recommendation_display_name: str - :ivar reported_severity: Estimated severity of this recommendation. - Possible values include: 'Informational', 'Low', 'Medium', 'High' + :ivar reported_severity: Assessed recommendation severity. Possible values + include: 'Informational', 'Low', 'Medium', 'High' :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity - :ivar devices_count: the number of device with this recommendation + :ivar devices_count: Number of devices with this recommendation. :vartype devices_count: int """ @@ -1793,31 +2265,8 @@ def __init__(self, **kwargs) -> None: self.devices_count = None -class IoTSecurityDeviceRecommendationsList(Model): - """List of recommendations with the count of devices. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of aggregated recommendation data - :type value: - list[~azure.mgmt.security.models.IoTSecurityDeviceRecommendation] - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[IoTSecurityDeviceRecommendation]'}, - } - - def __init__(self, *, value, **kwargs) -> None: - super(IoTSecurityDeviceRecommendationsList, self).__init__(**kwargs) - self.value = value - - class IoTSecuritySolutionAnalyticsModel(Resource): - """Security Analytics of a security solution. + """Security analytics of your IoT Security solution. Variables are only populated by the server, and will be ignored when sending a request. @@ -1828,24 +2277,25 @@ class IoTSecuritySolutionAnalyticsModel(Resource): :vartype name: str :ivar type: Resource type :vartype type: str - :ivar metrics: Security Analytics of a security solution + :ivar metrics: Security analytics of your IoT Security solution. :vartype metrics: ~azure.mgmt.security.models.IoTSeverityMetrics - :ivar unhealthy_device_count: number of unhealthy devices + :ivar unhealthy_device_count: Number of unhealthy devices within your IoT + Security solution. :vartype unhealthy_device_count: int - :ivar devices_metrics: The list of devices metrics by the aggregated date. + :ivar devices_metrics: List of device metrics by the aggregation date. :vartype devices_metrics: list[~azure.mgmt.security.models.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem] - :param top_alerted_devices: The list of top 3 devices with the most - attacked. + :param top_alerted_devices: List of the 3 devices with the most alerts. :type top_alerted_devices: - ~azure.mgmt.security.models.IoTSecurityAlertedDevicesList - :param most_prevalent_device_alerts: The list of most prevalent 3 alerts. + list[~azure.mgmt.security.models.IoTSecurityAlertedDevice] + :param most_prevalent_device_alerts: List of the 3 most prevalent device + alerts. :type most_prevalent_device_alerts: - ~azure.mgmt.security.models.IoTSecurityDeviceAlertsList - :param most_prevalent_device_recommendations: The list of most prevalent 3 - recommendations. + list[~azure.mgmt.security.models.IoTSecurityDeviceAlert] + :param most_prevalent_device_recommendations: List of the 3 most prevalent + device recommendations. :type most_prevalent_device_recommendations: - ~azure.mgmt.security.models.IoTSecurityDeviceRecommendationsList + list[~azure.mgmt.security.models.IoTSecurityDeviceRecommendation] """ _validation = { @@ -1864,9 +2314,9 @@ class IoTSecuritySolutionAnalyticsModel(Resource): 'metrics': {'key': 'properties.metrics', 'type': 'IoTSeverityMetrics'}, 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'int'}, 'devices_metrics': {'key': 'properties.devicesMetrics', 'type': '[IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem]'}, - 'top_alerted_devices': {'key': 'properties.topAlertedDevices', 'type': 'IoTSecurityAlertedDevicesList'}, - 'most_prevalent_device_alerts': {'key': 'properties.mostPrevalentDeviceAlerts', 'type': 'IoTSecurityDeviceAlertsList'}, - 'most_prevalent_device_recommendations': {'key': 'properties.mostPrevalentDeviceRecommendations', 'type': 'IoTSecurityDeviceRecommendationsList'}, + 'top_alerted_devices': {'key': 'properties.topAlertedDevices', 'type': '[IoTSecurityAlertedDevice]'}, + 'most_prevalent_device_alerts': {'key': 'properties.mostPrevalentDeviceAlerts', 'type': '[IoTSecurityDeviceAlert]'}, + 'most_prevalent_device_recommendations': {'key': 'properties.mostPrevalentDeviceRecommendations', 'type': '[IoTSecurityDeviceRecommendation]'}, } def __init__(self, *, top_alerted_devices=None, most_prevalent_device_alerts=None, most_prevalent_device_recommendations=None, **kwargs) -> None: @@ -1880,17 +2330,19 @@ def __init__(self, *, top_alerted_devices=None, most_prevalent_device_alerts=Non class IoTSecuritySolutionAnalyticsModelList(Model): - """List of Security Analytics of a security solution. + """List of Security analytics of your IoT Security solution. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param value: Required. List of Security Analytics of a security solution + :param value: Required. List of Security analytics of your IoT Security + solution :type value: list[~azure.mgmt.security.models.IoTSecuritySolutionAnalyticsModel] - :ivar next_link: The URI to fetch the next page. + :ivar next_link: When there is too much alert data for one page, use this + URI to fetch the next page. :vartype next_link: str """ @@ -1913,9 +2365,10 @@ def __init__(self, *, value, **kwargs) -> None: class IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem(Model): """IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem. - :param date_property: the date of the metrics + :param date_property: Aggregation of IoT Security solution device alert + metrics by date. :type date_property: datetime - :param devices_metrics: devices alerts count by severity. + :param devices_metrics: Device alert count by severity. :type devices_metrics: ~azure.mgmt.security.models.IoTSeverityMetrics """ @@ -1931,7 +2384,7 @@ def __init__(self, *, date_property=None, devices_metrics=None, **kwargs) -> Non class IoTSecuritySolutionModel(Model): - """Security Solution. + """IoT Security solution configuration and resource information. Variables are only populated by the server, and will be ignored when sending a request. @@ -1952,10 +2405,10 @@ class IoTSecuritySolutionModel(Model): :type workspace: str :param display_name: Required. Resource display name. :type display_name: str - :param status: Security solution status. Possible values include: - 'Enabled', 'Disabled'. Default value: "Enabled" . + :param status: Status of the IoT Security solution. Possible values + include: 'Enabled', 'Disabled'. Default value: "Enabled" . :type status: str or ~azure.mgmt.security.models.SecuritySolutionStatus - :param export: List of additional export to workspace data options + :param export: List of additional options for exporting to workspace data. :type export: list[str or ~azure.mgmt.security.models.ExportData] :param disabled_data_sources: Disabled data sources. Disabling these data sources compromises the system. @@ -2020,13 +2473,13 @@ def __init__(self, *, workspace: str, display_name: str, iot_hubs, tags=None, lo class IoTSeverityMetrics(Model): - """Severity metrics. + """IoT Security solution analytics severity metrics. - :param high: count of high severity items + :param high: Count of high severity alerts/recommendations. :type high: int - :param medium: count of medium severity items + :param medium: Count of medium severity alerts/recommendations. :type medium: int - :param low: count of low severity items + :param low: Count of low severity alerts/recommendations. :type low: int """ @@ -2146,6 +2599,8 @@ class JitNetworkAccessPolicyInitiateRequest(Model): open access for :type virtual_machines: list[~azure.mgmt.security.models.JitNetworkAccessPolicyInitiateVirtualMachine] + :param justification: The justification for making the initiate request + :type justification: str """ _validation = { @@ -2154,11 +2609,13 @@ class JitNetworkAccessPolicyInitiateRequest(Model): _attribute_map = { 'virtual_machines': {'key': 'virtualMachines', 'type': '[JitNetworkAccessPolicyInitiateVirtualMachine]'}, + 'justification': {'key': 'justification', 'type': 'str'}, } - def __init__(self, *, virtual_machines, **kwargs) -> None: + def __init__(self, *, virtual_machines, justification: str=None, **kwargs) -> None: super(JitNetworkAccessPolicyInitiateRequest, self).__init__(**kwargs) self.virtual_machines = virtual_machines + self.justification = justification class JitNetworkAccessPolicyInitiateVirtualMachine(Model): @@ -2281,6 +2738,8 @@ class JitNetworkAccessRequest(Model): :param requestor: Required. The identity of the person who made the request :type requestor: str + :param justification: The justification for making the initiate request + :type justification: str """ _validation = { @@ -2293,13 +2752,15 @@ class JitNetworkAccessRequest(Model): 'virtual_machines': {'key': 'virtualMachines', 'type': '[JitNetworkAccessRequestVirtualMachine]'}, 'start_time_utc': {'key': 'startTimeUtc', 'type': 'iso-8601'}, 'requestor': {'key': 'requestor', 'type': 'str'}, + 'justification': {'key': 'justification', 'type': 'str'}, } - def __init__(self, *, virtual_machines, start_time_utc, requestor: str, **kwargs) -> None: + def __init__(self, *, virtual_machines, start_time_utc, requestor: str, justification: str=None, **kwargs) -> None: super(JitNetworkAccessRequest, self).__init__(**kwargs) self.virtual_machines = virtual_machines self.start_time_utc = start_time_utc self.requestor = requestor + self.justification = justification class JitNetworkAccessRequestPort(Model): @@ -2549,7 +3010,10 @@ def __init__(self, *, path: str=None, action=None, type=None, publisher_info=Non class Pricing(Resource): - """Pricing tier will be applied for the scope based on the resource ID. + """Azure Security Center is provided in two pricing tiers: free and standard, + with the standard tier available with a trial period. The standard tier + offers advanced security capabilities, while the free tier offers basic + security features. Variables are only populated by the server, and will be ignored when sending a request. @@ -2617,6 +3081,35 @@ def __init__(self, *, value, **kwargs) -> None: self.value = value +class ProtectionMode(Model): + """The protection mode of the collection/file types. Exe/Msi/Script are used + for Windows, Executable is used for Linux. + + :param exe: Possible values include: 'Audit', 'Enforce', 'None' + :type exe: str or ~azure.mgmt.security.models.enum + :param msi: Possible values include: 'Audit', 'Enforce', 'None' + :type msi: str or ~azure.mgmt.security.models.enum + :param script: Possible values include: 'Audit', 'Enforce', 'None' + :type script: str or ~azure.mgmt.security.models.enum + :param executable: Possible values include: 'Audit', 'Enforce', 'None' + :type executable: str or ~azure.mgmt.security.models.enum + """ + + _attribute_map = { + 'exe': {'key': 'exe', 'type': 'str'}, + 'msi': {'key': 'msi', 'type': 'str'}, + 'script': {'key': 'script', 'type': 'str'}, + 'executable': {'key': 'executable', 'type': 'str'}, + } + + def __init__(self, *, exe=None, msi=None, script=None, executable=None, **kwargs) -> None: + super(ProtectionMode, self).__init__(**kwargs) + self.exe = exe + self.msi = msi + self.script = script + self.executable = executable + + class PublisherInfo(Model): """Represents the publisher information of a process/rule. @@ -2651,15 +3144,15 @@ def __init__(self, *, publisher_name: str=None, product_name: str=None, binary_n class RecommendationConfigurationProperties(Model): - """Recommendation configuration. + """The type of IoT Security recommendation. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param recommendation_type: Required. The recommendation type. Possible - values include: 'IoT_ACRAuthentication', + :param recommendation_type: Required. The type of IoT Security + recommendation. Possible values include: 'IoT_ACRAuthentication', 'IoT_AgentSendsUnutilizedMessages', 'IoT_Baseline', 'IoT_EdgeHubMemOptimize', 'IoT_EdgeLoggingOptions', 'IoT_InconsistentModuleSettings', 'IoT_InstallAgent', @@ -2671,9 +3164,9 @@ class RecommendationConfigurationProperties(Model): ~azure.mgmt.security.models.RecommendationType :ivar name: :vartype name: str - :param status: Required. Recommendation status. The recommendation is not - generated when the status is disabled. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . + :param status: Required. Recommendation status. When the recommendation + status is disabled recommendations are not generated. Possible values + include: 'Disabled', 'Enabled'. Default value: "Enabled" . :type status: str or ~azure.mgmt.security.models.RecommendationConfigStatus """ @@ -2893,6 +3386,83 @@ def __init__(self, *, state=None, **kwargs) -> None: self.unsupported_controls = None +class SecurityAssessmentMetadata(Resource): + """Security assessment metadata. + + 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 display_name: User friendly display name of the assessment + :vartype display_name: str + :ivar policy_definition_id: Azure resource ID of the policy definition + that turns this assessment calculation on + :vartype policy_definition_id: str + :ivar description: Human readable description of the assessment + :vartype description: str + :ivar remediation_description: Human readable description of what you + should do to mitigate this security issue + :vartype remediation_description: str + :ivar category: + :vartype category: list[str or ~azure.mgmt.security.models.Category] + :ivar severity: The severity level of the assessment. Possible values + include: 'Low', 'Medium', 'High' + :vartype severity: str or ~azure.mgmt.security.models.Severity + :ivar preview: True if this assessment is in preview release status + :vartype preview: bool + :ivar assessment_type: BuiltIn if the assessment based on built-in Azure + Policy definition, Custom if the assessment based on custom Azure Policy + definition. Possible values include: 'BuiltIn', 'CustomPolicy', + 'CustomerManaged' + :vartype assessment_type: str or + ~azure.mgmt.security.models.AssessmentType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'policy_definition_id': {'readonly': True}, + 'description': {'readonly': True}, + 'remediation_description': {'readonly': True}, + 'category': {'readonly': True}, + 'severity': {'readonly': True}, + 'preview': {'readonly': True}, + 'assessment_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + '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]'}, + 'severity': {'key': 'properties.severity', 'type': 'str'}, + 'preview': {'key': 'properties.preview', 'type': 'bool'}, + 'assessment_type': {'key': 'properties.assessmentType', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SecurityAssessmentMetadata, self).__init__(**kwargs) + self.display_name = None + self.policy_definition_id = None + self.description = None + self.remediation_description = None + self.category = None + self.severity = None + self.preview = None + self.assessment_type = None + + class SecurityContact(Resource): """Contact details for security issues. @@ -2948,6 +3518,83 @@ def __init__(self, *, email: str, alert_notifications, alerts_to_admins, phone: self.alerts_to_admins = alerts_to_admins +class SecuritySubAssessment(Resource): + """Security sub-assessment on a resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :ivar security_sub_assessment_id: Vulnerability ID + :vartype security_sub_assessment_id: str + :ivar display_name: User friendly display name of the sub-assessment + :vartype display_name: str + :param status: + :type status: ~azure.mgmt.security.models.SubAssessmentStatus + :ivar remediation: Information on how to remediate this sub-assessment + :vartype remediation: str + :ivar impact: Description of the impact of this sub-assessment + :vartype impact: str + :ivar category: Category of the sub-assessment + :vartype category: str + :ivar description: Human readable description of the assessment status + :vartype description: str + :ivar time_generated: The date and time the sub-assessment was generated + :vartype time_generated: datetime + :param resource_details: + :type resource_details: ~azure.mgmt.security.models.ResourceDetails + :param additional_data: + :type additional_data: ~azure.mgmt.security.models.AdditionalData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'security_sub_assessment_id': {'readonly': True}, + 'display_name': {'readonly': True}, + 'remediation': {'readonly': True}, + 'impact': {'readonly': True}, + 'category': {'readonly': True}, + 'description': {'readonly': True}, + 'time_generated': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'security_sub_assessment_id': {'key': 'properties.id', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'SubAssessmentStatus'}, + 'remediation': {'key': 'properties.remediation', 'type': 'str'}, + 'impact': {'key': 'properties.impact', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'time_generated': {'key': 'properties.timeGenerated', 'type': 'iso-8601'}, + 'resource_details': {'key': 'properties.resourceDetails', 'type': 'ResourceDetails'}, + 'additional_data': {'key': 'properties.additionalData', 'type': 'AdditionalData'}, + } + + def __init__(self, *, status=None, resource_details=None, additional_data=None, **kwargs) -> None: + super(SecuritySubAssessment, self).__init__(**kwargs) + self.security_sub_assessment_id = None + self.display_name = None + self.status = status + self.remediation = None + self.impact = None + self.category = None + self.description = None + self.time_generated = None + self.resource_details = resource_details + self.additional_data = additional_data + + class SecurityTask(Resource): """Security task that we recommend to do in order to strengthen security. @@ -3111,6 +3758,145 @@ def __init__(self, *, value=None, **kwargs) -> None: self.value = value +class ServerVulnerabilityProperties(AdditionalData): + """Additional context fields for server vulnerability assessment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param assessed_resource_type: Required. Constant filled by server. + :type assessed_resource_type: str + :ivar type: Vulnerability Type. e.g: Vulnerability, Potential + Vulnerability, Information Gathered + :vartype type: str + :ivar cvss: Dictionary from cvss version to cvss details object + :vartype cvss: dict[str, ~azure.mgmt.security.models.CVSS] + :ivar patchable: Indicates whether a patch is available or not + :vartype patchable: bool + :ivar cve: List of CVEs + :vartype cve: list[~azure.mgmt.security.models.CVE] + :ivar threat: Threat name + :vartype threat: str + :ivar published_time: Published time + :vartype published_time: datetime + :ivar vendor_references: + :vartype vendor_references: + list[~azure.mgmt.security.models.VendorReference] + """ + + _validation = { + 'assessed_resource_type': {'required': True}, + 'type': {'readonly': True}, + 'cvss': {'readonly': True}, + 'patchable': {'readonly': True}, + 'cve': {'readonly': True}, + 'threat': {'readonly': True}, + 'published_time': {'readonly': True}, + 'vendor_references': {'readonly': True}, + } + + _attribute_map = { + 'assessed_resource_type': {'key': 'assessedResourceType', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'cvss': {'key': 'cvss', 'type': '{CVSS}'}, + 'patchable': {'key': 'patchable', 'type': 'bool'}, + 'cve': {'key': 'cve', 'type': '[CVE]'}, + 'threat': {'key': 'threat', 'type': 'str'}, + 'published_time': {'key': 'publishedTime', 'type': 'iso-8601'}, + 'vendor_references': {'key': 'vendorReferences', 'type': '[VendorReference]'}, + } + + def __init__(self, **kwargs) -> None: + super(ServerVulnerabilityProperties, self).__init__(**kwargs) + self.type = None + self.cvss = None + self.patchable = None + self.cve = None + self.threat = None + self.published_time = None + self.vendor_references = None + self.assessed_resource_type = 'ServerVulnerabilityAssessment' + + +class SqlServerVulnerabilityProperties(AdditionalData): + """Details of the resource that was assessed. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param assessed_resource_type: Required. Constant filled by server. + :type assessed_resource_type: str + :ivar type: The resource type the sub assessment refers to in its resource + details + :vartype type: str + :ivar query: The T-SQL query that runs on your SQL database to perform the + particular check + :vartype query: str + """ + + _validation = { + 'assessed_resource_type': {'required': True}, + 'type': {'readonly': True}, + 'query': {'readonly': True}, + } + + _attribute_map = { + 'assessed_resource_type': {'key': 'assessedResourceType', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'query': {'key': 'query', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SqlServerVulnerabilityProperties, self).__init__(**kwargs) + self.type = None + self.query = None + self.assessed_resource_type = 'SqlServerVulnerability' + + +class SubAssessmentStatus(Model): + """Status of the sub-assessment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Programmatic code for the status of the assessment. Possible + values include: 'Healthy', 'Unhealthy', 'NotApplicable' + :vartype code: str or ~azure.mgmt.security.models.SubAssessmentStatusCode + :ivar cause: Programmatic code for the cause of the assessment status + :vartype cause: str + :ivar description: Human readable description of the assessment status + :vartype description: str + :ivar severity: The sub-assessment severity level. Possible values + include: 'Low', 'Medium', 'High' + :vartype severity: str or ~azure.mgmt.security.models.Severity + """ + + _validation = { + 'code': {'readonly': True}, + 'cause': {'readonly': True}, + 'description': {'readonly': True}, + 'severity': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'cause': {'key': 'cause', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SubAssessmentStatus, self).__init__(**kwargs) + self.code = None + self.cause = None + self.description = None + self.severity = None + + class TagsResource(Model): """A container holding only the Tags for a resource, allowing the user to update the tags. @@ -3128,6 +3914,103 @@ def __init__(self, *, tags=None, **kwargs) -> None: self.tags = tags +class ThresholdCustomAlertRule(CustomAlertRule): + """A custom alert rule that checks if a value (depends on the custom alert + type) is within the given range. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :param min_threshold: Required. The minimum threshold. + :type min_threshold: int + :param max_threshold: Required. The maximum threshold. + :type max_threshold: int + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'min_threshold': {'required': True}, + 'max_threshold': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'min_threshold': {'key': 'minThreshold', 'type': 'int'}, + 'max_threshold': {'key': 'maxThreshold', 'type': 'int'}, + } + + def __init__(self, *, is_enabled: bool, rule_type: str, min_threshold: int, max_threshold: int, **kwargs) -> None: + super(ThresholdCustomAlertRule, self).__init__(is_enabled=is_enabled, rule_type=rule_type, **kwargs) + self.min_threshold = min_threshold + self.max_threshold = max_threshold + + +class TimeWindowCustomAlertRule(ThresholdCustomAlertRule): + """A custom alert rule that checks if the number of activities (depends on the + custom alert type) in a time window is within the given range. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :param min_threshold: Required. The minimum threshold. + :type min_threshold: int + :param max_threshold: Required. The maximum threshold. + :type max_threshold: int + :param time_window_size: Required. The time window size in iso8601 format. + :type time_window_size: timedelta + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'min_threshold': {'required': True}, + 'max_threshold': {'required': True}, + 'time_window_size': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'min_threshold': {'key': 'minThreshold', 'type': 'int'}, + 'max_threshold': {'key': 'maxThreshold', 'type': 'int'}, + 'time_window_size': {'key': 'timeWindowSize', 'type': 'duration'}, + } + + def __init__(self, *, is_enabled: bool, rule_type: str, min_threshold: int, max_threshold: int, time_window_size, **kwargs) -> None: + super(TimeWindowCustomAlertRule, self).__init__(is_enabled=is_enabled, rule_type=rule_type, min_threshold=min_threshold, max_threshold=max_threshold, **kwargs) + self.time_window_size = time_window_size + + class TopologyResource(Model): """TopologyResource. @@ -3306,8 +4189,8 @@ class UpdateIotSecuritySolutionData(TagsResource): _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, - 'user_defined_resources': {'key': 'userDefinedResources', 'type': 'UserDefinedResourcesProperties'}, - 'recommendations_configuration': {'key': 'recommendationsConfiguration', 'type': '[RecommendationConfigurationProperties]'}, + 'user_defined_resources': {'key': 'properties.userDefinedResources', 'type': 'UserDefinedResourcesProperties'}, + 'recommendations_configuration': {'key': 'properties.recommendationsConfiguration', 'type': '[RecommendationConfigurationProperties]'}, } def __init__(self, *, tags=None, user_defined_resources=None, recommendations_configuration=None, **kwargs) -> None: @@ -3317,7 +4200,7 @@ def __init__(self, *, tags=None, user_defined_resources=None, recommendations_co class UserDefinedResourcesProperties(Model): - """Properties of the solution's user defined resources. + """Properties of the IoT Security solution's user defined resources. All required parameters must be populated in order to send to Azure. @@ -3368,6 +4251,34 @@ def __init__(self, *, username: str=None, recommendation_action=None, **kwargs) self.recommendation_action = recommendation_action +class VendorReference(Model): + """Vendor reference. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar title: Link title + :vartype title: str + :ivar link: Link url + :vartype link: str + """ + + _validation = { + 'title': {'readonly': True}, + 'link': {'readonly': True}, + } + + _attribute_map = { + 'title': {'key': 'title', 'type': 'str'}, + 'link': {'key': 'link', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(VendorReference, self).__init__(**kwargs) + self.title = None + self.link = None + + class VmRecommendation(Model): """Represents a machine that is part of a VM/server group. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_paged_models.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_paged_models.py index 362a777bdc8c..b9aa4747d1d9 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_paged_models.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_paged_models.py @@ -51,6 +51,19 @@ class SettingPaged(Paged): def __init__(self, *args, **kwargs): super(SettingPaged, self).__init__(*args, **kwargs) +class DeviceSecurityGroupPaged(Paged): + """ + A paging container for iterating over a list of :class:`DeviceSecurityGroup ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DeviceSecurityGroup]'} + } + + def __init__(self, *args, **kwargs): + + super(DeviceSecurityGroupPaged, self).__init__(*args, **kwargs) class IoTSecuritySolutionModelPaged(Paged): """ A paging container for iterating over a list of :class:`IoTSecuritySolutionModel ` object @@ -298,3 +311,29 @@ class RegulatoryComplianceAssessmentPaged(Paged): def __init__(self, *args, **kwargs): super(RegulatoryComplianceAssessmentPaged, self).__init__(*args, **kwargs) +class SecuritySubAssessmentPaged(Paged): + """ + A paging container for iterating over a list of :class:`SecuritySubAssessment ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SecuritySubAssessment]'} + } + + def __init__(self, *args, **kwargs): + + super(SecuritySubAssessmentPaged, self).__init__(*args, **kwargs) +class SecurityAssessmentMetadataPaged(Paged): + """ + A paging container for iterating over a list of :class:`SecurityAssessmentMetadata ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SecurityAssessmentMetadata]'} + } + + def __init__(self, *args, **kwargs): + + super(SecurityAssessmentMetadataPaged, 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 09cf991ceb06..325cf60ac27e 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_security_center_enums.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_security_center_enums.py @@ -40,6 +40,12 @@ class SettingKind(str, Enum): alert_suppression_setting = "AlertSuppressionSetting" +class ValueType(str, Enum): + + ip_cidr = "IpCidr" #: An IP range in CIDR format (e.g. '192.168.0.1/8'). + string = "String" #: Any string value. + + class SecuritySolutionStatus(str, Enum): enabled = "Enabled" @@ -150,6 +156,36 @@ class State(str, Enum): unsupported = "Unsupported" #: No supported regulatory compliance data for the given standard +class SubAssessmentStatusCode(str, Enum): + + healthy = "Healthy" #: The resource is healthy + unhealthy = "Unhealthy" #: The resource has a security issue that needs to be addressed + not_applicable = "NotApplicable" #: Assessment for this resource did not happen + + +class Severity(str, Enum): + + low = "Low" + medium = "Medium" + high = "High" + + +class Category(str, Enum): + + compute = "Compute" + networking = "Networking" + data = "Data" + identity_and_access = "IdentityAndAccess" + io_t = "IoT" + + +class AssessmentType(str, Enum): + + built_in = "BuiltIn" #: Azure Security Center managed assessments + custom_policy = "CustomPolicy" #: User defined custom assessments ingested automatically by Azure Security Center + customer_managed = "CustomerManaged" #: User assessments pushed directly by the user or other third party to Azure Security Center + + class ConnectionType(str, Enum): internal = "Internal" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/__init__.py index 2044043fcb95..8a1a3aadee60 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/__init__.py @@ -13,14 +13,11 @@ from ._pricings_operations import PricingsOperations from ._alerts_operations import AlertsOperations from ._settings_operations import SettingsOperations -from ._io_tsecurity_solutions_operations import IoTSecuritySolutionsOperations -from ._io_tsecurity_solutions_resource_group_operations import IoTSecuritySolutionsResourceGroupOperations +from ._device_security_groups_operations import DeviceSecurityGroupsOperations from ._iot_security_solution_operations import IotSecuritySolutionOperations -from ._io_tsecurity_solutions_analytics_operations import IoTSecuritySolutionsAnalyticsOperations -from ._io_tsecurity_solutions_analytics_aggregated_alerts_operations import IoTSecuritySolutionsAnalyticsAggregatedAlertsOperations -from ._io_tsecurity_solutions_analytics_aggregated_alert_operations import IoTSecuritySolutionsAnalyticsAggregatedAlertOperations -from ._io_tsecurity_solutions_analytics_recommendation_operations import IoTSecuritySolutionsAnalyticsRecommendationOperations -from ._io_tsecurity_solutions_analytics_recommendations_operations import IoTSecuritySolutionsAnalyticsRecommendationsOperations +from ._iot_security_solution_analytics_operations import IotSecuritySolutionAnalyticsOperations +from ._iot_security_solutions_analytics_aggregated_alert_operations import IotSecuritySolutionsAnalyticsAggregatedAlertOperations +from ._iot_security_solutions_analytics_recommendation_operations import IotSecuritySolutionsAnalyticsRecommendationOperations from ._allowed_connections_operations import AllowedConnectionsOperations from ._discovered_security_solutions_operations import DiscoveredSecuritySolutionsOperations from ._external_security_solutions_operations import ExternalSecuritySolutionsOperations @@ -40,20 +37,20 @@ from ._regulatory_compliance_controls_operations import RegulatoryComplianceControlsOperations from ._regulatory_compliance_assessments_operations import RegulatoryComplianceAssessmentsOperations from ._server_vulnerability_assessment_operations import ServerVulnerabilityAssessmentOperations +from ._sub_assessments_operations import SubAssessmentsOperations +from ._assessments_metadata_operations import AssessmentsMetadataOperations +from ._assessments_metadata_subscription_operations import AssessmentsMetadataSubscriptionOperations __all__ = [ 'ComplianceResultsOperations', 'PricingsOperations', 'AlertsOperations', 'SettingsOperations', - 'IoTSecuritySolutionsOperations', - 'IoTSecuritySolutionsResourceGroupOperations', + 'DeviceSecurityGroupsOperations', 'IotSecuritySolutionOperations', - 'IoTSecuritySolutionsAnalyticsOperations', - 'IoTSecuritySolutionsAnalyticsAggregatedAlertsOperations', - 'IoTSecuritySolutionsAnalyticsAggregatedAlertOperations', - 'IoTSecuritySolutionsAnalyticsRecommendationOperations', - 'IoTSecuritySolutionsAnalyticsRecommendationsOperations', + 'IotSecuritySolutionAnalyticsOperations', + 'IotSecuritySolutionsAnalyticsAggregatedAlertOperations', + 'IotSecuritySolutionsAnalyticsRecommendationOperations', 'AllowedConnectionsOperations', 'DiscoveredSecuritySolutionsOperations', 'ExternalSecuritySolutionsOperations', @@ -73,4 +70,7 @@ 'RegulatoryComplianceControlsOperations', 'RegulatoryComplianceAssessmentsOperations', 'ServerVulnerabilityAssessmentOperations', + 'SubAssessmentsOperations', + 'AssessmentsMetadataOperations', + 'AssessmentsMetadataSubscriptionOperations', ] diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_aggregated_alerts_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_assessments_metadata_operations.py similarity index 50% rename from sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_aggregated_alerts_operations.py rename to sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_assessments_metadata_operations.py index 8e47ea54d879..3d4f020ce936 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_aggregated_alerts_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_assessments_metadata_operations.py @@ -16,8 +16,8 @@ from .. import models -class IoTSecuritySolutionsAnalyticsAggregatedAlertsOperations(object): - """IoTSecuritySolutionsAnalyticsAggregatedAlertsOperations operations. +class AssessmentsMetadataOperations(object): + """AssessmentsMetadataOperations operations. You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. @@ -25,7 +25,7 @@ class IoTSecuritySolutionsAnalyticsAggregatedAlertsOperations(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: "2019-08-01". + :ivar api_version: API version for the operation. Constant value: "2019-01-01-preview". """ models = models @@ -35,47 +35,32 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-08-01" + self.api_version = "2019-01-01-preview" self.config = config def list( - self, resource_group_name, solution_name, top=None, custom_headers=None, raw=False, **operation_config): - """Security Analytics of a security solution. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param solution_name: The solution manager name - :type solution_name: str - :param top: The number of results to retrieve. - :type top: int + self, custom_headers=None, raw=False, **operation_config): + """Get metadata information on all assessment types. + :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of IoTSecurityAggregatedAlert + :return: An iterator like instance of SecurityAssessmentMetadata :rtype: - ~azure.mgmt.security.models.IoTSecurityAggregatedAlertPaged[~azure.mgmt.security.models.IoTSecurityAggregatedAlert] + ~azure.mgmt.security.models.SecurityAssessmentMetadataPaged[~azure.mgmt.security.models.SecurityAssessmentMetadata] :raises: :class:`CloudError` """ def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'solutionName': self._serialize.url("solution_name", solution_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') else: url = next_link @@ -111,7 +96,65 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.IoTSecurityAggregatedAlertPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.SecurityAssessmentMetadataPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Security/assessmentMetadata'} + + def get( + self, assessment_metadata_name, custom_headers=None, raw=False, **operation_config): + """Get metadata information on an assessment type. + + :param assessment_metadata_name: The Assessment Key - Unique key for + the assessment type + :type assessment_metadata_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: SecurityAssessmentMetadata or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadata or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'assessmentMetadataName': self._serialize.url("assessment_metadata_name", assessment_metadata_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SecurityAssessmentMetadata', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts'} + get.metadata = {'url': '/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_assessments_metadata_subscription_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_assessments_metadata_subscription_operations.py new file mode 100644 index 000000000000..4722669c7493 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_assessments_metadata_subscription_operations.py @@ -0,0 +1,233 @@ +# 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 AssessmentsMetadataSubscriptionOperations(object): + """AssessmentsMetadataSubscriptionOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2019-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-01-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Get metadata information on all assessment types in a specific + 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 operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SecurityAssessmentMetadata + :rtype: + ~azure.mgmt.security.models.SecurityAssessmentMetadataPaged[~azure.mgmt.security.models.SecurityAssessmentMetadata] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.SecurityAssessmentMetadataPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata'} + + def get( + self, assessment_metadata_name, custom_headers=None, raw=False, **operation_config): + """Get metadata information on an assessment type in a specific + subscription. + + :param assessment_metadata_name: The Assessment Key - Unique key for + the assessment type + :type assessment_metadata_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: SecurityAssessmentMetadata or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadata or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'assessmentMetadataName': self._serialize.url("assessment_metadata_name", assessment_metadata_name, 'str'), + '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/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('SecurityAssessmentMetadata', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}'} + + def create( + self, assessment_metadata_name, custom_headers=None, raw=False, **operation_config): + """Create metadata information on an assessment type in a specific + subscription. + + :param assessment_metadata_name: The Assessment Key - Unique key for + the assessment type + :type assessment_metadata_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: SecurityAssessmentMetadata or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadata or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + assessment_metadata = None + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'assessmentMetadataName': self._serialize.url("assessment_metadata_name", assessment_metadata_name, 'str'), + '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/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(assessment_metadata, 'SecurityAssessmentMetadata') + + # 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]: + 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('SecurityAssessmentMetadata', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_device_security_groups_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_device_security_groups_operations.py new file mode 100644 index 000000000000..581733e3c324 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_device_security_groups_operations.py @@ -0,0 +1,298 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class DeviceSecurityGroupsOperations(object): + """DeviceSecurityGroupsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2019-08-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-08-01" + + self.config = config + + def list( + self, resource_id, custom_headers=None, raw=False, **operation_config): + """Use this method get the list of device security groups for the + specified IoT Hub resource. + + :param resource_id: The identifier of the resource. + :type resource_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DeviceSecurityGroup + :rtype: + ~azure.mgmt.security.models.DeviceSecurityGroupPaged[~azure.mgmt.security.models.DeviceSecurityGroup] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeviceSecurityGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups'} + + def get( + self, resource_id, device_security_group_name, custom_headers=None, raw=False, **operation_config): + """Use this method to get the device security group for the specified IoT + Hub resource. + + :param resource_id: The identifier of the resource. + :type resource_id: str + :param device_security_group_name: The name of the device security + group. Note that the name of the device security group is case + insensitive. + :type device_security_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeviceSecurityGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.DeviceSecurityGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, 'str'), + 'deviceSecurityGroupName': self._serialize.url("device_security_group_name", device_security_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeviceSecurityGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}'} + + def create_or_update( + self, resource_id, device_security_group_name, device_security_group, custom_headers=None, raw=False, **operation_config): + """Use this method to creates or updates the device security group on a + specified IoT Hub resource. + + :param resource_id: The identifier of the resource. + :type resource_id: str + :param device_security_group_name: The name of the device security + group. Note that the name of the device security group is case + insensitive. + :type device_security_group_name: str + :param device_security_group: Security group object. + :type device_security_group: + ~azure.mgmt.security.models.DeviceSecurityGroup + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeviceSecurityGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.DeviceSecurityGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, 'str'), + 'deviceSecurityGroupName': self._serialize.url("device_security_group_name", device_security_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(device_security_group, 'DeviceSecurityGroup') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeviceSecurityGroup', response) + if response.status_code == 201: + deserialized = self._deserialize('DeviceSecurityGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}'} + + def delete( + self, resource_id, device_security_group_name, custom_headers=None, raw=False, **operation_config): + """User this method to deletes the device security group. + + :param resource_id: The identifier of the resource. + :type resource_id: str + :param device_security_group_name: The name of the device security + group. Note that the name of the device security group is case + insensitive. + :type device_security_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, 'str'), + 'deviceSecurityGroupName': self._serialize.url("device_security_group_name", device_security_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_recommendation_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_recommendation_operations.py deleted file mode 100644 index 3e251e9f060e..000000000000 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_recommendation_operations.py +++ /dev/null @@ -1,108 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class IoTSecuritySolutionsAnalyticsRecommendationOperations(object): - """IoTSecuritySolutionsAnalyticsRecommendationOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2019-08-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-08-01" - - self.config = config - - def get( - self, resource_group_name, solution_name, aggregated_recommendation_name, custom_headers=None, raw=False, **operation_config): - """Security Analytics of a security solution. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param solution_name: The solution manager name - :type solution_name: str - :param aggregated_recommendation_name: Identifier of the aggregated - recommendation - :type aggregated_recommendation_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: IoTSecurityAggregatedRecommendation or ClientRawResponse if - raw=true - :rtype: - ~azure.mgmt.security.models.IoTSecurityAggregatedRecommendation or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'solutionName': self._serialize.url("solution_name", solution_name, 'str'), - 'aggregatedRecommendationName': self._serialize.url("aggregated_recommendation_name", aggregated_recommendation_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('IoTSecurityAggregatedRecommendation', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName}'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_operations.py deleted file mode 100644 index b3f222701615..000000000000 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_operations.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class IoTSecuritySolutionsOperations(object): - """IoTSecuritySolutionsOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2019-08-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-08-01" - - self.config = config - - def list( - self, filter=None, custom_headers=None, raw=False, **operation_config): - """List of security solutions. - - :param filter: filter the Security Solution with OData syntax. - supporting filter by iotHubs - :type filter: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of IoTSecuritySolutionModel - :rtype: - ~azure.mgmt.security.models.IoTSecuritySolutionModelPaged[~azure.mgmt.security.models.IoTSecuritySolutionModel] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.IoTSecuritySolutionModelPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotSecuritySolutions'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_resource_group_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_resource_group_operations.py deleted file mode 100644 index 1536a6eb452c..000000000000 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_resource_group_operations.py +++ /dev/null @@ -1,115 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class IoTSecuritySolutionsResourceGroupOperations(object): - """IoTSecuritySolutionsResourceGroupOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2019-08-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-08-01" - - self.config = config - - def list( - self, resource_group_name, filter=None, custom_headers=None, raw=False, **operation_config): - """List of security solutions. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param filter: filter the Security Solution with OData syntax. - supporting filter by iotHubs - :type filter: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of IoTSecuritySolutionModel - :rtype: - ~azure.mgmt.security.models.IoTSecuritySolutionModelPaged[~azure.mgmt.security.models.IoTSecuritySolutionModel] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.IoTSecuritySolutionModelPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solution_analytics_operations.py similarity index 89% rename from sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_operations.py rename to sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solution_analytics_operations.py index 70e6b43692b5..a7ee65858d04 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solution_analytics_operations.py @@ -16,8 +16,8 @@ from .. import models -class IoTSecuritySolutionsAnalyticsOperations(object): - """IoTSecuritySolutionsAnalyticsOperations operations. +class IotSecuritySolutionAnalyticsOperations(object): + """IotSecuritySolutionAnalyticsOperations operations. You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. @@ -39,14 +39,14 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def get_all( + def list( self, resource_group_name, solution_name, custom_headers=None, raw=False, **operation_config): - """Security Analytics of a security solution. + """Use this method to get IoT security Analytics metrics in an array. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. :type resource_group_name: str - :param solution_name: The solution manager name + :param solution_name: The name of the IoT Security solution. :type solution_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -61,7 +61,7 @@ def get_all( :raises: :class:`CloudError` """ # Construct URL - url = self.get_all.metadata['url'] + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -101,16 +101,16 @@ def get_all( return client_raw_response return deserialized - get_all.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels'} - def get_default( + def get( self, resource_group_name, solution_name, custom_headers=None, raw=False, **operation_config): - """Security Analytics of a security solution. + """Use this method to get IoT Security Analytics metrics. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. :type resource_group_name: str - :param solution_name: The solution manager name + :param solution_name: The name of the IoT Security solution. :type solution_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -124,7 +124,7 @@ def get_default( :raises: :class:`CloudError` """ # Construct URL - url = self.get_default.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -164,4 +164,4 @@ def get_default( return client_raw_response return deserialized - get_default.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solution_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solution_operations.py index 3a3c15481184..8a820da44265 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solution_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solution_operations.py @@ -39,14 +39,163 @@ def __init__(self, client, config, serializer, deserializer): self.config = config + def list_by_subscription( + self, filter=None, custom_headers=None, raw=False, **operation_config): + """Use this method to get the list of IoT Security solutions by + subscription. + + :param filter: Filter the IoT Security solution with OData syntax. + Supports filtering by iotHubs. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of IoTSecuritySolutionModel + :rtype: + ~azure.mgmt.security.models.IoTSecuritySolutionModelPaged[~azure.mgmt.security.models.IoTSecuritySolutionModel] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.IoTSecuritySolutionModelPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotSecuritySolutions'} + + def list_by_resource_group( + self, resource_group_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Use this method to get the list IoT Security solutions organized by + resource group. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param filter: Filter the IoT Security solution with OData syntax. + Supports filtering by iotHubs. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of IoTSecuritySolutionModel + :rtype: + ~azure.mgmt.security.models.IoTSecuritySolutionModelPaged[~azure.mgmt.security.models.IoTSecuritySolutionModel] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.IoTSecuritySolutionModelPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions'} + def get( self, resource_group_name, solution_name, custom_headers=None, raw=False, **operation_config): - """Details of a specific iot security solution. + """User this method to get details of a specific IoT Security solution + based on solution name. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. :type resource_group_name: str - :param solution_name: The solution manager name + :param solution_name: The name of the IoT Security solution. :type solution_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -101,14 +250,14 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}'} - def create( + def create_or_update( self, resource_group_name, solution_name, iot_security_solution_data, custom_headers=None, raw=False, **operation_config): - """Create new solution manager. + """Use this method to create or update yours IoT Security solution. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. :type resource_group_name: str - :param solution_name: The solution manager name + :param solution_name: The name of the IoT Security solution. :type solution_name: str :param iot_security_solution_data: The security solution data :type iot_security_solution_data: @@ -124,7 +273,7 @@ def create( :raises: :class:`CloudError` """ # Construct URL - url = self.create.metadata['url'] + url = self.create_or_update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -170,17 +319,18 @@ def create( return client_raw_response return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}'} def update( self, resource_group_name, solution_name, update_iot_security_solution_data, custom_headers=None, raw=False, **operation_config): - """update existing Security Solution tags or user defined resources. To - update other fields use the CreateOrUpdate method. + """Use this method to update existing IoT Security solution tags or user + defined resources. To update other fields use the CreateOrUpdate + method. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. :type resource_group_name: str - :param solution_name: The solution manager name + :param solution_name: The name of the IoT Security solution. :type solution_name: str :param update_iot_security_solution_data: The security solution data :type update_iot_security_solution_data: @@ -244,12 +394,12 @@ def update( def delete( self, resource_group_name, solution_name, custom_headers=None, raw=False, **operation_config): - """Create new solution manager. + """Use this method to delete yours IoT Security solution. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. :type resource_group_name: str - :param solution_name: The solution manager name + :param solution_name: The name of the IoT Security solution. :type solution_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_aggregated_alert_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solutions_analytics_aggregated_alert_operations.py similarity index 63% rename from sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_aggregated_alert_operations.py rename to sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solutions_analytics_aggregated_alert_operations.py index b4a3340cf7e6..327bbbd5f397 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_aggregated_alert_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solutions_analytics_aggregated_alert_operations.py @@ -16,8 +16,8 @@ from .. import models -class IoTSecuritySolutionsAnalyticsAggregatedAlertOperations(object): - """IoTSecuritySolutionsAnalyticsAggregatedAlertOperations operations. +class IotSecuritySolutionsAnalyticsAggregatedAlertOperations(object): + """IotSecuritySolutionsAnalyticsAggregatedAlertOperations operations. You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. @@ -39,16 +39,95 @@ def __init__(self, client, config, serializer, deserializer): self.config = config + def list( + self, resource_group_name, solution_name, top=None, custom_headers=None, raw=False, **operation_config): + """Use this method to get the aggregated alert list of yours IoT Security + solution. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param solution_name: The name of the IoT Security solution. + :type solution_name: str + :param top: Number of results to retrieve. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of IoTSecurityAggregatedAlert + :rtype: + ~azure.mgmt.security.models.IoTSecurityAggregatedAlertPaged[~azure.mgmt.security.models.IoTSecurityAggregatedAlert] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'solutionName': self._serialize.url("solution_name", solution_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.IoTSecurityAggregatedAlertPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts'} + def get( self, resource_group_name, solution_name, aggregated_alert_name, custom_headers=None, raw=False, **operation_config): - """Security Analytics of a security solution. + """Use this method to get a single the aggregated alert of yours IoT + Security solution. This aggregation is performed by alert name. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. :type resource_group_name: str - :param solution_name: The solution manager name + :param solution_name: The name of the IoT Security solution. :type solution_name: str - :param aggregated_alert_name: Identifier of the aggregated alert + :param aggregated_alert_name: Identifier of the aggregated alert. :type aggregated_alert_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -106,14 +185,14 @@ def get( def dismiss( self, resource_group_name, solution_name, aggregated_alert_name, custom_headers=None, raw=False, **operation_config): - """Security Analytics of a security solution. + """Use this method to dismiss an aggregated IoT Security Solution Alert. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. :type resource_group_name: str - :param solution_name: The solution manager name + :param solution_name: The name of the IoT Security solution. :type solution_name: str - :param aggregated_alert_name: Identifier of the aggregated alert + :param aggregated_alert_name: Identifier of the aggregated alert. :type aggregated_alert_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_recommendations_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solutions_analytics_recommendation_operations.py similarity index 54% rename from sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_recommendations_operations.py rename to sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solutions_analytics_recommendation_operations.py index 3276e998ec1a..57dbc1031ce4 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_recommendations_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solutions_analytics_recommendation_operations.py @@ -16,8 +16,8 @@ from .. import models -class IoTSecuritySolutionsAnalyticsRecommendationsOperations(object): - """IoTSecuritySolutionsAnalyticsRecommendationsOperations operations. +class IotSecuritySolutionsAnalyticsRecommendationOperations(object): + """IotSecuritySolutionsAnalyticsRecommendationOperations operations. You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. @@ -39,16 +39,87 @@ def __init__(self, client, config, serializer, deserializer): self.config = config + def get( + self, resource_group_name, solution_name, aggregated_recommendation_name, custom_headers=None, raw=False, **operation_config): + """Use this method to get the aggregated security analytics recommendation + of yours IoT Security solution. This aggregation is performed by + recommendation name. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param solution_name: The name of the IoT Security solution. + :type solution_name: str + :param aggregated_recommendation_name: Name of the recommendation + aggregated for this query. + :type aggregated_recommendation_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: IoTSecurityAggregatedRecommendation or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.security.models.IoTSecurityAggregatedRecommendation or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'solutionName': self._serialize.url("solution_name", solution_name, 'str'), + 'aggregatedRecommendationName': self._serialize.url("aggregated_recommendation_name", aggregated_recommendation_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IoTSecurityAggregatedRecommendation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName}'} + def list( self, resource_group_name, solution_name, top=None, custom_headers=None, raw=False, **operation_config): - """Security Analytics of a security solution. + """Use this method to get the list of aggregated security analytics + recommendations of yours IoT Security solution. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. :type resource_group_name: str - :param solution_name: The solution manager name + :param solution_name: The name of the IoT Security solution. :type solution_name: str - :param top: The number of results to retrieve. + :param top: Number of results to retrieve. :type top: int :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_jit_network_access_policies_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_jit_network_access_policies_operations.py index 48df52e84dba..16a6f67da9d1 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_jit_network_access_policies_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_jit_network_access_policies_operations.py @@ -511,7 +511,7 @@ def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}'} def initiate( - self, resource_group_name, jit_network_access_policy_name, virtual_machines, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, jit_network_access_policy_name, virtual_machines, justification=None, custom_headers=None, raw=False, **operation_config): """Initiate a JIT access from a specific Just-in-Time policy configuration. @@ -525,6 +525,9 @@ def initiate( access for :type virtual_machines: list[~azure.mgmt.security.models.JitNetworkAccessPolicyInitiateVirtualMachine] + :param justification: The justification for making the initiate + request + :type justification: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -535,7 +538,7 @@ def initiate( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - body = models.JitNetworkAccessPolicyInitiateRequest(virtual_machines=virtual_machines) + body = models.JitNetworkAccessPolicyInitiateRequest(virtual_machines=virtual_machines, justification=justification) # Construct URL url = self.initiate.metadata['url'] diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_pricings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_pricings_operations.py index 02e06e34875c..e7d4637ae20b 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_pricings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_pricings_operations.py @@ -41,10 +41,7 @@ def __init__(self, client, config, serializer, deserializer): def list( self, custom_headers=None, raw=False, **operation_config): - """A given security pricing configuration in the subscription. Azure - Security Center is available in two pricing tiers: Free and Standard, - on multiple resource types, including Virtual machines, SQL Servers, - App service plans and Storage accounts. + """Lists Security Center pricing configurations in the subscription. :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -99,10 +96,8 @@ def list( def get( self, pricing_name, custom_headers=None, raw=False, **operation_config): - """A given security pricing configuration in the subscription. Azure - Security Center is available in two pricing tiers: Free and Standard, - on multiple resource types, including Virtual machines, SQL Servers, - App service plans and Storage accounts. + """Gets a provided Security Center pricing configuration in the + subscription. :param pricing_name: name of the pricing configuration :type pricing_name: str @@ -160,10 +155,8 @@ def get( def update( self, pricing_name, pricing_tier, custom_headers=None, raw=False, **operation_config): - """A given security pricing configuration in the subscription. Azure - Security Center is available in two pricing tiers: Free and Standard, - on multiple resource types, including Virtual machines, SQL Servers, - App service plans and Storage accounts. + """Updates a provided Security Center pricing configuration in the + subscription. :param pricing_name: name of the pricing configuration :type pricing_name: str diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_sub_assessments_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_sub_assessments_operations.py new file mode 100644 index 000000000000..c73ee21df970 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_sub_assessments_operations.py @@ -0,0 +1,253 @@ +# 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 SubAssessmentsOperations(object): + """SubAssessmentsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2019-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-01-01-preview" + + self.config = config + + def list_all( + self, scope, custom_headers=None, raw=False, **operation_config): + """Get security sub-assessments on all your scanned resources inside a + subscription scope. + + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management + group (/providers/Microsoft.Management/managementGroups/mgName). + :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: An iterator like instance of SecuritySubAssessment + :rtype: + ~azure.mgmt.security.models.SecuritySubAssessmentPaged[~azure.mgmt.security.models.SecuritySubAssessment] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.SecuritySubAssessmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_all.metadata = {'url': '/{scope}/providers/Microsoft.Security/subAssessments'} + + def list( + self, scope, assessment_name, custom_headers=None, raw=False, **operation_config): + """Get security sub-assessments on all your scanned resources inside a + scope. + + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management + group (/providers/Microsoft.Management/managementGroups/mgName). + :type scope: str + :param assessment_name: The Assessment Key - Unique key for the + assessment type + :type assessment_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: An iterator like instance of SecuritySubAssessment + :rtype: + ~azure.mgmt.security.models.SecuritySubAssessmentPaged[~azure.mgmt.security.models.SecuritySubAssessment] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str'), + 'assessmentName': self._serialize.url("assessment_name", assessment_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.SecuritySubAssessmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments'} + + def get( + self, scope, assessment_name, sub_assessment_name, custom_headers=None, raw=False, **operation_config): + """Get a security sub-assessment on your scanned resource. + + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management + group (/providers/Microsoft.Management/managementGroups/mgName). + :type scope: str + :param assessment_name: The Assessment Key - Unique key for the + assessment type + :type assessment_name: str + :param sub_assessment_name: The Sub-Assessment Key - Unique key for + the sub-assessment type + :type sub_assessment_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: SecuritySubAssessment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.SecuritySubAssessment or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str'), + 'assessmentName': self._serialize.url("assessment_name", assessment_name, 'str'), + 'subAssessmentName': self._serialize.url("sub_assessment_name", sub_assessment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SecuritySubAssessment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments/{subAssessmentName}'}