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 6e5d20a55e1d..25aa49718c6d 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 @@ -13,15 +13,19 @@ from msrest import Serializer, Deserializer from ._configuration import SecurityCenterConfiguration +from .operations import NetworkDataOperations from .operations import ComplianceResultsOperations from .operations import PricingsOperations from .operations import AlertsOperations from .operations import SettingsOperations -from .operations import DeviceSecurityGroupsOperations +from .operations import IoTSecuritySolutionsOperations +from .operations import IoTSecuritySolutionsResourceGroupOperations from .operations import IotSecuritySolutionOperations -from .operations import IotSecuritySolutionAnalyticsOperations -from .operations import IotSecuritySolutionsAnalyticsAggregatedAlertOperations -from .operations import IotSecuritySolutionsAnalyticsRecommendationOperations +from .operations import IoTSecuritySolutionsAnalyticsOperations +from .operations import IoTSecuritySolutionsAnalyticsAggregatedAlertsOperations +from .operations import IoTSecuritySolutionsAnalyticsAggregatedAlertOperations +from .operations import IoTSecuritySolutionsAnalyticsRecommendationOperations +from .operations import IoTSecuritySolutionsAnalyticsRecommendationsOperations from .operations import AllowedConnectionsOperations from .operations import DiscoveredSecuritySolutionsOperations from .operations import ExternalSecuritySolutionsOperations @@ -41,7 +45,6 @@ from .operations import RegulatoryComplianceControlsOperations from .operations import RegulatoryComplianceAssessmentsOperations from .operations import ServerVulnerabilityAssessmentOperations -from .operations import SubAssessmentsOperations from . import models @@ -51,6 +54,8 @@ class SecurityCenter(SDKClient): :ivar config: Configuration for client. :vartype config: SecurityCenterConfiguration + :ivar network_data: NetworkData operations + :vartype network_data: azure.mgmt.security.operations.NetworkDataOperations :ivar compliance_results: ComplianceResults operations :vartype compliance_results: azure.mgmt.security.operations.ComplianceResultsOperations :ivar pricings: Pricings operations @@ -59,16 +64,22 @@ class SecurityCenter(SDKClient): :vartype alerts: azure.mgmt.security.operations.AlertsOperations :ivar settings: Settings operations :vartype settings: azure.mgmt.security.operations.SettingsOperations - :ivar device_security_groups: DeviceSecurityGroups operations - :vartype device_security_groups: azure.mgmt.security.operations.DeviceSecurityGroupsOperations + :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 iot_security_solution: IotSecuritySolution operations :vartype iot_security_solution: azure.mgmt.security.operations.IotSecuritySolutionOperations - :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 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 allowed_connections: AllowedConnections operations :vartype allowed_connections: azure.mgmt.security.operations.AllowedConnectionsOperations :ivar discovered_security_solutions: DiscoveredSecuritySolutions operations @@ -107,8 +118,6 @@ 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 :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -131,6 +140,8 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) + self.network_data = NetworkDataOperations( + self._client, self.config, self._serialize, self._deserialize) self.compliance_results = ComplianceResultsOperations( self._client, self.config, self._serialize, self._deserialize) self.pricings = PricingsOperations( @@ -139,15 +150,21 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.settings = SettingsOperations( self._client, self.config, self._serialize, self._deserialize) - self.device_security_groups = DeviceSecurityGroupsOperations( + self.io_tsecurity_solutions = IoTSecuritySolutionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.io_tsecurity_solutions_resource_group = IoTSecuritySolutionsResourceGroupOperations( self._client, self.config, self._serialize, self._deserialize) self.iot_security_solution = IotSecuritySolutionOperations( self._client, self.config, self._serialize, self._deserialize) - self.iot_security_solution_analytics = IotSecuritySolutionAnalyticsOperations( + 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.iot_security_solutions_analytics_aggregated_alert = IotSecuritySolutionsAnalyticsAggregatedAlertOperations( + self.io_tsecurity_solutions_analytics_aggregated_alert = IoTSecuritySolutionsAnalyticsAggregatedAlertOperations( self._client, self.config, self._serialize, self._deserialize) - self.iot_security_solutions_analytics_recommendation = IotSecuritySolutionsAnalyticsRecommendationOperations( + self.io_tsecurity_solutions_analytics_recommendation = IoTSecuritySolutionsAnalyticsRecommendationOperations( + self._client, self.config, self._serialize, self._deserialize) + self.io_tsecurity_solutions_analytics_recommendations = IoTSecuritySolutionsAnalyticsRecommendationsOperations( self._client, self.config, self._serialize, self._deserialize) self.allowed_connections = AllowedConnectionsOperations( self._client, self.config, self._serialize, self._deserialize) @@ -187,5 +204,3 @@ 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) 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 a366a0b4789c..da440b4f61f9 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,13 +13,11 @@ 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 @@ -28,8 +26,6 @@ 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 @@ -37,14 +33,9 @@ from ._models_py3 import ComplianceSegment from ._models_py3 import ConnectableResource from ._models_py3 import ConnectedResource + from ._models_py3 import ConnectedResources 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 @@ -53,11 +44,13 @@ 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 @@ -73,36 +66,33 @@ 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 NetworkData + from ._models_py3 import NetworkDataConnectableResource + from ._models_py3 import NetworkDataConnectableResourceActualTraffic + from ._models_py3 import NetworkDataConnectableResourceAllowedConnections + from ._models_py3 import NetworkDataConnectableResourceUnusedPorts + from ._models_py3 import NetworkDataList 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 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 @@ -110,20 +100,17 @@ 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 @@ -132,8 +119,6 @@ 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 @@ -141,14 +126,9 @@ from ._models import ComplianceSegment from ._models import ConnectableResource from ._models import ConnectedResource + from ._models import ConnectedResources 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 @@ -157,11 +137,13 @@ 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 @@ -177,36 +159,33 @@ from ._models import JitNetworkAccessRequestPort from ._models import JitNetworkAccessRequestVirtualMachine from ._models import Kind - from ._models import ListCustomAlertRule from ._models import Location + from ._models import NetworkData + from ._models import NetworkDataConnectableResource + from ._models import NetworkDataConnectableResourceActualTraffic + from ._models import NetworkDataConnectableResourceAllowedConnections + from ._models import NetworkDataConnectableResourceUnusedPorts + from ._models import NetworkDataList 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 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 @@ -214,7 +193,6 @@ 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 @@ -223,7 +201,6 @@ 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 @@ -231,28 +208,28 @@ from ._paged_models import IoTSecurityAggregatedRecommendationPaged from ._paged_models import IoTSecuritySolutionModelPaged from ._paged_models import JitNetworkAccessPolicyPaged +from ._paged_models import NetworkDataPaged from ._paged_models import OperationPaged from ._paged_models import RegulatoryComplianceAssessmentPaged from ._paged_models import RegulatoryComplianceControlPaged from ._paged_models import RegulatoryComplianceStandardPaged 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 from ._paged_models import WorkspaceSettingPaged from ._security_center_enums import ( + ConnectionTypeValues, + TrafficDataState, ResourceStatus, PricingTier, ReportedSeverity, SettingKind, - ValueType, SecuritySolutionStatus, ExportData, DataSource, RecommendationType, RecommendationConfigStatus, - UnmaskedIpLoggingStatus, SecurityFamily, AadConnectivityState, ExternalSecuritySolutionKind, @@ -263,8 +240,7 @@ AlertNotifications, AlertsToAdmins, State, - SubAssessmentStatusCode, - Severity, + ExpandValues, ConnectionType, ) @@ -272,13 +248,11 @@ 'AadConnectivityState1', 'AadExternalSecuritySolution', 'AadSolutionProperties', - 'AdditionalData', 'AdvancedThreatProtectionSetting', 'Alert', 'AlertConfidenceReason', 'AlertEntity', 'AllowedConnectionsResource', - 'AllowlistCustomAlertRule', 'AppWhitelistingGroup', 'AppWhitelistingGroups', 'AppWhitelistingIssueSummary', @@ -287,8 +261,6 @@ 'AtaExternalSecuritySolution', 'AtaSolutionProperties', 'AutoProvisioningSetting', - 'AwsResourceDetails', - 'AzureResourceDetails', 'CefExternalSecuritySolution', 'CefSolutionProperties', 'Compliance', @@ -296,14 +268,9 @@ 'ComplianceSegment', 'ConnectableResource', 'ConnectedResource', + 'ConnectedResources', 'ConnectedWorkspace', - 'ContainerRegistryVulnerabilityProperties', - 'CustomAlertRule', - 'CVE', - 'CVSS', 'DataExportSetting', - 'DenylistCustomAlertRule', - 'DeviceSecurityGroup', 'DiscoveredSecuritySolution', 'ExternalSecuritySolution', 'ExternalSecuritySolutionKind1', @@ -312,11 +279,13 @@ 'InformationProtectionPolicy', 'InformationType', 'IoTSecurityAggregatedAlert', - 'IoTSecurityAggregatedAlertPropertiesTopDevicesListItem', 'IoTSecurityAggregatedRecommendation', 'IoTSecurityAlertedDevice', + 'IoTSecurityAlertedDevicesList', 'IoTSecurityDeviceAlert', + 'IoTSecurityDeviceAlertsList', 'IoTSecurityDeviceRecommendation', + 'IoTSecurityDeviceRecommendationsList', 'IoTSecuritySolutionAnalyticsModel', 'IoTSecuritySolutionAnalyticsModelList', 'IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem', @@ -332,36 +301,33 @@ 'JitNetworkAccessRequestPort', 'JitNetworkAccessRequestVirtualMachine', 'Kind', - 'ListCustomAlertRule', 'Location', + 'NetworkData', + 'NetworkDataConnectableResource', + 'NetworkDataConnectableResourceActualTraffic', + 'NetworkDataConnectableResourceAllowedConnections', + 'NetworkDataConnectableResourceUnusedPorts', + 'NetworkDataList', 'Operation', 'OperationDisplay', 'PathRecommendation', 'Pricing', 'PricingList', - 'ProtectionMode', 'PublisherInfo', 'RecommendationConfigurationProperties', 'RegulatoryComplianceAssessment', 'RegulatoryComplianceControl', 'RegulatoryComplianceStandard', 'Resource', - 'ResourceDetails', 'SecurityContact', - 'SecuritySubAssessment', 'SecurityTask', 'SecurityTaskParameters', 'SensitivityLabel', 'ServerVulnerabilityAssessment', 'ServerVulnerabilityAssessmentsList', - 'ServerVulnerabilityProperties', 'Setting', 'SettingResource', - 'SqlServerVulnerabilityProperties', - 'SubAssessmentStatus', 'TagsResource', - 'ThresholdCustomAlertRule', - 'TimeWindowCustomAlertRule', 'TopologyResource', 'TopologySingleResource', 'TopologySingleResourceChild', @@ -369,13 +335,12 @@ 'UpdateIotSecuritySolutionData', 'UserDefinedResourcesProperties', 'UserRecommendation', - 'VendorReference', 'VmRecommendation', 'WorkspaceSetting', + 'NetworkDataPaged', 'ComplianceResultPaged', 'AlertPaged', 'SettingPaged', - 'DeviceSecurityGroupPaged', 'IoTSecuritySolutionModelPaged', 'IoTSecurityAggregatedAlertPaged', 'IoTSecurityAggregatedRecommendationPaged', @@ -395,18 +360,17 @@ 'RegulatoryComplianceStandardPaged', 'RegulatoryComplianceControlPaged', 'RegulatoryComplianceAssessmentPaged', - 'SecuritySubAssessmentPaged', + 'ConnectionTypeValues', + 'TrafficDataState', 'ResourceStatus', 'PricingTier', 'ReportedSeverity', 'SettingKind', - 'ValueType', 'SecuritySolutionStatus', 'ExportData', 'DataSource', 'RecommendationType', 'RecommendationConfigStatus', - 'UnmaskedIpLoggingStatus', 'SecurityFamily', 'AadConnectivityState', 'ExternalSecuritySolutionKind', @@ -417,7 +381,6 @@ 'AlertNotifications', 'AlertsToAdmins', 'State', - 'SubAssessmentStatusCode', - 'Severity', + 'ExpandValues', '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 efa51ccc0b7b..23ff2133f31e 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,36 +164,6 @@ 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. @@ -522,136 +492,6 @@ 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. @@ -666,11 +506,8 @@ 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', - 'None' + :param enforcement_mode: Possible values include: 'Audit', 'Enforce' :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 @@ -704,7 +541,6 @@ 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]'}, @@ -720,7 +556,6 @@ 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) @@ -773,14 +608,8 @@ def __init__(self, **kwargs): class AppWhitelistingPutGroupData(Model): """The altered data of the recommended VM/server group policy. - :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' + :param enforcement_mode: Possible values include: 'Audit', 'Enforce' :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] @@ -791,7 +620,6 @@ 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]'}, } @@ -799,7 +627,6 @@ 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) @@ -979,100 +806,6 @@ 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. @@ -1385,139 +1118,63 @@ def __init__(self, **kwargs): self.udp_ports = None -class ConnectedWorkspace(Model): - """Represents an OMS workspace to which the solution is connected. - - :param id: Azure resource ID of the connected OMS workspace - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ConnectedWorkspace, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class ContainerRegistryVulnerabilityProperties(AdditionalData): - """Additional context fields for container registry Vulnerability assessment. +class ConnectedResources(Model): + """The connections details. 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 + :ivar tcp_ports_count: The connections tcp ports count + :vartype tcp_ports_count: int + :ivar udp_ports_count: The connections udp ports count + :vartype udp_ports_count: int + :ivar tcp_ports: The connections tcp ports + :vartype tcp_ports: str + :ivar udp_ports: The connections udp ports + :vartype udp_ports: str + :ivar ports: The connections ports + :vartype ports: str """ _validation = { - 'title': {'readonly': True}, - 'link': {'readonly': True}, + 'tcp_ports_count': {'readonly': True}, + 'udp_ports_count': {'readonly': True}, + 'tcp_ports': {'readonly': True}, + 'udp_ports': {'readonly': True}, + 'ports': {'readonly': True}, } _attribute_map = { - 'title': {'key': 'title', 'type': 'str'}, - 'link': {'key': 'link', 'type': 'str'}, + 'tcp_ports_count': {'key': 'tcpPortsCount', 'type': 'int'}, + 'udp_ports_count': {'key': 'udpPortsCount', 'type': 'int'}, + 'tcp_ports': {'key': 'tcpPorts', 'type': 'str'}, + 'udp_ports': {'key': 'udpPorts', 'type': 'str'}, + 'ports': {'key': 'ports', 'type': 'str'}, } def __init__(self, **kwargs): - super(CVE, self).__init__(**kwargs) - self.title = None - self.link = None - + super(ConnectedResources, self).__init__(**kwargs) + self.tcp_ports_count = None + self.udp_ports_count = None + self.tcp_ports = None + self.udp_ports = None + self.ports = None -class CVSS(Model): - """CVSS details. - Variables are only populated by the server, and will be ignored when - sending a request. +class ConnectedWorkspace(Model): + """Represents an OMS workspace to which the solution is connected. - :ivar base: CVSS base - :vartype base: float + :param id: Azure resource ID of the connected OMS workspace + :type id: str """ - _validation = { - 'base': {'readonly': True}, - } - _attribute_map = { - 'base': {'key': 'base', 'type': 'float'}, + 'id': {'key': 'id', 'type': 'str'}, } def __init__(self, **kwargs): - super(CVSS, self).__init__(**kwargs) - self.base = None + super(ConnectedWorkspace, self).__init__(**kwargs) + self.id = kwargs.get('id', None) class SettingResource(Resource): @@ -1640,104 +1297,6 @@ 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. @@ -1943,39 +1502,36 @@ 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: Date of detection. + :ivar aggregated_date_utc: The date the incidents were detected by the + vendor :vartype aggregated_date_utc: date - :ivar vendor_name: Name of the organization that raised the alert. + :ivar vendor_name: Name of the vendor that discovered the incident :vartype vendor_name: str - :ivar reported_severity: Assessed alert severity. Possible values include: - 'Informational', 'Low', 'Medium', 'High' + :ivar reported_severity: Estimated severity of this alert. 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 suspected vulnerability and meaning. + :ivar description: Description of the incident and what it means :vartype description: str - :ivar count: Number of alerts occurrences within the aggregated time - window. + :ivar count: Occurrence number of the alert within the aggregated date :vartype count: int - :ivar effected_resource_type: Azure resource ID of the resource that - received the alerts. + :ivar effected_resource_type: Azure resource ID of the resource that got + 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: IoT Security solution alert response. + :ivar action_taken: The action that was taken as a response to the alert + (Active, Blocked etc.) :vartype action_taken: str - :ivar log_analytics_query: Log analytics query for getting the list of - affected devices/alerts. + :ivar log_analytics_query: query in log analytics to get 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 = { @@ -1994,7 +1550,6 @@ class IoTSecurityAggregatedAlert(Model): 'system_source': {'readonly': True}, 'action_taken': {'readonly': True}, 'log_analytics_query': {'readonly': True}, - 'top_devices_list': {'readonly': True}, } _attribute_map = { @@ -2014,7 +1569,6 @@ 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): @@ -2035,45 +1589,10 @@ 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): - """IoT Security solution recommendation information. + """Security Solution Recommendation Information. Variables are only populated by the server, and will be ignored when sending a request. @@ -2086,31 +1605,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 suspected vulnerability and meaning. + :ivar description: Description of the incident and what it means :vartype description: str - :ivar recommendation_type_id: Recommendation-type GUID. + :ivar recommendation_type_id: The recommendation-type GUID. :vartype recommendation_type_id: str - :ivar detected_by: Name of the organization that made the recommendation. + :ivar detected_by: Name of the vendor that discovered the issue :vartype detected_by: str :ivar remediation_steps: Recommended steps for remediation :vartype remediation_steps: str - :ivar reported_severity: Assessed recommendation severity. Possible values - include: 'Informational', 'Low', 'Medium', 'High' + :ivar reported_severity: Estimated severity of this recommendation. + Possible values include: 'Informational', 'Low', 'Medium', 'High' :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity - :ivar healthy_devices: Number of healthy devices within the IoT Security - solution. + :ivar healthy_devices: the number of the healthy devices within the + solution :vartype healthy_devices: int - :ivar unhealthy_device_count: Number of unhealthy devices within the IoT - Security solution. + :ivar unhealthy_device_count: the number of the unhealthy devices within + the solution :vartype unhealthy_device_count: int - :ivar log_analytics_query: Log analytics query for getting the list of - affected devices/alerts. + :ivar log_analytics_query: query in log analytics to get the list of + affected devices/alerts :vartype log_analytics_query: str """ @@ -2165,15 +1684,15 @@ def __init__(self, **kwargs): class IoTSecurityAlertedDevice(Model): - """Statistical information about the number of alerts per device during last - set number of days. + """Statistic information about the number of alerts per device during the last + period. Variables are only populated by the server, and will be ignored when sending a request. - :ivar device_id: Device identifier. + :ivar device_id: Name of the alert type :vartype device_id: str - :ivar alerts_count: Number of alerts raised for this device. + :ivar alerts_count: the number of alerts raised for this device :vartype alerts_count: int """ @@ -2193,20 +1712,42 @@ def __init__(self, **kwargs): self.alerts_count = None +class IoTSecurityAlertedDevicesList(Model): + """List of devices with the count of raised alerts. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. List of aggregated alerts data + :type value: list[~azure.mgmt.security.models.IoTSecurityAlertedDevice] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IoTSecurityAlertedDevice]'}, + } + + def __init__(self, **kwargs): + super(IoTSecurityAlertedDevicesList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + class IoTSecurityDeviceAlert(Model): - """Statistical information about the number of alerts per alert type during - last set number of days. + """Statistic information about the number of alerts per alert type during the + last period. 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: Assessed Alert severity. Possible values include: - 'Informational', 'Low', 'Medium', 'High' + :ivar reported_severity: Estimated severity of this alert. Possible values + include: 'Informational', 'Low', 'Medium', 'High' :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity - :ivar alerts_count: Number of alerts raised for this alert type. + :ivar alerts_count: the number of alerts raised for this alert type :vartype alerts_count: int """ @@ -2229,20 +1770,50 @@ 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): - """Statistical information about the number of recommendations per device, per + """Statistic information about the number of recommendations 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: Assessed recommendation severity. Possible values - include: 'Informational', 'Low', 'Medium', 'High' + :ivar reported_severity: Estimated severity of this recommendation. + Possible values include: 'Informational', 'Low', 'Medium', 'High' :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity - :ivar devices_count: Number of devices with this recommendation. + :ivar devices_count: the number of device with this recommendation :vartype devices_count: int """ @@ -2265,8 +1836,31 @@ 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 your IoT Security solution. + """Security Analytics of a security solution. Variables are only populated by the server, and will be ignored when sending a request. @@ -2277,25 +1871,24 @@ class IoTSecuritySolutionAnalyticsModel(Resource): :vartype name: str :ivar type: Resource type :vartype type: str - :ivar metrics: Security analytics of your IoT Security solution. + :ivar metrics: Security Analytics of a security solution :vartype metrics: ~azure.mgmt.security.models.IoTSeverityMetrics - :ivar unhealthy_device_count: Number of unhealthy devices within your IoT - Security solution. + :ivar unhealthy_device_count: number of unhealthy devices :vartype unhealthy_device_count: int - :ivar devices_metrics: List of device metrics by the aggregation date. + :ivar devices_metrics: The list of devices metrics by the aggregated date. :vartype devices_metrics: list[~azure.mgmt.security.models.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem] - :param top_alerted_devices: List of the 3 devices with the most alerts. + :param top_alerted_devices: The list of top 3 devices with the most + attacked. :type top_alerted_devices: - list[~azure.mgmt.security.models.IoTSecurityAlertedDevice] - :param most_prevalent_device_alerts: List of the 3 most prevalent device - alerts. + ~azure.mgmt.security.models.IoTSecurityAlertedDevicesList + :param most_prevalent_device_alerts: The list of most prevalent 3 alerts. :type most_prevalent_device_alerts: - list[~azure.mgmt.security.models.IoTSecurityDeviceAlert] - :param most_prevalent_device_recommendations: List of the 3 most prevalent - device recommendations. + ~azure.mgmt.security.models.IoTSecurityDeviceAlertsList + :param most_prevalent_device_recommendations: The list of most prevalent 3 + recommendations. :type most_prevalent_device_recommendations: - list[~azure.mgmt.security.models.IoTSecurityDeviceRecommendation] + ~azure.mgmt.security.models.IoTSecurityDeviceRecommendationsList """ _validation = { @@ -2314,9 +1907,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': '[IoTSecurityAlertedDevice]'}, - 'most_prevalent_device_alerts': {'key': 'properties.mostPrevalentDeviceAlerts', 'type': '[IoTSecurityDeviceAlert]'}, - 'most_prevalent_device_recommendations': {'key': 'properties.mostPrevalentDeviceRecommendations', 'type': '[IoTSecurityDeviceRecommendation]'}, + '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'}, } def __init__(self, **kwargs): @@ -2330,19 +1923,17 @@ def __init__(self, **kwargs): class IoTSecuritySolutionAnalyticsModelList(Model): - """List of Security analytics of your IoT Security solution. + """List of Security Analytics of a 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 your IoT Security - solution + :param value: Required. List of Security Analytics of a security solution :type value: list[~azure.mgmt.security.models.IoTSecuritySolutionAnalyticsModel] - :ivar next_link: When there is too much alert data for one page, use this - URI to fetch the next page. + :ivar next_link: The URI to fetch the next page. :vartype next_link: str """ @@ -2365,10 +1956,9 @@ def __init__(self, **kwargs): class IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem(Model): """IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem. - :param date_property: Aggregation of IoT Security solution device alert - metrics by date. + :param date_property: the date of the metrics :type date_property: datetime - :param devices_metrics: Device alert count by severity. + :param devices_metrics: devices alerts count by severity. :type devices_metrics: ~azure.mgmt.security.models.IoTSeverityMetrics """ @@ -2384,7 +1974,7 @@ def __init__(self, **kwargs): class IoTSecuritySolutionModel(Model): - """IoT Security solution configuration and resource information. + """Security Solution. Variables are only populated by the server, and will be ignored when sending a request. @@ -2405,10 +1995,10 @@ class IoTSecuritySolutionModel(Model): :type workspace: str :param display_name: Required. Resource display name. :type display_name: str - :param status: Status of the IoT Security solution. Possible values - include: 'Enabled', 'Disabled'. Default value: "Enabled" . + :param status: Security solution status. Possible values include: + 'Enabled', 'Disabled'. Default value: "Enabled" . :type status: str or ~azure.mgmt.security.models.SecuritySolutionStatus - :param export: List of additional options for exporting to workspace data. + :param export: List of additional export to workspace data options :type export: list[str or ~azure.mgmt.security.models.ExportData] :param disabled_data_sources: Disabled data sources. Disabling these data sources compromises the system. @@ -2425,11 +2015,6 @@ class IoTSecuritySolutionModel(Model): :param recommendations_configuration: :type recommendations_configuration: list[~azure.mgmt.security.models.RecommendationConfigurationProperties] - :param unmasked_ip_logging_status: Unmasked IP address logging status. - Possible values include: 'Disabled', 'Enabled'. Default value: "Disabled" - . - :type unmasked_ip_logging_status: str or - ~azure.mgmt.security.models.UnmaskedIpLoggingStatus """ _validation = { @@ -2457,7 +2042,6 @@ class IoTSecuritySolutionModel(Model): 'user_defined_resources': {'key': 'properties.userDefinedResources', 'type': 'UserDefinedResourcesProperties'}, 'auto_discovered_resources': {'key': 'properties.autoDiscoveredResources', 'type': '[str]'}, 'recommendations_configuration': {'key': 'properties.recommendationsConfiguration', 'type': '[RecommendationConfigurationProperties]'}, - 'unmasked_ip_logging_status': {'key': 'properties.unmaskedIpLoggingStatus', 'type': 'str'}, } def __init__(self, **kwargs): @@ -2476,17 +2060,16 @@ def __init__(self, **kwargs): self.user_defined_resources = kwargs.get('user_defined_resources', None) self.auto_discovered_resources = None self.recommendations_configuration = kwargs.get('recommendations_configuration', None) - self.unmasked_ip_logging_status = kwargs.get('unmasked_ip_logging_status', "Disabled") class IoTSeverityMetrics(Model): - """IoT Security solution analytics severity metrics. + """Severity metrics. - :param high: Count of high severity alerts/recommendations. + :param high: count of high severity items :type high: int - :param medium: Count of medium severity alerts/recommendations. + :param medium: count of medium severity items :type medium: int - :param low: Count of low severity alerts/recommendations. + :param low: count of low severity items :type low: int """ @@ -2606,8 +2189,6 @@ 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 = { @@ -2616,13 +2197,11 @@ 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): @@ -2745,8 +2324,6 @@ 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 = { @@ -2759,7 +2336,6 @@ 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): @@ -2767,7 +2343,6 @@ 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): @@ -2894,6 +2469,217 @@ def __init__(self, **kwargs): self.location = None +class NetworkData(Resource): + """Network data 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 + :param connectable_resources: + :type connectable_resources: + list[~azure.mgmt.security.models.NetworkDataConnectableResource] + """ + + _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'}, + 'connectable_resources': {'key': 'properties.connectableResources', 'type': '[NetworkDataConnectableResource]'}, + } + + def __init__(self, **kwargs): + super(NetworkData, self).__init__(**kwargs) + self.connectable_resources = kwargs.get('connectable_resources', None) + + +class NetworkDataConnectableResource(Model): + """Describes the allowed inbound and outbound traffic of an Azure resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar connectable_resource_id: The connectable resource id + :vartype connectable_resource_id: str + :param connection_type: The connection type between the extension resource + to the connectable resource Id. Possible values include: 'Azure VM' + :type connection_type: str or + ~azure.mgmt.security.models.ConnectionTypeValues + :ivar allowed_connections: The allowed connections details + :vartype allowed_connections: + ~azure.mgmt.security.models.NetworkDataConnectableResourceAllowedConnections + :ivar actual_traffic: The actual traffic details + :vartype actual_traffic: + ~azure.mgmt.security.models.NetworkDataConnectableResourceActualTraffic + :ivar unused_ports: The unused ports details + :vartype unused_ports: + ~azure.mgmt.security.models.NetworkDataConnectableResourceUnusedPorts + """ + + _validation = { + 'connectable_resource_id': {'readonly': True}, + 'allowed_connections': {'readonly': True}, + 'actual_traffic': {'readonly': True}, + 'unused_ports': {'readonly': True}, + } + + _attribute_map = { + 'connectable_resource_id': {'key': 'connectableResourceId', 'type': 'str'}, + 'connection_type': {'key': 'connectionType', 'type': 'str'}, + 'allowed_connections': {'key': 'allowedConnections', 'type': 'NetworkDataConnectableResourceAllowedConnections'}, + 'actual_traffic': {'key': 'actualTraffic', 'type': 'NetworkDataConnectableResourceActualTraffic'}, + 'unused_ports': {'key': 'unusedPorts', 'type': 'NetworkDataConnectableResourceUnusedPorts'}, + } + + def __init__(self, **kwargs): + super(NetworkDataConnectableResource, self).__init__(**kwargs) + self.connectable_resource_id = None + self.connection_type = kwargs.get('connection_type', None) + self.allowed_connections = None + self.actual_traffic = None + self.unused_ports = None + + +class NetworkDataConnectableResourceActualTraffic(Model): + """The actual traffic details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar start_time: The UTC start time of the actual traffic time range + :vartype start_time: datetime + :ivar end_time: The UTC end time of the actual traffic time range + :vartype end_time: datetime + :param traffic_data_state: Indicate whether the network traffic data is + collected on the Azure resource. Possible values include: 'Available', + 'Not available' + :type traffic_data_state: str or + ~azure.mgmt.security.models.TrafficDataState + :param inbound_connected_resources: + :type inbound_connected_resources: + ~azure.mgmt.security.models.ConnectedResources + :param outbound_connected_resources: + :type outbound_connected_resources: + ~azure.mgmt.security.models.ConnectedResources + """ + + _validation = { + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'traffic_data_state': {'key': 'trafficDataState', 'type': 'str'}, + 'inbound_connected_resources': {'key': 'inboundConnectedResources', 'type': 'ConnectedResources'}, + 'outbound_connected_resources': {'key': 'outboundConnectedResources', 'type': 'ConnectedResources'}, + } + + def __init__(self, **kwargs): + super(NetworkDataConnectableResourceActualTraffic, self).__init__(**kwargs) + self.start_time = None + self.end_time = None + self.traffic_data_state = kwargs.get('traffic_data_state', None) + self.inbound_connected_resources = kwargs.get('inbound_connected_resources', None) + self.outbound_connected_resources = kwargs.get('outbound_connected_resources', None) + + +class NetworkDataConnectableResourceAllowedConnections(Model): + """The allowed connections details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar calculated_date_time: The UTC time on which the allowed connections + was calculated + :vartype calculated_date_time: datetime + :param inbound_connected_resources: + :type inbound_connected_resources: + ~azure.mgmt.security.models.ConnectedResources + :param outbound_connected_resources: + :type outbound_connected_resources: + ~azure.mgmt.security.models.ConnectedResources + """ + + _validation = { + 'calculated_date_time': {'readonly': True}, + } + + _attribute_map = { + 'calculated_date_time': {'key': 'calculatedDateTime', 'type': 'iso-8601'}, + 'inbound_connected_resources': {'key': 'inboundConnectedResources', 'type': 'ConnectedResources'}, + 'outbound_connected_resources': {'key': 'outboundConnectedResources', 'type': 'ConnectedResources'}, + } + + def __init__(self, **kwargs): + super(NetworkDataConnectableResourceAllowedConnections, self).__init__(**kwargs) + self.calculated_date_time = None + self.inbound_connected_resources = kwargs.get('inbound_connected_resources', None) + self.outbound_connected_resources = kwargs.get('outbound_connected_resources', None) + + +class NetworkDataConnectableResourceUnusedPorts(Model): + """The unused ports details. + + :param inbound_connected_resources: + :type inbound_connected_resources: + ~azure.mgmt.security.models.ConnectedResources + :param outbound_connected_resources: + :type outbound_connected_resources: + ~azure.mgmt.security.models.ConnectedResources + """ + + _attribute_map = { + 'inbound_connected_resources': {'key': 'inboundConnectedResources', 'type': 'ConnectedResources'}, + 'outbound_connected_resources': {'key': 'outboundConnectedResources', 'type': 'ConnectedResources'}, + } + + def __init__(self, **kwargs): + super(NetworkDataConnectableResourceUnusedPorts, self).__init__(**kwargs) + self.inbound_connected_resources = kwargs.get('inbound_connected_resources', None) + self.outbound_connected_resources = kwargs.get('outbound_connected_resources', None) + + +class NetworkDataList(Model): + """List of network data. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: + :vartype value: list[~azure.mgmt.security.models.NetworkData] + :ivar next_link: The URI to fetch the next page. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkData]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NetworkDataList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + class Operation(Model): """Possible operation in the REST API of Microsoft.Security. @@ -3088,35 +2874,6 @@ 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. @@ -3151,15 +2908,15 @@ def __init__(self, **kwargs): class RecommendationConfigurationProperties(Model): - """The type of IoT Security recommendation. + """Recommendation configuration. 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 type of IoT Security - recommendation. Possible values include: 'IoT_ACRAuthentication', + :param recommendation_type: Required. The recommendation type. Possible + values include: 'IoT_ACRAuthentication', 'IoT_AgentSendsUnutilizedMessages', 'IoT_Baseline', 'IoT_EdgeHubMemOptimize', 'IoT_EdgeLoggingOptions', 'IoT_InconsistentModuleSettings', 'IoT_InstallAgent', @@ -3171,9 +2928,9 @@ class RecommendationConfigurationProperties(Model): ~azure.mgmt.security.models.RecommendationType :ivar name: :vartype name: str - :param status: Required. Recommendation status. When the recommendation - status is disabled recommendations are not generated. Possible values - include: 'Disabled', 'Enabled'. Default value: "Enabled" . + :param status: Required. Recommendation status. The recommendation is not + generated when the status is disabled. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . :type status: str or ~azure.mgmt.security.models.RecommendationConfigStatus """ @@ -3448,83 +3205,6 @@ 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. @@ -3688,145 +3368,6 @@ 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. @@ -3844,103 +3385,6 @@ 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. @@ -4119,8 +3563,8 @@ class UpdateIotSecuritySolutionData(TagsResource): _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, - 'user_defined_resources': {'key': 'properties.userDefinedResources', 'type': 'UserDefinedResourcesProperties'}, - 'recommendations_configuration': {'key': 'properties.recommendationsConfiguration', 'type': '[RecommendationConfigurationProperties]'}, + 'user_defined_resources': {'key': 'userDefinedResources', 'type': 'UserDefinedResourcesProperties'}, + 'recommendations_configuration': {'key': 'recommendationsConfiguration', 'type': '[RecommendationConfigurationProperties]'}, } def __init__(self, **kwargs): @@ -4130,7 +3574,7 @@ def __init__(self, **kwargs): class UserDefinedResourcesProperties(Model): - """Properties of the IoT Security solution's user defined resources. + """Properties of the solution's user defined resources. All required parameters must be populated in order to send to Azure. @@ -4181,34 +3625,6 @@ 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 67e9f418a4cd..acd57706f731 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,36 +164,6 @@ 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. @@ -522,136 +492,6 @@ 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. @@ -666,11 +506,8 @@ 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', - 'None' + :param enforcement_mode: Possible values include: 'Audit', 'Enforce' :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 @@ -704,7 +541,6 @@ 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]'}, @@ -713,14 +549,13 @@ class AppWhitelistingGroup(Model): 'path_recommendations': {'key': 'properties.pathRecommendations', 'type': '[PathRecommendation]'}, } - 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: + 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: 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 @@ -773,14 +608,8 @@ 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: The enforcement mode of the group. Can also be - defined per collection type by using ProtectionMode. Possible values - include: 'Audit', 'Enforce', 'None' + :param enforcement_mode: Possible values include: 'Audit', 'Enforce' :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] @@ -791,15 +620,13 @@ 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, protection_mode=None, vm_recommendations=None, path_recommendations=None, **kwargs) -> None: + def __init__(self, *, enforcement_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 @@ -979,100 +806,6 @@ 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. @@ -1385,139 +1118,63 @@ def __init__(self, **kwargs) -> None: self.udp_ports = None -class ConnectedWorkspace(Model): - """Represents an OMS workspace to which the solution is connected. - - :param id: Azure resource ID of the connected OMS workspace - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, *, id: str=None, **kwargs) -> None: - super(ConnectedWorkspace, self).__init__(**kwargs) - 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. +class ConnectedResources(Model): + """The connections 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 + :ivar tcp_ports_count: The connections tcp ports count + :vartype tcp_ports_count: int + :ivar udp_ports_count: The connections udp ports count + :vartype udp_ports_count: int + :ivar tcp_ports: The connections tcp ports + :vartype tcp_ports: str + :ivar udp_ports: The connections udp ports + :vartype udp_ports: str + :ivar ports: The connections ports + :vartype ports: str """ _validation = { - 'title': {'readonly': True}, - 'link': {'readonly': True}, + 'tcp_ports_count': {'readonly': True}, + 'udp_ports_count': {'readonly': True}, + 'tcp_ports': {'readonly': True}, + 'udp_ports': {'readonly': True}, + 'ports': {'readonly': True}, } _attribute_map = { - 'title': {'key': 'title', 'type': 'str'}, - 'link': {'key': 'link', 'type': 'str'}, + 'tcp_ports_count': {'key': 'tcpPortsCount', 'type': 'int'}, + 'udp_ports_count': {'key': 'udpPortsCount', 'type': 'int'}, + 'tcp_ports': {'key': 'tcpPorts', 'type': 'str'}, + 'udp_ports': {'key': 'udpPorts', 'type': 'str'}, + 'ports': {'key': 'ports', 'type': 'str'}, } def __init__(self, **kwargs) -> None: - super(CVE, self).__init__(**kwargs) - self.title = None - self.link = None - + super(ConnectedResources, self).__init__(**kwargs) + self.tcp_ports_count = None + self.udp_ports_count = None + self.tcp_ports = None + self.udp_ports = None + self.ports = None -class CVSS(Model): - """CVSS details. - Variables are only populated by the server, and will be ignored when - sending a request. +class ConnectedWorkspace(Model): + """Represents an OMS workspace to which the solution is connected. - :ivar base: CVSS base - :vartype base: float + :param id: Azure resource ID of the connected OMS workspace + :type id: str """ - _validation = { - 'base': {'readonly': True}, - } - _attribute_map = { - 'base': {'key': 'base', 'type': 'float'}, + 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: - super(CVSS, self).__init__(**kwargs) - self.base = None + def __init__(self, *, id: str=None, **kwargs) -> None: + super(ConnectedWorkspace, self).__init__(**kwargs) + self.id = id class SettingResource(Resource): @@ -1640,104 +1297,6 @@ 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. @@ -1943,39 +1502,36 @@ 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: Date of detection. + :ivar aggregated_date_utc: The date the incidents were detected by the + vendor :vartype aggregated_date_utc: date - :ivar vendor_name: Name of the organization that raised the alert. + :ivar vendor_name: Name of the vendor that discovered the incident :vartype vendor_name: str - :ivar reported_severity: Assessed alert severity. Possible values include: - 'Informational', 'Low', 'Medium', 'High' + :ivar reported_severity: Estimated severity of this alert. 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 suspected vulnerability and meaning. + :ivar description: Description of the incident and what it means :vartype description: str - :ivar count: Number of alerts occurrences within the aggregated time - window. + :ivar count: Occurrence number of the alert within the aggregated date :vartype count: int - :ivar effected_resource_type: Azure resource ID of the resource that - received the alerts. + :ivar effected_resource_type: Azure resource ID of the resource that got + 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: IoT Security solution alert response. - :vartype action_taken: str - :ivar log_analytics_query: Log analytics query for getting the list of - affected devices/alerts. + :ivar action_taken: The action that was taken as a response to the alert + (Active, Blocked etc.) + :vartype action_taken: str + :ivar log_analytics_query: query in log analytics to get 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 = { @@ -1994,7 +1550,6 @@ class IoTSecurityAggregatedAlert(Model): 'system_source': {'readonly': True}, 'action_taken': {'readonly': True}, 'log_analytics_query': {'readonly': True}, - 'top_devices_list': {'readonly': True}, } _attribute_map = { @@ -2014,7 +1569,6 @@ 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: @@ -2035,45 +1589,10 @@ 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): - """IoT Security solution recommendation information. + """Security Solution Recommendation Information. Variables are only populated by the server, and will be ignored when sending a request. @@ -2086,31 +1605,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 suspected vulnerability and meaning. + :ivar description: Description of the incident and what it means :vartype description: str - :ivar recommendation_type_id: Recommendation-type GUID. + :ivar recommendation_type_id: The recommendation-type GUID. :vartype recommendation_type_id: str - :ivar detected_by: Name of the organization that made the recommendation. + :ivar detected_by: Name of the vendor that discovered the issue :vartype detected_by: str :ivar remediation_steps: Recommended steps for remediation :vartype remediation_steps: str - :ivar reported_severity: Assessed recommendation severity. Possible values - include: 'Informational', 'Low', 'Medium', 'High' + :ivar reported_severity: Estimated severity of this recommendation. + Possible values include: 'Informational', 'Low', 'Medium', 'High' :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity - :ivar healthy_devices: Number of healthy devices within the IoT Security - solution. + :ivar healthy_devices: the number of the healthy devices within the + solution :vartype healthy_devices: int - :ivar unhealthy_device_count: Number of unhealthy devices within the IoT - Security solution. + :ivar unhealthy_device_count: the number of the unhealthy devices within + the solution :vartype unhealthy_device_count: int - :ivar log_analytics_query: Log analytics query for getting the list of - affected devices/alerts. + :ivar log_analytics_query: query in log analytics to get the list of + affected devices/alerts :vartype log_analytics_query: str """ @@ -2165,15 +1684,15 @@ def __init__(self, *, tags=None, recommendation_name: str=None, **kwargs) -> Non class IoTSecurityAlertedDevice(Model): - """Statistical information about the number of alerts per device during last - set number of days. + """Statistic information about the number of alerts per device during the last + period. Variables are only populated by the server, and will be ignored when sending a request. - :ivar device_id: Device identifier. + :ivar device_id: Name of the alert type :vartype device_id: str - :ivar alerts_count: Number of alerts raised for this device. + :ivar alerts_count: the number of alerts raised for this device :vartype alerts_count: int """ @@ -2193,20 +1712,42 @@ def __init__(self, **kwargs) -> None: self.alerts_count = None +class IoTSecurityAlertedDevicesList(Model): + """List of devices with the count of raised alerts. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. List of aggregated alerts data + :type value: list[~azure.mgmt.security.models.IoTSecurityAlertedDevice] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IoTSecurityAlertedDevice]'}, + } + + def __init__(self, *, value, **kwargs) -> None: + super(IoTSecurityAlertedDevicesList, self).__init__(**kwargs) + self.value = value + + class IoTSecurityDeviceAlert(Model): - """Statistical information about the number of alerts per alert type during - last set number of days. + """Statistic information about the number of alerts per alert type during the + last period. 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: Assessed Alert severity. Possible values include: - 'Informational', 'Low', 'Medium', 'High' + :ivar reported_severity: Estimated severity of this alert. Possible values + include: 'Informational', 'Low', 'Medium', 'High' :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity - :ivar alerts_count: Number of alerts raised for this alert type. + :ivar alerts_count: the number of alerts raised for this alert type :vartype alerts_count: int """ @@ -2229,20 +1770,50 @@ 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): - """Statistical information about the number of recommendations per device, per + """Statistic information about the number of recommendations 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: Assessed recommendation severity. Possible values - include: 'Informational', 'Low', 'Medium', 'High' + :ivar reported_severity: Estimated severity of this recommendation. + Possible values include: 'Informational', 'Low', 'Medium', 'High' :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity - :ivar devices_count: Number of devices with this recommendation. + :ivar devices_count: the number of device with this recommendation :vartype devices_count: int """ @@ -2265,8 +1836,31 @@ 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 your IoT Security solution. + """Security Analytics of a security solution. Variables are only populated by the server, and will be ignored when sending a request. @@ -2277,25 +1871,24 @@ class IoTSecuritySolutionAnalyticsModel(Resource): :vartype name: str :ivar type: Resource type :vartype type: str - :ivar metrics: Security analytics of your IoT Security solution. + :ivar metrics: Security Analytics of a security solution :vartype metrics: ~azure.mgmt.security.models.IoTSeverityMetrics - :ivar unhealthy_device_count: Number of unhealthy devices within your IoT - Security solution. + :ivar unhealthy_device_count: number of unhealthy devices :vartype unhealthy_device_count: int - :ivar devices_metrics: List of device metrics by the aggregation date. + :ivar devices_metrics: The list of devices metrics by the aggregated date. :vartype devices_metrics: list[~azure.mgmt.security.models.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem] - :param top_alerted_devices: List of the 3 devices with the most alerts. + :param top_alerted_devices: The list of top 3 devices with the most + attacked. :type top_alerted_devices: - list[~azure.mgmt.security.models.IoTSecurityAlertedDevice] - :param most_prevalent_device_alerts: List of the 3 most prevalent device - alerts. + ~azure.mgmt.security.models.IoTSecurityAlertedDevicesList + :param most_prevalent_device_alerts: The list of most prevalent 3 alerts. :type most_prevalent_device_alerts: - list[~azure.mgmt.security.models.IoTSecurityDeviceAlert] - :param most_prevalent_device_recommendations: List of the 3 most prevalent - device recommendations. + ~azure.mgmt.security.models.IoTSecurityDeviceAlertsList + :param most_prevalent_device_recommendations: The list of most prevalent 3 + recommendations. :type most_prevalent_device_recommendations: - list[~azure.mgmt.security.models.IoTSecurityDeviceRecommendation] + ~azure.mgmt.security.models.IoTSecurityDeviceRecommendationsList """ _validation = { @@ -2314,9 +1907,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': '[IoTSecurityAlertedDevice]'}, - 'most_prevalent_device_alerts': {'key': 'properties.mostPrevalentDeviceAlerts', 'type': '[IoTSecurityDeviceAlert]'}, - 'most_prevalent_device_recommendations': {'key': 'properties.mostPrevalentDeviceRecommendations', 'type': '[IoTSecurityDeviceRecommendation]'}, + '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'}, } def __init__(self, *, top_alerted_devices=None, most_prevalent_device_alerts=None, most_prevalent_device_recommendations=None, **kwargs) -> None: @@ -2330,19 +1923,17 @@ def __init__(self, *, top_alerted_devices=None, most_prevalent_device_alerts=Non class IoTSecuritySolutionAnalyticsModelList(Model): - """List of Security analytics of your IoT Security solution. + """List of Security Analytics of a 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 your IoT Security - solution + :param value: Required. List of Security Analytics of a security solution :type value: list[~azure.mgmt.security.models.IoTSecuritySolutionAnalyticsModel] - :ivar next_link: When there is too much alert data for one page, use this - URI to fetch the next page. + :ivar next_link: The URI to fetch the next page. :vartype next_link: str """ @@ -2365,10 +1956,9 @@ def __init__(self, *, value, **kwargs) -> None: class IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem(Model): """IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem. - :param date_property: Aggregation of IoT Security solution device alert - metrics by date. + :param date_property: the date of the metrics :type date_property: datetime - :param devices_metrics: Device alert count by severity. + :param devices_metrics: devices alerts count by severity. :type devices_metrics: ~azure.mgmt.security.models.IoTSeverityMetrics """ @@ -2384,7 +1974,7 @@ def __init__(self, *, date_property=None, devices_metrics=None, **kwargs) -> Non class IoTSecuritySolutionModel(Model): - """IoT Security solution configuration and resource information. + """Security Solution. Variables are only populated by the server, and will be ignored when sending a request. @@ -2405,10 +1995,10 @@ class IoTSecuritySolutionModel(Model): :type workspace: str :param display_name: Required. Resource display name. :type display_name: str - :param status: Status of the IoT Security solution. Possible values - include: 'Enabled', 'Disabled'. Default value: "Enabled" . + :param status: Security solution status. Possible values include: + 'Enabled', 'Disabled'. Default value: "Enabled" . :type status: str or ~azure.mgmt.security.models.SecuritySolutionStatus - :param export: List of additional options for exporting to workspace data. + :param export: List of additional export to workspace data options :type export: list[str or ~azure.mgmt.security.models.ExportData] :param disabled_data_sources: Disabled data sources. Disabling these data sources compromises the system. @@ -2425,11 +2015,6 @@ class IoTSecuritySolutionModel(Model): :param recommendations_configuration: :type recommendations_configuration: list[~azure.mgmt.security.models.RecommendationConfigurationProperties] - :param unmasked_ip_logging_status: Unmasked IP address logging status. - Possible values include: 'Disabled', 'Enabled'. Default value: "Disabled" - . - :type unmasked_ip_logging_status: str or - ~azure.mgmt.security.models.UnmaskedIpLoggingStatus """ _validation = { @@ -2457,10 +2042,9 @@ class IoTSecuritySolutionModel(Model): 'user_defined_resources': {'key': 'properties.userDefinedResources', 'type': 'UserDefinedResourcesProperties'}, 'auto_discovered_resources': {'key': 'properties.autoDiscoveredResources', 'type': '[str]'}, 'recommendations_configuration': {'key': 'properties.recommendationsConfiguration', 'type': '[RecommendationConfigurationProperties]'}, - 'unmasked_ip_logging_status': {'key': 'properties.unmaskedIpLoggingStatus', 'type': 'str'}, } - def __init__(self, *, workspace: str, display_name: str, iot_hubs, tags=None, location: str=None, status="Enabled", export=None, disabled_data_sources=None, user_defined_resources=None, recommendations_configuration=None, unmasked_ip_logging_status="Disabled", **kwargs) -> None: + def __init__(self, *, workspace: str, display_name: str, iot_hubs, tags=None, location: str=None, status="Enabled", export=None, disabled_data_sources=None, user_defined_resources=None, recommendations_configuration=None, **kwargs) -> None: super(IoTSecuritySolutionModel, self).__init__(**kwargs) self.id = None self.name = None @@ -2476,17 +2060,16 @@ def __init__(self, *, workspace: str, display_name: str, iot_hubs, tags=None, lo self.user_defined_resources = user_defined_resources self.auto_discovered_resources = None self.recommendations_configuration = recommendations_configuration - self.unmasked_ip_logging_status = unmasked_ip_logging_status class IoTSeverityMetrics(Model): - """IoT Security solution analytics severity metrics. + """Severity metrics. - :param high: Count of high severity alerts/recommendations. + :param high: count of high severity items :type high: int - :param medium: Count of medium severity alerts/recommendations. + :param medium: count of medium severity items :type medium: int - :param low: Count of low severity alerts/recommendations. + :param low: count of low severity items :type low: int """ @@ -2606,8 +2189,6 @@ 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 = { @@ -2616,13 +2197,11 @@ class JitNetworkAccessPolicyInitiateRequest(Model): _attribute_map = { 'virtual_machines': {'key': 'virtualMachines', 'type': '[JitNetworkAccessPolicyInitiateVirtualMachine]'}, - 'justification': {'key': 'justification', 'type': 'str'}, } - def __init__(self, *, virtual_machines, justification: str=None, **kwargs) -> None: + def __init__(self, *, virtual_machines, **kwargs) -> None: super(JitNetworkAccessPolicyInitiateRequest, self).__init__(**kwargs) self.virtual_machines = virtual_machines - self.justification = justification class JitNetworkAccessPolicyInitiateVirtualMachine(Model): @@ -2745,8 +2324,6 @@ 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 = { @@ -2759,15 +2336,13 @@ 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, justification: str=None, **kwargs) -> None: + def __init__(self, *, virtual_machines, start_time_utc, requestor: str, **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): @@ -2894,6 +2469,217 @@ def __init__(self, **kwargs) -> None: self.location = None +class NetworkData(Resource): + """Network data 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 + :param connectable_resources: + :type connectable_resources: + list[~azure.mgmt.security.models.NetworkDataConnectableResource] + """ + + _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'}, + 'connectable_resources': {'key': 'properties.connectableResources', 'type': '[NetworkDataConnectableResource]'}, + } + + def __init__(self, *, connectable_resources=None, **kwargs) -> None: + super(NetworkData, self).__init__(**kwargs) + self.connectable_resources = connectable_resources + + +class NetworkDataConnectableResource(Model): + """Describes the allowed inbound and outbound traffic of an Azure resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar connectable_resource_id: The connectable resource id + :vartype connectable_resource_id: str + :param connection_type: The connection type between the extension resource + to the connectable resource Id. Possible values include: 'Azure VM' + :type connection_type: str or + ~azure.mgmt.security.models.ConnectionTypeValues + :ivar allowed_connections: The allowed connections details + :vartype allowed_connections: + ~azure.mgmt.security.models.NetworkDataConnectableResourceAllowedConnections + :ivar actual_traffic: The actual traffic details + :vartype actual_traffic: + ~azure.mgmt.security.models.NetworkDataConnectableResourceActualTraffic + :ivar unused_ports: The unused ports details + :vartype unused_ports: + ~azure.mgmt.security.models.NetworkDataConnectableResourceUnusedPorts + """ + + _validation = { + 'connectable_resource_id': {'readonly': True}, + 'allowed_connections': {'readonly': True}, + 'actual_traffic': {'readonly': True}, + 'unused_ports': {'readonly': True}, + } + + _attribute_map = { + 'connectable_resource_id': {'key': 'connectableResourceId', 'type': 'str'}, + 'connection_type': {'key': 'connectionType', 'type': 'str'}, + 'allowed_connections': {'key': 'allowedConnections', 'type': 'NetworkDataConnectableResourceAllowedConnections'}, + 'actual_traffic': {'key': 'actualTraffic', 'type': 'NetworkDataConnectableResourceActualTraffic'}, + 'unused_ports': {'key': 'unusedPorts', 'type': 'NetworkDataConnectableResourceUnusedPorts'}, + } + + def __init__(self, *, connection_type=None, **kwargs) -> None: + super(NetworkDataConnectableResource, self).__init__(**kwargs) + self.connectable_resource_id = None + self.connection_type = connection_type + self.allowed_connections = None + self.actual_traffic = None + self.unused_ports = None + + +class NetworkDataConnectableResourceActualTraffic(Model): + """The actual traffic details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar start_time: The UTC start time of the actual traffic time range + :vartype start_time: datetime + :ivar end_time: The UTC end time of the actual traffic time range + :vartype end_time: datetime + :param traffic_data_state: Indicate whether the network traffic data is + collected on the Azure resource. Possible values include: 'Available', + 'Not available' + :type traffic_data_state: str or + ~azure.mgmt.security.models.TrafficDataState + :param inbound_connected_resources: + :type inbound_connected_resources: + ~azure.mgmt.security.models.ConnectedResources + :param outbound_connected_resources: + :type outbound_connected_resources: + ~azure.mgmt.security.models.ConnectedResources + """ + + _validation = { + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'traffic_data_state': {'key': 'trafficDataState', 'type': 'str'}, + 'inbound_connected_resources': {'key': 'inboundConnectedResources', 'type': 'ConnectedResources'}, + 'outbound_connected_resources': {'key': 'outboundConnectedResources', 'type': 'ConnectedResources'}, + } + + def __init__(self, *, traffic_data_state=None, inbound_connected_resources=None, outbound_connected_resources=None, **kwargs) -> None: + super(NetworkDataConnectableResourceActualTraffic, self).__init__(**kwargs) + self.start_time = None + self.end_time = None + self.traffic_data_state = traffic_data_state + self.inbound_connected_resources = inbound_connected_resources + self.outbound_connected_resources = outbound_connected_resources + + +class NetworkDataConnectableResourceAllowedConnections(Model): + """The allowed connections details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar calculated_date_time: The UTC time on which the allowed connections + was calculated + :vartype calculated_date_time: datetime + :param inbound_connected_resources: + :type inbound_connected_resources: + ~azure.mgmt.security.models.ConnectedResources + :param outbound_connected_resources: + :type outbound_connected_resources: + ~azure.mgmt.security.models.ConnectedResources + """ + + _validation = { + 'calculated_date_time': {'readonly': True}, + } + + _attribute_map = { + 'calculated_date_time': {'key': 'calculatedDateTime', 'type': 'iso-8601'}, + 'inbound_connected_resources': {'key': 'inboundConnectedResources', 'type': 'ConnectedResources'}, + 'outbound_connected_resources': {'key': 'outboundConnectedResources', 'type': 'ConnectedResources'}, + } + + def __init__(self, *, inbound_connected_resources=None, outbound_connected_resources=None, **kwargs) -> None: + super(NetworkDataConnectableResourceAllowedConnections, self).__init__(**kwargs) + self.calculated_date_time = None + self.inbound_connected_resources = inbound_connected_resources + self.outbound_connected_resources = outbound_connected_resources + + +class NetworkDataConnectableResourceUnusedPorts(Model): + """The unused ports details. + + :param inbound_connected_resources: + :type inbound_connected_resources: + ~azure.mgmt.security.models.ConnectedResources + :param outbound_connected_resources: + :type outbound_connected_resources: + ~azure.mgmt.security.models.ConnectedResources + """ + + _attribute_map = { + 'inbound_connected_resources': {'key': 'inboundConnectedResources', 'type': 'ConnectedResources'}, + 'outbound_connected_resources': {'key': 'outboundConnectedResources', 'type': 'ConnectedResources'}, + } + + def __init__(self, *, inbound_connected_resources=None, outbound_connected_resources=None, **kwargs) -> None: + super(NetworkDataConnectableResourceUnusedPorts, self).__init__(**kwargs) + self.inbound_connected_resources = inbound_connected_resources + self.outbound_connected_resources = outbound_connected_resources + + +class NetworkDataList(Model): + """List of network data. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: + :vartype value: list[~azure.mgmt.security.models.NetworkData] + :ivar next_link: The URI to fetch the next page. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkData]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(NetworkDataList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + class Operation(Model): """Possible operation in the REST API of Microsoft.Security. @@ -3088,35 +2874,6 @@ 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. @@ -3151,15 +2908,15 @@ def __init__(self, *, publisher_name: str=None, product_name: str=None, binary_n class RecommendationConfigurationProperties(Model): - """The type of IoT Security recommendation. + """Recommendation configuration. 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 type of IoT Security - recommendation. Possible values include: 'IoT_ACRAuthentication', + :param recommendation_type: Required. The recommendation type. Possible + values include: 'IoT_ACRAuthentication', 'IoT_AgentSendsUnutilizedMessages', 'IoT_Baseline', 'IoT_EdgeHubMemOptimize', 'IoT_EdgeLoggingOptions', 'IoT_InconsistentModuleSettings', 'IoT_InstallAgent', @@ -3171,9 +2928,9 @@ class RecommendationConfigurationProperties(Model): ~azure.mgmt.security.models.RecommendationType :ivar name: :vartype name: str - :param status: Required. Recommendation status. When the recommendation - status is disabled recommendations are not generated. Possible values - include: 'Disabled', 'Enabled'. Default value: "Enabled" . + :param status: Required. Recommendation status. The recommendation is not + generated when the status is disabled. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . :type status: str or ~azure.mgmt.security.models.RecommendationConfigStatus """ @@ -3448,83 +3205,6 @@ 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. @@ -3688,145 +3368,6 @@ 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. @@ -3844,103 +3385,6 @@ 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. @@ -4119,8 +3563,8 @@ class UpdateIotSecuritySolutionData(TagsResource): _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, - 'user_defined_resources': {'key': 'properties.userDefinedResources', 'type': 'UserDefinedResourcesProperties'}, - 'recommendations_configuration': {'key': 'properties.recommendationsConfiguration', 'type': '[RecommendationConfigurationProperties]'}, + 'user_defined_resources': {'key': 'userDefinedResources', 'type': 'UserDefinedResourcesProperties'}, + 'recommendations_configuration': {'key': 'recommendationsConfiguration', 'type': '[RecommendationConfigurationProperties]'}, } def __init__(self, *, tags=None, user_defined_resources=None, recommendations_configuration=None, **kwargs) -> None: @@ -4130,7 +3574,7 @@ def __init__(self, *, tags=None, user_defined_resources=None, recommendations_co class UserDefinedResourcesProperties(Model): - """Properties of the IoT Security solution's user defined resources. + """Properties of the solution's user defined resources. All required parameters must be populated in order to send to Azure. @@ -4181,34 +3625,6 @@ 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 670bbb1a5813..bbf28162c5ea 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 @@ -12,6 +12,19 @@ from msrest.paging import Paged +class NetworkDataPaged(Paged): + """ + A paging container for iterating over a list of :class:`NetworkData ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[NetworkData]'} + } + + def __init__(self, *args, **kwargs): + + super(NetworkDataPaged, self).__init__(*args, **kwargs) class ComplianceResultPaged(Paged): """ A paging container for iterating over a list of :class:`ComplianceResult ` object @@ -51,19 +64,6 @@ 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 @@ -311,16 +311,3 @@ 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) 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 8679f192cc6c..7784d8a1c677 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 @@ -12,6 +12,17 @@ from enum import Enum +class ConnectionTypeValues(str, Enum): + + azure_vm = "Azure VM" + + +class TrafficDataState(str, Enum): + + available = "Available" #: The network traffic data is collected on the Azure resource + notavailable = "Not available" #: the network traffic data is not collected on the Azure resource + + class ResourceStatus(str, Enum): healthy = "Healthy" #: This assessment on the resource is healthy @@ -40,12 +51,6 @@ 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" @@ -88,12 +93,6 @@ class RecommendationConfigStatus(str, Enum): enabled = "Enabled" -class UnmaskedIpLoggingStatus(str, Enum): - - disabled = "Disabled" #: Unmasked IP logging is disabled - enabled = "Enabled" #: Unmasked IP logging is enabled - - class SecurityFamily(str, Enum): waf = "Waf" @@ -162,18 +161,10 @@ 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 ExpandValues(str, Enum): -class Severity(str, Enum): - - low = "Low" - medium = "Medium" - high = "High" + true = "true" #: Get the expand network data object - more information about the network data (ports and connections details) + false = "false" #: Get the slim network data object class ConnectionType(str, Enum): 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 9fa27d57ef23..04e7ff825320 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 @@ -9,15 +9,19 @@ # regenerated. # -------------------------------------------------------------------------- +from ._network_data_operations import NetworkDataOperations from ._compliance_results_operations import ComplianceResultsOperations from ._pricings_operations import PricingsOperations from ._alerts_operations import AlertsOperations from ._settings_operations import SettingsOperations -from ._device_security_groups_operations import DeviceSecurityGroupsOperations +from ._io_tsecurity_solutions_operations import IoTSecuritySolutionsOperations +from ._io_tsecurity_solutions_resource_group_operations import IoTSecuritySolutionsResourceGroupOperations from ._iot_security_solution_operations import IotSecuritySolutionOperations -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 ._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 ._allowed_connections_operations import AllowedConnectionsOperations from ._discovered_security_solutions_operations import DiscoveredSecuritySolutionsOperations from ._external_security_solutions_operations import ExternalSecuritySolutionsOperations @@ -37,18 +41,21 @@ 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 __all__ = [ + 'NetworkDataOperations', 'ComplianceResultsOperations', 'PricingsOperations', 'AlertsOperations', 'SettingsOperations', - 'DeviceSecurityGroupsOperations', + 'IoTSecuritySolutionsOperations', + 'IoTSecuritySolutionsResourceGroupOperations', 'IotSecuritySolutionOperations', - 'IotSecuritySolutionAnalyticsOperations', - 'IotSecuritySolutionsAnalyticsAggregatedAlertOperations', - 'IotSecuritySolutionsAnalyticsRecommendationOperations', + 'IoTSecuritySolutionsAnalyticsOperations', + 'IoTSecuritySolutionsAnalyticsAggregatedAlertsOperations', + 'IoTSecuritySolutionsAnalyticsAggregatedAlertOperations', + 'IoTSecuritySolutionsAnalyticsRecommendationOperations', + 'IoTSecuritySolutionsAnalyticsRecommendationsOperations', 'AllowedConnectionsOperations', 'DiscoveredSecuritySolutionsOperations', 'ExternalSecuritySolutionsOperations', @@ -68,5 +75,4 @@ 'RegulatoryComplianceControlsOperations', 'RegulatoryComplianceAssessmentsOperations', 'ServerVulnerabilityAssessmentOperations', - 'SubAssessmentsOperations', ] diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solutions_analytics_aggregated_alert_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_aggregated_alert_operations.py similarity index 63% rename from sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solutions_analytics_aggregated_alert_operations.py rename to sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_aggregated_alert_operations.py index 327bbbd5f397..b4a3340cf7e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solutions_analytics_aggregated_alert_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_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,95 +39,16 @@ 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): - """Use this method to get a single the aggregated alert of yours IoT - Security solution. This aggregation is performed by alert name. + """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 name of the IoT Security solution. + :param solution_name: The solution manager name :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 @@ -185,14 +106,14 @@ def get( def dismiss( self, resource_group_name, solution_name, aggregated_alert_name, custom_headers=None, raw=False, **operation_config): - """Use this method to dismiss an aggregated IoT Security Solution Alert. + """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 name of the IoT Security solution. + :param solution_name: The solution manager name :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_aggregated_alerts_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_aggregated_alerts_operations.py new file mode 100644 index 000000000000..8e47ea54d879 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_aggregated_alerts_operations.py @@ -0,0 +1,117 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class IoTSecuritySolutionsAnalyticsAggregatedAlertsOperations(object): + """IoTSecuritySolutionsAnalyticsAggregatedAlertsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2019-08-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-08-01" + + self.config = config + + def list( + self, resource_group_name, solution_name, top=None, custom_headers=None, raw=False, **operation_config): + """Security Analytics of a security solution. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param solution_name: The solution manager name + :type solution_name: str + :param top: The number of results to retrieve. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of IoTSecurityAggregatedAlert + :rtype: + ~azure.mgmt.security.models.IoTSecurityAggregatedAlertPaged[~azure.mgmt.security.models.IoTSecurityAggregatedAlert] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'solutionName': self._serialize.url("solution_name", solution_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.IoTSecurityAggregatedAlertPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solution_analytics_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_operations.py similarity index 89% rename from sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solution_analytics_operations.py rename to sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_operations.py index a7ee65858d04..70e6b43692b5 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solution_analytics_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_operations.py @@ -16,8 +16,8 @@ from .. import models -class IotSecuritySolutionAnalyticsOperations(object): - """IotSecuritySolutionAnalyticsOperations operations. +class IoTSecuritySolutionsAnalyticsOperations(object): + """IoTSecuritySolutionsAnalyticsOperations 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 list( + def get_all( self, resource_group_name, solution_name, custom_headers=None, raw=False, **operation_config): - """Use this method to get IoT security Analytics metrics in an array. + """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 name of the IoT Security solution. + :param solution_name: The solution manager name :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 list( :raises: :class:`CloudError` """ # Construct URL - url = self.list.metadata['url'] + url = self.get_all.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 list( return client_raw_response return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels'} + get_all.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels'} - def get( + def get_default( self, resource_group_name, solution_name, custom_headers=None, raw=False, **operation_config): - """Use this method to get IoT Security Analytics metrics. + """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 name of the IoT Security solution. + :param solution_name: The solution manager name :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( :raises: :class:`CloudError` """ # Construct URL - url = self.get.metadata['url'] + url = self.get_default.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( return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default'} + get_default.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/_io_tsecurity_solutions_analytics_recommendation_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_recommendation_operations.py new file mode 100644 index 000000000000..3e251e9f060e --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_recommendation_operations.py @@ -0,0 +1,108 @@ +# 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/_iot_security_solutions_analytics_recommendation_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_recommendations_operations.py similarity index 54% rename from sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solutions_analytics_recommendation_operations.py rename to sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_recommendations_operations.py index 57dbc1031ce4..3276e998ec1a 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solutions_analytics_recommendation_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_analytics_recommendations_operations.py @@ -16,8 +16,8 @@ from .. import models -class IotSecuritySolutionsAnalyticsRecommendationOperations(object): - """IotSecuritySolutionsAnalyticsRecommendationOperations operations. +class IoTSecuritySolutionsAnalyticsRecommendationsOperations(object): + """IoTSecuritySolutionsAnalyticsRecommendationsOperations 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,87 +39,16 @@ 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): - """Use this method to get the list of aggregated security analytics - recommendations of yours IoT Security solution. + """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 name of the IoT Security solution. + :param solution_name: The solution manager name :type solution_name: str - :param top: Number of results to retrieve. + :param top: The number of results to retrieve. :type top: int :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the 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 new file mode 100644 index 000000000000..b3f222701615 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_operations.py @@ -0,0 +1,111 @@ +# 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 new file mode 100644 index 000000000000..1536a6eb452c --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_io_tsecurity_solutions_resource_group_operations.py @@ -0,0 +1,115 @@ +# 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/_iot_security_solution_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_security_solution_operations.py index 8a820da44265..3a3c15481184 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,163 +39,14 @@ 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): - """User this method to get details of a specific IoT Security solution - based on solution name. + """Details of a specific 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. + :param solution_name: The solution manager name :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 @@ -250,14 +101,14 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}'} - def create_or_update( + def create( self, resource_group_name, solution_name, iot_security_solution_data, custom_headers=None, raw=False, **operation_config): - """Use this method to create or update yours IoT Security solution. + """Create new solution manager. :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. + :param solution_name: The solution manager name :type solution_name: str :param iot_security_solution_data: The security solution data :type iot_security_solution_data: @@ -273,7 +124,7 @@ def create_or_update( :raises: :class:`CloudError` """ # Construct URL - url = self.create_or_update.metadata['url'] + url = self.create.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\._\(\)]+$'), @@ -319,18 +170,17 @@ def create_or_update( return client_raw_response return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}'} + create.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): - """Use this method to update existing IoT Security solution tags or user - defined resources. To update other fields use the CreateOrUpdate - method. + """update existing 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 name of the IoT Security solution. + :param solution_name: The solution manager name :type solution_name: str :param update_iot_security_solution_data: The security solution data :type update_iot_security_solution_data: @@ -394,12 +244,12 @@ def update( def delete( self, resource_group_name, solution_name, custom_headers=None, raw=False, **operation_config): - """Use this method to delete yours IoT Security solution. + """Create new solution manager. :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. + :param solution_name: The solution manager name :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/_jit_network_access_policies_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_jit_network_access_policies_operations.py index 16a6f67da9d1..48df52e84dba 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, justification=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, jit_network_access_policy_name, virtual_machines, custom_headers=None, raw=False, **operation_config): """Initiate a JIT access from a specific Just-in-Time policy configuration. @@ -525,9 +525,6 @@ 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 @@ -538,7 +535,7 @@ def initiate( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - body = models.JitNetworkAccessPolicyInitiateRequest(virtual_machines=virtual_machines, justification=justification) + body = models.JitNetworkAccessPolicyInitiateRequest(virtual_machines=virtual_machines) # Construct URL url = self.initiate.metadata['url'] 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/_network_data_operations.py similarity index 55% rename from sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_device_security_groups_operations.py rename to sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_network_data_operations.py index 581733e3c324..cfb4760d7934 100644 --- 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/_network_data_operations.py @@ -16,8 +16,8 @@ from .. import models -class DeviceSecurityGroupsOperations(object): - """DeviceSecurityGroupsOperations operations. +class NetworkDataOperations(object): + """NetworkDataOperations 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 DeviceSecurityGroupsOperations(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,25 +35,26 @@ 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_id, custom_headers=None, raw=False, **operation_config): - """Use this method get the list of device security groups for the - specified IoT Hub resource. + self, expand=None, custom_headers=None, raw=False, **operation_config): + """Get the network data on all your scanned resources inside a scope. - :param resource_id: The identifier of the resource. - :type resource_id: str + :param expand: expand whether you want to get more information about + the network data (ports and connections details). Possible values + include: 'true', 'false' + :type expand: str or ~azure.mgmt.security.models.ExpandValues :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 + :return: An iterator like instance of NetworkData :rtype: - ~azure.mgmt.security.models.DeviceSecurityGroupPaged[~azure.mgmt.security.models.DeviceSecurityGroup] + ~azure.mgmt.security.models.NetworkDataPaged[~azure.mgmt.security.models.NetworkData] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -61,13 +62,15 @@ def prepare_request(next_link=None): # Construct URL url = self.list.metadata['url'] path_format_arguments = { - 'resourceId': self._serialize.url("resource_id", resource_id, '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') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') else: url = next_link @@ -103,43 +106,43 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.DeviceSecurityGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.NetworkDataPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/networkData'} - 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. + def get_resource_collection( + self, resource_id, expand=None, custom_headers=None, raw=False, **operation_config): + """Get the network data collection on your scanned 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 expand: expand whether you want to get more information about + the network data (ports and connections details). Possible values + include: 'true', 'false' + :type expand: str or ~azure.mgmt.security.models.ExpandValues :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 + :return: NetworkDataList or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.NetworkDataList or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.get.metadata['url'] + url = self.get_resource_collection.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') + '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') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') # Construct headers header_parameters = {} @@ -162,55 +165,51 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('DeviceSecurityGroup', response) + deserialized = self._deserialize('NetworkDataList', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}'} + get_resource_collection.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/NetworkData'} - 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. + def get( + self, resource_id, expand=None, custom_headers=None, raw=False, **operation_config): + """Get the network data on your scanned 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 expand: expand whether you want to get more information about + the network data (ports and connections details). Possible values + include: 'true', 'false' + :type expand: str or ~azure.mgmt.security.models.ExpandValues :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 + :return: NetworkData or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.NetworkData or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.create_or_update.metadata['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') + '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') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, '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: @@ -218,81 +217,22 @@ def create_or_update( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - # Construct body - body_content = self._serialize.body(device_security_group, 'DeviceSecurityGroup') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + 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, 201]: + 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 response.status_code == 201: - deserialized = self._deserialize('DeviceSecurityGroup', response) + deserialized = self._deserialize('NetworkData', 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}'} + get.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/NetworkData/default'} 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 deleted file mode 100644 index c73ee21df970..000000000000 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_sub_assessments_operations.py +++ /dev/null @@ -1,253 +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 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}'}