From 9722d56e1448db6124ea4e83b9dac9cd51d2c434 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Sun, 18 Jul 2021 13:46:19 +0000 Subject: [PATCH] CodeGen from PR 15196 in Azure/azure-rest-api-specs Merge 1ad1d3609bffc1badf080f0f492122f011200fdb into ebe90b1dfef9ec9706dee06e84676a6c6979ab53 --- sdk/security/azure-mgmt-security/MANIFEST.in | 1 + sdk/security/azure-mgmt-security/_meta.json | 8 + .../azure/mgmt/security/_security_center.py | 75 +- .../azure/mgmt/security/models/__init__.py | 150 +- .../azure/mgmt/security/models/_models.py | 1623 ++++++++++++---- .../azure/mgmt/security/models/_models_py3.py | 1643 +++++++++++++---- .../mgmt/security/models/_paged_models.py | 172 +- .../security/models/_security_center_enums.py | 213 ++- .../mgmt/security/operations/__init__.py | 30 +- .../security/operations/_alerts_operations.py | 136 +- .../_assessments_metadata_operations.py | 36 +- .../operations/_assessments_operations.py | 24 +- .../_ingestion_settings_operations.py | 400 ++++ .../operations/_iot_alert_types_operations.py | 151 +- .../operations/_iot_alerts_operations.py | 188 +- .../_iot_defender_settings_operations.py | 71 +- .../_iot_recommendation_types_operations.py | 151 +- .../_iot_recommendations_operations.py | 178 +- .../operations/_iot_sensors_operations.py | 148 +- .../operations/_iot_sites_operations.py | 276 +++ .../_on_premise_iot_sensors_operations.py | 68 + ...ver_vulnerability_assessment_operations.py | 74 +- .../operations/_settings_operations.py | 12 +- .../_software_inventories_operations.py | 257 +++ 24 files changed, 4344 insertions(+), 1741 deletions(-) create mode 100644 sdk/security/azure-mgmt-security/_meta.json create mode 100644 sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_ingestion_settings_operations.py create mode 100644 sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sites_operations.py create mode 100644 sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_software_inventories_operations.py diff --git a/sdk/security/azure-mgmt-security/MANIFEST.in b/sdk/security/azure-mgmt-security/MANIFEST.in index a3cb07df87658..3a9b6517412bc 100644 --- a/sdk/security/azure-mgmt-security/MANIFEST.in +++ b/sdk/security/azure-mgmt-security/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/security/azure-mgmt-security/_meta.json b/sdk/security/azure-mgmt-security/_meta.json new file mode 100644 index 0000000000000..98d92ca95f7d2 --- /dev/null +++ b/sdk/security/azure-mgmt-security/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "V2", + "use": "@microsoft.azure/autorest.python@~4.0.71", + "commit": "705b15bac0fab1c4d1be6b04970ea0d0eac40ead", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/security/resource-manager/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2", + "readme": "specification/security/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/_security_center.py index de0ae7d443e35..4f1183f0d9638 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 @@ -15,17 +15,12 @@ from ._configuration import SecurityCenterConfiguration from .operations import ComplianceResultsOperations from .operations import PricingsOperations -from .operations import SettingsOperations from .operations import AdvancedThreatProtectionOperations from .operations import DeviceSecurityGroupsOperations from .operations import IotSecuritySolutionOperations from .operations import IotSecuritySolutionAnalyticsOperations from .operations import IotSecuritySolutionsAnalyticsAggregatedAlertOperations from .operations import IotSecuritySolutionsAnalyticsRecommendationOperations -from .operations import IotAlertTypesOperations -from .operations import IotAlertsOperations -from .operations import IotRecommendationTypesOperations -from .operations import IotRecommendationsOperations from .operations import LocationsOperations from .operations import Operations from .operations import TasksOperations @@ -47,7 +42,6 @@ from .operations import AdaptiveNetworkHardeningsOperations from .operations import AllowedConnectionsOperations from .operations import TopologyOperations -from .operations import AlertsOperations from .operations import JitNetworkAccessPoliciesOperations from .operations import DiscoveredSecuritySolutionsOperations from .operations import SecuritySolutionsReferenceDataOperations @@ -66,6 +60,15 @@ from .operations import DevicesForHubOperations from .operations import DeviceOperations from .operations import OnPremiseIotSensorsOperations +from .operations import IotSitesOperations +from .operations import IotAlertsOperations +from .operations import IotAlertTypesOperations +from .operations import IotRecommendationsOperations +from .operations import IotRecommendationTypesOperations +from .operations import AlertsOperations +from .operations import SettingsOperations +from .operations import IngestionSettingsOperations +from .operations import SoftwareInventoriesOperations from . import models @@ -79,8 +82,6 @@ class SecurityCenter(SDKClient): :vartype compliance_results: azure.mgmt.security.operations.ComplianceResultsOperations :ivar pricings: Pricings operations :vartype pricings: azure.mgmt.security.operations.PricingsOperations - :ivar settings: Settings operations - :vartype settings: azure.mgmt.security.operations.SettingsOperations :ivar advanced_threat_protection: AdvancedThreatProtection operations :vartype advanced_threat_protection: azure.mgmt.security.operations.AdvancedThreatProtectionOperations :ivar device_security_groups: DeviceSecurityGroups operations @@ -93,14 +94,6 @@ class SecurityCenter(SDKClient): :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 iot_alert_types: IotAlertTypes operations - :vartype iot_alert_types: azure.mgmt.security.operations.IotAlertTypesOperations - :ivar iot_alerts: IotAlerts operations - :vartype iot_alerts: azure.mgmt.security.operations.IotAlertsOperations - :ivar iot_recommendation_types: IotRecommendationTypes operations - :vartype iot_recommendation_types: azure.mgmt.security.operations.IotRecommendationTypesOperations - :ivar iot_recommendations: IotRecommendations operations - :vartype iot_recommendations: azure.mgmt.security.operations.IotRecommendationsOperations :ivar locations: Locations operations :vartype locations: azure.mgmt.security.operations.LocationsOperations :ivar operations: Operations operations @@ -143,8 +136,6 @@ class SecurityCenter(SDKClient): :vartype allowed_connections: azure.mgmt.security.operations.AllowedConnectionsOperations :ivar topology: Topology operations :vartype topology: azure.mgmt.security.operations.TopologyOperations - :ivar alerts: Alerts operations - :vartype alerts: azure.mgmt.security.operations.AlertsOperations :ivar jit_network_access_policies: JitNetworkAccessPolicies operations :vartype jit_network_access_policies: azure.mgmt.security.operations.JitNetworkAccessPoliciesOperations :ivar discovered_security_solutions: DiscoveredSecuritySolutions operations @@ -181,6 +172,24 @@ class SecurityCenter(SDKClient): :vartype device: azure.mgmt.security.operations.DeviceOperations :ivar on_premise_iot_sensors: OnPremiseIotSensors operations :vartype on_premise_iot_sensors: azure.mgmt.security.operations.OnPremiseIotSensorsOperations + :ivar iot_sites: IotSites operations + :vartype iot_sites: azure.mgmt.security.operations.IotSitesOperations + :ivar iot_alerts: IotAlerts operations + :vartype iot_alerts: azure.mgmt.security.operations.IotAlertsOperations + :ivar iot_alert_types: IotAlertTypes operations + :vartype iot_alert_types: azure.mgmt.security.operations.IotAlertTypesOperations + :ivar iot_recommendations: IotRecommendations operations + :vartype iot_recommendations: azure.mgmt.security.operations.IotRecommendationsOperations + :ivar iot_recommendation_types: IotRecommendationTypes operations + :vartype iot_recommendation_types: azure.mgmt.security.operations.IotRecommendationTypesOperations + :ivar alerts: Alerts operations + :vartype alerts: azure.mgmt.security.operations.AlertsOperations + :ivar settings: Settings operations + :vartype settings: azure.mgmt.security.operations.SettingsOperations + :ivar ingestion_settings: IngestionSettings operations + :vartype ingestion_settings: azure.mgmt.security.operations.IngestionSettingsOperations + :ivar software_inventories: SoftwareInventories operations + :vartype software_inventories: azure.mgmt.security.operations.SoftwareInventoriesOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -207,8 +216,6 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.pricings = PricingsOperations( self._client, self.config, self._serialize, self._deserialize) - self.settings = SettingsOperations( - self._client, self.config, self._serialize, self._deserialize) self.advanced_threat_protection = AdvancedThreatProtectionOperations( self._client, self.config, self._serialize, self._deserialize) self.device_security_groups = DeviceSecurityGroupsOperations( @@ -221,14 +228,6 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.iot_security_solutions_analytics_recommendation = IotSecuritySolutionsAnalyticsRecommendationOperations( self._client, self.config, self._serialize, self._deserialize) - self.iot_alert_types = IotAlertTypesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.iot_alerts = IotAlertsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.iot_recommendation_types = IotRecommendationTypesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.iot_recommendations = IotRecommendationsOperations( - self._client, self.config, self._serialize, self._deserialize) self.locations = LocationsOperations( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( @@ -271,8 +270,6 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.topology = TopologyOperations( self._client, self.config, self._serialize, self._deserialize) - self.alerts = AlertsOperations( - self._client, self.config, self._serialize, self._deserialize) self.jit_network_access_policies = JitNetworkAccessPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) self.discovered_security_solutions = DiscoveredSecuritySolutionsOperations( @@ -309,3 +306,21 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.on_premise_iot_sensors = OnPremiseIotSensorsOperations( self._client, self.config, self._serialize, self._deserialize) + self.iot_sites = IotSitesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.iot_alerts = IotAlertsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.iot_alert_types = IotAlertTypesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.iot_recommendations = IotRecommendationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.iot_recommendation_types = IotRecommendationTypesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.alerts = AlertsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.settings = SettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.ingestion_settings = IngestionSettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.software_inventories = SoftwareInventoriesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/__init__.py index f182e6ae46be7..29b3606a00ec4 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/__init__.py @@ -20,10 +20,15 @@ from ._models_py3 import AdaptiveNetworkHardening from ._models_py3 import AdaptiveNetworkHardeningEnforceRequest from ._models_py3 import AdditionalData + from ._models_py3 import AdditionalWorkspacesProperties from ._models_py3 import AdvancedThreatProtectionSetting from ._models_py3 import Alert from ._models_py3 import AlertEntity + from ._models_py3 import AlertSimulatorBundlesRequestProperties + from ._models_py3 import AlertSimulatorRequestBody + from ._models_py3 import AlertSimulatorRequestProperties from ._models_py3 import AlertsSuppressionRule + from ._models_py3 import AlertSyncSettings from ._models_py3 import AllowedConnectionsResource from ._models_py3 import AllowlistCustomAlertRule from ._models_py3 import AmqpC2DMessagesNotInAllowedRange @@ -32,6 +37,7 @@ from ._models_py3 import AscLocation from ._models_py3 import AssessmentLinks from ._models_py3 import AssessmentStatus + from ._models_py3 import AssessmentStatusResponse from ._models_py3 import AtaExternalSecuritySolution from ._models_py3 import AtaSolutionProperties from ._models_py3 import AuthenticationDetailsProperties @@ -63,6 +69,8 @@ from ._models_py3 import ConnectableResource from ._models_py3 import ConnectedResource from ._models_py3 import ConnectedWorkspace + from ._models_py3 import ConnectionFromIpNotAllowed + from ._models_py3 import ConnectionStrings from ._models_py3 import ConnectionToIpNotAllowed from ._models_py3 import ConnectorSetting from ._models_py3 import ContainerRegistryVulnerabilityProperties @@ -76,6 +84,7 @@ from ._models_py3 import DirectMethodInvokesNotInAllowedRange from ._models_py3 import DiscoveredSecuritySolution from ._models_py3 import EffectiveNetworkSecurityGroups + from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ETag from ._models_py3 import ExternalSecuritySolution from ._models_py3 import ExternalSecuritySolutionKind1 @@ -91,13 +100,14 @@ from ._models_py3 import InformationProtectionKeyword from ._models_py3 import InformationProtectionPolicy from ._models_py3 import InformationType - from ._models_py3 import IotAlert + from ._models_py3 import IngestionConnectionString + from ._models_py3 import IngestionSetting + from ._models_py3 import IngestionSettingToken from ._models_py3 import IotAlertModel from ._models_py3 import IotAlertType from ._models_py3 import IotAlertTypeList from ._models_py3 import IotDefenderSettingsList from ._models_py3 import IotDefenderSettingsModel - from ._models_py3 import IotRecommendation from ._models_py3 import IotRecommendationModel from ._models_py3 import IotRecommendationType from ._models_py3 import IotRecommendationTypeList @@ -111,9 +121,11 @@ from ._models_py3 import IoTSecuritySolutionAnalyticsModelList from ._models_py3 import IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem from ._models_py3 import IoTSecuritySolutionModel - from ._models_py3 import IotSensor from ._models_py3 import IotSensorsList + from ._models_py3 import IotSensorsModel from ._models_py3 import IoTSeverityMetrics + from ._models_py3 import IotSitesList + from ._models_py3 import IotSitesModel from ._models_py3 import IpAddress from ._models_py3 import JitNetworkAccessPolicy from ._models_py3 import JitNetworkAccessPolicyInitiatePort @@ -148,7 +160,6 @@ from ._models_py3 import PackageDownloadsSensor from ._models_py3 import PackageDownloadsSensorFull from ._models_py3 import PackageDownloadsSensorFullOvf - from ._models_py3 import PackageDownloadsThreatIntelligence from ._models_py3 import PathRecommendation from ._models_py3 import Pricing from ._models_py3 import PricingList @@ -164,6 +175,7 @@ from ._models_py3 import RegulatoryComplianceControl from ._models_py3 import RegulatoryComplianceStandard from ._models_py3 import Remediation + from ._models_py3 import ResetPasswordInput from ._models_py3 import Resource from ._models_py3 import ResourceDetails from ._models_py3 import ResourceIdentifier @@ -189,7 +201,11 @@ from ._models_py3 import SecurityAssessmentMetadata from ._models_py3 import SecurityAssessmentMetadataPartnerData from ._models_py3 import SecurityAssessmentMetadataProperties + from ._models_py3 import SecurityAssessmentMetadataPropertiesResponsePublishDates + from ._models_py3 import SecurityAssessmentMetadataResponse from ._models_py3 import SecurityAssessmentPartnerData + from ._models_py3 import SecurityAssessmentPropertiesBase + from ._models_py3 import SecurityAssessmentResponse from ._models_py3 import SecurityContact from ._models_py3 import SecuritySolution from ._models_py3 import SecuritySolutionsReferenceData @@ -204,11 +220,12 @@ from ._models_py3 import ServerVulnerabilityProperties from ._models_py3 import ServicePrincipalProperties from ._models_py3 import Setting - from ._models_py3 import SettingResource from ._models_py3 import Site + from ._models_py3 import Software from ._models_py3 import SqlServerVulnerabilityProperties from ._models_py3 import SubAssessmentStatus from ._models_py3 import SuppressionAlertsScope + from ._models_py3 import SystemData from ._models_py3 import Tags from ._models_py3 import TagsResource from ._models_py3 import ThresholdCustomAlertRule @@ -221,6 +238,7 @@ from ._models_py3 import TwinUpdatesNotInAllowedRange from ._models_py3 import UnauthorizedOperationsNotInAllowedRange from ._models_py3 import UpdateIotSecuritySolutionData + from ._models_py3 import UpgradePackageDownloadInfo from ._models_py3 import UserDefinedResourcesProperties from ._models_py3 import UserRecommendation from ._models_py3 import VaRule @@ -238,10 +256,15 @@ from ._models import AdaptiveNetworkHardening from ._models import AdaptiveNetworkHardeningEnforceRequest from ._models import AdditionalData + from ._models import AdditionalWorkspacesProperties from ._models import AdvancedThreatProtectionSetting from ._models import Alert from ._models import AlertEntity + from ._models import AlertSimulatorBundlesRequestProperties + from ._models import AlertSimulatorRequestBody + from ._models import AlertSimulatorRequestProperties from ._models import AlertsSuppressionRule + from ._models import AlertSyncSettings from ._models import AllowedConnectionsResource from ._models import AllowlistCustomAlertRule from ._models import AmqpC2DMessagesNotInAllowedRange @@ -250,6 +273,7 @@ from ._models import AscLocation from ._models import AssessmentLinks from ._models import AssessmentStatus + from ._models import AssessmentStatusResponse from ._models import AtaExternalSecuritySolution from ._models import AtaSolutionProperties from ._models import AuthenticationDetailsProperties @@ -281,6 +305,8 @@ from ._models import ConnectableResource from ._models import ConnectedResource from ._models import ConnectedWorkspace + from ._models import ConnectionFromIpNotAllowed + from ._models import ConnectionStrings from ._models import ConnectionToIpNotAllowed from ._models import ConnectorSetting from ._models import ContainerRegistryVulnerabilityProperties @@ -294,6 +320,7 @@ from ._models import DirectMethodInvokesNotInAllowedRange from ._models import DiscoveredSecuritySolution from ._models import EffectiveNetworkSecurityGroups + from ._models import ErrorAdditionalInfo from ._models import ETag from ._models import ExternalSecuritySolution from ._models import ExternalSecuritySolutionKind1 @@ -309,13 +336,14 @@ from ._models import InformationProtectionKeyword from ._models import InformationProtectionPolicy from ._models import InformationType - from ._models import IotAlert + from ._models import IngestionConnectionString + from ._models import IngestionSetting + from ._models import IngestionSettingToken from ._models import IotAlertModel from ._models import IotAlertType from ._models import IotAlertTypeList from ._models import IotDefenderSettingsList from ._models import IotDefenderSettingsModel - from ._models import IotRecommendation from ._models import IotRecommendationModel from ._models import IotRecommendationType from ._models import IotRecommendationTypeList @@ -329,9 +357,11 @@ from ._models import IoTSecuritySolutionAnalyticsModelList from ._models import IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem from ._models import IoTSecuritySolutionModel - from ._models import IotSensor from ._models import IotSensorsList + from ._models import IotSensorsModel from ._models import IoTSeverityMetrics + from ._models import IotSitesList + from ._models import IotSitesModel from ._models import IpAddress from ._models import JitNetworkAccessPolicy from ._models import JitNetworkAccessPolicyInitiatePort @@ -366,7 +396,6 @@ from ._models import PackageDownloadsSensor from ._models import PackageDownloadsSensorFull from ._models import PackageDownloadsSensorFullOvf - from ._models import PackageDownloadsThreatIntelligence from ._models import PathRecommendation from ._models import Pricing from ._models import PricingList @@ -382,6 +411,7 @@ from ._models import RegulatoryComplianceControl from ._models import RegulatoryComplianceStandard from ._models import Remediation + from ._models import ResetPasswordInput from ._models import Resource from ._models import ResourceDetails from ._models import ResourceIdentifier @@ -407,7 +437,11 @@ from ._models import SecurityAssessmentMetadata from ._models import SecurityAssessmentMetadataPartnerData from ._models import SecurityAssessmentMetadataProperties + from ._models import SecurityAssessmentMetadataPropertiesResponsePublishDates + from ._models import SecurityAssessmentMetadataResponse from ._models import SecurityAssessmentPartnerData + from ._models import SecurityAssessmentPropertiesBase + from ._models import SecurityAssessmentResponse from ._models import SecurityContact from ._models import SecuritySolution from ._models import SecuritySolutionsReferenceData @@ -422,11 +456,12 @@ from ._models import ServerVulnerabilityProperties from ._models import ServicePrincipalProperties from ._models import Setting - from ._models import SettingResource from ._models import Site + from ._models import Software from ._models import SqlServerVulnerabilityProperties from ._models import SubAssessmentStatus from ._models import SuppressionAlertsScope + from ._models import SystemData from ._models import Tags from ._models import TagsResource from ._models import ThresholdCustomAlertRule @@ -439,6 +474,7 @@ from ._models import TwinUpdatesNotInAllowedRange from ._models import UnauthorizedOperationsNotInAllowedRange from ._models import UpdateIotSecuritySolutionData + from ._models import UpgradePackageDownloadInfo from ._models import UserDefinedResourcesProperties from ._models import UserRecommendation from ._models import VaRule @@ -460,10 +496,9 @@ from ._paged_models import DiscoveredSecuritySolutionPaged from ._paged_models import ExternalSecuritySolutionPaged from ._paged_models import InformationProtectionPolicyPaged +from ._paged_models import IngestionSettingPaged from ._paged_models import IotAlertModelPaged -from ._paged_models import IotAlertPaged from ._paged_models import IotRecommendationModelPaged -from ._paged_models import IotRecommendationPaged from ._paged_models import IoTSecurityAggregatedAlertPaged from ._paged_models import IoTSecurityAggregatedRecommendationPaged from ._paged_models import IoTSecuritySolutionModelPaged @@ -475,13 +510,14 @@ from ._paged_models import SecureScoreControlDefinitionItemPaged from ._paged_models import SecureScoreControlDetailsPaged from ._paged_models import SecureScoreItemPaged -from ._paged_models import SecurityAssessmentMetadataPaged -from ._paged_models import SecurityAssessmentPaged +from ._paged_models import SecurityAssessmentMetadataResponsePaged +from ._paged_models import SecurityAssessmentResponsePaged from ._paged_models import SecurityContactPaged from ._paged_models import SecuritySolutionPaged from ._paged_models import SecuritySubAssessmentPaged from ._paged_models import SecurityTaskPaged from ._paged_models import SettingPaged +from ._paged_models import SoftwarePaged from ._paged_models import TopologyResourcePaged from ._paged_models import WorkspaceSettingPaged from ._security_center_enums import ( @@ -494,10 +530,10 @@ RecommendationType, RecommendationConfigStatus, UnmaskedIpLoggingStatus, + AdditionalWorkspaceType, + AdditionalWorkspaceDataType, + CreatedByType, ReportedSeverity, - AlertSeverity, - AlertIntent, - RecommendationSeverity, AutoProvision, Rank, AlertNotifications, @@ -509,7 +545,7 @@ PropertyType, Operator, RuleState, - Category, + Categories, UserImpact, ImplementationEffort, Threats, @@ -517,8 +553,6 @@ AssessmentStatusCode, Direction, TransportProtocol, - Intent, - AlertStatus, Protocol, Status, StatusReason, @@ -535,7 +569,11 @@ RuleStatus, RuleSeverity, RuleType, + OnboardingKind, VersionKind, + SensorStatus, + TiStatus, + SensorType, MacSignificance, RelationToIpStatus, ManagementState, @@ -545,6 +583,13 @@ ProgrammingState, ScanningFunctionality, DeviceStatus, + AlertSeverity, + AlertIntent, + RecommendationSeverity, + Intent, + AlertStatus, + BundleType, + EndOfSupportStatus, ExpandEnum, ConnectionType, ExpandControlsEnum, @@ -561,10 +606,15 @@ 'AdaptiveNetworkHardening', 'AdaptiveNetworkHardeningEnforceRequest', 'AdditionalData', + 'AdditionalWorkspacesProperties', 'AdvancedThreatProtectionSetting', 'Alert', 'AlertEntity', + 'AlertSimulatorBundlesRequestProperties', + 'AlertSimulatorRequestBody', + 'AlertSimulatorRequestProperties', 'AlertsSuppressionRule', + 'AlertSyncSettings', 'AllowedConnectionsResource', 'AllowlistCustomAlertRule', 'AmqpC2DMessagesNotInAllowedRange', @@ -573,6 +623,7 @@ 'AscLocation', 'AssessmentLinks', 'AssessmentStatus', + 'AssessmentStatusResponse', 'AtaExternalSecuritySolution', 'AtaSolutionProperties', 'AuthenticationDetailsProperties', @@ -604,6 +655,8 @@ 'ConnectableResource', 'ConnectedResource', 'ConnectedWorkspace', + 'ConnectionFromIpNotAllowed', + 'ConnectionStrings', 'ConnectionToIpNotAllowed', 'ConnectorSetting', 'ContainerRegistryVulnerabilityProperties', @@ -617,6 +670,7 @@ 'DirectMethodInvokesNotInAllowedRange', 'DiscoveredSecuritySolution', 'EffectiveNetworkSecurityGroups', + 'ErrorAdditionalInfo', 'ETag', 'ExternalSecuritySolution', 'ExternalSecuritySolutionKind1', @@ -632,13 +686,14 @@ 'InformationProtectionKeyword', 'InformationProtectionPolicy', 'InformationType', - 'IotAlert', + 'IngestionConnectionString', + 'IngestionSetting', + 'IngestionSettingToken', 'IotAlertModel', 'IotAlertType', 'IotAlertTypeList', 'IotDefenderSettingsList', 'IotDefenderSettingsModel', - 'IotRecommendation', 'IotRecommendationModel', 'IotRecommendationType', 'IotRecommendationTypeList', @@ -652,9 +707,11 @@ 'IoTSecuritySolutionAnalyticsModelList', 'IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem', 'IoTSecuritySolutionModel', - 'IotSensor', 'IotSensorsList', + 'IotSensorsModel', 'IoTSeverityMetrics', + 'IotSitesList', + 'IotSitesModel', 'IpAddress', 'JitNetworkAccessPolicy', 'JitNetworkAccessPolicyInitiatePort', @@ -689,7 +746,6 @@ 'PackageDownloadsSensor', 'PackageDownloadsSensorFull', 'PackageDownloadsSensorFullOvf', - 'PackageDownloadsThreatIntelligence', 'PathRecommendation', 'Pricing', 'PricingList', @@ -705,6 +761,7 @@ 'RegulatoryComplianceControl', 'RegulatoryComplianceStandard', 'Remediation', + 'ResetPasswordInput', 'Resource', 'ResourceDetails', 'ResourceIdentifier', @@ -730,7 +787,11 @@ 'SecurityAssessmentMetadata', 'SecurityAssessmentMetadataPartnerData', 'SecurityAssessmentMetadataProperties', + 'SecurityAssessmentMetadataPropertiesResponsePublishDates', + 'SecurityAssessmentMetadataResponse', 'SecurityAssessmentPartnerData', + 'SecurityAssessmentPropertiesBase', + 'SecurityAssessmentResponse', 'SecurityContact', 'SecuritySolution', 'SecuritySolutionsReferenceData', @@ -745,11 +806,12 @@ 'ServerVulnerabilityProperties', 'ServicePrincipalProperties', 'Setting', - 'SettingResource', 'Site', + 'Software', 'SqlServerVulnerabilityProperties', 'SubAssessmentStatus', 'SuppressionAlertsScope', + 'SystemData', 'Tags', 'TagsResource', 'ThresholdCustomAlertRule', @@ -762,6 +824,7 @@ 'TwinUpdatesNotInAllowedRange', 'UnauthorizedOperationsNotInAllowedRange', 'UpdateIotSecuritySolutionData', + 'UpgradePackageDownloadInfo', 'UserDefinedResourcesProperties', 'UserRecommendation', 'VaRule', @@ -769,15 +832,10 @@ 'VmRecommendation', 'WorkspaceSetting', 'ComplianceResultPaged', - 'SettingPaged', 'DeviceSecurityGroupPaged', 'IoTSecuritySolutionModelPaged', 'IoTSecurityAggregatedAlertPaged', 'IoTSecurityAggregatedRecommendationPaged', - 'IotAlertPaged', - 'IotAlertModelPaged', - 'IotRecommendationPaged', - 'IotRecommendationModelPaged', 'AscLocationPaged', 'OperationPaged', 'SecurityTaskPaged', @@ -792,12 +850,11 @@ 'SecuritySubAssessmentPaged', 'AutomationPaged', 'AlertsSuppressionRulePaged', - 'SecurityAssessmentMetadataPaged', - 'SecurityAssessmentPaged', + 'SecurityAssessmentMetadataResponsePaged', + 'SecurityAssessmentResponsePaged', 'AdaptiveNetworkHardeningPaged', 'AllowedConnectionsResourcePaged', 'TopologyResourcePaged', - 'AlertPaged', 'JitNetworkAccessPolicyPaged', 'DiscoveredSecuritySolutionPaged', 'ExternalSecuritySolutionPaged', @@ -807,6 +864,12 @@ 'SecuritySolutionPaged', 'ConnectorSettingPaged', 'DevicePaged', + 'IotAlertModelPaged', + 'IotRecommendationModelPaged', + 'AlertPaged', + 'SettingPaged', + 'IngestionSettingPaged', + 'SoftwarePaged', 'ResourceStatus', 'PricingTier', 'ValueType', @@ -816,10 +879,10 @@ 'RecommendationType', 'RecommendationConfigStatus', 'UnmaskedIpLoggingStatus', + 'AdditionalWorkspaceType', + 'AdditionalWorkspaceDataType', + 'CreatedByType', 'ReportedSeverity', - 'AlertSeverity', - 'AlertIntent', - 'RecommendationSeverity', 'AutoProvision', 'Rank', 'AlertNotifications', @@ -831,7 +894,7 @@ 'PropertyType', 'Operator', 'RuleState', - 'Category', + 'Categories', 'UserImpact', 'ImplementationEffort', 'Threats', @@ -839,8 +902,6 @@ 'AssessmentStatusCode', 'Direction', 'TransportProtocol', - 'Intent', - 'AlertStatus', 'Protocol', 'Status', 'StatusReason', @@ -857,7 +918,11 @@ 'RuleStatus', 'RuleSeverity', 'RuleType', + 'OnboardingKind', 'VersionKind', + 'SensorStatus', + 'TiStatus', + 'SensorType', 'MacSignificance', 'RelationToIpStatus', 'ManagementState', @@ -867,6 +932,13 @@ 'ProgrammingState', 'ScanningFunctionality', 'DeviceStatus', + 'AlertSeverity', + 'AlertIntent', + 'RecommendationSeverity', + 'Intent', + 'AlertStatus', + 'BundleType', + 'EndOfSupportStatus', 'ExpandEnum', 'ConnectionType', 'ExpandControlsEnum', diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models.py index 941c6b8b9bde2..e3ef2ff02d842 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models.py @@ -643,6 +643,32 @@ def __init__(self, **kwargs): self.assessed_resource_type = None +class AdditionalWorkspacesProperties(Model): + """Properties of the additional workspaces. + + :param workspace: Workspace resource id + :type workspace: str + :param type: Workspace type. Possible values include: 'Sentinel'. Default + value: "Sentinel" . + :type type: str or ~azure.mgmt.security.models.AdditionalWorkspaceType + :param data_types: List of data types sent to workspace + :type data_types: list[str or + ~azure.mgmt.security.models.AdditionalWorkspaceDataType] + """ + + _attribute_map = { + 'workspace': {'key': 'workspace', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data_types': {'key': 'dataTypes', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(AdditionalWorkspacesProperties, self).__init__(**kwargs) + self.workspace = kwargs.get('workspace', None) + self.type = kwargs.get('type', "Sentinel") + self.data_types = kwargs.get('data_types', None) + + class AdvancedThreatProtectionSetting(Resource): """The Advanced Threat Protection resource. @@ -878,6 +904,87 @@ def __init__(self, **kwargs): self.type = None +class AlertSimulatorRequestProperties(Model): + """Describes properties of an alert simulation request. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AlertSimulatorBundlesRequestProperties + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Bundles': 'AlertSimulatorBundlesRequestProperties'} + } + + def __init__(self, **kwargs): + super(AlertSimulatorRequestProperties, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.kind = None + + +class AlertSimulatorBundlesRequestProperties(AlertSimulatorRequestProperties): + """Simulate alerts according to this bundles. + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param kind: Required. Constant filled by server. + :type kind: str + :param bundles: Bundles list. + :type bundles: list[str or ~azure.mgmt.security.models.BundleType] + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'bundles': {'key': 'bundles', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(AlertSimulatorBundlesRequestProperties, self).__init__(**kwargs) + self.bundles = kwargs.get('bundles', None) + self.kind = 'Bundles' + + +class AlertSimulatorRequestBody(Model): + """Alert Simulator request body. + + :param properties: Alert Simulator request body data. + :type properties: + ~azure.mgmt.security.models.AlertSimulatorRequestProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'AlertSimulatorRequestProperties'}, + } + + def __init__(self, **kwargs): + super(AlertSimulatorRequestBody, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + class AlertsSuppressionRule(Resource): """Describes the suppression rule. @@ -947,6 +1054,93 @@ def __init__(self, **kwargs): self.suppression_alerts_scope = kwargs.get('suppression_alerts_scope', None) +class Setting(Resource): + """The kind of the security setting. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DataExportSettings, AlertSyncSettings + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'DataExportSettings': 'DataExportSettings', 'AlertSyncSettings': 'AlertSyncSettings'} + } + + def __init__(self, **kwargs): + super(Setting, self).__init__(**kwargs) + self.kind = None + self.kind = 'Setting' + + +class AlertSyncSettings(Setting): + """Represents an alert sync setting. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param enabled: Required. Is the alert sync setting enabled + :type enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'enabled': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(AlertSyncSettings, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.kind = 'AlertSyncSettings' + + class AllowedConnectionsResource(Model): """The resource whose properties describes the allowed traffic between Azure resources. @@ -1053,8 +1247,8 @@ class AllowlistCustomAlertRule(ListCustomAlertRule): type) is allowed. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ConnectionToIpNotAllowed, LocalUserNotAllowed, - ProcessNotAllowed + sub-classes are: ConnectionToIpNotAllowed, ConnectionFromIpNotAllowed, + LocalUserNotAllowed, ProcessNotAllowed Variables are only populated by the server, and will be ignored when sending a request. @@ -1096,7 +1290,7 @@ class AllowlistCustomAlertRule(ListCustomAlertRule): } _subtype_map = { - 'rule_type': {'ConnectionToIpNotAllowed': 'ConnectionToIpNotAllowed', 'LocalUserNotAllowed': 'LocalUserNotAllowed', 'ProcessNotAllowed': 'ProcessNotAllowed'} + 'rule_type': {'ConnectionToIpNotAllowed': 'ConnectionToIpNotAllowed', 'ConnectionFromIpNotAllowed': 'ConnectionFromIpNotAllowed', 'LocalUserNotAllowed': 'LocalUserNotAllowed', 'ProcessNotAllowed': 'ProcessNotAllowed'} } def __init__(self, **kwargs): @@ -1341,6 +1535,49 @@ def __init__(self, **kwargs): self.description = kwargs.get('description', None) +class AssessmentStatusResponse(AssessmentStatus): + """The result of the 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 code: Required. Programmatic code for the status of the assessment. + Possible values include: 'Healthy', 'Unhealthy', 'NotApplicable' + :type code: str or ~azure.mgmt.security.models.AssessmentStatusCode + :param cause: Programmatic code for the cause of the assessment status + :type cause: str + :param description: Human readable description of the assessment status + :type description: str + :ivar first_evaluation_date: The time that the assessment was created and + first evaluated. Returned as UTC time in ISO 8601 format + :vartype first_evaluation_date: datetime + :ivar status_change_date: The time that the status of the assessment last + changed. Returned as UTC time in ISO 8601 format + :vartype status_change_date: datetime + """ + + _validation = { + 'code': {'required': True}, + 'first_evaluation_date': {'readonly': True}, + 'status_change_date': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'cause': {'key': 'cause', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'first_evaluation_date': {'key': 'firstEvaluationDate', 'type': 'iso-8601'}, + 'status_change_date': {'key': 'statusChangeDate', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(AssessmentStatusResponse, self).__init__(**kwargs) + self.first_evaluation_date = None + self.status_change_date = None + + class AtaExternalSecuritySolution(ExternalSecuritySolution): """Represents an ATA security solution which sends logs to an OMS workspace. @@ -1797,7 +2034,10 @@ class AutomationSource(Model): https://aka.ms/ASCAutomationSchemas. :param event_source: A valid event source type. Possible values include: - 'Assessments', 'SubAssessments', 'Alerts' + 'Assessments', 'SubAssessments', 'Alerts', 'SecureScores', + 'SecureScoresSnapshot', 'SecureScoreControls', + 'SecureScoreControlsSnapshot', 'RegulatoryComplianceAssessment', + 'RegulatoryComplianceAssessmentSnapshot' :type event_source: str or ~azure.mgmt.security.models.EventSource :param rule_sets: A set of rules which evaluate upon event interception. A logical disjunction is applied between defined rule sets (logical 'or'). @@ -2335,33 +2575,49 @@ def __init__(self, **kwargs): class CloudError(Model): - """Error response structure. + """Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: An identifier for the error. Codes are invariant and are - intended to be consumed programmatically. + :ivar code: The error code. :vartype code: str - :ivar message: A message describing the error, intended to be suitable for - display in a user interface. + :ivar message: The error message. :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.security.models.CloudErrorBody] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.security.models.ErrorAdditionalInfo] """ _validation = { 'code': {'readonly': True}, 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, } _attribute_map = { 'code': {'key': 'error.code', 'type': 'str'}, 'message': {'key': 'error.message', 'type': 'str'}, + 'target': {'key': 'error.target', 'type': 'str'}, + 'details': {'key': 'error.details', 'type': '[CloudErrorBody]'}, + 'additional_info': {'key': 'error.additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } def __init__(self, **kwargs): super(CloudError, self).__init__(**kwargs) self.code = None self.message = None + self.target = None + self.details = None + self.additional_info = None class CloudErrorException(HttpOperationError): @@ -2376,6 +2632,50 @@ def __init__(self, deserialize, response, *args): super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) +class CloudErrorBody(Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.security.models.CloudErrorBody] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.security.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + class Compliance(Resource): """Compliance of a scope. @@ -2580,8 +2880,8 @@ def __init__(self, **kwargs): self.id = kwargs.get('id', None) -class ConnectionToIpNotAllowed(AllowlistCustomAlertRule): - """Outbound connection to an ip that isn't allowed. Allow list consists of +class ConnectionFromIpNotAllowed(AllowlistCustomAlertRule): + """Inbound connection from an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation. Variables are only populated by the server, and will be ignored when @@ -2624,71 +2924,141 @@ class ConnectionToIpNotAllowed(AllowlistCustomAlertRule): } def __init__(self, **kwargs): - super(ConnectionToIpNotAllowed, self).__init__(**kwargs) - self.rule_type = 'ConnectionToIpNotAllowed' + super(ConnectionFromIpNotAllowed, self).__init__(**kwargs) + self.rule_type = 'ConnectionFromIpNotAllowed' -class ConnectorSetting(Resource): - """The connector setting. +class ConnectionStrings(Model): + """Connection string for ingesting security data and logs. - Variables are only populated by the server, and will be ignored when - sending a request. + All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param hybrid_compute_settings: Settings for hybrid compute management. - These settings are relevant only for Arc autoProvision (Hybrid Compute). - :type hybrid_compute_settings: - ~azure.mgmt.security.models.HybridComputeSettingsProperties - :param authentication_details: Settings for authentication management, - these settings are relevant only for the cloud connector. - :type authentication_details: - ~azure.mgmt.security.models.AuthenticationDetailsProperties + :param value: Required. Connection strings + :type value: list[~azure.mgmt.security.models.IngestionConnectionString] """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + 'value': {'required': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'hybrid_compute_settings': {'key': 'properties.hybridComputeSettings', 'type': 'HybridComputeSettingsProperties'}, - 'authentication_details': {'key': 'properties.authenticationDetails', 'type': 'AuthenticationDetailsProperties'}, + 'value': {'key': 'value', 'type': '[IngestionConnectionString]'}, } def __init__(self, **kwargs): - super(ConnectorSetting, self).__init__(**kwargs) - self.hybrid_compute_settings = kwargs.get('hybrid_compute_settings', None) - self.authentication_details = kwargs.get('authentication_details', None) + super(ConnectionStrings, self).__init__(**kwargs) + self.value = kwargs.get('value', None) -class ContainerRegistryVulnerabilityProperties(AdditionalData): - """Additional context fields for container registry Vulnerability assessment. +class ConnectionToIpNotAllowed(AllowlistCustomAlertRule): + """Outbound connection to an ip that isn't allowed. Allow list consists of + ipv4 or ipv6 range in CIDR notation. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :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 display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. Constant filled by server. + :type rule_type: str + :ivar value_type: The value type of the items in the list. Possible values + include: 'IpCidr', 'String' + :vartype value_type: str or ~azure.mgmt.security.models.ValueType + :param allowlist_values: Required. The values to allow. The format of the + values depends on the rule type. + :type allowlist_values: list[str] + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'value_type': {'readonly': True}, + 'allowlist_values': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'value_type': {'key': 'valueType', 'type': 'str'}, + 'allowlist_values': {'key': 'allowlistValues', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ConnectionToIpNotAllowed, self).__init__(**kwargs) + self.rule_type = 'ConnectionToIpNotAllowed' + + +class ConnectorSetting(Resource): + """The connector setting. + + 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 hybrid_compute_settings: Settings for hybrid compute management. + These settings are relevant only for Arc autoProvision (Hybrid Compute). + :type hybrid_compute_settings: + ~azure.mgmt.security.models.HybridComputeSettingsProperties + :param authentication_details: Settings for authentication management, + these settings are relevant only for the cloud connector. + :type authentication_details: + ~azure.mgmt.security.models.AuthenticationDetailsProperties + """ + + _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'}, + 'hybrid_compute_settings': {'key': 'properties.hybridComputeSettings', 'type': 'HybridComputeSettingsProperties'}, + 'authentication_details': {'key': 'properties.authenticationDetails', 'type': 'AuthenticationDetailsProperties'}, + } + + def __init__(self, **kwargs): + super(ConnectorSetting, self).__init__(**kwargs) + self.hybrid_compute_settings = kwargs.get('hybrid_compute_settings', None) + self.authentication_details = kwargs.get('authentication_details', None) + + +class ContainerRegistryVulnerabilityProperties(AdditionalData): + """Additional context fields for container registry Vulnerability assessment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param assessed_resource_type: Required. Constant filled by server. + :type assessed_resource_type: str + :ivar type: Vulnerability Type. e.g: Vulnerability, Potential + Vulnerability, Information Gathered, Vulnerability + :vartype type: str + :ivar cvss: Dictionary from cvss version to cvss details object + :vartype cvss: dict[str, ~azure.mgmt.security.models.CVSS] + :ivar patchable: Indicates whether a patch is available or not + :vartype patchable: bool + :ivar cve: List of CVEs + :vartype cve: list[~azure.mgmt.security.models.CVE] :ivar published_time: Published time :vartype published_time: datetime :ivar vendor_references: @@ -2789,95 +3159,6 @@ def __init__(self, **kwargs): self.base = None -class SettingResource(Resource): - """The kind of the security setting. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Setting - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param kind: Required. Constant filled by server. - :type kind: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - } - - _subtype_map = { - 'kind': {'Setting': 'Setting'} - } - - def __init__(self, **kwargs): - super(SettingResource, self).__init__(**kwargs) - self.kind = None - self.kind = 'SettingResource' - - -class Setting(SettingResource): - """Represents a security setting in Azure Security Center. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataExportSettings - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param kind: Required. Constant filled by server. - :type kind: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - } - - _subtype_map = { - 'kind': {'DataExportSettings': 'DataExportSettings'} - } - - def __init__(self, **kwargs): - super(Setting, self).__init__(**kwargs) - self.kind = 'Setting' - - class DataExportSettings(Setting): """Represents a data export setting. @@ -2894,7 +3175,7 @@ class DataExportSettings(Setting): :vartype type: str :param kind: Required. Constant filled by server. :type kind: str - :param enabled: Required. Is the data export setting is enabled + :param enabled: Required. Is the data export setting enabled :type enabled: bool """ @@ -3309,6 +3590,34 @@ def __init__(self, **kwargs): self.network_security_groups = kwargs.get('network_security_groups', None) +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + class ETag(Model): """Entity tag is used for comparing two or more entities from the same requested resource. @@ -3922,68 +4231,106 @@ def __init__(self, **kwargs): self.keywords = kwargs.get('keywords', None) -class IotAlert(Model): - """IoT alert. +class IngestionConnectionString(Model): + """Connection string for ingesting security data and logs. Variables are only populated by the server, and will be ignored when sending a request. - :ivar system_alert_id: Holds the product canonical identifier of the alert - within the scope of a product - :vartype system_alert_id: str - :ivar compromised_entity: Display name of the main entity being reported - on - :vartype compromised_entity: str - :ivar alert_type: The type name of the alert - :vartype alert_type: str - :ivar start_time_utc: The impact start time of the alert (the time of the - first event or activity included in the alert) - :vartype start_time_utc: str - :ivar end_time_utc: The impact end time of the alert (the time of the last - event or activity included in the alert) - :vartype end_time_utc: str - :param entities: A list of entities related to the alert - :type entities: list[object] - :param extended_properties: A bag of fields which extends the alert - information - :type extended_properties: object + :ivar location: The region where ingested logs and data resides + :vartype location: str + :ivar value: Connection string value + :vartype value: str """ _validation = { - 'system_alert_id': {'readonly': True}, - 'compromised_entity': {'readonly': True}, - 'alert_type': {'readonly': True}, - 'start_time_utc': {'readonly': True}, - 'end_time_utc': {'readonly': True}, + 'location': {'readonly': True}, + 'value': {'readonly': True}, } _attribute_map = { - 'system_alert_id': {'key': 'properties.systemAlertId', 'type': 'str'}, - 'compromised_entity': {'key': 'properties.compromisedEntity', 'type': 'str'}, - 'alert_type': {'key': 'properties.alertType', 'type': 'str'}, - 'start_time_utc': {'key': 'properties.startTimeUtc', 'type': 'str'}, - 'end_time_utc': {'key': 'properties.endTimeUtc', 'type': 'str'}, - 'entities': {'key': 'properties.entities', 'type': '[object]'}, - 'extended_properties': {'key': 'properties.extendedProperties', 'type': 'object'}, + 'location': {'key': 'location', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, } def __init__(self, **kwargs): - super(IotAlert, self).__init__(**kwargs) - self.system_alert_id = None - self.compromised_entity = None - self.alert_type = None - self.start_time_utc = None - self.end_time_utc = None - self.entities = kwargs.get('entities', None) - self.extended_properties = kwargs.get('extended_properties', None) + super(IngestionConnectionString, self).__init__(**kwargs) + self.location = None + self.value = None -class IotAlertModel(Model): +class IngestionSetting(Resource): + """Configures how to correlate scan data and logs with resources associated + with the subscription. + + 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 properties: Ingestion setting data + :type properties: object + """ + + _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'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(IngestionSetting, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class IngestionSettingToken(Model): + """Configures how to correlate scan data and logs with resources associated + with the subscription. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar token: The token is used for correlating security data and logs with + the resources in the subscription. + :vartype token: str + """ + + _validation = { + 'token': {'readonly': True}, + } + + _attribute_map = { + 'token': {'key': 'token', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IngestionSettingToken, self).__init__(**kwargs) + self.token = None + + +class IotAlertModel(Resource): """IoT alert. Variables are only populated by the server, and will be ignored when sending a request. + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str :ivar system_alert_id: Holds the product canonical identifier of the alert within the scope of a product :vartype system_alert_id: str @@ -4006,6 +4353,9 @@ class IotAlertModel(Model): """ _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, 'system_alert_id': {'readonly': True}, 'compromised_entity': {'readonly': True}, 'alert_type': {'readonly': True}, @@ -4014,6 +4364,9 @@ class IotAlertModel(Model): } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, 'system_alert_id': {'key': 'properties.systemAlertId', 'type': 'str'}, 'compromised_entity': {'key': 'properties.compromisedEntity', 'type': 'str'}, 'alert_type': {'key': 'properties.alertType', 'type': 'str'}, @@ -4168,87 +4521,50 @@ class IotDefenderSettingsModel(Resource): :vartype id: str :ivar name: Resource name :vartype name: str - :ivar type: Resource type - :vartype type: str - :param device_quota: Required. Size of the device quota (as a opposed to a - Pay as You Go billing model). Value is required to be in multiples of - 1000. - :type device_quota: int - :param sentinel_workspace_resource_ids: Required. Sentinel Workspace - Resource Ids - :type sentinel_workspace_resource_ids: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'device_quota': {'required': True, 'minimum': 1000}, - 'sentinel_workspace_resource_ids': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'device_quota': {'key': 'properties.deviceQuota', 'type': 'int'}, - 'sentinel_workspace_resource_ids': {'key': 'properties.sentinelWorkspaceResourceIds', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(IotDefenderSettingsModel, self).__init__(**kwargs) - self.device_quota = kwargs.get('device_quota', None) - self.sentinel_workspace_resource_ids = kwargs.get('sentinel_workspace_resource_ids', None) - - -class IotRecommendation(Resource): - """IoT recommendation. - - 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 device_id: Identifier of the device being reported on - :vartype device_id: str - :ivar recommendation_type: The type name of the recommendation - :vartype recommendation_type: str - :ivar discovered_time_utc: The discovery time of the recommendation - :vartype discovered_time_utc: str - :param recommendation_additional_data: A bag of fields which extends the - recommendation information - :type recommendation_additional_data: object + :ivar type: Resource type + :vartype type: str + :param device_quota: Required. Size of the device quota (as a opposed to a + Pay as You Go billing model). Value is required to be in multiples of + 1000. + :type device_quota: int + :param sentinel_workspace_resource_ids: Required. Sentinel Workspace + Resource Ids + :type sentinel_workspace_resource_ids: list[str] + :param onboarding_kind: Required. The kind of onboarding for the + subscription. Possible values include: 'Default', 'MigratedToAzure', + 'Evaluation', 'Purchased' + :type onboarding_kind: str or ~azure.mgmt.security.models.OnboardingKind + :ivar evaluation_end_time: End time of the evaluation period, if such + exist + :vartype evaluation_end_time: datetime """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'device_id': {'readonly': True}, - 'recommendation_type': {'readonly': True}, - 'discovered_time_utc': {'readonly': True}, + 'device_quota': {'required': True, 'minimum': 1000}, + 'sentinel_workspace_resource_ids': {'required': True}, + 'onboarding_kind': {'required': True}, + 'evaluation_end_time': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'device_id': {'key': 'properties.deviceId', 'type': 'str'}, - 'recommendation_type': {'key': 'properties.recommendationType', 'type': 'str'}, - 'discovered_time_utc': {'key': 'properties.discoveredTimeUtc', 'type': 'str'}, - 'recommendation_additional_data': {'key': 'properties.recommendationAdditionalData', 'type': 'object'}, + 'device_quota': {'key': 'properties.deviceQuota', 'type': 'int'}, + 'sentinel_workspace_resource_ids': {'key': 'properties.sentinelWorkspaceResourceIds', 'type': '[str]'}, + 'onboarding_kind': {'key': 'properties.onboardingKind', 'type': 'str'}, + 'evaluation_end_time': {'key': 'properties.evaluationEndTime', 'type': 'iso-8601'}, } def __init__(self, **kwargs): - super(IotRecommendation, self).__init__(**kwargs) - self.device_id = None - self.recommendation_type = None - self.discovered_time_utc = None - self.recommendation_additional_data = kwargs.get('recommendation_additional_data', None) + super(IotDefenderSettingsModel, self).__init__(**kwargs) + self.device_quota = kwargs.get('device_quota', None) + self.sentinel_workspace_resource_ids = kwargs.get('sentinel_workspace_resource_ids', None) + self.onboarding_kind = kwargs.get('onboarding_kind', None) + self.evaluation_end_time = None class IotRecommendationModel(Resource): @@ -4430,7 +4746,7 @@ class IoTSecurityAggregatedAlert(Model): :vartype description: str :ivar count: Number of alerts occurrences within the aggregated time window. - :vartype count: int + :vartype count: long :ivar effected_resource_type: Azure resource ID of the resource that received the alerts. :vartype effected_resource_type: str @@ -4478,7 +4794,7 @@ class IoTSecurityAggregatedAlert(Model): 'reported_severity': {'key': 'properties.reportedSeverity', 'type': 'str'}, 'remediation_steps': {'key': 'properties.remediationSteps', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, + 'count': {'key': 'properties.count', 'type': 'long'}, 'effected_resource_type': {'key': 'properties.effectedResourceType', 'type': 'str'}, 'system_source': {'key': 'properties.systemSource', 'type': 'str'}, 'action_taken': {'key': 'properties.actionTaken', 'type': 'str'}, @@ -4516,7 +4832,7 @@ class IoTSecurityAggregatedAlertPropertiesTopDevicesListItem(Model): :ivar device_id: Name of the device. :vartype device_id: str :ivar alerts_count: Number of alerts raised for this device. - :vartype alerts_count: int + :vartype alerts_count: long :ivar last_occurrence: Most recent time this alert was raised for this device, on this day. :vartype last_occurrence: str @@ -4530,7 +4846,7 @@ class IoTSecurityAggregatedAlertPropertiesTopDevicesListItem(Model): _attribute_map = { 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'alerts_count': {'key': 'alertsCount', 'type': 'int'}, + 'alerts_count': {'key': 'alertsCount', 'type': 'long'}, 'last_occurrence': {'key': 'lastOccurrence', 'type': 'str'}, } @@ -4574,10 +4890,10 @@ class IoTSecurityAggregatedRecommendation(Model): ~azure.mgmt.security.models.ReportedSeverity :ivar healthy_devices: Number of healthy devices within the IoT Security solution. - :vartype healthy_devices: int + :vartype healthy_devices: long :ivar unhealthy_device_count: Number of unhealthy devices within the IoT Security solution. - :vartype unhealthy_device_count: int + :vartype unhealthy_device_count: long :ivar log_analytics_query: Log analytics query for getting the list of affected devices/alerts. :vartype log_analytics_query: str @@ -4610,8 +4926,8 @@ class IoTSecurityAggregatedRecommendation(Model): 'detected_by': {'key': 'properties.detectedBy', 'type': 'str'}, 'remediation_steps': {'key': 'properties.remediationSteps', 'type': 'str'}, 'reported_severity': {'key': 'properties.reportedSeverity', 'type': 'str'}, - 'healthy_devices': {'key': 'properties.healthyDevices', 'type': 'int'}, - 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'int'}, + 'healthy_devices': {'key': 'properties.healthyDevices', 'type': 'long'}, + 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'long'}, 'log_analytics_query': {'key': 'properties.logAnalyticsQuery', 'type': 'str'}, } @@ -4643,7 +4959,7 @@ class IoTSecurityAlertedDevice(Model): :ivar device_id: Device identifier. :vartype device_id: str :ivar alerts_count: Number of alerts raised for this device. - :vartype alerts_count: int + :vartype alerts_count: long """ _validation = { @@ -4653,7 +4969,7 @@ class IoTSecurityAlertedDevice(Model): _attribute_map = { 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'alerts_count': {'key': 'alertsCount', 'type': 'int'}, + 'alerts_count': {'key': 'alertsCount', 'type': 'long'}, } def __init__(self, **kwargs): @@ -4676,7 +4992,7 @@ class IoTSecurityDeviceAlert(Model): :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity :ivar alerts_count: Number of alerts raised for this alert type. - :vartype alerts_count: int + :vartype alerts_count: long """ _validation = { @@ -4688,7 +5004,7 @@ class IoTSecurityDeviceAlert(Model): _attribute_map = { 'alert_display_name': {'key': 'alertDisplayName', 'type': 'str'}, 'reported_severity': {'key': 'reportedSeverity', 'type': 'str'}, - 'alerts_count': {'key': 'alertsCount', 'type': 'int'}, + 'alerts_count': {'key': 'alertsCount', 'type': 'long'}, } def __init__(self, **kwargs): @@ -4712,7 +5028,7 @@ class IoTSecurityDeviceRecommendation(Model): :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity :ivar devices_count: Number of devices with this recommendation. - :vartype devices_count: int + :vartype devices_count: long """ _validation = { @@ -4724,7 +5040,7 @@ class IoTSecurityDeviceRecommendation(Model): _attribute_map = { 'recommendation_display_name': {'key': 'recommendationDisplayName', 'type': 'str'}, 'reported_severity': {'key': 'reportedSeverity', 'type': 'str'}, - 'devices_count': {'key': 'devicesCount', 'type': 'int'}, + 'devices_count': {'key': 'devicesCount', 'type': 'long'}, } def __init__(self, **kwargs): @@ -4750,7 +5066,7 @@ class IoTSecuritySolutionAnalyticsModel(Resource): :vartype metrics: ~azure.mgmt.security.models.IoTSeverityMetrics :ivar unhealthy_device_count: Number of unhealthy devices within your IoT Security solution. - :vartype unhealthy_device_count: int + :vartype unhealthy_device_count: long :ivar devices_metrics: List of device metrics by the aggregation date. :vartype devices_metrics: list[~azure.mgmt.security.models.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem] @@ -4781,7 +5097,7 @@ class IoTSecuritySolutionAnalyticsModel(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'metrics': {'key': 'properties.metrics', 'type': 'IoTSeverityMetrics'}, - 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'int'}, + 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'long'}, 'devices_metrics': {'key': 'properties.devicesMetrics', 'type': '[IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem]'}, 'top_alerted_devices': {'key': 'properties.topAlertedDevices', 'type': '[IoTSecurityAlertedDevice]'}, 'most_prevalent_device_alerts': {'key': 'properties.mostPrevalentDeviceAlerts', 'type': '[IoTSecurityDeviceAlert]'}, @@ -4899,6 +5215,12 @@ class IoTSecuritySolutionModel(Model): . :type unmasked_ip_logging_status: str or ~azure.mgmt.security.models.UnmaskedIpLoggingStatus + :param additional_workspaces: List of additional workspaces + :type additional_workspaces: + list[~azure.mgmt.security.models.AdditionalWorkspacesProperties] + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: ~azure.mgmt.security.models.SystemData """ _validation = { @@ -4908,6 +5230,7 @@ class IoTSecuritySolutionModel(Model): 'display_name': {'required': True}, 'iot_hubs': {'required': True}, 'auto_discovered_resources': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -4926,6 +5249,8 @@ class IoTSecuritySolutionModel(Model): 'auto_discovered_resources': {'key': 'properties.autoDiscoveredResources', 'type': '[str]'}, 'recommendations_configuration': {'key': 'properties.recommendationsConfiguration', 'type': '[RecommendationConfigurationProperties]'}, 'unmasked_ip_logging_status': {'key': 'properties.unmaskedIpLoggingStatus', 'type': 'str'}, + 'additional_workspaces': {'key': 'properties.additionalWorkspaces', 'type': '[AdditionalWorkspacesProperties]'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__(self, **kwargs): @@ -4945,10 +5270,35 @@ def __init__(self, **kwargs): self.auto_discovered_resources = None self.recommendations_configuration = kwargs.get('recommendations_configuration', None) self.unmasked_ip_logging_status = kwargs.get('unmasked_ip_logging_status', "Disabled") + self.additional_workspaces = kwargs.get('additional_workspaces', None) + self.system_data = None + + +class IotSensorsList(Model): + """List of IoT sensors. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List data + :vartype value: list[~azure.mgmt.security.models.IotSensorsModel] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IotSensorsModel]'}, + } + + def __init__(self, **kwargs): + super(IotSensorsList, self).__init__(**kwargs) + self.value = None -class IotSensor(Resource): - """IoT sensor. +class IotSensorsModel(Resource): + """IoT sensor model. Variables are only populated by the server, and will be ignored when sending a request. @@ -4959,36 +5309,111 @@ class IotSensor(Resource): :vartype name: str :ivar type: Resource type :vartype type: str - :param properties: IoT sensor properties - :type properties: object + :ivar connectivity_time: Last connectivity time of the IoT sensor + :vartype connectivity_time: str + :ivar creation_time: Creation time of the IoT sensor + :vartype creation_time: str + :ivar dynamic_learning: Dynamic mode status of the IoT sensor + :vartype dynamic_learning: bool + :ivar learning_mode: Learning mode status of the IoT sensor + :vartype learning_mode: bool + :ivar sensor_status: Status of the IoT sensor. Possible values include: + 'Ok', 'Disconnected', 'Unavailable' + :vartype sensor_status: str or ~azure.mgmt.security.models.SensorStatus + :ivar sensor_version: Version of the IoT sensor + :vartype sensor_version: str + :param ti_automatic_updates: TI Automatic mode status of the IoT sensor + :type ti_automatic_updates: bool + :ivar ti_status: TI Status of the IoT sensor. Possible values include: + 'Ok', 'Failed', 'InProgress', 'UpdateAvailable' + :vartype ti_status: str or ~azure.mgmt.security.models.TiStatus + :ivar ti_version: TI Version of the IoT sensor + :vartype ti_version: str + :param zone: Zone of the IoT sensor + :type zone: str + :param sensor_type: Type of sensor. Possible values include: 'Ot', + 'Enterprise' + :type sensor_type: str or ~azure.mgmt.security.models.SensorType """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'connectivity_time': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'dynamic_learning': {'readonly': True}, + 'learning_mode': {'readonly': True}, + 'sensor_status': {'readonly': True}, + 'sensor_version': {'readonly': True}, + 'ti_status': {'readonly': True}, + 'ti_version': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, + 'connectivity_time': {'key': 'properties.connectivityTime', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, + 'dynamic_learning': {'key': 'properties.dynamicLearning', 'type': 'bool'}, + 'learning_mode': {'key': 'properties.learningMode', 'type': 'bool'}, + 'sensor_status': {'key': 'properties.sensorStatus', 'type': 'str'}, + 'sensor_version': {'key': 'properties.sensorVersion', 'type': 'str'}, + 'ti_automatic_updates': {'key': 'properties.tiAutomaticUpdates', 'type': 'bool'}, + 'ti_status': {'key': 'properties.tiStatus', 'type': 'str'}, + 'ti_version': {'key': 'properties.tiVersion', 'type': 'str'}, + 'zone': {'key': 'properties.zone', 'type': 'str'}, + 'sensor_type': {'key': 'properties.sensorType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IotSensorsModel, self).__init__(**kwargs) + self.connectivity_time = None + self.creation_time = None + self.dynamic_learning = None + self.learning_mode = None + self.sensor_status = None + self.sensor_version = None + self.ti_automatic_updates = kwargs.get('ti_automatic_updates', None) + self.ti_status = None + self.ti_version = None + self.zone = kwargs.get('zone', None) + self.sensor_type = kwargs.get('sensor_type', None) + + +class IoTSeverityMetrics(Model): + """IoT Security solution analytics severity metrics. + + :param high: Count of high severity alerts/recommendations. + :type high: long + :param medium: Count of medium severity alerts/recommendations. + :type medium: long + :param low: Count of low severity alerts/recommendations. + :type low: long + """ + + _attribute_map = { + 'high': {'key': 'high', 'type': 'long'}, + 'medium': {'key': 'medium', 'type': 'long'}, + 'low': {'key': 'low', 'type': 'long'}, } def __init__(self, **kwargs): - super(IotSensor, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + super(IoTSeverityMetrics, self).__init__(**kwargs) + self.high = kwargs.get('high', None) + self.medium = kwargs.get('medium', None) + self.low = kwargs.get('low', None) -class IotSensorsList(Model): - """List of IoT sensors. +class IotSitesList(Model): + """List of IoT sites. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List data - :vartype value: list[~azure.mgmt.security.models.IotSensor] + :vartype value: list[~azure.mgmt.security.models.IotSitesModel] """ _validation = { @@ -4996,36 +5421,53 @@ class IotSensorsList(Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[IotSensor]'}, + 'value': {'key': 'value', 'type': '[IotSitesModel]'}, } def __init__(self, **kwargs): - super(IotSensorsList, self).__init__(**kwargs) + super(IotSitesList, self).__init__(**kwargs) self.value = None -class IoTSeverityMetrics(Model): - """IoT Security solution analytics severity metrics. +class IotSitesModel(Resource): + """IoT site model. - :param high: Count of high severity alerts/recommendations. - :type high: int - :param medium: Count of medium severity alerts/recommendations. - :type medium: int - :param low: Count of low severity alerts/recommendations. - :type low: int + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param display_name: Required. Display name of the IoT site + :type display_name: str + :param tags: Tags of the IoT site + :type tags: dict[str, str] """ + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'required': True}, + } + _attribute_map = { - 'high': {'key': 'high', 'type': 'int'}, - 'medium': {'key': 'medium', 'type': 'int'}, - 'low': {'key': 'low', 'type': 'int'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'tags': {'key': 'properties.tags', 'type': '{str}'}, } def __init__(self, **kwargs): - super(IoTSeverityMetrics, self).__init__(**kwargs) - self.high = kwargs.get('high', None) - self.medium = kwargs.get('medium', None) - self.low = kwargs.get('low', None) + super(IotSitesModel, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.tags = kwargs.get('tags', None) class IpAddress(Model): @@ -6054,19 +6496,39 @@ class PackageDownloads(Model): ~azure.mgmt.security.models.PackageDownloadsCentralManager :ivar threat_intelligence: All downloads for threat intelligence :vartype threat_intelligence: - ~azure.mgmt.security.models.PackageDownloadsThreatIntelligence + list[~azure.mgmt.security.models.PackageDownloadInfo] + :ivar snmp: SNMP Server file + :vartype snmp: list[~azure.mgmt.security.models.PackageDownloadInfo] + :ivar wmi_tool: Used for local configuration export + :vartype wmi_tool: list[~azure.mgmt.security.models.PackageDownloadInfo] + :ivar authorized_devices_import_template: Authorized devices import + template + :vartype authorized_devices_import_template: + list[~azure.mgmt.security.models.PackageDownloadInfo] + :ivar device_information_update_import_template: Authorized devices import + template + :vartype device_information_update_import_template: + list[~azure.mgmt.security.models.PackageDownloadInfo] """ _validation = { 'sensor': {'readonly': True}, 'central_manager': {'readonly': True}, 'threat_intelligence': {'readonly': True}, + 'snmp': {'readonly': True}, + 'wmi_tool': {'readonly': True}, + 'authorized_devices_import_template': {'readonly': True}, + 'device_information_update_import_template': {'readonly': True}, } _attribute_map = { 'sensor': {'key': 'sensor', 'type': 'PackageDownloadsSensor'}, 'central_manager': {'key': 'centralManager', 'type': 'PackageDownloadsCentralManager'}, - 'threat_intelligence': {'key': 'threatIntelligence', 'type': 'PackageDownloadsThreatIntelligence'}, + 'threat_intelligence': {'key': 'threatIntelligence', 'type': '[PackageDownloadInfo]'}, + 'snmp': {'key': 'snmp', 'type': '[PackageDownloadInfo]'}, + 'wmi_tool': {'key': 'wmiTool', 'type': '[PackageDownloadInfo]'}, + 'authorized_devices_import_template': {'key': 'authorizedDevicesImportTemplate', 'type': '[PackageDownloadInfo]'}, + 'device_information_update_import_template': {'key': 'deviceInformationUpdateImportTemplate', 'type': '[PackageDownloadInfo]'}, } def __init__(self, **kwargs): @@ -6074,6 +6536,10 @@ def __init__(self, **kwargs): self.sensor = None self.central_manager = None self.threat_intelligence = None + self.snmp = None + self.wmi_tool = None + self.authorized_devices_import_template = None + self.device_information_update_import_template = None class PackageDownloadsCentralManager(Model): @@ -6087,7 +6553,8 @@ class PackageDownloadsCentralManager(Model): ~azure.mgmt.security.models.PackageDownloadsCentralManagerFull :ivar upgrade: Central Manager upgrade package downloads (on existing installations) - :vartype upgrade: list[~azure.mgmt.security.models.PackageDownloadInfo] + :vartype upgrade: + list[~azure.mgmt.security.models.UpgradePackageDownloadInfo] """ _validation = { @@ -6097,7 +6564,7 @@ class PackageDownloadsCentralManager(Model): _attribute_map = { 'full': {'key': 'full', 'type': 'PackageDownloadsCentralManagerFull'}, - 'upgrade': {'key': 'upgrade', 'type': '[PackageDownloadInfo]'}, + 'upgrade': {'key': 'upgrade', 'type': '[UpgradePackageDownloadInfo]'}, } def __init__(self, **kwargs): @@ -6187,7 +6654,8 @@ class PackageDownloadsSensor(Model): :vartype full: ~azure.mgmt.security.models.PackageDownloadsSensorFull :param upgrade: Sensor upgrade package downloads (on existing installations) - :type upgrade: list[~azure.mgmt.security.models.PackageDownloadInfo] + :type upgrade: + list[~azure.mgmt.security.models.UpgradePackageDownloadInfo] """ _validation = { @@ -6196,7 +6664,7 @@ class PackageDownloadsSensor(Model): _attribute_map = { 'full': {'key': 'full', 'type': 'PackageDownloadsSensorFull'}, - 'upgrade': {'key': 'upgrade', 'type': '[PackageDownloadInfo]'}, + 'upgrade': {'key': 'upgrade', 'type': '[UpgradePackageDownloadInfo]'}, } def __init__(self, **kwargs): @@ -6266,22 +6734,6 @@ def __init__(self, **kwargs): self.line = None -class PackageDownloadsThreatIntelligence(Model): - """All downloads for threat intelligence. - - :param link: Download link - :type link: str - """ - - _attribute_map = { - 'link': {'key': 'link', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PackageDownloadsThreatIntelligence, self).__init__(**kwargs) - self.link = kwargs.get('link', None) - - class PathRecommendation(Model): """Represents a path that is recommended to be allowed and its properties. @@ -6909,6 +7361,22 @@ def __init__(self, **kwargs): self.portal_link = kwargs.get('portal_link', None) +class ResetPasswordInput(Model): + """Reset password input. + + :param appliance_id: The appliance id of the sensor. + :type appliance_id: str + """ + + _attribute_map = { + 'appliance_id': {'key': 'applianceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResetPasswordInput, self).__init__(**kwargs) + self.appliance_id = kwargs.get('appliance_id', None) + + class Rule(Model): """Describes remote addresses that is recommended to communicate with the Azure resource on some (Protocol, Port, Direction). All other remote @@ -7558,8 +8026,6 @@ class SecurityAssessment(Resource): :type resource_details: ~azure.mgmt.security.models.ResourceDetails :ivar display_name: User friendly display name of the assessment :vartype display_name: str - :param status: Required. - :type status: ~azure.mgmt.security.models.AssessmentStatus :param additional_data: Additional data regarding the assessment :type additional_data: dict[str, str] :param links: @@ -7570,6 +8036,8 @@ class SecurityAssessment(Resource): :param partners_data: :type partners_data: ~azure.mgmt.security.models.SecurityAssessmentPartnerData + :param status: Required. + :type status: ~azure.mgmt.security.models.AssessmentStatus """ _validation = { @@ -7587,22 +8055,22 @@ class SecurityAssessment(Resource): 'type': {'key': 'type', 'type': 'str'}, 'resource_details': {'key': 'properties.resourceDetails', 'type': 'ResourceDetails'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'AssessmentStatus'}, 'additional_data': {'key': 'properties.additionalData', 'type': '{str}'}, 'links': {'key': 'properties.links', 'type': 'AssessmentLinks'}, 'metadata': {'key': 'properties.metadata', 'type': 'SecurityAssessmentMetadataProperties'}, 'partners_data': {'key': 'properties.partnersData', 'type': 'SecurityAssessmentPartnerData'}, + 'status': {'key': 'properties.status', 'type': 'AssessmentStatus'}, } def __init__(self, **kwargs): super(SecurityAssessment, self).__init__(**kwargs) self.resource_details = kwargs.get('resource_details', None) self.display_name = None - self.status = kwargs.get('status', None) self.additional_data = kwargs.get('additional_data', None) self.links = kwargs.get('links', None) self.metadata = kwargs.get('metadata', None) self.partners_data = kwargs.get('partners_data', None) + self.status = kwargs.get('status', None) class SecurityAssessmentMetadata(Resource): @@ -7630,8 +8098,131 @@ class SecurityAssessmentMetadata(Resource): :param remediation_description: Human readable description of what you should do to mitigate this security issue :type remediation_description: str - :param category: - :type category: list[str or ~azure.mgmt.security.models.Category] + :param categories: + :type categories: list[str or ~azure.mgmt.security.models.Categories] + :param severity: Required. The severity level of the assessment. Possible + values include: 'Low', 'Medium', 'High' + :type severity: str or ~azure.mgmt.security.models.Severity + :param user_impact: The user impact of the assessment. Possible values + include: 'Low', 'Moderate', 'High' + :type user_impact: str or ~azure.mgmt.security.models.UserImpact + :param implementation_effort: The implementation effort required to + remediate this assessment. Possible values include: 'Low', 'Moderate', + 'High' + :type implementation_effort: str or + ~azure.mgmt.security.models.ImplementationEffort + :param threats: + :type threats: list[str or ~azure.mgmt.security.models.Threats] + :param preview: True if this assessment is in preview release status + :type preview: bool + :param assessment_type: Required. BuiltIn if the assessment based on + built-in Azure Policy definition, Custom if the assessment based on custom + Azure Policy definition. Possible values include: 'BuiltIn', + 'CustomPolicy', 'CustomerManaged', 'VerifiedPartner' + :type assessment_type: str or ~azure.mgmt.security.models.AssessmentType + :param partner_data: + :type partner_data: + ~azure.mgmt.security.models.SecurityAssessmentMetadataPartnerData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'required': True}, + 'policy_definition_id': {'readonly': True}, + 'severity': {'required': True}, + 'assessment_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'policy_definition_id': {'key': 'properties.policyDefinitionId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'remediation_description': {'key': 'properties.remediationDescription', 'type': 'str'}, + 'categories': {'key': 'properties.categories', 'type': '[str]'}, + 'severity': {'key': 'properties.severity', 'type': 'str'}, + 'user_impact': {'key': 'properties.userImpact', 'type': 'str'}, + 'implementation_effort': {'key': 'properties.implementationEffort', 'type': 'str'}, + 'threats': {'key': 'properties.threats', 'type': '[str]'}, + 'preview': {'key': 'properties.preview', 'type': 'bool'}, + 'assessment_type': {'key': 'properties.assessmentType', 'type': 'str'}, + 'partner_data': {'key': 'properties.partnerData', 'type': 'SecurityAssessmentMetadataPartnerData'}, + } + + def __init__(self, **kwargs): + super(SecurityAssessmentMetadata, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.policy_definition_id = None + self.description = kwargs.get('description', None) + self.remediation_description = kwargs.get('remediation_description', None) + self.categories = kwargs.get('categories', None) + self.severity = kwargs.get('severity', None) + self.user_impact = kwargs.get('user_impact', None) + self.implementation_effort = kwargs.get('implementation_effort', None) + self.threats = kwargs.get('threats', None) + self.preview = kwargs.get('preview', None) + self.assessment_type = kwargs.get('assessment_type', None) + self.partner_data = kwargs.get('partner_data', None) + + +class SecurityAssessmentMetadataPartnerData(Model): + """Describes the partner that created the assessment. + + All required parameters must be populated in order to send to Azure. + + :param partner_name: Required. Name of the company of the partner + :type partner_name: str + :param product_name: Name of the product of the partner that created the + assessment + :type product_name: str + :param secret: Required. Secret to authenticate the partner and verify it + created the assessment - write only + :type secret: str + """ + + _validation = { + 'partner_name': {'required': True}, + 'secret': {'required': True}, + } + + _attribute_map = { + 'partner_name': {'key': 'partnerName', 'type': 'str'}, + 'product_name': {'key': 'productName', 'type': 'str'}, + 'secret': {'key': 'secret', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SecurityAssessmentMetadataPartnerData, self).__init__(**kwargs) + self.partner_name = kwargs.get('partner_name', None) + self.product_name = kwargs.get('product_name', None) + self.secret = kwargs.get('secret', None) + + +class SecurityAssessmentMetadataProperties(Model): + """Describes properties of an assessment metadata. + + 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 display_name: Required. User friendly display name of the + assessment + :type display_name: str + :ivar policy_definition_id: Azure resource ID of the policy definition + that turns this assessment calculation on + :vartype policy_definition_id: str + :param description: Human readable description of the assessment + :type description: str + :param remediation_description: Human readable description of what you + should do to mitigate this security issue + :type remediation_description: str + :param categories: + :type categories: list[str or ~azure.mgmt.security.models.Categories] :param severity: Required. The severity level of the assessment. Possible values include: 'Low', 'Medium', 'High' :type severity: str or ~azure.mgmt.security.models.Severity @@ -7658,9 +8249,6 @@ class SecurityAssessmentMetadata(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, 'display_name': {'required': True}, 'policy_definition_id': {'readonly': True}, 'severity': {'required': True}, @@ -7668,30 +8256,27 @@ class SecurityAssessmentMetadata(Resource): } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'policy_definition_id': {'key': 'properties.policyDefinitionId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'remediation_description': {'key': 'properties.remediationDescription', 'type': 'str'}, - 'category': {'key': 'properties.category', 'type': '[str]'}, - 'severity': {'key': 'properties.severity', 'type': 'str'}, - 'user_impact': {'key': 'properties.userImpact', 'type': 'str'}, - 'implementation_effort': {'key': 'properties.implementationEffort', 'type': 'str'}, - 'threats': {'key': 'properties.threats', 'type': '[str]'}, - 'preview': {'key': 'properties.preview', 'type': 'bool'}, - 'assessment_type': {'key': 'properties.assessmentType', 'type': 'str'}, - 'partner_data': {'key': 'properties.partnerData', 'type': 'SecurityAssessmentMetadataPartnerData'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'policy_definition_id': {'key': 'policyDefinitionId', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'remediation_description': {'key': 'remediationDescription', 'type': 'str'}, + 'categories': {'key': 'categories', 'type': '[str]'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'user_impact': {'key': 'userImpact', 'type': 'str'}, + 'implementation_effort': {'key': 'implementationEffort', 'type': 'str'}, + 'threats': {'key': 'threats', 'type': '[str]'}, + 'preview': {'key': 'preview', 'type': 'bool'}, + 'assessment_type': {'key': 'assessmentType', 'type': 'str'}, + 'partner_data': {'key': 'partnerData', 'type': 'SecurityAssessmentMetadataPartnerData'}, } def __init__(self, **kwargs): - super(SecurityAssessmentMetadata, self).__init__(**kwargs) + super(SecurityAssessmentMetadataProperties, self).__init__(**kwargs) self.display_name = kwargs.get('display_name', None) self.policy_definition_id = None self.description = kwargs.get('description', None) self.remediation_description = kwargs.get('remediation_description', None) - self.category = kwargs.get('category', None) + self.categories = kwargs.get('categories', None) self.severity = kwargs.get('severity', None) self.user_impact = kwargs.get('user_impact', None) self.implementation_effort = kwargs.get('implementation_effort', None) @@ -7701,47 +8286,47 @@ def __init__(self, **kwargs): self.partner_data = kwargs.get('partner_data', None) -class SecurityAssessmentMetadataPartnerData(Model): - """Describes the partner that created the assessment. +class SecurityAssessmentMetadataPropertiesResponsePublishDates(Model): + """SecurityAssessmentMetadataPropertiesResponsePublishDates. All required parameters must be populated in order to send to Azure. - :param partner_name: Required. Name of the company of the partner - :type partner_name: str - :param product_name: Name of the product of the partner that created the - assessment - :type product_name: str - :param secret: Required. Secret to authenticate the partner and verify it - created the assessment - write only - :type secret: str + :param ga: + :type ga: str + :param public: Required. + :type public: str """ _validation = { - 'partner_name': {'required': True}, - 'secret': {'required': True}, + 'ga': {'pattern': r'^([0-9]{2}/){2}[0-9]{4}$'}, + 'public': {'required': True, 'pattern': r'^([0-9]{2}/){2}[0-9]{4}$'}, } _attribute_map = { - 'partner_name': {'key': 'partnerName', 'type': 'str'}, - 'product_name': {'key': 'productName', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, + 'ga': {'key': 'GA', 'type': 'str'}, + 'public': {'key': 'public', 'type': 'str'}, } def __init__(self, **kwargs): - super(SecurityAssessmentMetadataPartnerData, self).__init__(**kwargs) - self.partner_name = kwargs.get('partner_name', None) - self.product_name = kwargs.get('product_name', None) - self.secret = kwargs.get('secret', None) + super(SecurityAssessmentMetadataPropertiesResponsePublishDates, self).__init__(**kwargs) + self.ga = kwargs.get('ga', None) + self.public = kwargs.get('public', None) -class SecurityAssessmentMetadataProperties(Model): - """Describes properties of an assessment metadata. +class SecurityAssessmentMetadataResponse(Resource): + """Security assessment metadata response. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str :param display_name: Required. User friendly display name of the assessment :type display_name: str @@ -7753,8 +8338,8 @@ class SecurityAssessmentMetadataProperties(Model): :param remediation_description: Human readable description of what you should do to mitigate this security issue :type remediation_description: str - :param category: - :type category: list[str or ~azure.mgmt.security.models.Category] + :param categories: + :type categories: list[str or ~azure.mgmt.security.models.Categories] :param severity: Required. The severity level of the assessment. Possible values include: 'Low', 'Medium', 'High' :type severity: str or ~azure.mgmt.security.models.Severity @@ -7778,37 +8363,51 @@ class SecurityAssessmentMetadataProperties(Model): :param partner_data: :type partner_data: ~azure.mgmt.security.models.SecurityAssessmentMetadataPartnerData + :param publish_dates: + :type publish_dates: + ~azure.mgmt.security.models.SecurityAssessmentMetadataPropertiesResponsePublishDates + :param planned_deprecation_date: + :type planned_deprecation_date: str """ _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, 'display_name': {'required': True}, 'policy_definition_id': {'readonly': True}, 'severity': {'required': True}, 'assessment_type': {'required': True}, + 'planned_deprecation_date': {'pattern': r'^[0-9]{2}/[0-9]{4}$'}, } _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'policy_definition_id': {'key': 'policyDefinitionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'remediation_description': {'key': 'remediationDescription', 'type': 'str'}, - 'category': {'key': 'category', 'type': '[str]'}, - 'severity': {'key': 'severity', 'type': 'str'}, - 'user_impact': {'key': 'userImpact', 'type': 'str'}, - 'implementation_effort': {'key': 'implementationEffort', 'type': 'str'}, - 'threats': {'key': 'threats', 'type': '[str]'}, - 'preview': {'key': 'preview', 'type': 'bool'}, - 'assessment_type': {'key': 'assessmentType', 'type': 'str'}, - 'partner_data': {'key': 'partnerData', 'type': 'SecurityAssessmentMetadataPartnerData'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'policy_definition_id': {'key': 'properties.policyDefinitionId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'remediation_description': {'key': 'properties.remediationDescription', 'type': 'str'}, + 'categories': {'key': 'properties.categories', 'type': '[str]'}, + 'severity': {'key': 'properties.severity', 'type': 'str'}, + 'user_impact': {'key': 'properties.userImpact', 'type': 'str'}, + 'implementation_effort': {'key': 'properties.implementationEffort', 'type': 'str'}, + 'threats': {'key': 'properties.threats', 'type': '[str]'}, + 'preview': {'key': 'properties.preview', 'type': 'bool'}, + 'assessment_type': {'key': 'properties.assessmentType', 'type': 'str'}, + 'partner_data': {'key': 'properties.partnerData', 'type': 'SecurityAssessmentMetadataPartnerData'}, + 'publish_dates': {'key': 'properties.publishDates', 'type': 'SecurityAssessmentMetadataPropertiesResponsePublishDates'}, + 'planned_deprecation_date': {'key': 'properties.plannedDeprecationDate', 'type': 'str'}, } def __init__(self, **kwargs): - super(SecurityAssessmentMetadataProperties, self).__init__(**kwargs) + super(SecurityAssessmentMetadataResponse, self).__init__(**kwargs) self.display_name = kwargs.get('display_name', None) self.policy_definition_id = None self.description = kwargs.get('description', None) self.remediation_description = kwargs.get('remediation_description', None) - self.category = kwargs.get('category', None) + self.categories = kwargs.get('categories', None) self.severity = kwargs.get('severity', None) self.user_impact = kwargs.get('user_impact', None) self.implementation_effort = kwargs.get('implementation_effort', None) @@ -7816,6 +8415,8 @@ def __init__(self, **kwargs): self.preview = kwargs.get('preview', None) self.assessment_type = kwargs.get('assessment_type', None) self.partner_data = kwargs.get('partner_data', None) + self.publish_dates = kwargs.get('publish_dates', None) + self.planned_deprecation_date = kwargs.get('planned_deprecation_date', None) class SecurityAssessmentPartnerData(Model): @@ -7845,6 +8446,119 @@ def __init__(self, **kwargs): self.secret = kwargs.get('secret', None) +class SecurityAssessmentPropertiesBase(Model): + """Describes properties of an 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 resource_details: Required. + :type resource_details: ~azure.mgmt.security.models.ResourceDetails + :ivar display_name: User friendly display name of the assessment + :vartype display_name: str + :param additional_data: Additional data regarding the assessment + :type additional_data: dict[str, str] + :param links: + :type links: ~azure.mgmt.security.models.AssessmentLinks + :param metadata: + :type metadata: + ~azure.mgmt.security.models.SecurityAssessmentMetadataProperties + :param partners_data: + :type partners_data: + ~azure.mgmt.security.models.SecurityAssessmentPartnerData + """ + + _validation = { + 'resource_details': {'required': True}, + 'display_name': {'readonly': True}, + } + + _attribute_map = { + 'resource_details': {'key': 'resourceDetails', 'type': 'ResourceDetails'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'additional_data': {'key': 'additionalData', 'type': '{str}'}, + 'links': {'key': 'links', 'type': 'AssessmentLinks'}, + 'metadata': {'key': 'metadata', 'type': 'SecurityAssessmentMetadataProperties'}, + 'partners_data': {'key': 'partnersData', 'type': 'SecurityAssessmentPartnerData'}, + } + + def __init__(self, **kwargs): + super(SecurityAssessmentPropertiesBase, self).__init__(**kwargs) + self.resource_details = kwargs.get('resource_details', None) + self.display_name = None + self.additional_data = kwargs.get('additional_data', None) + self.links = kwargs.get('links', None) + self.metadata = kwargs.get('metadata', None) + self.partners_data = kwargs.get('partners_data', None) + + +class SecurityAssessmentResponse(Resource): + """Security assessment on a resource - response format. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param resource_details: Required. + :type resource_details: ~azure.mgmt.security.models.ResourceDetails + :ivar display_name: User friendly display name of the assessment + :vartype display_name: str + :param additional_data: Additional data regarding the assessment + :type additional_data: dict[str, str] + :param links: + :type links: ~azure.mgmt.security.models.AssessmentLinks + :param metadata: + :type metadata: + ~azure.mgmt.security.models.SecurityAssessmentMetadataProperties + :param partners_data: + :type partners_data: + ~azure.mgmt.security.models.SecurityAssessmentPartnerData + :param status: Required. + :type status: ~azure.mgmt.security.models.AssessmentStatusResponse + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'resource_details': {'required': True}, + 'display_name': {'readonly': True}, + 'status': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'resource_details': {'key': 'properties.resourceDetails', 'type': 'ResourceDetails'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'additional_data': {'key': 'properties.additionalData', 'type': '{str}'}, + 'links': {'key': 'properties.links', 'type': 'AssessmentLinks'}, + 'metadata': {'key': 'properties.metadata', 'type': 'SecurityAssessmentMetadataProperties'}, + 'partners_data': {'key': 'properties.partnersData', 'type': 'SecurityAssessmentPartnerData'}, + 'status': {'key': 'properties.status', 'type': 'AssessmentStatusResponse'}, + } + + def __init__(self, **kwargs): + super(SecurityAssessmentResponse, self).__init__(**kwargs) + self.resource_details = kwargs.get('resource_details', None) + self.display_name = None + self.additional_data = kwargs.get('additional_data', None) + self.links = kwargs.get('links', None) + self.metadata = kwargs.get('metadata', None) + self.partners_data = kwargs.get('partners_data', None) + self.status = kwargs.get('status', None) + + class SecurityContact(Resource): """Contact details for security issues. @@ -8441,6 +9155,78 @@ def __init__(self, **kwargs): self.display_name = None +class Software(Resource): + """Represents a software data. + + 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 device_id: Unique identifier for the virtual machine in the + service. + :type device_id: str + :param os_platform: Platform of the operating system running on the + device. + :type os_platform: str + :param vendor: Name of the software vendor. + :type vendor: str + :param software_name: Name of the software product. + :type software_name: str + :param version: Version number of the software product. + :type version: str + :param end_of_support_status: End of support status. Possible values + include: 'None', 'noLongerSupported', 'versionNoLongerSupported', + 'upcomingNoLongerSupported', 'upcomingVersionNoLongerSupported' + :type end_of_support_status: str or + ~azure.mgmt.security.models.EndOfSupportStatus + :param end_of_support_date: The end of support date in case the product is + upcoming end of support. + :type end_of_support_date: str + :param number_of_known_vulnerabilities: Number of weaknesses. + :type number_of_known_vulnerabilities: int + :param first_seen_at: First time that the software was seen in the device. + :type first_seen_at: str + """ + + _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'}, + 'device_id': {'key': 'properties.deviceId', 'type': 'str'}, + 'os_platform': {'key': 'properties.osPlatform', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'software_name': {'key': 'properties.softwareName', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'end_of_support_status': {'key': 'properties.endOfSupportStatus', 'type': 'str'}, + 'end_of_support_date': {'key': 'properties.endOfSupportDate', 'type': 'str'}, + 'number_of_known_vulnerabilities': {'key': 'properties.numberOfKnownVulnerabilities', 'type': 'int'}, + 'first_seen_at': {'key': 'properties.firstSeenAt', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Software, self).__init__(**kwargs) + self.device_id = kwargs.get('device_id', None) + self.os_platform = kwargs.get('os_platform', None) + self.vendor = kwargs.get('vendor', None) + self.software_name = kwargs.get('software_name', None) + self.version = kwargs.get('version', None) + self.end_of_support_status = kwargs.get('end_of_support_status', None) + self.end_of_support_date = kwargs.get('end_of_support_date', None) + self.number_of_known_vulnerabilities = kwargs.get('number_of_known_vulnerabilities', None) + self.first_seen_at = kwargs.get('first_seen_at', None) + + class SqlServerVulnerabilityProperties(AdditionalData): """Details of the resource that was assessed. @@ -8541,6 +9327,46 @@ def __init__(self, **kwargs): self.all_of = kwargs.get('all_of', None) +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or ~azure.mgmt.security.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.security.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC) + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + class Tags(Model): """A list of key value pairs that describe the resource. @@ -8860,6 +9686,41 @@ def __init__(self, **kwargs): self.recommendations_configuration = kwargs.get('recommendations_configuration', None) +class UpgradePackageDownloadInfo(PackageDownloadInfo): + """Information on a specific package upgrade download. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar version: Version number + :vartype version: str + :param link: Download link + :type link: str + :ivar version_kind: Kind of the version. Possible values include: + 'Latest', 'Previous', 'Preview' + :vartype version_kind: str or ~azure.mgmt.security.models.VersionKind + :ivar from_version: Minimum base version for upgrade + :vartype from_version: str + """ + + _validation = { + 'version': {'readonly': True}, + 'version_kind': {'readonly': True}, + 'from_version': {'readonly': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'link': {'key': 'link', 'type': 'str'}, + 'version_kind': {'key': 'versionKind', 'type': 'str'}, + 'from_version': {'key': 'fromVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UpgradePackageDownloadInfo, self).__init__(**kwargs) + self.from_version = None + + class UserDefinedResourcesProperties(Model): """Properties of the IoT Security solution's user defined resources. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models_py3.py index 13585f8f34535..1f4d4f2ad8381 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models_py3.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models_py3.py @@ -643,6 +643,32 @@ def __init__(self, **kwargs) -> None: self.assessed_resource_type = None +class AdditionalWorkspacesProperties(Model): + """Properties of the additional workspaces. + + :param workspace: Workspace resource id + :type workspace: str + :param type: Workspace type. Possible values include: 'Sentinel'. Default + value: "Sentinel" . + :type type: str or ~azure.mgmt.security.models.AdditionalWorkspaceType + :param data_types: List of data types sent to workspace + :type data_types: list[str or + ~azure.mgmt.security.models.AdditionalWorkspaceDataType] + """ + + _attribute_map = { + 'workspace': {'key': 'workspace', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data_types': {'key': 'dataTypes', 'type': '[str]'}, + } + + def __init__(self, *, workspace: str=None, type="Sentinel", data_types=None, **kwargs) -> None: + super(AdditionalWorkspacesProperties, self).__init__(**kwargs) + self.workspace = workspace + self.type = type + self.data_types = data_types + + class AdvancedThreatProtectionSetting(Resource): """The Advanced Threat Protection resource. @@ -878,6 +904,87 @@ def __init__(self, *, additional_properties=None, **kwargs) -> None: self.type = None +class AlertSimulatorRequestProperties(Model): + """Describes properties of an alert simulation request. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AlertSimulatorBundlesRequestProperties + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Bundles': 'AlertSimulatorBundlesRequestProperties'} + } + + def __init__(self, *, additional_properties=None, **kwargs) -> None: + super(AlertSimulatorRequestProperties, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.kind = None + + +class AlertSimulatorBundlesRequestProperties(AlertSimulatorRequestProperties): + """Simulate alerts according to this bundles. + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param kind: Required. Constant filled by server. + :type kind: str + :param bundles: Bundles list. + :type bundles: list[str or ~azure.mgmt.security.models.BundleType] + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'bundles': {'key': 'bundles', 'type': '[str]'}, + } + + def __init__(self, *, additional_properties=None, bundles=None, **kwargs) -> None: + super(AlertSimulatorBundlesRequestProperties, self).__init__(additional_properties=additional_properties, **kwargs) + self.bundles = bundles + self.kind = 'Bundles' + + +class AlertSimulatorRequestBody(Model): + """Alert Simulator request body. + + :param properties: Alert Simulator request body data. + :type properties: + ~azure.mgmt.security.models.AlertSimulatorRequestProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'AlertSimulatorRequestProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(AlertSimulatorRequestBody, self).__init__(**kwargs) + self.properties = properties + + class AlertsSuppressionRule(Resource): """Describes the suppression rule. @@ -947,6 +1054,93 @@ def __init__(self, *, alert_type: str, reason: str, state, expiration_date_utc=N self.suppression_alerts_scope = suppression_alerts_scope +class Setting(Resource): + """The kind of the security setting. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DataExportSettings, AlertSyncSettings + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'DataExportSettings': 'DataExportSettings', 'AlertSyncSettings': 'AlertSyncSettings'} + } + + def __init__(self, **kwargs) -> None: + super(Setting, self).__init__(**kwargs) + self.kind = None + self.kind = 'Setting' + + +class AlertSyncSettings(Setting): + """Represents an alert sync setting. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param enabled: Required. Is the alert sync setting enabled + :type enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'enabled': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + } + + def __init__(self, *, enabled: bool, **kwargs) -> None: + super(AlertSyncSettings, self).__init__(**kwargs) + self.enabled = enabled + self.kind = 'AlertSyncSettings' + + class AllowedConnectionsResource(Model): """The resource whose properties describes the allowed traffic between Azure resources. @@ -1053,8 +1247,8 @@ class AllowlistCustomAlertRule(ListCustomAlertRule): type) is allowed. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ConnectionToIpNotAllowed, LocalUserNotAllowed, - ProcessNotAllowed + sub-classes are: ConnectionToIpNotAllowed, ConnectionFromIpNotAllowed, + LocalUserNotAllowed, ProcessNotAllowed Variables are only populated by the server, and will be ignored when sending a request. @@ -1096,7 +1290,7 @@ class AllowlistCustomAlertRule(ListCustomAlertRule): } _subtype_map = { - 'rule_type': {'ConnectionToIpNotAllowed': 'ConnectionToIpNotAllowed', 'LocalUserNotAllowed': 'LocalUserNotAllowed', 'ProcessNotAllowed': 'ProcessNotAllowed'} + 'rule_type': {'ConnectionToIpNotAllowed': 'ConnectionToIpNotAllowed', 'ConnectionFromIpNotAllowed': 'ConnectionFromIpNotAllowed', 'LocalUserNotAllowed': 'LocalUserNotAllowed', 'ProcessNotAllowed': 'ProcessNotAllowed'} } def __init__(self, *, is_enabled: bool, allowlist_values, **kwargs) -> None: @@ -1341,6 +1535,49 @@ def __init__(self, *, code, cause: str=None, description: str=None, **kwargs) -> self.description = description +class AssessmentStatusResponse(AssessmentStatus): + """The result of the 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 code: Required. Programmatic code for the status of the assessment. + Possible values include: 'Healthy', 'Unhealthy', 'NotApplicable' + :type code: str or ~azure.mgmt.security.models.AssessmentStatusCode + :param cause: Programmatic code for the cause of the assessment status + :type cause: str + :param description: Human readable description of the assessment status + :type description: str + :ivar first_evaluation_date: The time that the assessment was created and + first evaluated. Returned as UTC time in ISO 8601 format + :vartype first_evaluation_date: datetime + :ivar status_change_date: The time that the status of the assessment last + changed. Returned as UTC time in ISO 8601 format + :vartype status_change_date: datetime + """ + + _validation = { + 'code': {'required': True}, + 'first_evaluation_date': {'readonly': True}, + 'status_change_date': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'cause': {'key': 'cause', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'first_evaluation_date': {'key': 'firstEvaluationDate', 'type': 'iso-8601'}, + 'status_change_date': {'key': 'statusChangeDate', 'type': 'iso-8601'}, + } + + def __init__(self, *, code, cause: str=None, description: str=None, **kwargs) -> None: + super(AssessmentStatusResponse, self).__init__(code=code, cause=cause, description=description, **kwargs) + self.first_evaluation_date = None + self.status_change_date = None + + class AtaExternalSecuritySolution(ExternalSecuritySolution): """Represents an ATA security solution which sends logs to an OMS workspace. @@ -1797,7 +2034,10 @@ class AutomationSource(Model): https://aka.ms/ASCAutomationSchemas. :param event_source: A valid event source type. Possible values include: - 'Assessments', 'SubAssessments', 'Alerts' + 'Assessments', 'SubAssessments', 'Alerts', 'SecureScores', + 'SecureScoresSnapshot', 'SecureScoreControls', + 'SecureScoreControlsSnapshot', 'RegulatoryComplianceAssessment', + 'RegulatoryComplianceAssessmentSnapshot' :type event_source: str or ~azure.mgmt.security.models.EventSource :param rule_sets: A set of rules which evaluate upon event interception. A logical disjunction is applied between defined rule sets (logical 'or'). @@ -2335,33 +2575,49 @@ def __init__(self, *, additional_properties=None, device_vendor: str=None, devic class CloudError(Model): - """Error response structure. + """Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: An identifier for the error. Codes are invariant and are - intended to be consumed programmatically. + :ivar code: The error code. :vartype code: str - :ivar message: A message describing the error, intended to be suitable for - display in a user interface. + :ivar message: The error message. :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.security.models.CloudErrorBody] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.security.models.ErrorAdditionalInfo] """ _validation = { 'code': {'readonly': True}, 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, } _attribute_map = { 'code': {'key': 'error.code', 'type': 'str'}, 'message': {'key': 'error.message', 'type': 'str'}, + 'target': {'key': 'error.target', 'type': 'str'}, + 'details': {'key': 'error.details', 'type': '[CloudErrorBody]'}, + 'additional_info': {'key': 'error.additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } def __init__(self, **kwargs) -> None: super(CloudError, self).__init__(**kwargs) self.code = None self.message = None + self.target = None + self.details = None + self.additional_info = None class CloudErrorException(HttpOperationError): @@ -2376,6 +2632,50 @@ def __init__(self, deserialize, response, *args): super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) +class CloudErrorBody(Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.security.models.CloudErrorBody] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.security.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(CloudErrorBody, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + class Compliance(Resource): """Compliance of a scope. @@ -2580,8 +2880,8 @@ def __init__(self, *, id: str=None, **kwargs) -> None: self.id = id -class ConnectionToIpNotAllowed(AllowlistCustomAlertRule): - """Outbound connection to an ip that isn't allowed. Allow list consists of +class ConnectionFromIpNotAllowed(AllowlistCustomAlertRule): + """Inbound connection from an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation. Variables are only populated by the server, and will be ignored when @@ -2624,70 +2924,140 @@ class ConnectionToIpNotAllowed(AllowlistCustomAlertRule): } def __init__(self, *, is_enabled: bool, allowlist_values, **kwargs) -> None: - super(ConnectionToIpNotAllowed, self).__init__(is_enabled=is_enabled, allowlist_values=allowlist_values, **kwargs) - self.rule_type = 'ConnectionToIpNotAllowed' + super(ConnectionFromIpNotAllowed, self).__init__(is_enabled=is_enabled, allowlist_values=allowlist_values, **kwargs) + self.rule_type = 'ConnectionFromIpNotAllowed' -class ConnectorSetting(Resource): - """The connector setting. +class ConnectionStrings(Model): + """Connection string for ingesting security data and logs. - Variables are only populated by the server, and will be ignored when - sending a request. + All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param hybrid_compute_settings: Settings for hybrid compute management. - These settings are relevant only for Arc autoProvision (Hybrid Compute). - :type hybrid_compute_settings: - ~azure.mgmt.security.models.HybridComputeSettingsProperties - :param authentication_details: Settings for authentication management, - these settings are relevant only for the cloud connector. - :type authentication_details: - ~azure.mgmt.security.models.AuthenticationDetailsProperties + :param value: Required. Connection strings + :type value: list[~azure.mgmt.security.models.IngestionConnectionString] """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + 'value': {'required': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'hybrid_compute_settings': {'key': 'properties.hybridComputeSettings', 'type': 'HybridComputeSettingsProperties'}, - 'authentication_details': {'key': 'properties.authenticationDetails', 'type': 'AuthenticationDetailsProperties'}, + 'value': {'key': 'value', 'type': '[IngestionConnectionString]'}, } - def __init__(self, *, hybrid_compute_settings=None, authentication_details=None, **kwargs) -> None: - super(ConnectorSetting, self).__init__(**kwargs) - self.hybrid_compute_settings = hybrid_compute_settings - self.authentication_details = authentication_details + def __init__(self, *, value, **kwargs) -> None: + super(ConnectionStrings, self).__init__(**kwargs) + self.value = value -class ContainerRegistryVulnerabilityProperties(AdditionalData): - """Additional context fields for container registry Vulnerability assessment. +class ConnectionToIpNotAllowed(AllowlistCustomAlertRule): + """Outbound connection to an ip that isn't allowed. Allow list consists of + ipv4 or ipv6 range in CIDR notation. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :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 + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. Constant filled by server. + :type rule_type: str + :ivar value_type: The value type of the items in the list. Possible values + include: 'IpCidr', 'String' + :vartype value_type: str or ~azure.mgmt.security.models.ValueType + :param allowlist_values: Required. The values to allow. The format of the + values depends on the rule type. + :type allowlist_values: list[str] + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'value_type': {'readonly': True}, + 'allowlist_values': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'value_type': {'key': 'valueType', 'type': 'str'}, + 'allowlist_values': {'key': 'allowlistValues', 'type': '[str]'}, + } + + def __init__(self, *, is_enabled: bool, allowlist_values, **kwargs) -> None: + super(ConnectionToIpNotAllowed, self).__init__(is_enabled=is_enabled, allowlist_values=allowlist_values, **kwargs) + self.rule_type = 'ConnectionToIpNotAllowed' + + +class ConnectorSetting(Resource): + """The connector setting. + + 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 hybrid_compute_settings: Settings for hybrid compute management. + These settings are relevant only for Arc autoProvision (Hybrid Compute). + :type hybrid_compute_settings: + ~azure.mgmt.security.models.HybridComputeSettingsProperties + :param authentication_details: Settings for authentication management, + these settings are relevant only for the cloud connector. + :type authentication_details: + ~azure.mgmt.security.models.AuthenticationDetailsProperties + """ + + _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'}, + 'hybrid_compute_settings': {'key': 'properties.hybridComputeSettings', 'type': 'HybridComputeSettingsProperties'}, + 'authentication_details': {'key': 'properties.authenticationDetails', 'type': 'AuthenticationDetailsProperties'}, + } + + def __init__(self, *, hybrid_compute_settings=None, authentication_details=None, **kwargs) -> None: + super(ConnectorSetting, self).__init__(**kwargs) + self.hybrid_compute_settings = hybrid_compute_settings + self.authentication_details = authentication_details + + +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 @@ -2789,95 +3159,6 @@ def __init__(self, **kwargs) -> None: self.base = None -class SettingResource(Resource): - """The kind of the security setting. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Setting - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param kind: Required. Constant filled by server. - :type kind: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - } - - _subtype_map = { - 'kind': {'Setting': 'Setting'} - } - - def __init__(self, **kwargs) -> None: - super(SettingResource, self).__init__(**kwargs) - self.kind = None - self.kind = 'SettingResource' - - -class Setting(SettingResource): - """Represents a security setting in Azure Security Center. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataExportSettings - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param kind: Required. Constant filled by server. - :type kind: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - } - - _subtype_map = { - 'kind': {'DataExportSettings': 'DataExportSettings'} - } - - def __init__(self, **kwargs) -> None: - super(Setting, self).__init__(**kwargs) - self.kind = 'Setting' - - class DataExportSettings(Setting): """Represents a data export setting. @@ -2894,7 +3175,7 @@ class DataExportSettings(Setting): :vartype type: str :param kind: Required. Constant filled by server. :type kind: str - :param enabled: Required. Is the data export setting is enabled + :param enabled: Required. Is the data export setting enabled :type enabled: bool """ @@ -3309,6 +3590,34 @@ def __init__(self, *, network_interface: str=None, network_security_groups=None, self.network_security_groups = network_security_groups +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + class ETag(Model): """Entity tag is used for comparing two or more entities from the same requested resource. @@ -3922,68 +4231,106 @@ def __init__(self, *, display_name: str=None, description: str=None, order: int= self.keywords = keywords -class IotAlert(Model): - """IoT alert. +class IngestionConnectionString(Model): + """Connection string for ingesting security data and logs. Variables are only populated by the server, and will be ignored when sending a request. - :ivar system_alert_id: Holds the product canonical identifier of the alert - within the scope of a product - :vartype system_alert_id: str - :ivar compromised_entity: Display name of the main entity being reported - on - :vartype compromised_entity: str - :ivar alert_type: The type name of the alert - :vartype alert_type: str - :ivar start_time_utc: The impact start time of the alert (the time of the - first event or activity included in the alert) - :vartype start_time_utc: str - :ivar end_time_utc: The impact end time of the alert (the time of the last - event or activity included in the alert) - :vartype end_time_utc: str - :param entities: A list of entities related to the alert - :type entities: list[object] - :param extended_properties: A bag of fields which extends the alert - information - :type extended_properties: object + :ivar location: The region where ingested logs and data resides + :vartype location: str + :ivar value: Connection string value + :vartype value: str """ _validation = { - 'system_alert_id': {'readonly': True}, - 'compromised_entity': {'readonly': True}, - 'alert_type': {'readonly': True}, - 'start_time_utc': {'readonly': True}, - 'end_time_utc': {'readonly': True}, + 'location': {'readonly': True}, + 'value': {'readonly': True}, } _attribute_map = { - 'system_alert_id': {'key': 'properties.systemAlertId', 'type': 'str'}, - 'compromised_entity': {'key': 'properties.compromisedEntity', 'type': 'str'}, - 'alert_type': {'key': 'properties.alertType', 'type': 'str'}, - 'start_time_utc': {'key': 'properties.startTimeUtc', 'type': 'str'}, - 'end_time_utc': {'key': 'properties.endTimeUtc', 'type': 'str'}, - 'entities': {'key': 'properties.entities', 'type': '[object]'}, - 'extended_properties': {'key': 'properties.extendedProperties', 'type': 'object'}, + 'location': {'key': 'location', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, *, entities=None, extended_properties=None, **kwargs) -> None: - super(IotAlert, self).__init__(**kwargs) - self.system_alert_id = None - self.compromised_entity = None - self.alert_type = None - self.start_time_utc = None - self.end_time_utc = None - self.entities = entities - self.extended_properties = extended_properties + def __init__(self, **kwargs) -> None: + super(IngestionConnectionString, self).__init__(**kwargs) + self.location = None + self.value = None + + +class IngestionSetting(Resource): + """Configures how to correlate scan data and logs with resources associated + with the subscription. + + 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 properties: Ingestion setting data + :type properties: object + """ + + _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'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(IngestionSetting, self).__init__(**kwargs) + self.properties = properties + + +class IngestionSettingToken(Model): + """Configures how to correlate scan data and logs with resources associated + with the subscription. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar token: The token is used for correlating security data and logs with + the resources in the subscription. + :vartype token: str + """ + + _validation = { + 'token': {'readonly': True}, + } + + _attribute_map = { + 'token': {'key': 'token', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(IngestionSettingToken, self).__init__(**kwargs) + self.token = None -class IotAlertModel(Model): +class IotAlertModel(Resource): """IoT alert. Variables are only populated by the server, and will be ignored when sending a request. + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str :ivar system_alert_id: Holds the product canonical identifier of the alert within the scope of a product :vartype system_alert_id: str @@ -4006,6 +4353,9 @@ class IotAlertModel(Model): """ _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, 'system_alert_id': {'readonly': True}, 'compromised_entity': {'readonly': True}, 'alert_type': {'readonly': True}, @@ -4014,6 +4364,9 @@ class IotAlertModel(Model): } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, 'system_alert_id': {'key': 'properties.systemAlertId', 'type': 'str'}, 'compromised_entity': {'key': 'properties.compromisedEntity', 'type': 'str'}, 'alert_type': {'key': 'properties.alertType', 'type': 'str'}, @@ -4166,89 +4519,52 @@ class IotDefenderSettingsModel(Resource): :ivar id: Resource Id :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param device_quota: Required. Size of the device quota (as a opposed to a - Pay as You Go billing model). Value is required to be in multiples of - 1000. - :type device_quota: int - :param sentinel_workspace_resource_ids: Required. Sentinel Workspace - Resource Ids - :type sentinel_workspace_resource_ids: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'device_quota': {'required': True, 'minimum': 1000}, - 'sentinel_workspace_resource_ids': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'device_quota': {'key': 'properties.deviceQuota', 'type': 'int'}, - 'sentinel_workspace_resource_ids': {'key': 'properties.sentinelWorkspaceResourceIds', 'type': '[str]'}, - } - - def __init__(self, *, device_quota: int, sentinel_workspace_resource_ids, **kwargs) -> None: - super(IotDefenderSettingsModel, self).__init__(**kwargs) - self.device_quota = device_quota - self.sentinel_workspace_resource_ids = sentinel_workspace_resource_ids - - -class IotRecommendation(Resource): - """IoT recommendation. - - 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 device_id: Identifier of the device being reported on - :vartype device_id: str - :ivar recommendation_type: The type name of the recommendation - :vartype recommendation_type: str - :ivar discovered_time_utc: The discovery time of the recommendation - :vartype discovered_time_utc: str - :param recommendation_additional_data: A bag of fields which extends the - recommendation information - :type recommendation_additional_data: object + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param device_quota: Required. Size of the device quota (as a opposed to a + Pay as You Go billing model). Value is required to be in multiples of + 1000. + :type device_quota: int + :param sentinel_workspace_resource_ids: Required. Sentinel Workspace + Resource Ids + :type sentinel_workspace_resource_ids: list[str] + :param onboarding_kind: Required. The kind of onboarding for the + subscription. Possible values include: 'Default', 'MigratedToAzure', + 'Evaluation', 'Purchased' + :type onboarding_kind: str or ~azure.mgmt.security.models.OnboardingKind + :ivar evaluation_end_time: End time of the evaluation period, if such + exist + :vartype evaluation_end_time: datetime """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'device_id': {'readonly': True}, - 'recommendation_type': {'readonly': True}, - 'discovered_time_utc': {'readonly': True}, + 'device_quota': {'required': True, 'minimum': 1000}, + 'sentinel_workspace_resource_ids': {'required': True}, + 'onboarding_kind': {'required': True}, + 'evaluation_end_time': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'device_id': {'key': 'properties.deviceId', 'type': 'str'}, - 'recommendation_type': {'key': 'properties.recommendationType', 'type': 'str'}, - 'discovered_time_utc': {'key': 'properties.discoveredTimeUtc', 'type': 'str'}, - 'recommendation_additional_data': {'key': 'properties.recommendationAdditionalData', 'type': 'object'}, + 'device_quota': {'key': 'properties.deviceQuota', 'type': 'int'}, + 'sentinel_workspace_resource_ids': {'key': 'properties.sentinelWorkspaceResourceIds', 'type': '[str]'}, + 'onboarding_kind': {'key': 'properties.onboardingKind', 'type': 'str'}, + 'evaluation_end_time': {'key': 'properties.evaluationEndTime', 'type': 'iso-8601'}, } - def __init__(self, *, recommendation_additional_data=None, **kwargs) -> None: - super(IotRecommendation, self).__init__(**kwargs) - self.device_id = None - self.recommendation_type = None - self.discovered_time_utc = None - self.recommendation_additional_data = recommendation_additional_data + def __init__(self, *, device_quota: int, sentinel_workspace_resource_ids, onboarding_kind, **kwargs) -> None: + super(IotDefenderSettingsModel, self).__init__(**kwargs) + self.device_quota = device_quota + self.sentinel_workspace_resource_ids = sentinel_workspace_resource_ids + self.onboarding_kind = onboarding_kind + self.evaluation_end_time = None class IotRecommendationModel(Resource): @@ -4430,7 +4746,7 @@ class IoTSecurityAggregatedAlert(Model): :vartype description: str :ivar count: Number of alerts occurrences within the aggregated time window. - :vartype count: int + :vartype count: long :ivar effected_resource_type: Azure resource ID of the resource that received the alerts. :vartype effected_resource_type: str @@ -4478,7 +4794,7 @@ class IoTSecurityAggregatedAlert(Model): 'reported_severity': {'key': 'properties.reportedSeverity', 'type': 'str'}, 'remediation_steps': {'key': 'properties.remediationSteps', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, + 'count': {'key': 'properties.count', 'type': 'long'}, 'effected_resource_type': {'key': 'properties.effectedResourceType', 'type': 'str'}, 'system_source': {'key': 'properties.systemSource', 'type': 'str'}, 'action_taken': {'key': 'properties.actionTaken', 'type': 'str'}, @@ -4516,7 +4832,7 @@ class IoTSecurityAggregatedAlertPropertiesTopDevicesListItem(Model): :ivar device_id: Name of the device. :vartype device_id: str :ivar alerts_count: Number of alerts raised for this device. - :vartype alerts_count: int + :vartype alerts_count: long :ivar last_occurrence: Most recent time this alert was raised for this device, on this day. :vartype last_occurrence: str @@ -4530,7 +4846,7 @@ class IoTSecurityAggregatedAlertPropertiesTopDevicesListItem(Model): _attribute_map = { 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'alerts_count': {'key': 'alertsCount', 'type': 'int'}, + 'alerts_count': {'key': 'alertsCount', 'type': 'long'}, 'last_occurrence': {'key': 'lastOccurrence', 'type': 'str'}, } @@ -4574,10 +4890,10 @@ class IoTSecurityAggregatedRecommendation(Model): ~azure.mgmt.security.models.ReportedSeverity :ivar healthy_devices: Number of healthy devices within the IoT Security solution. - :vartype healthy_devices: int + :vartype healthy_devices: long :ivar unhealthy_device_count: Number of unhealthy devices within the IoT Security solution. - :vartype unhealthy_device_count: int + :vartype unhealthy_device_count: long :ivar log_analytics_query: Log analytics query for getting the list of affected devices/alerts. :vartype log_analytics_query: str @@ -4610,8 +4926,8 @@ class IoTSecurityAggregatedRecommendation(Model): 'detected_by': {'key': 'properties.detectedBy', 'type': 'str'}, 'remediation_steps': {'key': 'properties.remediationSteps', 'type': 'str'}, 'reported_severity': {'key': 'properties.reportedSeverity', 'type': 'str'}, - 'healthy_devices': {'key': 'properties.healthyDevices', 'type': 'int'}, - 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'int'}, + 'healthy_devices': {'key': 'properties.healthyDevices', 'type': 'long'}, + 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'long'}, 'log_analytics_query': {'key': 'properties.logAnalyticsQuery', 'type': 'str'}, } @@ -4643,7 +4959,7 @@ class IoTSecurityAlertedDevice(Model): :ivar device_id: Device identifier. :vartype device_id: str :ivar alerts_count: Number of alerts raised for this device. - :vartype alerts_count: int + :vartype alerts_count: long """ _validation = { @@ -4653,7 +4969,7 @@ class IoTSecurityAlertedDevice(Model): _attribute_map = { 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'alerts_count': {'key': 'alertsCount', 'type': 'int'}, + 'alerts_count': {'key': 'alertsCount', 'type': 'long'}, } def __init__(self, **kwargs) -> None: @@ -4676,7 +4992,7 @@ class IoTSecurityDeviceAlert(Model): :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity :ivar alerts_count: Number of alerts raised for this alert type. - :vartype alerts_count: int + :vartype alerts_count: long """ _validation = { @@ -4688,7 +5004,7 @@ class IoTSecurityDeviceAlert(Model): _attribute_map = { 'alert_display_name': {'key': 'alertDisplayName', 'type': 'str'}, 'reported_severity': {'key': 'reportedSeverity', 'type': 'str'}, - 'alerts_count': {'key': 'alertsCount', 'type': 'int'}, + 'alerts_count': {'key': 'alertsCount', 'type': 'long'}, } def __init__(self, **kwargs) -> None: @@ -4712,7 +5028,7 @@ class IoTSecurityDeviceRecommendation(Model): :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity :ivar devices_count: Number of devices with this recommendation. - :vartype devices_count: int + :vartype devices_count: long """ _validation = { @@ -4724,7 +5040,7 @@ class IoTSecurityDeviceRecommendation(Model): _attribute_map = { 'recommendation_display_name': {'key': 'recommendationDisplayName', 'type': 'str'}, 'reported_severity': {'key': 'reportedSeverity', 'type': 'str'}, - 'devices_count': {'key': 'devicesCount', 'type': 'int'}, + 'devices_count': {'key': 'devicesCount', 'type': 'long'}, } def __init__(self, **kwargs) -> None: @@ -4750,7 +5066,7 @@ class IoTSecuritySolutionAnalyticsModel(Resource): :vartype metrics: ~azure.mgmt.security.models.IoTSeverityMetrics :ivar unhealthy_device_count: Number of unhealthy devices within your IoT Security solution. - :vartype unhealthy_device_count: int + :vartype unhealthy_device_count: long :ivar devices_metrics: List of device metrics by the aggregation date. :vartype devices_metrics: list[~azure.mgmt.security.models.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem] @@ -4781,7 +5097,7 @@ class IoTSecuritySolutionAnalyticsModel(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'metrics': {'key': 'properties.metrics', 'type': 'IoTSeverityMetrics'}, - 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'int'}, + 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'long'}, 'devices_metrics': {'key': 'properties.devicesMetrics', 'type': '[IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem]'}, 'top_alerted_devices': {'key': 'properties.topAlertedDevices', 'type': '[IoTSecurityAlertedDevice]'}, 'most_prevalent_device_alerts': {'key': 'properties.mostPrevalentDeviceAlerts', 'type': '[IoTSecurityDeviceAlert]'}, @@ -4899,6 +5215,12 @@ class IoTSecuritySolutionModel(Model): . :type unmasked_ip_logging_status: str or ~azure.mgmt.security.models.UnmaskedIpLoggingStatus + :param additional_workspaces: List of additional workspaces + :type additional_workspaces: + list[~azure.mgmt.security.models.AdditionalWorkspacesProperties] + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: ~azure.mgmt.security.models.SystemData """ _validation = { @@ -4908,6 +5230,7 @@ class IoTSecuritySolutionModel(Model): 'display_name': {'required': True}, 'iot_hubs': {'required': True}, 'auto_discovered_resources': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -4926,9 +5249,11 @@ class IoTSecuritySolutionModel(Model): 'auto_discovered_resources': {'key': 'properties.autoDiscoveredResources', 'type': '[str]'}, 'recommendations_configuration': {'key': 'properties.recommendationsConfiguration', 'type': '[RecommendationConfigurationProperties]'}, 'unmasked_ip_logging_status': {'key': 'properties.unmaskedIpLoggingStatus', 'type': 'str'}, + 'additional_workspaces': {'key': 'properties.additionalWorkspaces', 'type': '[AdditionalWorkspacesProperties]'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } - def __init__(self, *, display_name: str, iot_hubs, tags=None, location: str=None, workspace: str=None, status="Enabled", export=None, disabled_data_sources=None, user_defined_resources=None, recommendations_configuration=None, unmasked_ip_logging_status="Disabled", **kwargs) -> None: + def __init__(self, *, display_name: str, iot_hubs, tags=None, location: str=None, workspace: str=None, status="Enabled", export=None, disabled_data_sources=None, user_defined_resources=None, recommendations_configuration=None, unmasked_ip_logging_status="Disabled", additional_workspaces=None, **kwargs) -> None: super(IoTSecuritySolutionModel, self).__init__(**kwargs) self.id = None self.name = None @@ -4945,10 +5270,35 @@ def __init__(self, *, display_name: str, iot_hubs, tags=None, location: str=None self.auto_discovered_resources = None self.recommendations_configuration = recommendations_configuration self.unmasked_ip_logging_status = unmasked_ip_logging_status + self.additional_workspaces = additional_workspaces + self.system_data = None + + +class IotSensorsList(Model): + """List of IoT sensors. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List data + :vartype value: list[~azure.mgmt.security.models.IotSensorsModel] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IotSensorsModel]'}, + } + + def __init__(self, **kwargs) -> None: + super(IotSensorsList, self).__init__(**kwargs) + self.value = None -class IotSensor(Resource): - """IoT sensor. +class IotSensorsModel(Resource): + """IoT sensor model. Variables are only populated by the server, and will be ignored when sending a request. @@ -4959,36 +5309,111 @@ class IotSensor(Resource): :vartype name: str :ivar type: Resource type :vartype type: str - :param properties: IoT sensor properties - :type properties: object + :ivar connectivity_time: Last connectivity time of the IoT sensor + :vartype connectivity_time: str + :ivar creation_time: Creation time of the IoT sensor + :vartype creation_time: str + :ivar dynamic_learning: Dynamic mode status of the IoT sensor + :vartype dynamic_learning: bool + :ivar learning_mode: Learning mode status of the IoT sensor + :vartype learning_mode: bool + :ivar sensor_status: Status of the IoT sensor. Possible values include: + 'Ok', 'Disconnected', 'Unavailable' + :vartype sensor_status: str or ~azure.mgmt.security.models.SensorStatus + :ivar sensor_version: Version of the IoT sensor + :vartype sensor_version: str + :param ti_automatic_updates: TI Automatic mode status of the IoT sensor + :type ti_automatic_updates: bool + :ivar ti_status: TI Status of the IoT sensor. Possible values include: + 'Ok', 'Failed', 'InProgress', 'UpdateAvailable' + :vartype ti_status: str or ~azure.mgmt.security.models.TiStatus + :ivar ti_version: TI Version of the IoT sensor + :vartype ti_version: str + :param zone: Zone of the IoT sensor + :type zone: str + :param sensor_type: Type of sensor. Possible values include: 'Ot', + 'Enterprise' + :type sensor_type: str or ~azure.mgmt.security.models.SensorType """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'connectivity_time': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'dynamic_learning': {'readonly': True}, + 'learning_mode': {'readonly': True}, + 'sensor_status': {'readonly': True}, + 'sensor_version': {'readonly': True}, + 'ti_status': {'readonly': True}, + 'ti_version': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, + 'connectivity_time': {'key': 'properties.connectivityTime', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, + 'dynamic_learning': {'key': 'properties.dynamicLearning', 'type': 'bool'}, + 'learning_mode': {'key': 'properties.learningMode', 'type': 'bool'}, + 'sensor_status': {'key': 'properties.sensorStatus', 'type': 'str'}, + 'sensor_version': {'key': 'properties.sensorVersion', 'type': 'str'}, + 'ti_automatic_updates': {'key': 'properties.tiAutomaticUpdates', 'type': 'bool'}, + 'ti_status': {'key': 'properties.tiStatus', 'type': 'str'}, + 'ti_version': {'key': 'properties.tiVersion', 'type': 'str'}, + 'zone': {'key': 'properties.zone', 'type': 'str'}, + 'sensor_type': {'key': 'properties.sensorType', 'type': 'str'}, + } + + def __init__(self, *, ti_automatic_updates: bool=None, zone: str=None, sensor_type=None, **kwargs) -> None: + super(IotSensorsModel, self).__init__(**kwargs) + self.connectivity_time = None + self.creation_time = None + self.dynamic_learning = None + self.learning_mode = None + self.sensor_status = None + self.sensor_version = None + self.ti_automatic_updates = ti_automatic_updates + self.ti_status = None + self.ti_version = None + self.zone = zone + self.sensor_type = sensor_type + + +class IoTSeverityMetrics(Model): + """IoT Security solution analytics severity metrics. + + :param high: Count of high severity alerts/recommendations. + :type high: long + :param medium: Count of medium severity alerts/recommendations. + :type medium: long + :param low: Count of low severity alerts/recommendations. + :type low: long + """ + + _attribute_map = { + 'high': {'key': 'high', 'type': 'long'}, + 'medium': {'key': 'medium', 'type': 'long'}, + 'low': {'key': 'low', 'type': 'long'}, } - def __init__(self, *, properties=None, **kwargs) -> None: - super(IotSensor, self).__init__(**kwargs) - self.properties = properties + def __init__(self, *, high: int=None, medium: int=None, low: int=None, **kwargs) -> None: + super(IoTSeverityMetrics, self).__init__(**kwargs) + self.high = high + self.medium = medium + self.low = low -class IotSensorsList(Model): - """List of IoT sensors. +class IotSitesList(Model): + """List of IoT sites. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List data - :vartype value: list[~azure.mgmt.security.models.IotSensor] + :vartype value: list[~azure.mgmt.security.models.IotSitesModel] """ _validation = { @@ -4996,36 +5421,53 @@ class IotSensorsList(Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[IotSensor]'}, + 'value': {'key': 'value', 'type': '[IotSitesModel]'}, } def __init__(self, **kwargs) -> None: - super(IotSensorsList, self).__init__(**kwargs) + super(IotSitesList, self).__init__(**kwargs) self.value = None -class IoTSeverityMetrics(Model): - """IoT Security solution analytics severity metrics. +class IotSitesModel(Resource): + """IoT site model. - :param high: Count of high severity alerts/recommendations. - :type high: int - :param medium: Count of medium severity alerts/recommendations. - :type medium: int - :param low: Count of low severity alerts/recommendations. - :type low: int + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param display_name: Required. Display name of the IoT site + :type display_name: str + :param tags: Tags of the IoT site + :type tags: dict[str, str] """ + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'required': True}, + } + _attribute_map = { - 'high': {'key': 'high', 'type': 'int'}, - 'medium': {'key': 'medium', 'type': 'int'}, - 'low': {'key': 'low', 'type': 'int'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'tags': {'key': 'properties.tags', 'type': '{str}'}, } - def __init__(self, *, high: int=None, medium: int=None, low: int=None, **kwargs) -> None: - super(IoTSeverityMetrics, self).__init__(**kwargs) - self.high = high - self.medium = medium - self.low = low + def __init__(self, *, display_name: str, tags=None, **kwargs) -> None: + super(IotSitesModel, self).__init__(**kwargs) + self.display_name = display_name + self.tags = tags class IpAddress(Model): @@ -6054,19 +6496,39 @@ class PackageDownloads(Model): ~azure.mgmt.security.models.PackageDownloadsCentralManager :ivar threat_intelligence: All downloads for threat intelligence :vartype threat_intelligence: - ~azure.mgmt.security.models.PackageDownloadsThreatIntelligence + list[~azure.mgmt.security.models.PackageDownloadInfo] + :ivar snmp: SNMP Server file + :vartype snmp: list[~azure.mgmt.security.models.PackageDownloadInfo] + :ivar wmi_tool: Used for local configuration export + :vartype wmi_tool: list[~azure.mgmt.security.models.PackageDownloadInfo] + :ivar authorized_devices_import_template: Authorized devices import + template + :vartype authorized_devices_import_template: + list[~azure.mgmt.security.models.PackageDownloadInfo] + :ivar device_information_update_import_template: Authorized devices import + template + :vartype device_information_update_import_template: + list[~azure.mgmt.security.models.PackageDownloadInfo] """ _validation = { 'sensor': {'readonly': True}, 'central_manager': {'readonly': True}, 'threat_intelligence': {'readonly': True}, + 'snmp': {'readonly': True}, + 'wmi_tool': {'readonly': True}, + 'authorized_devices_import_template': {'readonly': True}, + 'device_information_update_import_template': {'readonly': True}, } _attribute_map = { 'sensor': {'key': 'sensor', 'type': 'PackageDownloadsSensor'}, 'central_manager': {'key': 'centralManager', 'type': 'PackageDownloadsCentralManager'}, - 'threat_intelligence': {'key': 'threatIntelligence', 'type': 'PackageDownloadsThreatIntelligence'}, + 'threat_intelligence': {'key': 'threatIntelligence', 'type': '[PackageDownloadInfo]'}, + 'snmp': {'key': 'snmp', 'type': '[PackageDownloadInfo]'}, + 'wmi_tool': {'key': 'wmiTool', 'type': '[PackageDownloadInfo]'}, + 'authorized_devices_import_template': {'key': 'authorizedDevicesImportTemplate', 'type': '[PackageDownloadInfo]'}, + 'device_information_update_import_template': {'key': 'deviceInformationUpdateImportTemplate', 'type': '[PackageDownloadInfo]'}, } def __init__(self, **kwargs) -> None: @@ -6074,6 +6536,10 @@ def __init__(self, **kwargs) -> None: self.sensor = None self.central_manager = None self.threat_intelligence = None + self.snmp = None + self.wmi_tool = None + self.authorized_devices_import_template = None + self.device_information_update_import_template = None class PackageDownloadsCentralManager(Model): @@ -6087,7 +6553,8 @@ class PackageDownloadsCentralManager(Model): ~azure.mgmt.security.models.PackageDownloadsCentralManagerFull :ivar upgrade: Central Manager upgrade package downloads (on existing installations) - :vartype upgrade: list[~azure.mgmt.security.models.PackageDownloadInfo] + :vartype upgrade: + list[~azure.mgmt.security.models.UpgradePackageDownloadInfo] """ _validation = { @@ -6097,7 +6564,7 @@ class PackageDownloadsCentralManager(Model): _attribute_map = { 'full': {'key': 'full', 'type': 'PackageDownloadsCentralManagerFull'}, - 'upgrade': {'key': 'upgrade', 'type': '[PackageDownloadInfo]'}, + 'upgrade': {'key': 'upgrade', 'type': '[UpgradePackageDownloadInfo]'}, } def __init__(self, **kwargs) -> None: @@ -6187,7 +6654,8 @@ class PackageDownloadsSensor(Model): :vartype full: ~azure.mgmt.security.models.PackageDownloadsSensorFull :param upgrade: Sensor upgrade package downloads (on existing installations) - :type upgrade: list[~azure.mgmt.security.models.PackageDownloadInfo] + :type upgrade: + list[~azure.mgmt.security.models.UpgradePackageDownloadInfo] """ _validation = { @@ -6196,7 +6664,7 @@ class PackageDownloadsSensor(Model): _attribute_map = { 'full': {'key': 'full', 'type': 'PackageDownloadsSensorFull'}, - 'upgrade': {'key': 'upgrade', 'type': '[PackageDownloadInfo]'}, + 'upgrade': {'key': 'upgrade', 'type': '[UpgradePackageDownloadInfo]'}, } def __init__(self, *, upgrade=None, **kwargs) -> None: @@ -6266,22 +6734,6 @@ def __init__(self, **kwargs) -> None: self.line = None -class PackageDownloadsThreatIntelligence(Model): - """All downloads for threat intelligence. - - :param link: Download link - :type link: str - """ - - _attribute_map = { - 'link': {'key': 'link', 'type': 'str'}, - } - - def __init__(self, *, link: str=None, **kwargs) -> None: - super(PackageDownloadsThreatIntelligence, self).__init__(**kwargs) - self.link = link - - class PathRecommendation(Model): """Represents a path that is recommended to be allowed and its properties. @@ -6909,6 +7361,22 @@ def __init__(self, *, description: str=None, scripts=None, automated: bool=None, self.portal_link = portal_link +class ResetPasswordInput(Model): + """Reset password input. + + :param appliance_id: The appliance id of the sensor. + :type appliance_id: str + """ + + _attribute_map = { + 'appliance_id': {'key': 'applianceId', 'type': 'str'}, + } + + def __init__(self, *, appliance_id: str=None, **kwargs) -> None: + super(ResetPasswordInput, self).__init__(**kwargs) + self.appliance_id = appliance_id + + class Rule(Model): """Describes remote addresses that is recommended to communicate with the Azure resource on some (Protocol, Port, Direction). All other remote @@ -7558,8 +8026,6 @@ class SecurityAssessment(Resource): :type resource_details: ~azure.mgmt.security.models.ResourceDetails :ivar display_name: User friendly display name of the assessment :vartype display_name: str - :param status: Required. - :type status: ~azure.mgmt.security.models.AssessmentStatus :param additional_data: Additional data regarding the assessment :type additional_data: dict[str, str] :param links: @@ -7570,6 +8036,8 @@ class SecurityAssessment(Resource): :param partners_data: :type partners_data: ~azure.mgmt.security.models.SecurityAssessmentPartnerData + :param status: Required. + :type status: ~azure.mgmt.security.models.AssessmentStatus """ _validation = { @@ -7587,22 +8055,22 @@ class SecurityAssessment(Resource): 'type': {'key': 'type', 'type': 'str'}, 'resource_details': {'key': 'properties.resourceDetails', 'type': 'ResourceDetails'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'AssessmentStatus'}, 'additional_data': {'key': 'properties.additionalData', 'type': '{str}'}, 'links': {'key': 'properties.links', 'type': 'AssessmentLinks'}, 'metadata': {'key': 'properties.metadata', 'type': 'SecurityAssessmentMetadataProperties'}, 'partners_data': {'key': 'properties.partnersData', 'type': 'SecurityAssessmentPartnerData'}, + 'status': {'key': 'properties.status', 'type': 'AssessmentStatus'}, } def __init__(self, *, resource_details, status, additional_data=None, links=None, metadata=None, partners_data=None, **kwargs) -> None: super(SecurityAssessment, self).__init__(**kwargs) self.resource_details = resource_details self.display_name = None - self.status = status self.additional_data = additional_data self.links = links self.metadata = metadata self.partners_data = partners_data + self.status = status class SecurityAssessmentMetadata(Resource): @@ -7630,8 +8098,131 @@ class SecurityAssessmentMetadata(Resource): :param remediation_description: Human readable description of what you should do to mitigate this security issue :type remediation_description: str - :param category: - :type category: list[str or ~azure.mgmt.security.models.Category] + :param categories: + :type categories: list[str or ~azure.mgmt.security.models.Categories] + :param severity: Required. The severity level of the assessment. Possible + values include: 'Low', 'Medium', 'High' + :type severity: str or ~azure.mgmt.security.models.Severity + :param user_impact: The user impact of the assessment. Possible values + include: 'Low', 'Moderate', 'High' + :type user_impact: str or ~azure.mgmt.security.models.UserImpact + :param implementation_effort: The implementation effort required to + remediate this assessment. Possible values include: 'Low', 'Moderate', + 'High' + :type implementation_effort: str or + ~azure.mgmt.security.models.ImplementationEffort + :param threats: + :type threats: list[str or ~azure.mgmt.security.models.Threats] + :param preview: True if this assessment is in preview release status + :type preview: bool + :param assessment_type: Required. BuiltIn if the assessment based on + built-in Azure Policy definition, Custom if the assessment based on custom + Azure Policy definition. Possible values include: 'BuiltIn', + 'CustomPolicy', 'CustomerManaged', 'VerifiedPartner' + :type assessment_type: str or ~azure.mgmt.security.models.AssessmentType + :param partner_data: + :type partner_data: + ~azure.mgmt.security.models.SecurityAssessmentMetadataPartnerData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'required': True}, + 'policy_definition_id': {'readonly': True}, + 'severity': {'required': True}, + 'assessment_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'policy_definition_id': {'key': 'properties.policyDefinitionId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'remediation_description': {'key': 'properties.remediationDescription', 'type': 'str'}, + 'categories': {'key': 'properties.categories', 'type': '[str]'}, + 'severity': {'key': 'properties.severity', 'type': 'str'}, + 'user_impact': {'key': 'properties.userImpact', 'type': 'str'}, + 'implementation_effort': {'key': 'properties.implementationEffort', 'type': 'str'}, + 'threats': {'key': 'properties.threats', 'type': '[str]'}, + 'preview': {'key': 'properties.preview', 'type': 'bool'}, + 'assessment_type': {'key': 'properties.assessmentType', 'type': 'str'}, + 'partner_data': {'key': 'properties.partnerData', 'type': 'SecurityAssessmentMetadataPartnerData'}, + } + + def __init__(self, *, display_name: str, severity, assessment_type, description: str=None, remediation_description: str=None, categories=None, user_impact=None, implementation_effort=None, threats=None, preview: bool=None, partner_data=None, **kwargs) -> None: + super(SecurityAssessmentMetadata, self).__init__(**kwargs) + self.display_name = display_name + self.policy_definition_id = None + self.description = description + self.remediation_description = remediation_description + self.categories = categories + self.severity = severity + self.user_impact = user_impact + self.implementation_effort = implementation_effort + self.threats = threats + self.preview = preview + self.assessment_type = assessment_type + self.partner_data = partner_data + + +class SecurityAssessmentMetadataPartnerData(Model): + """Describes the partner that created the assessment. + + All required parameters must be populated in order to send to Azure. + + :param partner_name: Required. Name of the company of the partner + :type partner_name: str + :param product_name: Name of the product of the partner that created the + assessment + :type product_name: str + :param secret: Required. Secret to authenticate the partner and verify it + created the assessment - write only + :type secret: str + """ + + _validation = { + 'partner_name': {'required': True}, + 'secret': {'required': True}, + } + + _attribute_map = { + 'partner_name': {'key': 'partnerName', 'type': 'str'}, + 'product_name': {'key': 'productName', 'type': 'str'}, + 'secret': {'key': 'secret', 'type': 'str'}, + } + + def __init__(self, *, partner_name: str, secret: str, product_name: str=None, **kwargs) -> None: + super(SecurityAssessmentMetadataPartnerData, self).__init__(**kwargs) + self.partner_name = partner_name + self.product_name = product_name + self.secret = secret + + +class SecurityAssessmentMetadataProperties(Model): + """Describes properties of an assessment metadata. + + 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 display_name: Required. User friendly display name of the + assessment + :type display_name: str + :ivar policy_definition_id: Azure resource ID of the policy definition + that turns this assessment calculation on + :vartype policy_definition_id: str + :param description: Human readable description of the assessment + :type description: str + :param remediation_description: Human readable description of what you + should do to mitigate this security issue + :type remediation_description: str + :param categories: + :type categories: list[str or ~azure.mgmt.security.models.Categories] :param severity: Required. The severity level of the assessment. Possible values include: 'Low', 'Medium', 'High' :type severity: str or ~azure.mgmt.security.models.Severity @@ -7658,9 +8249,6 @@ class SecurityAssessmentMetadata(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, 'display_name': {'required': True}, 'policy_definition_id': {'readonly': True}, 'severity': {'required': True}, @@ -7668,30 +8256,27 @@ class SecurityAssessmentMetadata(Resource): } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'policy_definition_id': {'key': 'properties.policyDefinitionId', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'remediation_description': {'key': 'properties.remediationDescription', 'type': 'str'}, - 'category': {'key': 'properties.category', 'type': '[str]'}, - 'severity': {'key': 'properties.severity', 'type': 'str'}, - 'user_impact': {'key': 'properties.userImpact', 'type': 'str'}, - 'implementation_effort': {'key': 'properties.implementationEffort', 'type': 'str'}, - 'threats': {'key': 'properties.threats', 'type': '[str]'}, - 'preview': {'key': 'properties.preview', 'type': 'bool'}, - 'assessment_type': {'key': 'properties.assessmentType', 'type': 'str'}, - 'partner_data': {'key': 'properties.partnerData', 'type': 'SecurityAssessmentMetadataPartnerData'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'policy_definition_id': {'key': 'policyDefinitionId', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'remediation_description': {'key': 'remediationDescription', 'type': 'str'}, + 'categories': {'key': 'categories', 'type': '[str]'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'user_impact': {'key': 'userImpact', 'type': 'str'}, + 'implementation_effort': {'key': 'implementationEffort', 'type': 'str'}, + 'threats': {'key': 'threats', 'type': '[str]'}, + 'preview': {'key': 'preview', 'type': 'bool'}, + 'assessment_type': {'key': 'assessmentType', 'type': 'str'}, + 'partner_data': {'key': 'partnerData', 'type': 'SecurityAssessmentMetadataPartnerData'}, } - def __init__(self, *, display_name: str, severity, assessment_type, description: str=None, remediation_description: str=None, category=None, user_impact=None, implementation_effort=None, threats=None, preview: bool=None, partner_data=None, **kwargs) -> None: - super(SecurityAssessmentMetadata, self).__init__(**kwargs) + def __init__(self, *, display_name: str, severity, assessment_type, description: str=None, remediation_description: str=None, categories=None, user_impact=None, implementation_effort=None, threats=None, preview: bool=None, partner_data=None, **kwargs) -> None: + super(SecurityAssessmentMetadataProperties, self).__init__(**kwargs) self.display_name = display_name self.policy_definition_id = None self.description = description self.remediation_description = remediation_description - self.category = category + self.categories = categories self.severity = severity self.user_impact = user_impact self.implementation_effort = implementation_effort @@ -7701,47 +8286,47 @@ def __init__(self, *, display_name: str, severity, assessment_type, description: self.partner_data = partner_data -class SecurityAssessmentMetadataPartnerData(Model): - """Describes the partner that created the assessment. +class SecurityAssessmentMetadataPropertiesResponsePublishDates(Model): + """SecurityAssessmentMetadataPropertiesResponsePublishDates. All required parameters must be populated in order to send to Azure. - :param partner_name: Required. Name of the company of the partner - :type partner_name: str - :param product_name: Name of the product of the partner that created the - assessment - :type product_name: str - :param secret: Required. Secret to authenticate the partner and verify it - created the assessment - write only - :type secret: str + :param ga: + :type ga: str + :param public: Required. + :type public: str """ _validation = { - 'partner_name': {'required': True}, - 'secret': {'required': True}, + 'ga': {'pattern': r'^([0-9]{2}/){2}[0-9]{4}$'}, + 'public': {'required': True, 'pattern': r'^([0-9]{2}/){2}[0-9]{4}$'}, } _attribute_map = { - 'partner_name': {'key': 'partnerName', 'type': 'str'}, - 'product_name': {'key': 'productName', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, + 'ga': {'key': 'GA', 'type': 'str'}, + 'public': {'key': 'public', 'type': 'str'}, } - def __init__(self, *, partner_name: str, secret: str, product_name: str=None, **kwargs) -> None: - super(SecurityAssessmentMetadataPartnerData, self).__init__(**kwargs) - self.partner_name = partner_name - self.product_name = product_name - self.secret = secret + def __init__(self, *, public: str, ga: str=None, **kwargs) -> None: + super(SecurityAssessmentMetadataPropertiesResponsePublishDates, self).__init__(**kwargs) + self.ga = ga + self.public = public -class SecurityAssessmentMetadataProperties(Model): - """Describes properties of an assessment metadata. +class SecurityAssessmentMetadataResponse(Resource): + """Security assessment metadata response. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str :param display_name: Required. User friendly display name of the assessment :type display_name: str @@ -7753,8 +8338,8 @@ class SecurityAssessmentMetadataProperties(Model): :param remediation_description: Human readable description of what you should do to mitigate this security issue :type remediation_description: str - :param category: - :type category: list[str or ~azure.mgmt.security.models.Category] + :param categories: + :type categories: list[str or ~azure.mgmt.security.models.Categories] :param severity: Required. The severity level of the assessment. Possible values include: 'Low', 'Medium', 'High' :type severity: str or ~azure.mgmt.security.models.Severity @@ -7778,37 +8363,51 @@ class SecurityAssessmentMetadataProperties(Model): :param partner_data: :type partner_data: ~azure.mgmt.security.models.SecurityAssessmentMetadataPartnerData + :param publish_dates: + :type publish_dates: + ~azure.mgmt.security.models.SecurityAssessmentMetadataPropertiesResponsePublishDates + :param planned_deprecation_date: + :type planned_deprecation_date: str """ _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, 'display_name': {'required': True}, 'policy_definition_id': {'readonly': True}, 'severity': {'required': True}, 'assessment_type': {'required': True}, + 'planned_deprecation_date': {'pattern': r'^[0-9]{2}/[0-9]{4}$'}, } _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'policy_definition_id': {'key': 'policyDefinitionId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'remediation_description': {'key': 'remediationDescription', 'type': 'str'}, - 'category': {'key': 'category', 'type': '[str]'}, - 'severity': {'key': 'severity', 'type': 'str'}, - 'user_impact': {'key': 'userImpact', 'type': 'str'}, - 'implementation_effort': {'key': 'implementationEffort', 'type': 'str'}, - 'threats': {'key': 'threats', 'type': '[str]'}, - 'preview': {'key': 'preview', 'type': 'bool'}, - 'assessment_type': {'key': 'assessmentType', 'type': 'str'}, - 'partner_data': {'key': 'partnerData', 'type': 'SecurityAssessmentMetadataPartnerData'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'policy_definition_id': {'key': 'properties.policyDefinitionId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'remediation_description': {'key': 'properties.remediationDescription', 'type': 'str'}, + 'categories': {'key': 'properties.categories', 'type': '[str]'}, + 'severity': {'key': 'properties.severity', 'type': 'str'}, + 'user_impact': {'key': 'properties.userImpact', 'type': 'str'}, + 'implementation_effort': {'key': 'properties.implementationEffort', 'type': 'str'}, + 'threats': {'key': 'properties.threats', 'type': '[str]'}, + 'preview': {'key': 'properties.preview', 'type': 'bool'}, + 'assessment_type': {'key': 'properties.assessmentType', 'type': 'str'}, + 'partner_data': {'key': 'properties.partnerData', 'type': 'SecurityAssessmentMetadataPartnerData'}, + 'publish_dates': {'key': 'properties.publishDates', 'type': 'SecurityAssessmentMetadataPropertiesResponsePublishDates'}, + 'planned_deprecation_date': {'key': 'properties.plannedDeprecationDate', 'type': 'str'}, } - def __init__(self, *, display_name: str, severity, assessment_type, description: str=None, remediation_description: str=None, category=None, user_impact=None, implementation_effort=None, threats=None, preview: bool=None, partner_data=None, **kwargs) -> None: - super(SecurityAssessmentMetadataProperties, self).__init__(**kwargs) + def __init__(self, *, display_name: str, severity, assessment_type, description: str=None, remediation_description: str=None, categories=None, user_impact=None, implementation_effort=None, threats=None, preview: bool=None, partner_data=None, publish_dates=None, planned_deprecation_date: str=None, **kwargs) -> None: + super(SecurityAssessmentMetadataResponse, self).__init__(**kwargs) self.display_name = display_name self.policy_definition_id = None self.description = description self.remediation_description = remediation_description - self.category = category + self.categories = categories self.severity = severity self.user_impact = user_impact self.implementation_effort = implementation_effort @@ -7816,6 +8415,8 @@ def __init__(self, *, display_name: str, severity, assessment_type, description: self.preview = preview self.assessment_type = assessment_type self.partner_data = partner_data + self.publish_dates = publish_dates + self.planned_deprecation_date = planned_deprecation_date class SecurityAssessmentPartnerData(Model): @@ -7845,6 +8446,119 @@ def __init__(self, *, partner_name: str, secret: str, **kwargs) -> None: self.secret = secret +class SecurityAssessmentPropertiesBase(Model): + """Describes properties of an 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 resource_details: Required. + :type resource_details: ~azure.mgmt.security.models.ResourceDetails + :ivar display_name: User friendly display name of the assessment + :vartype display_name: str + :param additional_data: Additional data regarding the assessment + :type additional_data: dict[str, str] + :param links: + :type links: ~azure.mgmt.security.models.AssessmentLinks + :param metadata: + :type metadata: + ~azure.mgmt.security.models.SecurityAssessmentMetadataProperties + :param partners_data: + :type partners_data: + ~azure.mgmt.security.models.SecurityAssessmentPartnerData + """ + + _validation = { + 'resource_details': {'required': True}, + 'display_name': {'readonly': True}, + } + + _attribute_map = { + 'resource_details': {'key': 'resourceDetails', 'type': 'ResourceDetails'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'additional_data': {'key': 'additionalData', 'type': '{str}'}, + 'links': {'key': 'links', 'type': 'AssessmentLinks'}, + 'metadata': {'key': 'metadata', 'type': 'SecurityAssessmentMetadataProperties'}, + 'partners_data': {'key': 'partnersData', 'type': 'SecurityAssessmentPartnerData'}, + } + + def __init__(self, *, resource_details, additional_data=None, links=None, metadata=None, partners_data=None, **kwargs) -> None: + super(SecurityAssessmentPropertiesBase, self).__init__(**kwargs) + self.resource_details = resource_details + self.display_name = None + self.additional_data = additional_data + self.links = links + self.metadata = metadata + self.partners_data = partners_data + + +class SecurityAssessmentResponse(Resource): + """Security assessment on a resource - response format. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param resource_details: Required. + :type resource_details: ~azure.mgmt.security.models.ResourceDetails + :ivar display_name: User friendly display name of the assessment + :vartype display_name: str + :param additional_data: Additional data regarding the assessment + :type additional_data: dict[str, str] + :param links: + :type links: ~azure.mgmt.security.models.AssessmentLinks + :param metadata: + :type metadata: + ~azure.mgmt.security.models.SecurityAssessmentMetadataProperties + :param partners_data: + :type partners_data: + ~azure.mgmt.security.models.SecurityAssessmentPartnerData + :param status: Required. + :type status: ~azure.mgmt.security.models.AssessmentStatusResponse + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'resource_details': {'required': True}, + 'display_name': {'readonly': True}, + 'status': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'resource_details': {'key': 'properties.resourceDetails', 'type': 'ResourceDetails'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'additional_data': {'key': 'properties.additionalData', 'type': '{str}'}, + 'links': {'key': 'properties.links', 'type': 'AssessmentLinks'}, + 'metadata': {'key': 'properties.metadata', 'type': 'SecurityAssessmentMetadataProperties'}, + 'partners_data': {'key': 'properties.partnersData', 'type': 'SecurityAssessmentPartnerData'}, + 'status': {'key': 'properties.status', 'type': 'AssessmentStatusResponse'}, + } + + def __init__(self, *, resource_details, status, additional_data=None, links=None, metadata=None, partners_data=None, **kwargs) -> None: + super(SecurityAssessmentResponse, self).__init__(**kwargs) + self.resource_details = resource_details + self.display_name = None + self.additional_data = additional_data + self.links = links + self.metadata = metadata + self.partners_data = partners_data + self.status = status + + class SecurityContact(Resource): """Contact details for security issues. @@ -8441,6 +9155,78 @@ def __init__(self, **kwargs) -> None: self.display_name = None +class Software(Resource): + """Represents a software data. + + 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 device_id: Unique identifier for the virtual machine in the + service. + :type device_id: str + :param os_platform: Platform of the operating system running on the + device. + :type os_platform: str + :param vendor: Name of the software vendor. + :type vendor: str + :param software_name: Name of the software product. + :type software_name: str + :param version: Version number of the software product. + :type version: str + :param end_of_support_status: End of support status. Possible values + include: 'None', 'noLongerSupported', 'versionNoLongerSupported', + 'upcomingNoLongerSupported', 'upcomingVersionNoLongerSupported' + :type end_of_support_status: str or + ~azure.mgmt.security.models.EndOfSupportStatus + :param end_of_support_date: The end of support date in case the product is + upcoming end of support. + :type end_of_support_date: str + :param number_of_known_vulnerabilities: Number of weaknesses. + :type number_of_known_vulnerabilities: int + :param first_seen_at: First time that the software was seen in the device. + :type first_seen_at: str + """ + + _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'}, + 'device_id': {'key': 'properties.deviceId', 'type': 'str'}, + 'os_platform': {'key': 'properties.osPlatform', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'software_name': {'key': 'properties.softwareName', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'end_of_support_status': {'key': 'properties.endOfSupportStatus', 'type': 'str'}, + 'end_of_support_date': {'key': 'properties.endOfSupportDate', 'type': 'str'}, + 'number_of_known_vulnerabilities': {'key': 'properties.numberOfKnownVulnerabilities', 'type': 'int'}, + 'first_seen_at': {'key': 'properties.firstSeenAt', 'type': 'str'}, + } + + def __init__(self, *, device_id: str=None, os_platform: str=None, vendor: str=None, software_name: str=None, version: str=None, end_of_support_status=None, end_of_support_date: str=None, number_of_known_vulnerabilities: int=None, first_seen_at: str=None, **kwargs) -> None: + super(Software, self).__init__(**kwargs) + self.device_id = device_id + self.os_platform = os_platform + self.vendor = vendor + self.software_name = software_name + self.version = version + self.end_of_support_status = end_of_support_status + self.end_of_support_date = end_of_support_date + self.number_of_known_vulnerabilities = number_of_known_vulnerabilities + self.first_seen_at = first_seen_at + + class SqlServerVulnerabilityProperties(AdditionalData): """Details of the resource that was assessed. @@ -8541,6 +9327,46 @@ def __init__(self, *, all_of, **kwargs) -> None: self.all_of = all_of +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or ~azure.mgmt.security.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.security.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC) + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, *, created_by: str=None, created_by_type=None, created_at=None, last_modified_by: str=None, last_modified_by_type=None, last_modified_at=None, **kwargs) -> None: + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + class Tags(Model): """A list of key value pairs that describe the resource. @@ -8860,6 +9686,41 @@ def __init__(self, *, tags=None, user_defined_resources=None, recommendations_co self.recommendations_configuration = recommendations_configuration +class UpgradePackageDownloadInfo(PackageDownloadInfo): + """Information on a specific package upgrade download. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar version: Version number + :vartype version: str + :param link: Download link + :type link: str + :ivar version_kind: Kind of the version. Possible values include: + 'Latest', 'Previous', 'Preview' + :vartype version_kind: str or ~azure.mgmt.security.models.VersionKind + :ivar from_version: Minimum base version for upgrade + :vartype from_version: str + """ + + _validation = { + 'version': {'readonly': True}, + 'version_kind': {'readonly': True}, + 'from_version': {'readonly': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'link': {'key': 'link', 'type': 'str'}, + 'version_kind': {'key': 'versionKind', 'type': 'str'}, + 'from_version': {'key': 'fromVersion', 'type': 'str'}, + } + + def __init__(self, *, link: str=None, **kwargs) -> None: + super(UpgradePackageDownloadInfo, self).__init__(link=link, **kwargs) + self.from_version = None + + class UserDefinedResourcesProperties(Model): """Properties of the IoT Security solution's user defined resources. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_paged_models.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_paged_models.py index 5dcf2e2766af5..e4e39cdb9b563 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 @@ -25,19 +25,6 @@ class ComplianceResultPaged(Paged): def __init__(self, *args, **kwargs): super(ComplianceResultPaged, self).__init__(*args, **kwargs) -class SettingPaged(Paged): - """ - A paging container for iterating over a list of :class:`Setting ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Setting]'} - } - - 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 @@ -90,58 +77,6 @@ class IoTSecurityAggregatedRecommendationPaged(Paged): def __init__(self, *args, **kwargs): super(IoTSecurityAggregatedRecommendationPaged, self).__init__(*args, **kwargs) -class IotAlertPaged(Paged): - """ - A paging container for iterating over a list of :class:`IotAlert ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[IotAlert]'} - } - - def __init__(self, *args, **kwargs): - - super(IotAlertPaged, self).__init__(*args, **kwargs) -class IotAlertModelPaged(Paged): - """ - A paging container for iterating over a list of :class:`IotAlertModel ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[IotAlertModel]'} - } - - def __init__(self, *args, **kwargs): - - super(IotAlertModelPaged, self).__init__(*args, **kwargs) -class IotRecommendationPaged(Paged): - """ - A paging container for iterating over a list of :class:`IotRecommendation ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[IotRecommendation]'} - } - - def __init__(self, *args, **kwargs): - - super(IotRecommendationPaged, self).__init__(*args, **kwargs) -class IotRecommendationModelPaged(Paged): - """ - A paging container for iterating over a list of :class:`IotRecommendationModel ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[IotRecommendationModel]'} - } - - def __init__(self, *args, **kwargs): - - super(IotRecommendationModelPaged, self).__init__(*args, **kwargs) class AscLocationPaged(Paged): """ A paging container for iterating over a list of :class:`AscLocation ` object @@ -324,32 +259,32 @@ class AlertsSuppressionRulePaged(Paged): def __init__(self, *args, **kwargs): super(AlertsSuppressionRulePaged, self).__init__(*args, **kwargs) -class SecurityAssessmentMetadataPaged(Paged): +class SecurityAssessmentMetadataResponsePaged(Paged): """ - A paging container for iterating over a list of :class:`SecurityAssessmentMetadata ` object + A paging container for iterating over a list of :class:`SecurityAssessmentMetadataResponse ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[SecurityAssessmentMetadata]'} + 'current_page': {'key': 'value', 'type': '[SecurityAssessmentMetadataResponse]'} } def __init__(self, *args, **kwargs): - super(SecurityAssessmentMetadataPaged, self).__init__(*args, **kwargs) -class SecurityAssessmentPaged(Paged): + super(SecurityAssessmentMetadataResponsePaged, self).__init__(*args, **kwargs) +class SecurityAssessmentResponsePaged(Paged): """ - A paging container for iterating over a list of :class:`SecurityAssessment ` object + A paging container for iterating over a list of :class:`SecurityAssessmentResponse ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[SecurityAssessment]'} + 'current_page': {'key': 'value', 'type': '[SecurityAssessmentResponse]'} } def __init__(self, *args, **kwargs): - super(SecurityAssessmentPaged, self).__init__(*args, **kwargs) + super(SecurityAssessmentResponsePaged, self).__init__(*args, **kwargs) class AdaptiveNetworkHardeningPaged(Paged): """ A paging container for iterating over a list of :class:`AdaptiveNetworkHardening ` object @@ -389,19 +324,6 @@ class TopologyResourcePaged(Paged): def __init__(self, *args, **kwargs): super(TopologyResourcePaged, self).__init__(*args, **kwargs) -class AlertPaged(Paged): - """ - A paging container for iterating over a list of :class:`Alert ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Alert]'} - } - - def __init__(self, *args, **kwargs): - - super(AlertPaged, self).__init__(*args, **kwargs) class JitNetworkAccessPolicyPaged(Paged): """ A paging container for iterating over a list of :class:`JitNetworkAccessPolicy ` object @@ -519,3 +441,81 @@ class DevicePaged(Paged): def __init__(self, *args, **kwargs): super(DevicePaged, self).__init__(*args, **kwargs) +class IotAlertModelPaged(Paged): + """ + A paging container for iterating over a list of :class:`IotAlertModel ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[IotAlertModel]'} + } + + def __init__(self, *args, **kwargs): + + super(IotAlertModelPaged, self).__init__(*args, **kwargs) +class IotRecommendationModelPaged(Paged): + """ + A paging container for iterating over a list of :class:`IotRecommendationModel ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[IotRecommendationModel]'} + } + + def __init__(self, *args, **kwargs): + + super(IotRecommendationModelPaged, self).__init__(*args, **kwargs) +class AlertPaged(Paged): + """ + A paging container for iterating over a list of :class:`Alert ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Alert]'} + } + + def __init__(self, *args, **kwargs): + + super(AlertPaged, self).__init__(*args, **kwargs) +class SettingPaged(Paged): + """ + A paging container for iterating over a list of :class:`Setting ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Setting]'} + } + + def __init__(self, *args, **kwargs): + + super(SettingPaged, self).__init__(*args, **kwargs) +class IngestionSettingPaged(Paged): + """ + A paging container for iterating over a list of :class:`IngestionSetting ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[IngestionSetting]'} + } + + def __init__(self, *args, **kwargs): + + super(IngestionSettingPaged, self).__init__(*args, **kwargs) +class SoftwarePaged(Paged): + """ + A paging container for iterating over a list of :class:`Software ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Software]'} + } + + def __init__(self, *args, **kwargs): + + super(SoftwarePaged, self).__init__(*args, **kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_security_center_enums.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_security_center_enums.py index 651c39085b1f0..2fb8b42c41ef5 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_security_center_enums.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_security_center_enums.py @@ -80,48 +80,28 @@ class UnmaskedIpLoggingStatus(str, Enum): enabled = "Enabled" #: Unmasked IP logging is enabled -class ReportedSeverity(str, Enum): +class AdditionalWorkspaceType(str, Enum): - informational = "Informational" - low = "Low" - medium = "Medium" - high = "High" + sentinel = "Sentinel" -class AlertSeverity(str, Enum): +class AdditionalWorkspaceDataType(str, Enum): - informational = "Informational" - low = "Low" - medium = "Medium" - high = "High" + alerts = "Alerts" + raw_events = "RawEvents" -class AlertIntent(str, Enum): +class CreatedByType(str, Enum): - unknown = "Unknown" - pre_attack = "PreAttack" - initial_access = "InitialAccess" - persistence = "Persistence" - privilege_escalation = "PrivilegeEscalation" - defense_evasion = "DefenseEvasion" - credential_access = "CredentialAccess" - discovery = "Discovery" - lateral_movement = "LateralMovement" - execution = "Execution" - collection = "Collection" - exfiltration = "Exfiltration" - command_and_control = "CommandAndControl" - impact = "Impact" - probing = "Probing" - exploitation = "Exploitation" + user = "User" + application = "Application" + managed_identity = "ManagedIdentity" + key = "Key" -class RecommendationSeverity(str, Enum): +class ReportedSeverity(str, Enum): - unknown = "Unknown" - not_applicable = "NotApplicable" - healthy = "Healthy" - off_by_policy = "OffByPolicy" + informational = "Informational" low = "Low" medium = "Medium" high = "High" @@ -181,6 +161,12 @@ class EventSource(str, Enum): assessments = "Assessments" sub_assessments = "SubAssessments" alerts = "Alerts" + secure_scores = "SecureScores" + secure_scores_snapshot = "SecureScoresSnapshot" + secure_score_controls = "SecureScoreControls" + secure_score_controls_snapshot = "SecureScoreControlsSnapshot" + regulatory_compliance_assessment = "RegulatoryComplianceAssessment" + regulatory_compliance_assessment_snapshot = "RegulatoryComplianceAssessmentSnapshot" class PropertyType(str, Enum): @@ -193,15 +179,15 @@ class PropertyType(str, Enum): class Operator(str, Enum): - equals = "Equals" - greater_than = "GreaterThan" - greater_than_or_equal_to = "GreaterThanOrEqualTo" - lesser_than = "LesserThan" - lesser_than_or_equal_to = "LesserThanOrEqualTo" - not_equals = "NotEquals" - contains = "Contains" - starts_with = "StartsWith" - ends_with = "EndsWith" + equals = "Equals" #: Applies for decimal and non-decimal operands + greater_than = "GreaterThan" #: Applies only for decimal operands + greater_than_or_equal_to = "GreaterThanOrEqualTo" #: Applies only for decimal operands + lesser_than = "LesserThan" #: Applies only for decimal operands + lesser_than_or_equal_to = "LesserThanOrEqualTo" #: Applies only for decimal operands + not_equals = "NotEquals" #: Applies for decimal and non-decimal operands + contains = "Contains" #: Applies only for non-decimal operands + starts_with = "StartsWith" #: Applies only for non-decimal operands + ends_with = "EndsWith" #: Applies only for non-decimal operands class RuleState(str, Enum): @@ -211,7 +197,7 @@ class RuleState(str, Enum): expired = "Expired" -class Category(str, Enum): +class Categories(str, Enum): compute = "Compute" networking = "Networking" @@ -273,33 +259,6 @@ class TransportProtocol(str, Enum): udp = "UDP" -class Intent(str, Enum): - - unknown = "Unknown" #: Unknown - pre_attack = "PreAttack" #: PreAttack could be either an attempt to access a certain resource regardless of a malicious intent, or a failed attempt to gain access to a target system to gather information prior to exploitation. This step is usually detected as an attempt, originating from outside the network, to scan the target system and find a way in. Further details on the PreAttack stage can be read in [MITRE Pre-Att&ck matrix](https://attack.mitre.org/matrices/pre/). - initial_access = "InitialAccess" #: InitialAccess is the stage where an attacker manages to get foothold on the attacked resource. - persistence = "Persistence" #: Persistence is any access, action, or configuration change to a system that gives a threat actor a persistent presence on that system. - privilege_escalation = "PrivilegeEscalation" #: Privilege escalation is the result of actions that allow an adversary to obtain a higher level of permissions on a system or network. - defense_evasion = "DefenseEvasion" #: Defense evasion consists of techniques an adversary may use to evade detection or avoid other defenses. - credential_access = "CredentialAccess" #: Credential access represents techniques resulting in access to or control over system, domain, or service credentials that are used within an enterprise environment. - discovery = "Discovery" #: Discovery consists of techniques that allow the adversary to gain knowledge about the system and internal network. - lateral_movement = "LateralMovement" #: Lateral movement consists of techniques that enable an adversary to access and control remote systems on a network and could, but does not necessarily, include execution of tools on remote systems. - execution = "Execution" #: The execution tactic represents techniques that result in execution of adversary-controlled code on a local or remote system. - collection = "Collection" #: Collection consists of techniques used to identify and gather information, such as sensitive files, from a target network prior to exfiltration. - exfiltration = "Exfiltration" #: Exfiltration refers to techniques and attributes that result or aid in the adversary removing files and information from a target network. - command_and_control = "CommandAndControl" #: The command and control tactic represents how adversaries communicate with systems under their control within a target network. - impact = "Impact" #: Impact events primarily try to directly reduce the availability or integrity of a system, service, or network; including manipulation of data to impact a business or operational process. - probing = "Probing" #: Probing could be either an attempt to access a certain resource regardless of a malicious intent, or a failed attempt to gain access to a target system to gather information prior to exploitation. - exploitation = "Exploitation" #: Exploitation is the stage where an attacker manages to get a foothold on the attacked resource. This stage is relevant for compute hosts and resources such as user accounts, certificates etc. - - -class AlertStatus(str, Enum): - - active = "Active" #: An alert which doesn't specify a value is assigned the status 'Active' - resolved = "Resolved" #: Alert closed after handling - dismissed = "Dismissed" #: Alert dismissed as false positive - - class Protocol(str, Enum): tcp = "TCP" @@ -416,6 +375,14 @@ class RuleType(str, Enum): negative_list = "NegativeList" #: NegativeList +class OnboardingKind(str, Enum): + + default = "Default" + migrated_to_azure = "MigratedToAzure" + evaluation = "Evaluation" + purchased = "Purchased" + + class VersionKind(str, Enum): latest = "Latest" @@ -423,6 +390,27 @@ class VersionKind(str, Enum): preview = "Preview" +class SensorStatus(str, Enum): + + ok = "Ok" + disconnected = "Disconnected" + unavailable = "Unavailable" + + +class TiStatus(str, Enum): + + ok = "Ok" + failed = "Failed" + in_progress = "InProgress" + update_available = "UpdateAvailable" + + +class SensorType(str, Enum): + + ot = "Ot" + enterprise = "Enterprise" + + class MacSignificance(str, Enum): primary = "Primary" @@ -478,6 +466,93 @@ class DeviceStatus(str, Enum): removed = "Removed" +class AlertSeverity(str, Enum): + + informational = "Informational" + low = "Low" + medium = "Medium" + high = "High" + + +class AlertIntent(str, Enum): + + unknown = "Unknown" + pre_attack = "PreAttack" + initial_access = "InitialAccess" + persistence = "Persistence" + privilege_escalation = "PrivilegeEscalation" + defense_evasion = "DefenseEvasion" + credential_access = "CredentialAccess" + discovery = "Discovery" + lateral_movement = "LateralMovement" + execution = "Execution" + collection = "Collection" + exfiltration = "Exfiltration" + command_and_control = "CommandAndControl" + impact = "Impact" + probing = "Probing" + exploitation = "Exploitation" + + +class RecommendationSeverity(str, Enum): + + unknown = "Unknown" + not_applicable = "NotApplicable" + healthy = "Healthy" + off_by_policy = "OffByPolicy" + low = "Low" + medium = "Medium" + high = "High" + + +class Intent(str, Enum): + + unknown = "Unknown" #: Unknown + pre_attack = "PreAttack" #: PreAttack could be either an attempt to access a certain resource regardless of a malicious intent, or a failed attempt to gain access to a target system to gather information prior to exploitation. This step is usually detected as an attempt, originating from outside the network, to scan the target system and find a way in. Further details on the PreAttack stage can be read in [MITRE Pre-Att&ck matrix](https://attack.mitre.org/matrices/pre/). + initial_access = "InitialAccess" #: InitialAccess is the stage where an attacker manages to get foothold on the attacked resource. + persistence = "Persistence" #: Persistence is any access, action, or configuration change to a system that gives a threat actor a persistent presence on that system. + privilege_escalation = "PrivilegeEscalation" #: Privilege escalation is the result of actions that allow an adversary to obtain a higher level of permissions on a system or network. + defense_evasion = "DefenseEvasion" #: Defense evasion consists of techniques an adversary may use to evade detection or avoid other defenses. + credential_access = "CredentialAccess" #: Credential access represents techniques resulting in access to or control over system, domain, or service credentials that are used within an enterprise environment. + discovery = "Discovery" #: Discovery consists of techniques that allow the adversary to gain knowledge about the system and internal network. + lateral_movement = "LateralMovement" #: Lateral movement consists of techniques that enable an adversary to access and control remote systems on a network and could, but does not necessarily, include execution of tools on remote systems. + execution = "Execution" #: The execution tactic represents techniques that result in execution of adversary-controlled code on a local or remote system. + collection = "Collection" #: Collection consists of techniques used to identify and gather information, such as sensitive files, from a target network prior to exfiltration. + exfiltration = "Exfiltration" #: Exfiltration refers to techniques and attributes that result or aid in the adversary removing files and information from a target network. + command_and_control = "CommandAndControl" #: The command and control tactic represents how adversaries communicate with systems under their control within a target network. + impact = "Impact" #: Impact events primarily try to directly reduce the availability or integrity of a system, service, or network; including manipulation of data to impact a business or operational process. + probing = "Probing" #: Probing could be either an attempt to access a certain resource regardless of a malicious intent, or a failed attempt to gain access to a target system to gather information prior to exploitation. + exploitation = "Exploitation" #: Exploitation is the stage where an attacker manages to get a foothold on the attacked resource. This stage is relevant for compute hosts and resources such as user accounts, certificates etc. + + +class AlertStatus(str, Enum): + + active = "Active" #: An alert which doesn't specify a value is assigned the status 'Active' + resolved = "Resolved" #: Alert closed after handling + dismissed = "Dismissed" #: Alert dismissed as false positive + + +class BundleType(str, Enum): + + app_services = "AppServices" + dns = "DNS" + key_vaults = "KeyVaults" + kubernetes_service = "KubernetesService" + resource_manager = "ResourceManager" + sql_servers = "SqlServers" + storage_accounts = "StorageAccounts" + virtual_machines = "VirtualMachines" + + +class EndOfSupportStatus(str, Enum): + + none = "None" + no_longer_supported = "noLongerSupported" + version_no_longer_supported = "versionNoLongerSupported" + upcoming_no_longer_supported = "upcomingNoLongerSupported" + upcoming_version_no_longer_supported = "upcomingVersionNoLongerSupported" + + class ExpandEnum(str, Enum): links = "links" #: All links associated with an assessment diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/__init__.py index 751d0d5098d5f..b2d82cbcb14d7 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 @@ -11,17 +11,12 @@ from ._compliance_results_operations import ComplianceResultsOperations from ._pricings_operations import PricingsOperations -from ._settings_operations import SettingsOperations from ._advanced_threat_protection_operations import AdvancedThreatProtectionOperations from ._device_security_groups_operations import DeviceSecurityGroupsOperations 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 ._iot_alert_types_operations import IotAlertTypesOperations -from ._iot_alerts_operations import IotAlertsOperations -from ._iot_recommendation_types_operations import IotRecommendationTypesOperations -from ._iot_recommendations_operations import IotRecommendationsOperations from ._locations_operations import LocationsOperations from ._operations import Operations from ._tasks_operations import TasksOperations @@ -43,7 +38,6 @@ from ._adaptive_network_hardenings_operations import AdaptiveNetworkHardeningsOperations from ._allowed_connections_operations import AllowedConnectionsOperations from ._topology_operations import TopologyOperations -from ._alerts_operations import AlertsOperations from ._jit_network_access_policies_operations import JitNetworkAccessPoliciesOperations from ._discovered_security_solutions_operations import DiscoveredSecuritySolutionsOperations from ._security_solutions_reference_data_operations import SecuritySolutionsReferenceDataOperations @@ -62,21 +56,25 @@ from ._devices_for_hub_operations import DevicesForHubOperations from ._device_operations import DeviceOperations from ._on_premise_iot_sensors_operations import OnPremiseIotSensorsOperations +from ._iot_sites_operations import IotSitesOperations +from ._iot_alerts_operations import IotAlertsOperations +from ._iot_alert_types_operations import IotAlertTypesOperations +from ._iot_recommendations_operations import IotRecommendationsOperations +from ._iot_recommendation_types_operations import IotRecommendationTypesOperations +from ._alerts_operations import AlertsOperations +from ._settings_operations import SettingsOperations +from ._ingestion_settings_operations import IngestionSettingsOperations +from ._software_inventories_operations import SoftwareInventoriesOperations __all__ = [ 'ComplianceResultsOperations', 'PricingsOperations', - 'SettingsOperations', 'AdvancedThreatProtectionOperations', 'DeviceSecurityGroupsOperations', 'IotSecuritySolutionOperations', 'IotSecuritySolutionAnalyticsOperations', 'IotSecuritySolutionsAnalyticsAggregatedAlertOperations', 'IotSecuritySolutionsAnalyticsRecommendationOperations', - 'IotAlertTypesOperations', - 'IotAlertsOperations', - 'IotRecommendationTypesOperations', - 'IotRecommendationsOperations', 'LocationsOperations', 'Operations', 'TasksOperations', @@ -98,7 +96,6 @@ 'AdaptiveNetworkHardeningsOperations', 'AllowedConnectionsOperations', 'TopologyOperations', - 'AlertsOperations', 'JitNetworkAccessPoliciesOperations', 'DiscoveredSecuritySolutionsOperations', 'SecuritySolutionsReferenceDataOperations', @@ -117,4 +114,13 @@ 'DevicesForHubOperations', 'DeviceOperations', 'OnPremiseIotSensorsOperations', + 'IotSitesOperations', + 'IotAlertsOperations', + 'IotAlertTypesOperations', + 'IotRecommendationsOperations', + 'IotRecommendationTypesOperations', + 'AlertsOperations', + 'SettingsOperations', + 'IngestionSettingsOperations', + 'SoftwareInventoriesOperations', ] diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_alerts_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_alerts_operations.py index 3c069f9610fbf..e15d81e6e5754 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_alerts_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_alerts_operations.py @@ -12,6 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -25,7 +27,7 @@ class AlertsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2020-01-01". + :ivar api_version: API version for the operation. Constant value: "2021-01-01". """ models = models @@ -35,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-01-01" + self.api_version = "2021-01-01" self.config = config @@ -175,7 +177,7 @@ def internal_paging(next_link=None): return deserialized list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts'} - def list_subscription_level_alerts_by_region( + def list_subscription_level_by_region( self, custom_headers=None, raw=False, **operation_config): """List all the alerts that are associated with the subscription that are stored in a specific location. @@ -193,7 +195,7 @@ def list_subscription_level_alerts_by_region( def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_subscription_level_alerts_by_region.metadata['url'] + url = self.list_subscription_level_by_region.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str') @@ -241,9 +243,9 @@ def internal_paging(next_link=None): deserialized = models.AlertPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_subscription_level_alerts_by_region.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts'} + list_subscription_level_by_region.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts'} - def list_resource_group_level_alerts_by_region( + def list_resource_group_level_by_region( self, resource_group_name, custom_headers=None, raw=False, **operation_config): """List all the alerts that are associated with the resource group that are stored in a specific location. @@ -264,7 +266,7 @@ def list_resource_group_level_alerts_by_region( def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_resource_group_level_alerts_by_region.metadata['url'] + url = self.list_resource_group_level_by_region.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), @@ -313,9 +315,9 @@ def internal_paging(next_link=None): deserialized = models.AlertPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_resource_group_level_alerts_by_region.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts'} + list_resource_group_level_by_region.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts'} - def get_subscription_level_alert( + def get_subscription_level( self, alert_name, custom_headers=None, raw=False, **operation_config): """Get an alert that is associated with a subscription. @@ -332,7 +334,7 @@ def get_subscription_level_alert( :raises: :class:`CloudError` """ # Construct URL - url = self.get_subscription_level_alert.metadata['url'] + url = self.get_subscription_level.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), @@ -372,9 +374,9 @@ def get_subscription_level_alert( return client_raw_response return deserialized - get_subscription_level_alert.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}'} + get_subscription_level.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}'} - def get_resource_group_level_alerts( + def get_resource_group_level( self, alert_name, resource_group_name, custom_headers=None, raw=False, **operation_config): """Get an alert that is associated a resource group or a resource in a resource group. @@ -395,7 +397,7 @@ def get_resource_group_level_alerts( :raises: :class:`CloudError` """ # Construct URL - url = self.get_resource_group_level_alerts.metadata['url'] + url = self.get_resource_group_level.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), @@ -436,9 +438,9 @@ def get_resource_group_level_alerts( return client_raw_response return deserialized - get_resource_group_level_alerts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}'} + get_resource_group_level.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}'} - def update_subscription_level_alert_state_to_dismiss( + def update_subscription_level_state_to_dismiss( self, alert_name, custom_headers=None, raw=False, **operation_config): """Update the alert's state. @@ -454,7 +456,7 @@ def update_subscription_level_alert_state_to_dismiss( :raises: :class:`CloudError` """ # Construct URL - url = self.update_subscription_level_alert_state_to_dismiss.metadata['url'] + url = self.update_subscription_level_state_to_dismiss.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), @@ -487,7 +489,7 @@ def update_subscription_level_alert_state_to_dismiss( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - update_subscription_level_alert_state_to_dismiss.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss'} + update_subscription_level_state_to_dismiss.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss'} def update_subscription_level_state_to_resolve( self, alert_name, custom_headers=None, raw=False, **operation_config): @@ -540,7 +542,7 @@ def update_subscription_level_state_to_resolve( return client_raw_response update_subscription_level_state_to_resolve.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve'} - def update_subscription_level_alert_state_to_reactivate( + def update_subscription_level_state_to_activate( self, alert_name, custom_headers=None, raw=False, **operation_config): """Update the alert's state. @@ -556,7 +558,7 @@ def update_subscription_level_alert_state_to_reactivate( :raises: :class:`CloudError` """ # Construct URL - url = self.update_subscription_level_alert_state_to_reactivate.metadata['url'] + url = self.update_subscription_level_state_to_activate.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), @@ -589,7 +591,7 @@ def update_subscription_level_alert_state_to_reactivate( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - update_subscription_level_alert_state_to_reactivate.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate'} + update_subscription_level_state_to_activate.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate'} def update_resource_group_level_state_to_resolve( self, alert_name, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -646,7 +648,7 @@ def update_resource_group_level_state_to_resolve( return client_raw_response update_resource_group_level_state_to_resolve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve'} - def update_resource_group_level_alert_state_to_dismiss( + def update_resource_group_level_state_to_dismiss( self, alert_name, resource_group_name, custom_headers=None, raw=False, **operation_config): """Update the alert's state. @@ -665,7 +667,7 @@ def update_resource_group_level_alert_state_to_dismiss( :raises: :class:`CloudError` """ # Construct URL - url = self.update_resource_group_level_alert_state_to_dismiss.metadata['url'] + url = self.update_resource_group_level_state_to_dismiss.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), @@ -699,9 +701,9 @@ def update_resource_group_level_alert_state_to_dismiss( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - update_resource_group_level_alert_state_to_dismiss.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss'} + update_resource_group_level_state_to_dismiss.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss'} - def update_resource_group_level_alert_state_to_reactivate( + def update_resource_group_level_state_to_activate( self, alert_name, resource_group_name, custom_headers=None, raw=False, **operation_config): """Update the alert's state. @@ -720,7 +722,7 @@ def update_resource_group_level_alert_state_to_reactivate( :raises: :class:`CloudError` """ # Construct URL - url = self.update_resource_group_level_alert_state_to_reactivate.metadata['url'] + url = self.update_resource_group_level_state_to_activate.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), @@ -754,4 +756,86 @@ def update_resource_group_level_alert_state_to_reactivate( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - update_resource_group_level_alert_state_to_reactivate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate'} + update_resource_group_level_state_to_activate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate'} + + + def _simulate_initial( + self, properties=None, custom_headers=None, raw=False, **operation_config): + alert_simulator_request_body = models.AlertSimulatorRequestBody(properties=properties) + + # Construct URL + url = self.simulate.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(alert_simulator_request_body, 'AlertSimulatorRequestBody') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def simulate( + self, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Simulate security alerts. + + :param properties: Alert Simulator request body data. + :type properties: + ~azure.mgmt.security.models.AlertSimulatorRequestProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._simulate_initial( + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + simulate.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_assessments_metadata_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_assessments_metadata_operations.py index 9a5350d93fa9f..618277f049e3c 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_assessments_metadata_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_assessments_metadata_operations.py @@ -25,7 +25,7 @@ class AssessmentsMetadataOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2020-01-01". + :ivar api_version: API version for the operation. Constant value: "2021-06-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-01-01" + self.api_version = "2021-06-01" self.config = config @@ -48,9 +48,10 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of SecurityAssessmentMetadata + :return: An iterator like instance of + SecurityAssessmentMetadataResponse :rtype: - ~azure.mgmt.security.models.SecurityAssessmentMetadataPaged[~azure.mgmt.security.models.SecurityAssessmentMetadata] + ~azure.mgmt.security.models.SecurityAssessmentMetadataResponsePaged[~azure.mgmt.security.models.SecurityAssessmentMetadataResponse] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -96,7 +97,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.SecurityAssessmentMetadataPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.SecurityAssessmentMetadataResponsePaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/providers/Microsoft.Security/assessmentMetadata'} @@ -113,9 +114,10 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: SecurityAssessmentMetadata or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadata or - ~msrest.pipeline.ClientRawResponse + :return: SecurityAssessmentMetadataResponse or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadataResponse + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL @@ -150,7 +152,7 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SecurityAssessmentMetadata', response) + deserialized = self._deserialize('SecurityAssessmentMetadataResponse', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -169,9 +171,10 @@ def list_by_subscription( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of SecurityAssessmentMetadata + :return: An iterator like instance of + SecurityAssessmentMetadataResponse :rtype: - ~azure.mgmt.security.models.SecurityAssessmentMetadataPaged[~azure.mgmt.security.models.SecurityAssessmentMetadata] + ~azure.mgmt.security.models.SecurityAssessmentMetadataResponsePaged[~azure.mgmt.security.models.SecurityAssessmentMetadataResponse] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -221,7 +224,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.SecurityAssessmentMetadataPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.SecurityAssessmentMetadataResponsePaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata'} @@ -239,9 +242,10 @@ def get_in_subscription( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: SecurityAssessmentMetadata or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadata or - ~msrest.pipeline.ClientRawResponse + :return: SecurityAssessmentMetadataResponse or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadataResponse + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL @@ -277,7 +281,7 @@ def get_in_subscription( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SecurityAssessmentMetadata', response) + deserialized = self._deserialize('SecurityAssessmentMetadataResponse', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_assessments_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_assessments_operations.py index 2c4c32bdf45e3..d8a76ddfbc109 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_assessments_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_assessments_operations.py @@ -25,7 +25,7 @@ class AssessmentsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2020-01-01". + :ivar api_version: API version for the operation. Constant value: "2021-06-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-01-01" + self.api_version = "2021-06-01" self.config = config @@ -52,9 +52,9 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of SecurityAssessment + :return: An iterator like instance of SecurityAssessmentResponse :rtype: - ~azure.mgmt.security.models.SecurityAssessmentPaged[~azure.mgmt.security.models.SecurityAssessment] + ~azure.mgmt.security.models.SecurityAssessmentResponsePaged[~azure.mgmt.security.models.SecurityAssessmentResponse] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -104,7 +104,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.SecurityAssessmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.SecurityAssessmentResponsePaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/{scope}/providers/Microsoft.Security/assessments'} @@ -126,8 +126,8 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: SecurityAssessment or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.SecurityAssessment or + :return: SecurityAssessmentResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.SecurityAssessmentResponse or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -166,7 +166,7 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SecurityAssessment', response) + deserialized = self._deserialize('SecurityAssessmentResponse', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -194,8 +194,8 @@ def create_or_update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: SecurityAssessment or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.SecurityAssessment or + :return: SecurityAssessmentResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.SecurityAssessmentResponse or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -236,9 +236,9 @@ def create_or_update( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SecurityAssessment', response) + deserialized = self._deserialize('SecurityAssessmentResponse', response) if response.status_code == 201: - deserialized = self._deserialize('SecurityAssessment', response) + deserialized = self._deserialize('SecurityAssessmentResponse', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_ingestion_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_ingestion_settings_operations.py new file mode 100644 index 0000000000000..67f6ce4ea26de --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_ingestion_settings_operations.py @@ -0,0 +1,400 @@ +# 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 IngestionSettingsOperations(object): + """IngestionSettingsOperations 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: "2021-01-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-15-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Settings for ingesting security data and logs to correlate with + resources associated with the subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of IngestionSetting + :rtype: + ~azure.mgmt.security.models.IngestionSettingPaged[~azure.mgmt.security.models.IngestionSetting] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.IngestionSettingPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings'} + + def get( + self, ingestion_setting_name, custom_headers=None, raw=False, **operation_config): + """Settings for ingesting security data and logs to correlate with + resources associated with the subscription. + + :param ingestion_setting_name: Name of the ingestion setting + :type ingestion_setting_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: IngestionSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IngestionSetting 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}$'), + 'ingestionSettingName': self._serialize.url("ingestion_setting_name", ingestion_setting_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('IngestionSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}'} + + def create( + self, ingestion_setting_name, properties=None, custom_headers=None, raw=False, **operation_config): + """Create setting for ingesting security data and logs to correlate with + resources associated with the subscription. + + :param ingestion_setting_name: Name of the ingestion setting + :type ingestion_setting_name: str + :param properties: Ingestion setting data + :type properties: object + :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: IngestionSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IngestionSetting or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + ingestion_setting = models.IngestionSetting(properties=properties) + + # Construct 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}$'), + 'ingestionSettingName': self._serialize.url("ingestion_setting_name", ingestion_setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(ingestion_setting, 'IngestionSetting') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IngestionSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}'} + + def delete( + self, ingestion_setting_name, custom_headers=None, raw=False, **operation_config): + """Deletes the ingestion settings for this subscription. + + :param ingestion_setting_name: Name of the ingestion setting + :type ingestion_setting_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 = { + '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}$'), + 'ingestionSettingName': self._serialize.url("ingestion_setting_name", ingestion_setting_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': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}'} + + def list_tokens( + self, ingestion_setting_name, custom_headers=None, raw=False, **operation_config): + """Returns the token that is used for correlating ingested telemetry with + the resources in the subscription. + + :param ingestion_setting_name: Name of the ingestion setting + :type ingestion_setting_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: IngestionSettingToken or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IngestionSettingToken or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_tokens.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}$'), + 'ingestionSettingName': self._serialize.url("ingestion_setting_name", ingestion_setting_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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IngestionSettingToken', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_tokens.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listTokens'} + + def list_connection_strings( + self, ingestion_setting_name, custom_headers=None, raw=False, **operation_config): + """Connection strings for ingesting security scan logs and data. + + :param ingestion_setting_name: Name of the ingestion setting + :type ingestion_setting_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: ConnectionStrings or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.ConnectionStrings or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_connection_strings.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}$'), + 'ingestionSettingName': self._serialize.url("ingestion_setting_name", ingestion_setting_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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ConnectionStrings', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_connection_strings.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listConnectionStrings'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_alert_types_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_alert_types_operations.py index 68a582e8109d8..95c336efe29b6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_alert_types_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_alert_types_operations.py @@ -25,6 +25,7 @@ class IotAlertTypesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2020-08-06-preview". """ models = models @@ -34,141 +35,11 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer + self.api_version = "2020-08-06-preview" self.config = config def list( - self, resource_group_name, solution_name, custom_headers=None, raw=False, **operation_config): - """List IoT alert types. - - :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 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: IotAlertTypeList or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotAlertTypeList or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2019-08-01" - - # 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("api_version", 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('IotAlertTypeList', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlertTypes'} - - def get( - self, resource_group_name, solution_name, iot_alert_type_name, custom_headers=None, raw=False, **operation_config): - """Get IoT alert type. - - :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 iot_alert_type_name: Name of the alert type - :type iot_alert_type_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: IotAlertType or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotAlertType or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2019-08-01" - - # 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'), - 'iotAlertTypeName': self._serialize.url("iot_alert_type_name", iot_alert_type_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", 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('IotAlertType', 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}/iotAlertTypes/{iotAlertTypeName}'} - - def list1( self, custom_headers=None, raw=False, **operation_config): """List IoT alert types. @@ -182,10 +53,8 @@ def list1( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2020-08-06-preview" - # Construct URL - url = self.list1.metadata['url'] + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') } @@ -193,7 +62,7 @@ def list1( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -223,9 +92,9 @@ def list1( return client_raw_response return deserialized - list1.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes'} - def get1( + def get( self, iot_alert_type_name, custom_headers=None, raw=False, **operation_config): """Get IoT alert type. @@ -241,10 +110,8 @@ def get1( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2020-08-06-preview" - # Construct URL - url = self.get1.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'iotAlertTypeName': self._serialize.url("iot_alert_type_name", iot_alert_type_name, 'str') @@ -253,7 +120,7 @@ def get1( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -283,4 +150,4 @@ def get1( return client_raw_response return deserialized - get1.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes/{iotAlertTypeName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes/{iotAlertTypeName}'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_alerts_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_alerts_operations.py index 8f4e3128008b6..e3bac72a7994f 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_alerts_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_alerts_operations.py @@ -25,6 +25,7 @@ class IotAlertsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2020-08-06-preview". """ models = models @@ -34,178 +35,11 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer + self.api_version = "2020-08-06-preview" self.config = config def list( - self, resource_group_name, solution_name, min_start_time_utc=None, max_start_time_utc=None, alert_type=None, compromised_entity=None, limit=None, skip_token=None, custom_headers=None, raw=False, **operation_config): - """List IoT alerts. - - :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 min_start_time_utc: Filter by minimum startTimeUtc (ISO 8601 - format) - :type min_start_time_utc: str - :param max_start_time_utc: Filter by maximum startTimeUtc (ISO 8601 - format) - :type max_start_time_utc: str - :param alert_type: Filter by alert type - :type alert_type: str - :param compromised_entity: Filter by compromised device - :type compromised_entity: str - :param limit: Limit the number of items returned in a single page - :type limit: int - :param skip_token: Skip token used for pagination - :type skip_token: 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 IotAlert - :rtype: - ~azure.mgmt.security.models.IotAlertPaged[~azure.mgmt.security.models.IotAlert] - :raises: :class:`CloudError` - """ - api_version = "2019-08-01" - - 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("api_version", api_version, 'str') - if min_start_time_utc is not None: - query_parameters['startTimeUtc>'] = self._serialize.query("min_start_time_utc", min_start_time_utc, 'str') - if max_start_time_utc is not None: - query_parameters['startTimeUtc<'] = self._serialize.query("max_start_time_utc", max_start_time_utc, 'str') - if alert_type is not None: - query_parameters['alertType'] = self._serialize.query("alert_type", alert_type, 'str') - if compromised_entity is not None: - query_parameters['compromisedEntity'] = self._serialize.query("compromised_entity", compromised_entity, 'str') - if limit is not None: - query_parameters['$limit'] = self._serialize.query("limit", limit, 'int') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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.IotAlertPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlerts'} - - def get( - self, resource_group_name, solution_name, iot_alert_id, custom_headers=None, raw=False, **operation_config): - """Get IoT alert. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param solution_name: The name of the IoT Security solution. - :type solution_name: str - :param iot_alert_id: Id of the alert - :type iot_alert_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: IotAlert or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotAlert or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2019-08-01" - - # 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'), - 'iotAlertId': self._serialize.url("iot_alert_id", iot_alert_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", 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('IotAlert', 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}/iotAlerts/{iotAlertId}'} - - def list1( self, scope, min_start_time_utc=None, max_start_time_utc=None, alert_type=None, device_management_type=None, compromised_entity=None, limit=None, skip_token=None, custom_headers=None, raw=False, **operation_config): """List IoT alerts. @@ -241,12 +75,10 @@ def list1( ~azure.mgmt.security.models.IotAlertModelPaged[~azure.mgmt.security.models.IotAlertModel] :raises: :class:`CloudError` """ - api_version = "2020-08-06-preview" - def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list1.metadata['url'] + url = self.list.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) } @@ -254,7 +86,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') if min_start_time_utc is not None: query_parameters['startTimeUtc>'] = self._serialize.query("min_start_time_utc", min_start_time_utc, 'str') if max_start_time_utc is not None: @@ -307,9 +139,9 @@ def internal_paging(next_link=None): deserialized = models.IotAlertModelPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list1.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotAlerts'} + list.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotAlerts'} - def get1( + def get( self, scope, iot_alert_id, custom_headers=None, raw=False, **operation_config): """Get IoT alert. @@ -329,10 +161,8 @@ def get1( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2020-08-06-preview" - # Construct URL - url = self.get1.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'iotAlertId': self._serialize.url("iot_alert_id", iot_alert_id, 'str') @@ -341,7 +171,7 @@ def get1( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -371,4 +201,4 @@ def get1( return client_raw_response return deserialized - get1.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotAlerts/{iotAlertId}'} + get.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotAlerts/{iotAlertId}'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_defender_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_defender_settings_operations.py index 679341957e379..4c796db0a056e 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_defender_settings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_defender_settings_operations.py @@ -150,16 +150,12 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default'} def create_or_update( - self, device_quota, sentinel_workspace_resource_ids, custom_headers=None, raw=False, **operation_config): + self, iot_defender_settings_model, custom_headers=None, raw=False, **operation_config): """Create or update IoT Defender settings. - :param device_quota: Size of the device quota (as a opposed to a Pay - as You Go billing model). Value is required to be in multiples of - 1000. - :type device_quota: int - :param sentinel_workspace_resource_ids: Sentinel Workspace Resource - Ids - :type sentinel_workspace_resource_ids: list[str] + :param iot_defender_settings_model: The IoT defender settings model + :type iot_defender_settings_model: + ~azure.mgmt.security.models.IotDefenderSettingsModel :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -170,8 +166,6 @@ def create_or_update( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - iot_defender_settings_model = models.IotDefenderSettingsModel(device_quota=device_quota, sentinel_workspace_resource_ids=sentinel_workspace_resource_ids) - # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -320,3 +314,60 @@ def package_downloads_method( return deserialized package_downloads_method.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default/packageDownloads'} + + def download_manager_activation( + self, custom_headers=None, raw=False, callback=None, **operation_config): + """Download manager activation data defined for this subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param callback: When specified, will be called with each chunk of + data that is streamed. The callback should take two arguments, the + bytes of the current chunk of data and the response object. If the + data is uploading, response will be None. + :type callback: Callable[Bytes, response=None] + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.download_manager_activation.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/zip' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=True, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + download_manager_activation.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default/downloadManagerActivation'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_recommendation_types_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_recommendation_types_operations.py index 2ac1dadc2e865..bab2575515cb6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_recommendation_types_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_recommendation_types_operations.py @@ -25,6 +25,7 @@ class IotRecommendationTypesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2020-08-06-preview". """ models = models @@ -34,141 +35,11 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer + self.api_version = "2020-08-06-preview" self.config = config def list( - self, resource_group_name, solution_name, custom_headers=None, raw=False, **operation_config): - """List IoT recommendation types. - - :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 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: IotRecommendationTypeList or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotRecommendationTypeList or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2019-08-01" - - # 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("api_version", 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('IotRecommendationTypeList', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotRecommendationTypes'} - - def get( - self, resource_group_name, solution_name, iot_recommendation_type_name, custom_headers=None, raw=False, **operation_config): - """Get IoT recommendation type. - - :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 iot_recommendation_type_name: Name of the recommendation type - :type iot_recommendation_type_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: IotRecommendationType or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotRecommendationType or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2019-08-01" - - # 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'), - 'iotRecommendationTypeName': self._serialize.url("iot_recommendation_type_name", iot_recommendation_type_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", 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('IotRecommendationType', 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}/iotRecommendationTypes/{iotRecommendationTypeName}'} - - def list1( self, custom_headers=None, raw=False, **operation_config): """List IoT recommendation types. @@ -182,10 +53,8 @@ def list1( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2020-08-06-preview" - # Construct URL - url = self.list1.metadata['url'] + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') } @@ -193,7 +62,7 @@ def list1( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -223,9 +92,9 @@ def list1( return client_raw_response return deserialized - list1.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes'} - def get1( + def get( self, iot_recommendation_type_name, custom_headers=None, raw=False, **operation_config): """Get IoT recommendation type. @@ -241,10 +110,8 @@ def get1( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2020-08-06-preview" - # Construct URL - url = self.get1.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'iotRecommendationTypeName': self._serialize.url("iot_recommendation_type_name", iot_recommendation_type_name, 'str') @@ -253,7 +120,7 @@ def get1( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -283,4 +150,4 @@ def get1( return client_raw_response return deserialized - get1.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes/{iotRecommendationTypeName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes/{iotRecommendationTypeName}'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_recommendations_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_recommendations_operations.py index 36af51bc0cdf1..962b4ab04cbe1 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_recommendations_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_recommendations_operations.py @@ -25,6 +25,7 @@ class IotRecommendationsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2020-08-06-preview". """ models = models @@ -34,168 +35,11 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer + self.api_version = "2020-08-06-preview" self.config = config def list( - self, resource_group_name, solution_name, recommendation_type=None, device_id=None, limit=None, skip_token=None, custom_headers=None, raw=False, **operation_config): - """List IoT recommendations. - - :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 recommendation_type: Filter by recommendation type - :type recommendation_type: str - :param device_id: Filter by device id - :type device_id: str - :param limit: Limit the number of items returned in a single page - :type limit: int - :param skip_token: Skip token used for pagination - :type skip_token: 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 IotRecommendation - :rtype: - ~azure.mgmt.security.models.IotRecommendationPaged[~azure.mgmt.security.models.IotRecommendation] - :raises: :class:`CloudError` - """ - api_version = "2019-08-01" - - 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("api_version", api_version, 'str') - if recommendation_type is not None: - query_parameters['recommendationType'] = self._serialize.query("recommendation_type", recommendation_type, 'str') - if device_id is not None: - query_parameters['deviceId'] = self._serialize.query("device_id", device_id, 'str') - if limit is not None: - query_parameters['$limit'] = self._serialize.query("limit", limit, 'int') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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.IotRecommendationPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotRecommendations'} - - def get( - self, resource_group_name, solution_name, iot_recommendation_id, custom_headers=None, raw=False, **operation_config): - """Get IoT recommendation. - - :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 iot_recommendation_id: Id of the recommendation - :type iot_recommendation_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: IotRecommendation or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotRecommendation or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2019-08-01" - - # 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'), - 'iotRecommendationId': self._serialize.url("iot_recommendation_id", iot_recommendation_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", 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('IotRecommendation', 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}/iotRecommendations/{iotRecommendationId}'} - - def list1( self, scope, recommendation_type=None, device_id=None, limit=None, skip_token=None, custom_headers=None, raw=False, **operation_config): """List IoT recommendations. @@ -221,12 +65,10 @@ def list1( ~azure.mgmt.security.models.IotRecommendationModelPaged[~azure.mgmt.security.models.IotRecommendationModel] :raises: :class:`CloudError` """ - api_version = "2020-08-06-preview" - def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list1.metadata['url'] + url = self.list.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) } @@ -234,7 +76,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') if recommendation_type is not None: query_parameters['recommendationType'] = self._serialize.query("recommendation_type", recommendation_type, 'str') if device_id is not None: @@ -281,9 +123,9 @@ def internal_paging(next_link=None): deserialized = models.IotRecommendationModelPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list1.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotRecommendations'} + list.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotRecommendations'} - def get1( + def get( self, scope, iot_recommendation_id, custom_headers=None, raw=False, **operation_config): """Get IoT recommendation. @@ -303,10 +145,8 @@ def get1( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2020-08-06-preview" - # Construct URL - url = self.get1.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'iotRecommendationId': self._serialize.url("iot_recommendation_id", iot_recommendation_id, 'str') @@ -315,7 +155,7 @@ def get1( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -345,4 +185,4 @@ def get1( return client_raw_response return deserialized - get1.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotRecommendations/{iotRecommendationId}'} + get.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotRecommendations/{iotRecommendationId}'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sensors_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sensors_operations.py index 0565ee6ba734c..5557bba21f9d3 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sensors_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sensors_operations.py @@ -111,8 +111,8 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: IotSensor or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotSensor or + :return: IotSensorsModel or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IotSensorsModel or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -149,7 +149,7 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('IotSensor', response) + deserialized = self._deserialize('IotSensorsModel', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -159,7 +159,7 @@ def get( get.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}'} def create_or_update( - self, scope, iot_sensor_name, custom_headers=None, raw=False, **operation_config): + self, scope, iot_sensor_name, iot_sensors_model, custom_headers=None, raw=False, **operation_config): """Create or update IoT sensor. :param scope: Scope of the query (IoT Hub, @@ -167,13 +167,15 @@ def create_or_update( :type scope: str :param iot_sensor_name: Name of the IoT sensor :type iot_sensor_name: str + :param iot_sensors_model: The IoT sensor model + :type iot_sensors_model: ~azure.mgmt.security.models.IotSensorsModel :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: IotSensor or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotSensor or + :return: IotSensorsModel or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IotSensorsModel or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -192,6 +194,7 @@ def create_or_update( # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -199,8 +202,11 @@ def create_or_update( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + # Construct body + body_content = self._serialize.body(iot_sensors_model, 'IotSensorsModel') + # Construct and send request - request = self._client.put(url, query_parameters, header_parameters) + request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: @@ -210,9 +216,9 @@ def create_or_update( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('IotSensor', response) + deserialized = self._deserialize('IotSensorsModel', response) if response.status_code == 201: - deserialized = self._deserialize('IotSensor', response) + deserialized = self._deserialize('IotSensorsModel', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -336,3 +342,127 @@ def download_activation( return deserialized download_activation.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}/downloadActivation'} + + def download_reset_password( + self, scope, iot_sensor_name, appliance_id=None, custom_headers=None, raw=False, callback=None, **operation_config): + """Download file for reset password of the sensor. + + :param scope: Scope of the query (IoT Hub, + /providers/Microsoft.Devices/iotHubs/myHub) + :type scope: str + :param iot_sensor_name: Name of the IoT sensor + :type iot_sensor_name: str + :param appliance_id: The appliance id of the sensor. + :type appliance_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param callback: When specified, will be called with each chunk of + data that is streamed. The callback should take two arguments, the + bytes of the current chunk of data and the response object. If the + data is uploading, response will be None. + :type callback: Callable[Bytes, response=None] + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + body = models.ResetPasswordInput(appliance_id=appliance_id) + + # Construct URL + url = self.download_reset_password.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'iotSensorName': self._serialize.url("iot_sensor_name", iot_sensor_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/zip' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(body, 'ResetPasswordInput') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=True, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + download_reset_password.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}/downloadResetPassword'} + + def trigger_ti_package_update( + self, scope, iot_sensor_name, custom_headers=None, raw=False, **operation_config): + """Trigger threat intelligence package update. + + :param scope: Scope of the query (IoT Hub, + /providers/Microsoft.Devices/iotHubs/myHub) + :type scope: str + :param iot_sensor_name: Name of the IoT sensor + :type iot_sensor_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.trigger_ti_package_update.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'iotSensorName': self._serialize.url("iot_sensor_name", iot_sensor_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + trigger_ti_package_update.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}/triggerTiPackageUpdate'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sites_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sites_operations.py new file mode 100644 index 0000000000000..3f275513d9485 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sites_operations.py @@ -0,0 +1,276 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class IotSitesOperations(object): + """IotSitesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2020-08-06-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-08-06-preview" + + self.config = config + + def list( + self, scope, custom_headers=None, raw=False, **operation_config): + """List IoT sites. + + :param scope: Scope of the query (IoT Hub, + /providers/Microsoft.Devices/iotHubs/myHub) + :type scope: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: IotSitesList or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IotSitesList or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IotSitesList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSites'} + + def get( + self, scope, custom_headers=None, raw=False, **operation_config): + """Get IoT site. + + :param scope: Scope of the query (IoT Hub, + /providers/Microsoft.Devices/iotHubs/myHub) + :type scope: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: IotSitesModel or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IotSitesModel or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IotSitesModel', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSites/default'} + + def create_or_update( + self, scope, display_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Create or update IoT site. + + :param scope: Scope of the query (IoT Hub, + /providers/Microsoft.Devices/iotHubs/myHub) + :type scope: str + :param display_name: Display name of the IoT site + :type display_name: str + :param tags: Tags of the IoT site + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: IotSitesModel or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IotSitesModel or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + iot_sites_model = models.IotSitesModel(display_name=display_name, tags=tags) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(iot_sites_model, 'IotSitesModel') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IotSitesModel', response) + if response.status_code == 201: + deserialized = self._deserialize('IotSitesModel', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSites/default'} + + def delete( + self, scope, custom_headers=None, raw=False, **operation_config): + """Delete IoT site. + + :param scope: Scope of the query (IoT Hub, + /providers/Microsoft.Devices/iotHubs/myHub) + :type scope: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSites/default'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_on_premise_iot_sensors_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_on_premise_iot_sensors_operations.py index bd5c73f7dcd8d..234ea698cd85c 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_on_premise_iot_sensors_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_on_premise_iot_sensors_operations.py @@ -321,3 +321,71 @@ def download_activation( return deserialized download_activation.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}/downloadActivation'} + + def download_reset_password( + self, on_premise_iot_sensor_name, appliance_id=None, custom_headers=None, raw=False, callback=None, **operation_config): + """Download file for reset password of the sensor. + + :param on_premise_iot_sensor_name: Name of the on-premise IoT sensor + :type on_premise_iot_sensor_name: str + :param appliance_id: The appliance id of the sensor. + :type appliance_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param callback: When specified, will be called with each chunk of + data that is streamed. The callback should take two arguments, the + bytes of the current chunk of data and the response object. If the + data is uploading, response will be None. + :type callback: Callable[Bytes, response=None] + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + body = models.ResetPasswordInput(appliance_id=appliance_id) + + # Construct URL + url = self.download_reset_password.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'onPremiseIotSensorName': self._serialize.url("on_premise_iot_sensor_name", on_premise_iot_sensor_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/zip' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(body, 'ResetPasswordInput') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=True, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + download_reset_password.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}/downloadResetPassword'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_server_vulnerability_assessment_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_server_vulnerability_assessment_operations.py index b3e51771853c6..841109ee0ce6e 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_server_vulnerability_assessment_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_server_vulnerability_assessment_operations.py @@ -12,6 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -253,28 +255,9 @@ def create_or_update( return deserialized create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}'} - def delete( - self, resource_group_name, resource_namespace, resource_type, resource_name, custom_headers=None, raw=False, **operation_config): - """Removing server vulnerability assessment from a resource. - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param resource_namespace: The Namespace of the resource. - :type resource_namespace: str - :param resource_type: The type of the resource. - :type resource_type: str - :param resource_name: Name of the resource. - :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _delete_initial( + self, resource_group_name, resource_namespace, resource_type, resource_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.delete.metadata['url'] path_format_arguments = { @@ -304,7 +287,7 @@ def delete( request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 204]: + if response.status_code not in [200, 202, 204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -312,4 +295,51 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + + def delete( + self, resource_group_name, resource_namespace, resource_type, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Removing server vulnerability assessment from a resource. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param resource_namespace: The Namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_namespace=resource_namespace, + resource_type=resource_type, + resource_name=resource_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_settings_operations.py index 0fd17bfc35f64..68ca91260b725 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_settings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_settings_operations.py @@ -25,7 +25,7 @@ class SettingsOperations(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-01-01". + :ivar api_version: API version for the operation. Constant value: "2021-06-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-01-01" + self.api_version = "2021-06-01" self.config = config @@ -109,8 +109,8 @@ def get( self, setting_name, custom_headers=None, raw=False, **operation_config): """Settings of different configurations in security center. - :param setting_name: Name of setting: (MCAS/WDATP). Possible values - include: 'MCAS', 'WDATP' + :param setting_name: The name of the setting. Possible values include: + 'MCAS', 'WDATP', 'Sentinel' :type setting_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -168,8 +168,8 @@ def update( self, setting_name, setting, custom_headers=None, raw=False, **operation_config): """updating settings about different configurations in security center. - :param setting_name: Name of setting: (MCAS/WDATP). Possible values - include: 'MCAS', 'WDATP' + :param setting_name: The name of the setting. Possible values include: + 'MCAS', 'WDATP', 'Sentinel' :type setting_name: str :param setting: Setting object :type setting: ~azure.mgmt.security.models.Setting diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_software_inventories_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_software_inventories_operations.py new file mode 100644 index 0000000000000..94624a4c5cdd0 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_software_inventories_operations.py @@ -0,0 +1,257 @@ +# 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 SoftwareInventoriesOperations(object): + """SoftwareInventoriesOperations 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: "2021-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-05-01-preview" + + self.config = config + + def list_by_extended_resource( + self, resource_group_name, resource_namespace, resource_type, resource_name, custom_headers=None, raw=False, **operation_config): + """Gets the software inventory of the virtual machine. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param resource_namespace: The namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Software + :rtype: + ~azure.mgmt.security.models.SoftwarePaged[~azure.mgmt.security.models.Software] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_extended_resource.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\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_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.SoftwarePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_extended_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Gets the software inventory of all virtual machines in the + subscriptions. + + :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 Software + :rtype: + ~azure.mgmt.security.models.SoftwarePaged[~azure.mgmt.security.models.Software] + :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') + + 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.SoftwarePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/softwareInventories'} + + def get( + self, resource_group_name, resource_namespace, resource_type, resource_name, software_name, custom_headers=None, raw=False, **operation_config): + """Gets a single software data of the virtual machine. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param resource_namespace: The namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_name: str + :param software_name: Name of the installed software. + :type software_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: Software or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.Software 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\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'softwareName': self._serialize.url("software_name", software_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('Software', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName}'}