diff --git a/sdk/security/azure-mgmt-security/MANIFEST.in b/sdk/security/azure-mgmt-security/MANIFEST.in index a3cb07df8765..3a9b6517412b 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 000000000000..ed99090ca290 --- /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": "04096501f3aa82ea182b499286f9bcb0f8f830ee", + "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 de0ae7d443e3..dc07ab1757ba 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 @@ -60,12 +54,10 @@ from .operations import SqlVulnerabilityAssessmentScansOperations from .operations import SqlVulnerabilityAssessmentScanResultsOperations from .operations import SqlVulnerabilityAssessmentBaselineRulesOperations -from .operations import IotDefenderSettingsOperations -from .operations import IotSensorsOperations -from .operations import DevicesForSubscriptionOperations -from .operations import DevicesForHubOperations -from .operations import DeviceOperations -from .operations import OnPremiseIotSensorsOperations +from .operations import AlertsOperations +from .operations import SettingsOperations +from .operations import IngestionSettingsOperations +from .operations import SoftwareInventoriesOperations from . import models @@ -79,8 +71,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 +83,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 +125,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 @@ -169,18 +149,14 @@ class SecurityCenter(SDKClient): :vartype sql_vulnerability_assessment_scan_results: azure.mgmt.security.operations.SqlVulnerabilityAssessmentScanResultsOperations :ivar sql_vulnerability_assessment_baseline_rules: SqlVulnerabilityAssessmentBaselineRules operations :vartype sql_vulnerability_assessment_baseline_rules: azure.mgmt.security.operations.SqlVulnerabilityAssessmentBaselineRulesOperations - :ivar iot_defender_settings: IotDefenderSettings operations - :vartype iot_defender_settings: azure.mgmt.security.operations.IotDefenderSettingsOperations - :ivar iot_sensors: IotSensors operations - :vartype iot_sensors: azure.mgmt.security.operations.IotSensorsOperations - :ivar devices_for_subscription: DevicesForSubscription operations - :vartype devices_for_subscription: azure.mgmt.security.operations.DevicesForSubscriptionOperations - :ivar devices_for_hub: DevicesForHub operations - :vartype devices_for_hub: azure.mgmt.security.operations.DevicesForHubOperations - :ivar device: Device operations - :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 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 +183,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 +195,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 +237,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( @@ -297,15 +261,11 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.sql_vulnerability_assessment_baseline_rules = SqlVulnerabilityAssessmentBaselineRulesOperations( self._client, self.config, self._serialize, self._deserialize) - self.iot_defender_settings = IotDefenderSettingsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.iot_sensors = IotSensorsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.devices_for_subscription = DevicesForSubscriptionOperations( + self.alerts = AlertsOperations( self._client, self.config, self._serialize, self._deserialize) - self.devices_for_hub = DevicesForHubOperations( + self.settings = SettingsOperations( self._client, self.config, self._serialize, self._deserialize) - self.device = DeviceOperations( + self.ingestion_settings = IngestionSettingsOperations( self._client, self.config, self._serialize, self._deserialize) - self.on_premise_iot_sensors = OnPremiseIotSensorsOperations( + 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 f182e6ae46be..f6c83a36e0eb 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 @@ -71,18 +79,17 @@ from ._models_py3 import CVSS from ._models_py3 import DataExportSettings from ._models_py3 import DenylistCustomAlertRule - from ._models_py3 import Device from ._models_py3 import DeviceSecurityGroup 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 from ._models_py3 import ExternalSecuritySolutionProperties from ._models_py3 import FailedLocalLoginsNotInAllowedRange from ._models_py3 import FileUploadsNotInAllowedRange - from ._models_py3 import Firmware from ._models_py3 import GcpCredentialsDetailsProperties from ._models_py3 import HttpC2DMessagesNotInAllowedRange from ._models_py3 import HttpC2DRejectedMessagesNotInAllowedRange @@ -91,16 +98,9 @@ from ._models_py3 import InformationProtectionKeyword from ._models_py3 import InformationProtectionPolicy from ._models_py3 import InformationType - from ._models_py3 import IotAlert - 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 + from ._models_py3 import IngestionConnectionString + from ._models_py3 import IngestionSetting + from ._models_py3 import IngestionSettingToken from ._models_py3 import IoTSecurityAggregatedAlert from ._models_py3 import IoTSecurityAggregatedAlertPropertiesTopDevicesListItem from ._models_py3 import IoTSecurityAggregatedRecommendation @@ -111,10 +111,7 @@ 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 IoTSeverityMetrics - from ._models_py3 import IpAddress from ._models_py3 import JitNetworkAccessPolicy from ._models_py3 import JitNetworkAccessPolicyInitiatePort from ._models_py3 import JitNetworkAccessPolicyInitiateRequest @@ -129,32 +126,18 @@ from ._models_py3 import LocalUserNotAllowed from ._models_py3 import Location from ._models_py3 import LogAnalyticsIdentifier - from ._models_py3 import MacAddress from ._models_py3 import MqttC2DMessagesNotInAllowedRange from ._models_py3 import MqttC2DRejectedMessagesNotInAllowedRange from ._models_py3 import MqttD2CMessagesNotInAllowedRange - from ._models_py3 import NetworkInterface - from ._models_py3 import OnPremiseIotSensor - from ._models_py3 import OnPremiseIotSensorsList from ._models_py3 import OnPremiseResourceDetails from ._models_py3 import OnPremiseSqlResourceDetails from ._models_py3 import Operation from ._models_py3 import OperationDisplay - from ._models_py3 import PackageDownloadInfo - from ._models_py3 import PackageDownloads - from ._models_py3 import PackageDownloadsCentralManager - from ._models_py3 import PackageDownloadsCentralManagerFull - from ._models_py3 import PackageDownloadsCentralManagerFullOvf - 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 from ._models_py3 import ProcessNotAllowed from ._models_py3 import ProtectionMode - from ._models_py3 import Protocol1 from ._models_py3 import ProxyServerProperties from ._models_py3 import PublisherInfo from ._models_py3 import QueryCheck @@ -189,7 +172,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 @@ -198,17 +185,16 @@ from ._models_py3 import SecurityTask from ._models_py3 import SecurityTaskParameters from ._models_py3 import SensitivityLabel - from ._models_py3 import Sensor from ._models_py3 import ServerVulnerabilityAssessment from ._models_py3 import ServerVulnerabilityAssessmentsList 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 @@ -238,10 +224,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 +241,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 +273,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 @@ -289,18 +283,17 @@ from ._models import CVSS from ._models import DataExportSettings from ._models import DenylistCustomAlertRule - from ._models import Device from ._models import DeviceSecurityGroup 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 from ._models import ExternalSecuritySolutionProperties from ._models import FailedLocalLoginsNotInAllowedRange from ._models import FileUploadsNotInAllowedRange - from ._models import Firmware from ._models import GcpCredentialsDetailsProperties from ._models import HttpC2DMessagesNotInAllowedRange from ._models import HttpC2DRejectedMessagesNotInAllowedRange @@ -309,16 +302,9 @@ from ._models import InformationProtectionKeyword from ._models import InformationProtectionPolicy from ._models import InformationType - from ._models import IotAlert - 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 + from ._models import IngestionConnectionString + from ._models import IngestionSetting + from ._models import IngestionSettingToken from ._models import IoTSecurityAggregatedAlert from ._models import IoTSecurityAggregatedAlertPropertiesTopDevicesListItem from ._models import IoTSecurityAggregatedRecommendation @@ -329,10 +315,7 @@ from ._models import IoTSecuritySolutionAnalyticsModelList from ._models import IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem from ._models import IoTSecuritySolutionModel - from ._models import IotSensor - from ._models import IotSensorsList from ._models import IoTSeverityMetrics - from ._models import IpAddress from ._models import JitNetworkAccessPolicy from ._models import JitNetworkAccessPolicyInitiatePort from ._models import JitNetworkAccessPolicyInitiateRequest @@ -347,32 +330,18 @@ from ._models import LocalUserNotAllowed from ._models import Location from ._models import LogAnalyticsIdentifier - from ._models import MacAddress from ._models import MqttC2DMessagesNotInAllowedRange from ._models import MqttC2DRejectedMessagesNotInAllowedRange from ._models import MqttD2CMessagesNotInAllowedRange - from ._models import NetworkInterface - from ._models import OnPremiseIotSensor - from ._models import OnPremiseIotSensorsList from ._models import OnPremiseResourceDetails from ._models import OnPremiseSqlResourceDetails from ._models import Operation from ._models import OperationDisplay - from ._models import PackageDownloadInfo - from ._models import PackageDownloads - from ._models import PackageDownloadsCentralManager - from ._models import PackageDownloadsCentralManagerFull - from ._models import PackageDownloadsCentralManagerFullOvf - 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 from ._models import ProcessNotAllowed from ._models import ProtectionMode - from ._models import Protocol1 from ._models import ProxyServerProperties from ._models import PublisherInfo from ._models import QueryCheck @@ -407,7 +376,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 @@ -416,17 +389,16 @@ from ._models import SecurityTask from ._models import SecurityTaskParameters from ._models import SensitivityLabel - from ._models import Sensor from ._models import ServerVulnerabilityAssessment from ._models import ServerVulnerabilityAssessmentsList 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 @@ -455,15 +427,11 @@ from ._paged_models import CompliancePaged from ._paged_models import ComplianceResultPaged from ._paged_models import ConnectorSettingPaged -from ._paged_models import DevicePaged from ._paged_models import DeviceSecurityGroupPaged from ._paged_models import DiscoveredSecuritySolutionPaged from ._paged_models import ExternalSecuritySolutionPaged from ._paged_models import InformationProtectionPolicyPaged -from ._paged_models import IotAlertModelPaged -from ._paged_models import IotAlertPaged -from ._paged_models import IotRecommendationModelPaged -from ._paged_models import IotRecommendationPaged +from ._paged_models import IngestionSettingPaged from ._paged_models import IoTSecurityAggregatedAlertPaged from ._paged_models import IoTSecurityAggregatedRecommendationPaged from ._paged_models import IoTSecuritySolutionModelPaged @@ -475,13 +443,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 +463,10 @@ RecommendationType, RecommendationConfigStatus, UnmaskedIpLoggingStatus, + AdditionalWorkspaceType, + AdditionalWorkspaceDataType, + CreatedByType, ReportedSeverity, - AlertSeverity, - AlertIntent, - RecommendationSeverity, AutoProvision, Rank, AlertNotifications, @@ -509,7 +478,9 @@ PropertyType, Operator, RuleState, - Category, + Tactics, + Techniques, + Categories, UserImpact, ImplementationEffort, Threats, @@ -517,8 +488,6 @@ AssessmentStatusCode, Direction, TransportProtocol, - Intent, - AlertStatus, Protocol, Status, StatusReason, @@ -535,16 +504,11 @@ RuleStatus, RuleSeverity, RuleType, - VersionKind, - MacSignificance, - RelationToIpStatus, - ManagementState, - AuthorizationState, - DeviceCriticality, - PurdueLevel, - ProgrammingState, - ScanningFunctionality, - DeviceStatus, + AlertSeverity, + Intent, + AlertStatus, + BundleType, + EndOfSupportStatus, ExpandEnum, ConnectionType, ExpandControlsEnum, @@ -561,10 +525,15 @@ 'AdaptiveNetworkHardening', 'AdaptiveNetworkHardeningEnforceRequest', 'AdditionalData', + 'AdditionalWorkspacesProperties', 'AdvancedThreatProtectionSetting', 'Alert', 'AlertEntity', + 'AlertSimulatorBundlesRequestProperties', + 'AlertSimulatorRequestBody', + 'AlertSimulatorRequestProperties', 'AlertsSuppressionRule', + 'AlertSyncSettings', 'AllowedConnectionsResource', 'AllowlistCustomAlertRule', 'AmqpC2DMessagesNotInAllowedRange', @@ -573,6 +542,7 @@ 'AscLocation', 'AssessmentLinks', 'AssessmentStatus', + 'AssessmentStatusResponse', 'AtaExternalSecuritySolution', 'AtaSolutionProperties', 'AuthenticationDetailsProperties', @@ -604,6 +574,8 @@ 'ConnectableResource', 'ConnectedResource', 'ConnectedWorkspace', + 'ConnectionFromIpNotAllowed', + 'ConnectionStrings', 'ConnectionToIpNotAllowed', 'ConnectorSetting', 'ContainerRegistryVulnerabilityProperties', @@ -612,18 +584,17 @@ 'CVSS', 'DataExportSettings', 'DenylistCustomAlertRule', - 'Device', 'DeviceSecurityGroup', 'DirectMethodInvokesNotInAllowedRange', 'DiscoveredSecuritySolution', 'EffectiveNetworkSecurityGroups', + 'ErrorAdditionalInfo', 'ETag', 'ExternalSecuritySolution', 'ExternalSecuritySolutionKind1', 'ExternalSecuritySolutionProperties', 'FailedLocalLoginsNotInAllowedRange', 'FileUploadsNotInAllowedRange', - 'Firmware', 'GcpCredentialsDetailsProperties', 'HttpC2DMessagesNotInAllowedRange', 'HttpC2DRejectedMessagesNotInAllowedRange', @@ -632,16 +603,9 @@ 'InformationProtectionKeyword', 'InformationProtectionPolicy', 'InformationType', - 'IotAlert', - 'IotAlertModel', - 'IotAlertType', - 'IotAlertTypeList', - 'IotDefenderSettingsList', - 'IotDefenderSettingsModel', - 'IotRecommendation', - 'IotRecommendationModel', - 'IotRecommendationType', - 'IotRecommendationTypeList', + 'IngestionConnectionString', + 'IngestionSetting', + 'IngestionSettingToken', 'IoTSecurityAggregatedAlert', 'IoTSecurityAggregatedAlertPropertiesTopDevicesListItem', 'IoTSecurityAggregatedRecommendation', @@ -652,10 +616,7 @@ 'IoTSecuritySolutionAnalyticsModelList', 'IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem', 'IoTSecuritySolutionModel', - 'IotSensor', - 'IotSensorsList', 'IoTSeverityMetrics', - 'IpAddress', 'JitNetworkAccessPolicy', 'JitNetworkAccessPolicyInitiatePort', 'JitNetworkAccessPolicyInitiateRequest', @@ -670,32 +631,18 @@ 'LocalUserNotAllowed', 'Location', 'LogAnalyticsIdentifier', - 'MacAddress', 'MqttC2DMessagesNotInAllowedRange', 'MqttC2DRejectedMessagesNotInAllowedRange', 'MqttD2CMessagesNotInAllowedRange', - 'NetworkInterface', - 'OnPremiseIotSensor', - 'OnPremiseIotSensorsList', 'OnPremiseResourceDetails', 'OnPremiseSqlResourceDetails', 'Operation', 'OperationDisplay', - 'PackageDownloadInfo', - 'PackageDownloads', - 'PackageDownloadsCentralManager', - 'PackageDownloadsCentralManagerFull', - 'PackageDownloadsCentralManagerFullOvf', - 'PackageDownloadsSensor', - 'PackageDownloadsSensorFull', - 'PackageDownloadsSensorFullOvf', - 'PackageDownloadsThreatIntelligence', 'PathRecommendation', 'Pricing', 'PricingList', 'ProcessNotAllowed', 'ProtectionMode', - 'Protocol1', 'ProxyServerProperties', 'PublisherInfo', 'QueryCheck', @@ -730,7 +677,11 @@ 'SecurityAssessmentMetadata', 'SecurityAssessmentMetadataPartnerData', 'SecurityAssessmentMetadataProperties', + 'SecurityAssessmentMetadataPropertiesResponsePublishDates', + 'SecurityAssessmentMetadataResponse', 'SecurityAssessmentPartnerData', + 'SecurityAssessmentPropertiesBase', + 'SecurityAssessmentResponse', 'SecurityContact', 'SecuritySolution', 'SecuritySolutionsReferenceData', @@ -739,17 +690,16 @@ 'SecurityTask', 'SecurityTaskParameters', 'SensitivityLabel', - 'Sensor', 'ServerVulnerabilityAssessment', 'ServerVulnerabilityAssessmentsList', 'ServerVulnerabilityProperties', 'ServicePrincipalProperties', 'Setting', - 'SettingResource', - 'Site', + 'Software', 'SqlServerVulnerabilityProperties', 'SubAssessmentStatus', 'SuppressionAlertsScope', + 'SystemData', 'Tags', 'TagsResource', 'ThresholdCustomAlertRule', @@ -769,15 +719,10 @@ 'VmRecommendation', 'WorkspaceSetting', 'ComplianceResultPaged', - 'SettingPaged', 'DeviceSecurityGroupPaged', 'IoTSecuritySolutionModelPaged', 'IoTSecurityAggregatedAlertPaged', 'IoTSecurityAggregatedRecommendationPaged', - 'IotAlertPaged', - 'IotAlertModelPaged', - 'IotRecommendationPaged', - 'IotRecommendationModelPaged', 'AscLocationPaged', 'OperationPaged', 'SecurityTaskPaged', @@ -792,12 +737,11 @@ 'SecuritySubAssessmentPaged', 'AutomationPaged', 'AlertsSuppressionRulePaged', - 'SecurityAssessmentMetadataPaged', - 'SecurityAssessmentPaged', + 'SecurityAssessmentMetadataResponsePaged', + 'SecurityAssessmentResponsePaged', 'AdaptiveNetworkHardeningPaged', 'AllowedConnectionsResourcePaged', 'TopologyResourcePaged', - 'AlertPaged', 'JitNetworkAccessPolicyPaged', 'DiscoveredSecuritySolutionPaged', 'ExternalSecuritySolutionPaged', @@ -806,7 +750,10 @@ 'SecureScoreControlDefinitionItemPaged', 'SecuritySolutionPaged', 'ConnectorSettingPaged', - 'DevicePaged', + 'AlertPaged', + 'SettingPaged', + 'IngestionSettingPaged', + 'SoftwarePaged', 'ResourceStatus', 'PricingTier', 'ValueType', @@ -816,10 +763,10 @@ 'RecommendationType', 'RecommendationConfigStatus', 'UnmaskedIpLoggingStatus', + 'AdditionalWorkspaceType', + 'AdditionalWorkspaceDataType', + 'CreatedByType', 'ReportedSeverity', - 'AlertSeverity', - 'AlertIntent', - 'RecommendationSeverity', 'AutoProvision', 'Rank', 'AlertNotifications', @@ -831,7 +778,9 @@ 'PropertyType', 'Operator', 'RuleState', - 'Category', + 'Tactics', + 'Techniques', + 'Categories', 'UserImpact', 'ImplementationEffort', 'Threats', @@ -839,8 +788,6 @@ 'AssessmentStatusCode', 'Direction', 'TransportProtocol', - 'Intent', - 'AlertStatus', 'Protocol', 'Status', 'StatusReason', @@ -857,16 +804,11 @@ 'RuleStatus', 'RuleSeverity', 'RuleType', - 'VersionKind', - 'MacSignificance', - 'RelationToIpStatus', - 'ManagementState', - 'AuthorizationState', - 'DeviceCriticality', - 'PurdueLevel', - 'ProgrammingState', - 'ScanningFunctionality', - 'DeviceStatus', + 'AlertSeverity', + '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 941c6b8b9bde..d9a13f758312 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 """ @@ -2969,165 +3250,6 @@ def __init__(self, **kwargs): self.rule_type = 'DenylistCustomAlertRule' -class Device(Resource): - """Device model. - - 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 display_name: Device display name given by the collector - :type display_name: str - :param device_type: Device type. - :type device_type: str - :ivar source_name: The source that created the device - :vartype source_name: str - :ivar network_interfaces: List of network interfaces. - :vartype network_interfaces: - list[~azure.mgmt.security.models.NetworkInterface] - :ivar vendor: Device vendor - :vartype vendor: str - :param os_name: Device operating system name. - :type os_name: str - :ivar protocols: List of protocols. - :vartype protocols: list[~azure.mgmt.security.models.Protocol1] - :ivar last_active_time: last time the device was active in the network - :vartype last_active_time: datetime - :ivar last_update_time: last time the device was updated - :vartype last_update_time: datetime - :ivar management_state: Managed state of the device. Possible values - include: 'Managed', 'Unmanaged' - :vartype management_state: str or - ~azure.mgmt.security.models.ManagementState - :param authorization_state: Authorized state of the device. Possible - values include: 'Authorized', 'Unauthorized'. Default value: - "Unauthorized" . - :type authorization_state: str or - ~azure.mgmt.security.models.AuthorizationState - :param device_criticality: Device criticality. Possible values include: - 'Important', 'Standard'. Default value: "Standard" . - :type device_criticality: str or - ~azure.mgmt.security.models.DeviceCriticality - :param purdue_level: Purdue level of the device. Possible values include: - 'ProcessControl', 'Supervisory', 'Enterprise'. Default value: - "ProcessControl" . - :type purdue_level: str or ~azure.mgmt.security.models.PurdueLevel - :param notes: user notes for the device, up to 300 characters. - :type notes: str - :ivar firmwares: List of device firmwares. - :vartype firmwares: list[~azure.mgmt.security.models.Firmware] - :ivar discovery_time: Discovered time of the device. - :vartype discovery_time: datetime - :ivar programming_state: Indicates whether this device is programming. - Possible values include: 'ProgrammingDevice', 'NotProgrammingDevice' - :vartype programming_state: str or - ~azure.mgmt.security.models.ProgrammingState - :ivar last_programming_time: last time the device was programming or - programed. - :vartype last_programming_time: datetime - :ivar scanning_functionality: Indicates whether the device is a scanner. - Possible values include: 'ScannerDevice', 'NotScannerDevice' - :vartype scanning_functionality: str or - ~azure.mgmt.security.models.ScanningFunctionality - :ivar last_scan_time: last time the device was scanning. - :vartype last_scan_time: datetime - :ivar risk_score: risk score of the device. - :vartype risk_score: int - :ivar sensors: List of sensors that scanned this device. - :vartype sensors: list[~azure.mgmt.security.models.Sensor] - :ivar site: - :vartype site: ~azure.mgmt.security.models.Site - :ivar device_status: Device status. Possible values include: 'Active', - 'Removed' - :vartype device_status: str or ~azure.mgmt.security.models.DeviceStatus - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'source_name': {'readonly': True}, - 'network_interfaces': {'readonly': True}, - 'vendor': {'readonly': True}, - 'protocols': {'readonly': True}, - 'last_active_time': {'readonly': True}, - 'last_update_time': {'readonly': True}, - 'management_state': {'readonly': True}, - 'firmwares': {'readonly': True}, - 'discovery_time': {'readonly': True}, - 'programming_state': {'readonly': True}, - 'last_programming_time': {'readonly': True}, - 'scanning_functionality': {'readonly': True}, - 'last_scan_time': {'readonly': True}, - 'risk_score': {'readonly': True, 'maximum': 100, 'minimum': 0}, - 'sensors': {'readonly': True}, - 'site': {'readonly': True}, - 'device_status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'device_type': {'key': 'properties.deviceType', 'type': 'str'}, - 'source_name': {'key': 'properties.sourceName', 'type': 'str'}, - 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, - 'vendor': {'key': 'properties.vendor', 'type': 'str'}, - 'os_name': {'key': 'properties.osName', 'type': 'str'}, - 'protocols': {'key': 'properties.protocols', 'type': '[Protocol1]'}, - 'last_active_time': {'key': 'properties.lastActiveTime', 'type': 'iso-8601'}, - 'last_update_time': {'key': 'properties.lastUpdateTime', 'type': 'iso-8601'}, - 'management_state': {'key': 'properties.managementState', 'type': 'str'}, - 'authorization_state': {'key': 'properties.authorizationState', 'type': 'str'}, - 'device_criticality': {'key': 'properties.deviceCriticality', 'type': 'str'}, - 'purdue_level': {'key': 'properties.purdueLevel', 'type': 'str'}, - 'notes': {'key': 'properties.notes', 'type': 'str'}, - 'firmwares': {'key': 'properties.firmwares', 'type': '[Firmware]'}, - 'discovery_time': {'key': 'properties.discoveryTime', 'type': 'iso-8601'}, - 'programming_state': {'key': 'properties.programmingState', 'type': 'str'}, - 'last_programming_time': {'key': 'properties.lastProgrammingTime', 'type': 'iso-8601'}, - 'scanning_functionality': {'key': 'properties.scanningFunctionality', 'type': 'str'}, - 'last_scan_time': {'key': 'properties.lastScanTime', 'type': 'iso-8601'}, - 'risk_score': {'key': 'properties.riskScore', 'type': 'int'}, - 'sensors': {'key': 'properties.sensors', 'type': '[Sensor]'}, - 'site': {'key': 'properties.site', 'type': 'Site'}, - 'device_status': {'key': 'properties.deviceStatus', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Device, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.device_type = kwargs.get('device_type', None) - self.source_name = None - self.network_interfaces = None - self.vendor = None - self.os_name = kwargs.get('os_name', None) - self.protocols = None - self.last_active_time = None - self.last_update_time = None - self.management_state = None - self.authorization_state = kwargs.get('authorization_state', "Unauthorized") - self.device_criticality = kwargs.get('device_criticality', "Standard") - self.purdue_level = kwargs.get('purdue_level', "ProcessControl") - self.notes = kwargs.get('notes', None) - self.firmwares = None - self.discovery_time = None - self.programming_state = None - self.last_programming_time = None - self.scanning_functionality = None - self.last_scan_time = None - self.risk_score = None - self.sensors = None - self.site = None - self.device_status = None - - class DeviceSecurityGroup(Resource): """The device security group resource. @@ -3309,6 +3431,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. @@ -3443,61 +3593,6 @@ def __init__(self, **kwargs): self.rule_type = 'FileUploadsNotInAllowedRange' -class Firmware(Model): - """Firmware information. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar module_address: Address of the specific module a firmware is related - to - :vartype module_address: str - :ivar rack: Rack number of the module a firmware is related to. - :vartype rack: str - :ivar slot: Slot number in the rack of the module a firmware is related to - :vartype slot: str - :ivar serial: Serial of the firmware - :vartype serial: str - :ivar model: Firmware model - :vartype model: str - :ivar version: Firmware version - :vartype version: str - :ivar additional_data: A bag of fields which extends the firmware - information. - :vartype additional_data: object - """ - - _validation = { - 'module_address': {'readonly': True}, - 'rack': {'readonly': True}, - 'slot': {'readonly': True}, - 'serial': {'readonly': True}, - 'model': {'readonly': True}, - 'version': {'readonly': True}, - 'additional_data': {'readonly': True}, - } - - _attribute_map = { - 'module_address': {'key': 'moduleAddress', 'type': 'str'}, - 'rack': {'key': 'rack', 'type': 'str'}, - 'slot': {'key': 'slot', 'type': 'str'}, - 'serial': {'key': 'serial', 'type': 'str'}, - 'model': {'key': 'model', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'additional_data': {'key': 'additionalData', 'type': 'object'}, - } - - def __init__(self, **kwargs): - super(Firmware, self).__init__(**kwargs) - self.module_address = None - self.rack = None - self.slot = None - self.serial = None - self.model = None - self.version = None - self.additional_data = None - - class GcpCredentialsDetailsProperties(AuthenticationDetailsProperties): """GCP cloud account connector based service to service credentials, the credentials are composed of the organization ID and a JSON API key (write @@ -3922,287 +4017,37 @@ 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 - """ - - _validation = { - 'system_alert_id': {'readonly': True}, - 'compromised_entity': {'readonly': True}, - 'alert_type': {'readonly': True}, - 'start_time_utc': {'readonly': True}, - 'end_time_utc': {'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'}, - } - - 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) - - -class IotAlertModel(Model): - """IoT alert. - - 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 - """ - - _validation = { - 'system_alert_id': {'readonly': True}, - 'compromised_entity': {'readonly': True}, - 'alert_type': {'readonly': True}, - 'start_time_utc': {'readonly': True}, - 'end_time_utc': {'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'}, - } - - def __init__(self, **kwargs): - super(IotAlertModel, 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) - - -class IotAlertType(Resource): - """IoT alert type. - - 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 alert_display_name: The display name of the alert - :vartype alert_display_name: str - :ivar severity: The severity of the alert. Possible values include: - 'Informational', 'Low', 'Medium', 'High' - :vartype severity: str or ~azure.mgmt.security.models.AlertSeverity - :ivar description: Description of the suspected vulnerability and meaning. - :vartype description: str - :ivar provider_name: The name of the alert provider or internal partner - :vartype provider_name: str - :ivar product_name: The name of the product which published this alert - :vartype product_name: str - :ivar product_component_name: The name of a component inside the product - which generated the alert - :vartype product_component_name: str - :ivar vendor_name: The name of the vendor that raise the alert - :vartype vendor_name: str - :ivar intent: Kill chain related intent behind the alert. Could contain - multiple enum values (separated by commas). Possible values include: - 'Unknown', 'PreAttack', 'InitialAccess', 'Persistence', - 'PrivilegeEscalation', 'DefenseEvasion', 'CredentialAccess', 'Discovery', - 'LateralMovement', 'Execution', 'Collection', 'Exfiltration', - 'CommandAndControl', 'Impact', 'Probing', 'Exploitation' - :vartype intent: str or ~azure.mgmt.security.models.AlertIntent - :ivar remediation_steps: Manual action items to take to remediate the - alert - :vartype remediation_steps: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'alert_display_name': {'readonly': True}, - 'severity': {'readonly': True}, - 'description': {'readonly': True}, - 'provider_name': {'readonly': True}, - 'product_name': {'readonly': True}, - 'product_component_name': {'readonly': True}, - 'vendor_name': {'readonly': True}, - 'intent': {'readonly': True}, - 'remediation_steps': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'alert_display_name': {'key': 'properties.alertDisplayName', 'type': 'str'}, - 'severity': {'key': 'properties.severity', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'provider_name': {'key': 'properties.providerName', 'type': 'str'}, - 'product_name': {'key': 'properties.productName', 'type': 'str'}, - 'product_component_name': {'key': 'properties.productComponentName', 'type': 'str'}, - 'vendor_name': {'key': 'properties.vendorName', 'type': 'str'}, - 'intent': {'key': 'properties.intent', 'type': 'str'}, - 'remediation_steps': {'key': 'properties.remediationSteps', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(IotAlertType, self).__init__(**kwargs) - self.alert_display_name = None - self.severity = None - self.description = None - self.provider_name = None - self.product_name = None - self.product_component_name = None - self.vendor_name = None - self.intent = None - self.remediation_steps = None - - -class IotAlertTypeList(Model): - """List of alert types. - - :param value: List data - :type value: list[~azure.mgmt.security.models.IotAlertType] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[IotAlertType]'}, - } - - def __init__(self, **kwargs): - super(IotAlertTypeList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class IotDefenderSettingsList(Model): - """List of IoT Defender settings. - - 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.IotDefenderSettingsModel] + :ivar location: The region where ingested logs and data resides + :vartype location: str + :ivar value: Connection string value + :vartype value: str """ _validation = { + 'location': {'readonly': True}, 'value': {'readonly': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[IotDefenderSettingsModel]'}, + 'location': {'key': 'location', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, } def __init__(self, **kwargs): - super(IotDefenderSettingsList, self).__init__(**kwargs) + super(IngestionConnectionString, self).__init__(**kwargs) + self.location = None self.value = None -class IotDefenderSettingsModel(Resource): - """IoT Defender settings. - - 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 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. +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. @@ -4213,189 +4058,51 @@ class IotRecommendation(Resource): :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 + :param properties: Ingestion setting data + :type properties: object """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'device_id': {'readonly': True}, - 'recommendation_type': {'readonly': True}, - 'discovered_time_utc': {'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'}, + 'properties': {'key': 'properties', 'type': 'object'}, } 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(IngestionSetting, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) -class IotRecommendationModel(Resource): - """IoT recommendation. +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 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 token: The token is used for correlating security data and logs with + the resources in the subscription. + :vartype token: str """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'device_id': {'readonly': True}, - 'recommendation_type': {'readonly': True}, - 'discovered_time_utc': {'readonly': True}, + 'token': {'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'}, + 'token': {'key': 'token', 'type': 'str'}, } def __init__(self, **kwargs): - super(IotRecommendationModel, 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) - - -class IotRecommendationType(Resource): - """IoT recommendation type. - - 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 recommendation_display_name: The display name of the recommendation - :vartype recommendation_display_name: str - :ivar severity: The severity of the recommendation. Possible values - include: 'Unknown', 'NotApplicable', 'Healthy', 'OffByPolicy', 'Low', - 'Medium', 'High' - :vartype severity: str or - ~azure.mgmt.security.models.RecommendationSeverity - :ivar description: Description of the suspected vulnerability and meaning. - :vartype description: str - :ivar product_name: The name of the product which published this - recommendation - :vartype product_name: str - :ivar product_component_name: The name of a component inside the product - which generated the recommendation - :vartype product_component_name: str - :ivar vendor_name: The name of the vendor that raised the recommendation - :vartype vendor_name: str - :ivar control: The name of the recommendation's control category - :vartype control: str - :ivar remediation_steps: Manual action items to take to resolve the - recommendation - :vartype remediation_steps: list[str] - :ivar data_source: The alert's data source - :vartype data_source: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'recommendation_display_name': {'readonly': True}, - 'severity': {'readonly': True}, - 'description': {'readonly': True}, - 'product_name': {'readonly': True}, - 'product_component_name': {'readonly': True}, - 'vendor_name': {'readonly': True}, - 'control': {'readonly': True}, - 'remediation_steps': {'readonly': True}, - 'data_source': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'recommendation_display_name': {'key': 'properties.recommendationDisplayName', 'type': 'str'}, - 'severity': {'key': 'properties.severity', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'product_name': {'key': 'properties.productName', 'type': 'str'}, - 'product_component_name': {'key': 'properties.productComponentName', 'type': 'str'}, - 'vendor_name': {'key': 'properties.vendorName', 'type': 'str'}, - 'control': {'key': 'properties.control', 'type': 'str'}, - 'remediation_steps': {'key': 'properties.remediationSteps', 'type': '[str]'}, - 'data_source': {'key': 'properties.dataSource', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(IotRecommendationType, self).__init__(**kwargs) - self.recommendation_display_name = None - self.severity = None - self.description = None - self.product_name = None - self.product_component_name = None - self.vendor_name = None - self.control = None - self.remediation_steps = None - self.data_source = None - - -class IotRecommendationTypeList(Model): - """List of recommendation types. - - :param value: List data - :type value: list[~azure.mgmt.security.models.IotRecommendationType] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[IotRecommendationType]'}, - } - - def __init__(self, **kwargs): - super(IotRecommendationTypeList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super(IngestionSettingToken, self).__init__(**kwargs) + self.token = None class IoTSecurityAggregatedAlert(Model): @@ -4430,7 +4137,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 +4185,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 +4223,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 +4237,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 +4281,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 +4317,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 +4350,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 +4360,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 +4383,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 +4395,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 +4419,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 +4431,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 +4457,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 +4488,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 +4606,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 +4621,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 +4640,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): @@ -4936,89 +4652,34 @@ def __init__(self, **kwargs): self.tags = kwargs.get('tags', None) self.location = kwargs.get('location', None) self.workspace = kwargs.get('workspace', None) - self.display_name = kwargs.get('display_name', None) - self.status = kwargs.get('status', "Enabled") - self.export = kwargs.get('export', None) - self.disabled_data_sources = kwargs.get('disabled_data_sources', None) - self.iot_hubs = kwargs.get('iot_hubs', None) - self.user_defined_resources = kwargs.get('user_defined_resources', None) - self.auto_discovered_resources = None - self.recommendations_configuration = kwargs.get('recommendations_configuration', None) - self.unmasked_ip_logging_status = kwargs.get('unmasked_ip_logging_status', "Disabled") - - -class IotSensor(Resource): - """IoT sensor. - - 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: IoT sensor properties - :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(IotSensor, self).__init__(**kwargs) - self.properties = kwargs.get('properties', 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.IotSensor] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[IotSensor]'}, - } - - def __init__(self, **kwargs): - super(IotSensorsList, self).__init__(**kwargs) - self.value = None + self.display_name = kwargs.get('display_name', None) + self.status = kwargs.get('status', "Enabled") + self.export = kwargs.get('export', None) + self.disabled_data_sources = kwargs.get('disabled_data_sources', None) + self.iot_hubs = kwargs.get('iot_hubs', None) + self.user_defined_resources = kwargs.get('user_defined_resources', None) + self.auto_discovered_resources = None + self.recommendations_configuration = kwargs.get('recommendations_configuration', None) + self.unmasked_ip_logging_status = kwargs.get('unmasked_ip_logging_status', "Disabled") + self.additional_workspaces = kwargs.get('additional_workspaces', None) + self.system_data = None class IoTSeverityMetrics(Model): """IoT Security solution analytics severity metrics. :param high: Count of high severity alerts/recommendations. - :type high: int + :type high: long :param medium: Count of medium severity alerts/recommendations. - :type medium: int + :type medium: long :param low: Count of low severity alerts/recommendations. - :type low: int + :type low: long """ _attribute_map = { - 'high': {'key': 'high', 'type': 'int'}, - 'medium': {'key': 'medium', 'type': 'int'}, - 'low': {'key': 'low', 'type': 'int'}, + 'high': {'key': 'high', 'type': 'long'}, + 'medium': {'key': 'medium', 'type': 'long'}, + 'low': {'key': 'low', 'type': 'long'}, } def __init__(self, **kwargs): @@ -5028,49 +4689,6 @@ def __init__(self, **kwargs): self.low = kwargs.get('low', None) -class IpAddress(Model): - """IP Address information. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar v4_address: IPV4 address - :vartype v4_address: str - :ivar detection_time: Detection time of the ip address. - :vartype detection_time: datetime - :ivar subnet_cidr: Subnet Classless Inter-Domain Routing - :vartype subnet_cidr: str - :ivar fqdn: Fully qualified domain name - :vartype fqdn: str - :ivar fqdn_last_lookup_time: FQDN last lookup time. - :vartype fqdn_last_lookup_time: datetime - """ - - _validation = { - 'v4_address': {'readonly': True}, - 'detection_time': {'readonly': True}, - 'subnet_cidr': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'fqdn_last_lookup_time': {'readonly': True}, - } - - _attribute_map = { - 'v4_address': {'key': 'v4Address', 'type': 'str'}, - 'detection_time': {'key': 'detectionTime', 'type': 'iso-8601'}, - 'subnet_cidr': {'key': 'subnetCidr', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'fqdn_last_lookup_time': {'key': 'fqdnLastLookupTime', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(IpAddress, self).__init__(**kwargs) - self.v4_address = None - self.detection_time = None - self.subnet_cidr = None - self.fqdn = None - self.fqdn_last_lookup_time = None - - class JitNetworkAccessPolicy(Model): """JitNetworkAccessPolicy. @@ -5558,48 +5176,6 @@ def __init__(self, **kwargs): self.type = 'LogAnalytics' -class MacAddress(Model): - """MAC Address information. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar address: MAC address - :vartype address: str - :ivar detection_time: Detection time of the mac address. - :vartype detection_time: datetime - :ivar significance: Indicates whether this is the primary secondary MAC - address of the device. Possible values include: 'Primary', 'Secondary' - :vartype significance: str or ~azure.mgmt.security.models.MacSignificance - :ivar relation_to_ip_status: Indicates whether the relation of the mac to - the ip address is certain or a guess. Possible values include: 'Guess', - 'Certain' - :vartype relation_to_ip_status: str or - ~azure.mgmt.security.models.RelationToIpStatus - """ - - _validation = { - 'address': {'readonly': True}, - 'detection_time': {'readonly': True}, - 'significance': {'readonly': True}, - 'relation_to_ip_status': {'readonly': True}, - } - - _attribute_map = { - 'address': {'key': 'address', 'type': 'str'}, - 'detection_time': {'key': 'detectionTime', 'type': 'iso-8601'}, - 'significance': {'key': 'significance', 'type': 'str'}, - 'relation_to_ip_status': {'key': 'relationToIpStatus', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MacAddress, self).__init__(**kwargs) - self.address = None - self.detection_time = None - self.significance = None - self.relation_to_ip_status = None - - class MqttC2DMessagesNotInAllowedRange(TimeWindowCustomAlertRule): """Number of cloud to device messages (MQTT protocol) is not in allowed range. @@ -5748,94 +5324,6 @@ def __init__(self, **kwargs): self.rule_type = 'MqttD2CMessagesNotInAllowedRange' -class NetworkInterface(Model): - """Network interface. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param ip_address: - :type ip_address: ~azure.mgmt.security.models.IpAddress - :param mac_address: - :type mac_address: ~azure.mgmt.security.models.MacAddress - :ivar vlans: List of device vlans. - :vartype vlans: list[str] - """ - - _validation = { - 'vlans': {'readonly': True}, - } - - _attribute_map = { - 'ip_address': {'key': 'ipAddress', 'type': 'IpAddress'}, - 'mac_address': {'key': 'macAddress', 'type': 'MacAddress'}, - 'vlans': {'key': 'vlans', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(NetworkInterface, self).__init__(**kwargs) - self.ip_address = kwargs.get('ip_address', None) - self.mac_address = kwargs.get('mac_address', None) - self.vlans = None - - -class OnPremiseIotSensor(Resource): - """On-premise IoT sensor. - - 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: On-premise IoT sensor properties - :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(OnPremiseIotSensor, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class OnPremiseIotSensorsList(Model): - """List of on-premise 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.OnPremiseIotSensor] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OnPremiseIotSensor]'}, - } - - def __init__(self, **kwargs): - super(OnPremiseIotSensorsList, self).__init__(**kwargs) - self.value = None - - class OnPremiseResourceDetails(ResourceDetails): """Details of the On Premise resource that was assessed. @@ -6008,280 +5496,6 @@ def __init__(self, **kwargs): self.description = None -class PackageDownloadInfo(Model): - """Information on a specific package 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 - """ - - _validation = { - 'version': {'readonly': True}, - 'version_kind': {'readonly': True}, - } - - _attribute_map = { - 'version': {'key': 'version', 'type': 'str'}, - 'link': {'key': 'link', 'type': 'str'}, - 'version_kind': {'key': 'versionKind', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PackageDownloadInfo, self).__init__(**kwargs) - self.version = None - self.link = kwargs.get('link', None) - self.version_kind = None - - -class PackageDownloads(Model): - """Information about package downloads. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar sensor: Contains all Sensor binary downloads - :vartype sensor: ~azure.mgmt.security.models.PackageDownloadsSensor - :ivar central_manager: All downloads for Central Manager - :vartype central_manager: - ~azure.mgmt.security.models.PackageDownloadsCentralManager - :ivar threat_intelligence: All downloads for threat intelligence - :vartype threat_intelligence: - ~azure.mgmt.security.models.PackageDownloadsThreatIntelligence - """ - - _validation = { - 'sensor': {'readonly': True}, - 'central_manager': {'readonly': True}, - 'threat_intelligence': {'readonly': True}, - } - - _attribute_map = { - 'sensor': {'key': 'sensor', 'type': 'PackageDownloadsSensor'}, - 'central_manager': {'key': 'centralManager', 'type': 'PackageDownloadsCentralManager'}, - 'threat_intelligence': {'key': 'threatIntelligence', 'type': 'PackageDownloadsThreatIntelligence'}, - } - - def __init__(self, **kwargs): - super(PackageDownloads, self).__init__(**kwargs) - self.sensor = None - self.central_manager = None - self.threat_intelligence = None - - -class PackageDownloadsCentralManager(Model): - """All downloads for Central Manager. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar full: Contains full package downloads - :vartype full: - ~azure.mgmt.security.models.PackageDownloadsCentralManagerFull - :ivar upgrade: Central Manager upgrade package downloads (on existing - installations) - :vartype upgrade: list[~azure.mgmt.security.models.PackageDownloadInfo] - """ - - _validation = { - 'full': {'readonly': True}, - 'upgrade': {'readonly': True}, - } - - _attribute_map = { - 'full': {'key': 'full', 'type': 'PackageDownloadsCentralManagerFull'}, - 'upgrade': {'key': 'upgrade', 'type': '[PackageDownloadInfo]'}, - } - - def __init__(self, **kwargs): - super(PackageDownloadsCentralManager, self).__init__(**kwargs) - self.full = None - self.upgrade = None - - -class PackageDownloadsCentralManagerFull(Model): - """Contains full package downloads. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar iso: Contains all ISO full versions of the Central Manager - :vartype iso: list[~azure.mgmt.security.models.PackageDownloadInfo] - :ivar ovf: Contains all OVF (virtual machine) full versions of the Central - Manager - :vartype ovf: - ~azure.mgmt.security.models.PackageDownloadsCentralManagerFullOvf - """ - - _validation = { - 'iso': {'readonly': True}, - 'ovf': {'readonly': True}, - } - - _attribute_map = { - 'iso': {'key': 'iso', 'type': '[PackageDownloadInfo]'}, - 'ovf': {'key': 'ovf', 'type': 'PackageDownloadsCentralManagerFullOvf'}, - } - - def __init__(self, **kwargs): - super(PackageDownloadsCentralManagerFull, self).__init__(**kwargs) - self.iso = None - self.ovf = None - - -class PackageDownloadsCentralManagerFullOvf(Model): - """Contains all OVF (virtual machine) full versions of the Central Manager. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar enterprise: The Enterprise package type - :vartype enterprise: list[~azure.mgmt.security.models.PackageDownloadInfo] - :ivar enterprise_high_availability: The EnterpriseHighAvailability package - type - :vartype enterprise_high_availability: - list[~azure.mgmt.security.models.PackageDownloadInfo] - :ivar medium: The Medium package type - :vartype medium: list[~azure.mgmt.security.models.PackageDownloadInfo] - :ivar medium_high_availability: The MediumHighAvailability package type - :vartype medium_high_availability: - list[~azure.mgmt.security.models.PackageDownloadInfo] - """ - - _validation = { - 'enterprise': {'readonly': True}, - 'enterprise_high_availability': {'readonly': True}, - 'medium': {'readonly': True}, - 'medium_high_availability': {'readonly': True}, - } - - _attribute_map = { - 'enterprise': {'key': 'enterprise', 'type': '[PackageDownloadInfo]'}, - 'enterprise_high_availability': {'key': 'enterpriseHighAvailability', 'type': '[PackageDownloadInfo]'}, - 'medium': {'key': 'medium', 'type': '[PackageDownloadInfo]'}, - 'medium_high_availability': {'key': 'mediumHighAvailability', 'type': '[PackageDownloadInfo]'}, - } - - def __init__(self, **kwargs): - super(PackageDownloadsCentralManagerFullOvf, self).__init__(**kwargs) - self.enterprise = None - self.enterprise_high_availability = None - self.medium = None - self.medium_high_availability = None - - -class PackageDownloadsSensor(Model): - """Contains all Sensor binary downloads. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar full: Contains full package downloads - :vartype full: ~azure.mgmt.security.models.PackageDownloadsSensorFull - :param upgrade: Sensor upgrade package downloads (on existing - installations) - :type upgrade: list[~azure.mgmt.security.models.PackageDownloadInfo] - """ - - _validation = { - 'full': {'readonly': True}, - } - - _attribute_map = { - 'full': {'key': 'full', 'type': 'PackageDownloadsSensorFull'}, - 'upgrade': {'key': 'upgrade', 'type': '[PackageDownloadInfo]'}, - } - - def __init__(self, **kwargs): - super(PackageDownloadsSensor, self).__init__(**kwargs) - self.full = None - self.upgrade = kwargs.get('upgrade', None) - - -class PackageDownloadsSensorFull(Model): - """Contains full package downloads. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar iso: Contains all ISO full versions for the sensor - :vartype iso: list[~azure.mgmt.security.models.PackageDownloadInfo] - :param ovf: Contains all OVF (virtual machine) full versions for the - sensor - :type ovf: ~azure.mgmt.security.models.PackageDownloadsSensorFullOvf - """ - - _validation = { - 'iso': {'readonly': True}, - } - - _attribute_map = { - 'iso': {'key': 'iso', 'type': '[PackageDownloadInfo]'}, - 'ovf': {'key': 'ovf', 'type': 'PackageDownloadsSensorFullOvf'}, - } - - def __init__(self, **kwargs): - super(PackageDownloadsSensorFull, self).__init__(**kwargs) - self.iso = None - self.ovf = kwargs.get('ovf', None) - - -class PackageDownloadsSensorFullOvf(Model): - """Contains all OVF (virtual machine) full versions for the sensor. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar enterprise: Enterprise package type - :vartype enterprise: list[~azure.mgmt.security.models.PackageDownloadInfo] - :ivar medium: Medium package type - :vartype medium: list[~azure.mgmt.security.models.PackageDownloadInfo] - :ivar line: Line package type - :vartype line: list[~azure.mgmt.security.models.PackageDownloadInfo] - """ - - _validation = { - 'enterprise': {'readonly': True}, - 'medium': {'readonly': True}, - 'line': {'readonly': True}, - } - - _attribute_map = { - 'enterprise': {'key': 'enterprise', 'type': '[PackageDownloadInfo]'}, - 'medium': {'key': 'medium', 'type': '[PackageDownloadInfo]'}, - 'line': {'key': 'line', 'type': '[PackageDownloadInfo]'}, - } - - def __init__(self, **kwargs): - super(PackageDownloadsSensorFullOvf, self).__init__(**kwargs) - self.enterprise = None - self.medium = 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, **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. @@ -6481,34 +5695,7 @@ def __init__(self, **kwargs): self.exe = kwargs.get('exe', None) self.msi = kwargs.get('msi', None) self.script = kwargs.get('script', None) - self.executable = kwargs.get('executable', None) - - -class Protocol1(Model): - """Protocol data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: Protocol name - :vartype name: str - :param identifiers: list of protocol identifiers. - :type identifiers: str - """ - - _validation = { - 'name': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'identifiers': {'key': 'identifiers', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Protocol1, self).__init__(**kwargs) - self.name = None - self.identifiers = kwargs.get('identifiers', None) + self.executable = kwargs.get('executable', None) class ProxyServerProperties(Model): @@ -7558,8 +6745,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 +6755,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 +6774,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 +6817,8 @@ class SecurityAssessmentMetadata(Resource): :param remediation_description: Human readable description of what you should do to mitigate this security issue :type remediation_description: str - :param category: - :type category: list[str or ~azure.mgmt.security.models.Category] + :param categories: + :type categories: list[str or ~azure.mgmt.security.models.Categories] :param severity: Required. The severity level of the assessment. Possible values include: 'Low', 'Medium', 'High' :type severity: str or ~azure.mgmt.security.models.Severity @@ -7675,7 +6862,7 @@ class SecurityAssessmentMetadata(Resource): 'policy_definition_id': {'key': 'properties.policyDefinitionId', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'remediation_description': {'key': 'properties.remediationDescription', 'type': 'str'}, - 'category': {'key': 'properties.category', 'type': '[str]'}, + 'categories': {'key': 'properties.categories', 'type': '[str]'}, 'severity': {'key': 'properties.severity', 'type': 'str'}, 'user_impact': {'key': 'properties.userImpact', 'type': 'str'}, 'implementation_effort': {'key': 'properties.implementationEffort', 'type': 'str'}, @@ -7691,7 +6878,7 @@ def __init__(self, **kwargs): self.policy_definition_id = None self.description = kwargs.get('description', None) self.remediation_description = kwargs.get('remediation_description', None) - self.category = kwargs.get('category', None) + self.categories = kwargs.get('categories', None) self.severity = kwargs.get('severity', None) self.user_impact = kwargs.get('user_impact', None) self.implementation_effort = kwargs.get('implementation_effort', None) @@ -7753,8 +6940,8 @@ class SecurityAssessmentMetadataProperties(Model): :param remediation_description: Human readable description of what you should do to mitigate this security issue :type remediation_description: str - :param category: - :type category: list[str or ~azure.mgmt.security.models.Category] + :param categories: + :type categories: list[str or ~azure.mgmt.security.models.Categories] :param severity: Required. The severity level of the assessment. Possible values include: 'Low', 'Medium', 'High' :type severity: str or ~azure.mgmt.security.models.Severity @@ -7792,7 +6979,7 @@ class SecurityAssessmentMetadataProperties(Model): 'policy_definition_id': {'key': 'policyDefinitionId', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'remediation_description': {'key': 'remediationDescription', 'type': 'str'}, - 'category': {'key': 'category', 'type': '[str]'}, + 'categories': {'key': 'categories', 'type': '[str]'}, 'severity': {'key': 'severity', 'type': 'str'}, 'user_impact': {'key': 'userImpact', 'type': 'str'}, 'implementation_effort': {'key': 'implementationEffort', 'type': 'str'}, @@ -7808,7 +6995,144 @@ def __init__(self, **kwargs): self.policy_definition_id = None self.description = kwargs.get('description', None) self.remediation_description = kwargs.get('remediation_description', None) - self.category = kwargs.get('category', None) + self.categories = kwargs.get('categories', None) + self.severity = kwargs.get('severity', None) + self.user_impact = kwargs.get('user_impact', None) + self.implementation_effort = kwargs.get('implementation_effort', None) + 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 SecurityAssessmentMetadataPropertiesResponsePublishDates(Model): + """SecurityAssessmentMetadataPropertiesResponsePublishDates. + + All required parameters must be populated in order to send to Azure. + + :param ga: + :type ga: str + :param public: Required. + :type public: str + """ + + _validation = { + 'ga': {'pattern': r'^([0-9]{2}/){2}[0-9]{4}$'}, + 'public': {'required': True, 'pattern': r'^([0-9]{2}/){2}[0-9]{4}$'}, + } + + _attribute_map = { + 'ga': {'key': 'GA', 'type': 'str'}, + 'public': {'key': 'public', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SecurityAssessmentMetadataPropertiesResponsePublishDates, self).__init__(**kwargs) + self.ga = kwargs.get('ga', None) + self.public = kwargs.get('public', None) + + +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 + :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 + :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 + :param publish_dates: + :type publish_dates: + ~azure.mgmt.security.models.SecurityAssessmentMetadataPropertiesResponsePublishDates + :param planned_deprecation_date: + :type planned_deprecation_date: str + :param tactics: + :type tactics: list[str or ~azure.mgmt.security.models.Tactics] + :param techniques: + :type techniques: list[str or ~azure.mgmt.security.models.Techniques] + """ + + _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 = { + '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'}, + 'tactics': {'key': 'properties.tactics', 'type': '[str]'}, + 'techniques': {'key': 'properties.techniques', 'type': '[str]'}, + } + + def __init__(self, **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.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 +7140,10 @@ 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) + self.tactics = kwargs.get('tactics', None) + self.techniques = kwargs.get('techniques', None) class SecurityAssessmentPartnerData(Model): @@ -7845,6 +7173,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. @@ -8253,34 +7694,6 @@ def __init__(self, **kwargs): self.enabled = kwargs.get('enabled', None) -class Sensor(Model): - """Sensor data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: Sensor name - :vartype name: str - :ivar zone: Zone Name. - :vartype zone: str - """ - - _validation = { - 'name': {'readonly': True}, - 'zone': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'zone': {'key': 'zone', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Sensor, self).__init__(**kwargs) - self.name = None - self.zone = None - - class ServerVulnerabilityAssessment(Resource): """Describes the server vulnerability assessment details on a resource. @@ -8418,27 +7831,76 @@ def __init__(self, **kwargs): self.secret = kwargs.get('secret', None) -class Site(Model): - """Site data. +class Software(Resource): + """Represents a software data. Variables are only populated by the server, and will be ignored when sending a request. - :ivar display_name: Site display name - :vartype display_name: str + :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 = { - 'display_name': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, } _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, + '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(Site, self).__init__(**kwargs) - self.display_name = None + 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): @@ -8541,6 +8003,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. 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 13585f8f3453..fbda633199a7 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 """ @@ -2969,165 +3250,6 @@ def __init__(self, *, is_enabled: bool, denylist_values, **kwargs) -> None: self.rule_type = 'DenylistCustomAlertRule' -class Device(Resource): - """Device model. - - 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 display_name: Device display name given by the collector - :type display_name: str - :param device_type: Device type. - :type device_type: str - :ivar source_name: The source that created the device - :vartype source_name: str - :ivar network_interfaces: List of network interfaces. - :vartype network_interfaces: - list[~azure.mgmt.security.models.NetworkInterface] - :ivar vendor: Device vendor - :vartype vendor: str - :param os_name: Device operating system name. - :type os_name: str - :ivar protocols: List of protocols. - :vartype protocols: list[~azure.mgmt.security.models.Protocol1] - :ivar last_active_time: last time the device was active in the network - :vartype last_active_time: datetime - :ivar last_update_time: last time the device was updated - :vartype last_update_time: datetime - :ivar management_state: Managed state of the device. Possible values - include: 'Managed', 'Unmanaged' - :vartype management_state: str or - ~azure.mgmt.security.models.ManagementState - :param authorization_state: Authorized state of the device. Possible - values include: 'Authorized', 'Unauthorized'. Default value: - "Unauthorized" . - :type authorization_state: str or - ~azure.mgmt.security.models.AuthorizationState - :param device_criticality: Device criticality. Possible values include: - 'Important', 'Standard'. Default value: "Standard" . - :type device_criticality: str or - ~azure.mgmt.security.models.DeviceCriticality - :param purdue_level: Purdue level of the device. Possible values include: - 'ProcessControl', 'Supervisory', 'Enterprise'. Default value: - "ProcessControl" . - :type purdue_level: str or ~azure.mgmt.security.models.PurdueLevel - :param notes: user notes for the device, up to 300 characters. - :type notes: str - :ivar firmwares: List of device firmwares. - :vartype firmwares: list[~azure.mgmt.security.models.Firmware] - :ivar discovery_time: Discovered time of the device. - :vartype discovery_time: datetime - :ivar programming_state: Indicates whether this device is programming. - Possible values include: 'ProgrammingDevice', 'NotProgrammingDevice' - :vartype programming_state: str or - ~azure.mgmt.security.models.ProgrammingState - :ivar last_programming_time: last time the device was programming or - programed. - :vartype last_programming_time: datetime - :ivar scanning_functionality: Indicates whether the device is a scanner. - Possible values include: 'ScannerDevice', 'NotScannerDevice' - :vartype scanning_functionality: str or - ~azure.mgmt.security.models.ScanningFunctionality - :ivar last_scan_time: last time the device was scanning. - :vartype last_scan_time: datetime - :ivar risk_score: risk score of the device. - :vartype risk_score: int - :ivar sensors: List of sensors that scanned this device. - :vartype sensors: list[~azure.mgmt.security.models.Sensor] - :ivar site: - :vartype site: ~azure.mgmt.security.models.Site - :ivar device_status: Device status. Possible values include: 'Active', - 'Removed' - :vartype device_status: str or ~azure.mgmt.security.models.DeviceStatus - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'source_name': {'readonly': True}, - 'network_interfaces': {'readonly': True}, - 'vendor': {'readonly': True}, - 'protocols': {'readonly': True}, - 'last_active_time': {'readonly': True}, - 'last_update_time': {'readonly': True}, - 'management_state': {'readonly': True}, - 'firmwares': {'readonly': True}, - 'discovery_time': {'readonly': True}, - 'programming_state': {'readonly': True}, - 'last_programming_time': {'readonly': True}, - 'scanning_functionality': {'readonly': True}, - 'last_scan_time': {'readonly': True}, - 'risk_score': {'readonly': True, 'maximum': 100, 'minimum': 0}, - 'sensors': {'readonly': True}, - 'site': {'readonly': True}, - 'device_status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'device_type': {'key': 'properties.deviceType', 'type': 'str'}, - 'source_name': {'key': 'properties.sourceName', 'type': 'str'}, - 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, - 'vendor': {'key': 'properties.vendor', 'type': 'str'}, - 'os_name': {'key': 'properties.osName', 'type': 'str'}, - 'protocols': {'key': 'properties.protocols', 'type': '[Protocol1]'}, - 'last_active_time': {'key': 'properties.lastActiveTime', 'type': 'iso-8601'}, - 'last_update_time': {'key': 'properties.lastUpdateTime', 'type': 'iso-8601'}, - 'management_state': {'key': 'properties.managementState', 'type': 'str'}, - 'authorization_state': {'key': 'properties.authorizationState', 'type': 'str'}, - 'device_criticality': {'key': 'properties.deviceCriticality', 'type': 'str'}, - 'purdue_level': {'key': 'properties.purdueLevel', 'type': 'str'}, - 'notes': {'key': 'properties.notes', 'type': 'str'}, - 'firmwares': {'key': 'properties.firmwares', 'type': '[Firmware]'}, - 'discovery_time': {'key': 'properties.discoveryTime', 'type': 'iso-8601'}, - 'programming_state': {'key': 'properties.programmingState', 'type': 'str'}, - 'last_programming_time': {'key': 'properties.lastProgrammingTime', 'type': 'iso-8601'}, - 'scanning_functionality': {'key': 'properties.scanningFunctionality', 'type': 'str'}, - 'last_scan_time': {'key': 'properties.lastScanTime', 'type': 'iso-8601'}, - 'risk_score': {'key': 'properties.riskScore', 'type': 'int'}, - 'sensors': {'key': 'properties.sensors', 'type': '[Sensor]'}, - 'site': {'key': 'properties.site', 'type': 'Site'}, - 'device_status': {'key': 'properties.deviceStatus', 'type': 'str'}, - } - - def __init__(self, *, display_name: str=None, device_type: str=None, os_name: str=None, authorization_state="Unauthorized", device_criticality="Standard", purdue_level="ProcessControl", notes: str=None, **kwargs) -> None: - super(Device, self).__init__(**kwargs) - self.display_name = display_name - self.device_type = device_type - self.source_name = None - self.network_interfaces = None - self.vendor = None - self.os_name = os_name - self.protocols = None - self.last_active_time = None - self.last_update_time = None - self.management_state = None - self.authorization_state = authorization_state - self.device_criticality = device_criticality - self.purdue_level = purdue_level - self.notes = notes - self.firmwares = None - self.discovery_time = None - self.programming_state = None - self.last_programming_time = None - self.scanning_functionality = None - self.last_scan_time = None - self.risk_score = None - self.sensors = None - self.site = None - self.device_status = None - - class DeviceSecurityGroup(Resource): """The device security group resource. @@ -3309,6 +3431,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. @@ -3443,61 +3593,6 @@ def __init__(self, *, is_enabled: bool, min_threshold: int, max_threshold: int, self.rule_type = 'FileUploadsNotInAllowedRange' -class Firmware(Model): - """Firmware information. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar module_address: Address of the specific module a firmware is related - to - :vartype module_address: str - :ivar rack: Rack number of the module a firmware is related to. - :vartype rack: str - :ivar slot: Slot number in the rack of the module a firmware is related to - :vartype slot: str - :ivar serial: Serial of the firmware - :vartype serial: str - :ivar model: Firmware model - :vartype model: str - :ivar version: Firmware version - :vartype version: str - :ivar additional_data: A bag of fields which extends the firmware - information. - :vartype additional_data: object - """ - - _validation = { - 'module_address': {'readonly': True}, - 'rack': {'readonly': True}, - 'slot': {'readonly': True}, - 'serial': {'readonly': True}, - 'model': {'readonly': True}, - 'version': {'readonly': True}, - 'additional_data': {'readonly': True}, - } - - _attribute_map = { - 'module_address': {'key': 'moduleAddress', 'type': 'str'}, - 'rack': {'key': 'rack', 'type': 'str'}, - 'slot': {'key': 'slot', 'type': 'str'}, - 'serial': {'key': 'serial', 'type': 'str'}, - 'model': {'key': 'model', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'additional_data': {'key': 'additionalData', 'type': 'object'}, - } - - def __init__(self, **kwargs) -> None: - super(Firmware, self).__init__(**kwargs) - self.module_address = None - self.rack = None - self.slot = None - self.serial = None - self.model = None - self.version = None - self.additional_data = None - - class GcpCredentialsDetailsProperties(AuthenticationDetailsProperties): """GCP cloud account connector based service to service credentials, the credentials are composed of the organization ID and a JSON API key (write @@ -3922,287 +4017,37 @@ 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 - """ - - _validation = { - 'system_alert_id': {'readonly': True}, - 'compromised_entity': {'readonly': True}, - 'alert_type': {'readonly': True}, - 'start_time_utc': {'readonly': True}, - 'end_time_utc': {'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'}, - } - - 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 - - -class IotAlertModel(Model): - """IoT alert. - - 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 - """ - - _validation = { - 'system_alert_id': {'readonly': True}, - 'compromised_entity': {'readonly': True}, - 'alert_type': {'readonly': True}, - 'start_time_utc': {'readonly': True}, - 'end_time_utc': {'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'}, - } - - def __init__(self, *, entities=None, extended_properties=None, **kwargs) -> None: - super(IotAlertModel, 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 - - -class IotAlertType(Resource): - """IoT alert type. - - 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 alert_display_name: The display name of the alert - :vartype alert_display_name: str - :ivar severity: The severity of the alert. Possible values include: - 'Informational', 'Low', 'Medium', 'High' - :vartype severity: str or ~azure.mgmt.security.models.AlertSeverity - :ivar description: Description of the suspected vulnerability and meaning. - :vartype description: str - :ivar provider_name: The name of the alert provider or internal partner - :vartype provider_name: str - :ivar product_name: The name of the product which published this alert - :vartype product_name: str - :ivar product_component_name: The name of a component inside the product - which generated the alert - :vartype product_component_name: str - :ivar vendor_name: The name of the vendor that raise the alert - :vartype vendor_name: str - :ivar intent: Kill chain related intent behind the alert. Could contain - multiple enum values (separated by commas). Possible values include: - 'Unknown', 'PreAttack', 'InitialAccess', 'Persistence', - 'PrivilegeEscalation', 'DefenseEvasion', 'CredentialAccess', 'Discovery', - 'LateralMovement', 'Execution', 'Collection', 'Exfiltration', - 'CommandAndControl', 'Impact', 'Probing', 'Exploitation' - :vartype intent: str or ~azure.mgmt.security.models.AlertIntent - :ivar remediation_steps: Manual action items to take to remediate the - alert - :vartype remediation_steps: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'alert_display_name': {'readonly': True}, - 'severity': {'readonly': True}, - 'description': {'readonly': True}, - 'provider_name': {'readonly': True}, - 'product_name': {'readonly': True}, - 'product_component_name': {'readonly': True}, - 'vendor_name': {'readonly': True}, - 'intent': {'readonly': True}, - 'remediation_steps': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'alert_display_name': {'key': 'properties.alertDisplayName', 'type': 'str'}, - 'severity': {'key': 'properties.severity', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'provider_name': {'key': 'properties.providerName', 'type': 'str'}, - 'product_name': {'key': 'properties.productName', 'type': 'str'}, - 'product_component_name': {'key': 'properties.productComponentName', 'type': 'str'}, - 'vendor_name': {'key': 'properties.vendorName', 'type': 'str'}, - 'intent': {'key': 'properties.intent', 'type': 'str'}, - 'remediation_steps': {'key': 'properties.remediationSteps', 'type': '[str]'}, - } - - def __init__(self, **kwargs) -> None: - super(IotAlertType, self).__init__(**kwargs) - self.alert_display_name = None - self.severity = None - self.description = None - self.provider_name = None - self.product_name = None - self.product_component_name = None - self.vendor_name = None - self.intent = None - self.remediation_steps = None - - -class IotAlertTypeList(Model): - """List of alert types. - - :param value: List data - :type value: list[~azure.mgmt.security.models.IotAlertType] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[IotAlertType]'}, - } - - def __init__(self, *, value=None, **kwargs) -> None: - super(IotAlertTypeList, self).__init__(**kwargs) - self.value = value - - -class IotDefenderSettingsList(Model): - """List of IoT Defender settings. - - 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.IotDefenderSettingsModel] + :ivar location: The region where ingested logs and data resides + :vartype location: str + :ivar value: Connection string value + :vartype value: str """ _validation = { + 'location': {'readonly': True}, 'value': {'readonly': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[IotDefenderSettingsModel]'}, + 'location': {'key': 'location', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, } def __init__(self, **kwargs) -> None: - super(IotDefenderSettingsList, self).__init__(**kwargs) + super(IngestionConnectionString, self).__init__(**kwargs) + self.location = None self.value = None -class IotDefenderSettingsModel(Resource): - """IoT Defender settings. - - 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 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. +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. @@ -4213,189 +4058,51 @@ class IotRecommendation(Resource): :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 - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'device_id': {'readonly': True}, - 'recommendation_type': {'readonly': True}, - 'discovered_time_utc': {'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'}, - } - - 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 - - -class IotRecommendationModel(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 + :param properties: Ingestion setting data + :type properties: object """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'device_id': {'readonly': True}, - 'recommendation_type': {'readonly': True}, - 'discovered_time_utc': {'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'}, + 'properties': {'key': 'properties', 'type': 'object'}, } - def __init__(self, *, recommendation_additional_data=None, **kwargs) -> None: - super(IotRecommendationModel, 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, *, properties=None, **kwargs) -> None: + super(IngestionSetting, self).__init__(**kwargs) + self.properties = properties -class IotRecommendationType(Resource): - """IoT recommendation type. +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 id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :ivar recommendation_display_name: The display name of the recommendation - :vartype recommendation_display_name: str - :ivar severity: The severity of the recommendation. Possible values - include: 'Unknown', 'NotApplicable', 'Healthy', 'OffByPolicy', 'Low', - 'Medium', 'High' - :vartype severity: str or - ~azure.mgmt.security.models.RecommendationSeverity - :ivar description: Description of the suspected vulnerability and meaning. - :vartype description: str - :ivar product_name: The name of the product which published this - recommendation - :vartype product_name: str - :ivar product_component_name: The name of a component inside the product - which generated the recommendation - :vartype product_component_name: str - :ivar vendor_name: The name of the vendor that raised the recommendation - :vartype vendor_name: str - :ivar control: The name of the recommendation's control category - :vartype control: str - :ivar remediation_steps: Manual action items to take to resolve the - recommendation - :vartype remediation_steps: list[str] - :ivar data_source: The alert's data source - :vartype data_source: str + :ivar token: The token is used for correlating security data and logs with + the resources in the subscription. + :vartype token: str """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'recommendation_display_name': {'readonly': True}, - 'severity': {'readonly': True}, - 'description': {'readonly': True}, - 'product_name': {'readonly': True}, - 'product_component_name': {'readonly': True}, - 'vendor_name': {'readonly': True}, - 'control': {'readonly': True}, - 'remediation_steps': {'readonly': True}, - 'data_source': {'readonly': True}, + 'token': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'recommendation_display_name': {'key': 'properties.recommendationDisplayName', 'type': 'str'}, - 'severity': {'key': 'properties.severity', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'product_name': {'key': 'properties.productName', 'type': 'str'}, - 'product_component_name': {'key': 'properties.productComponentName', 'type': 'str'}, - 'vendor_name': {'key': 'properties.vendorName', 'type': 'str'}, - 'control': {'key': 'properties.control', 'type': 'str'}, - 'remediation_steps': {'key': 'properties.remediationSteps', 'type': '[str]'}, - 'data_source': {'key': 'properties.dataSource', 'type': 'str'}, + 'token': {'key': 'token', 'type': 'str'}, } def __init__(self, **kwargs) -> None: - super(IotRecommendationType, self).__init__(**kwargs) - self.recommendation_display_name = None - self.severity = None - self.description = None - self.product_name = None - self.product_component_name = None - self.vendor_name = None - self.control = None - self.remediation_steps = None - self.data_source = None - - -class IotRecommendationTypeList(Model): - """List of recommendation types. - - :param value: List data - :type value: list[~azure.mgmt.security.models.IotRecommendationType] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[IotRecommendationType]'}, - } - - def __init__(self, *, value=None, **kwargs) -> None: - super(IotRecommendationTypeList, self).__init__(**kwargs) - self.value = value + super(IngestionSettingToken, self).__init__(**kwargs) + self.token = None class IoTSecurityAggregatedAlert(Model): @@ -4430,7 +4137,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 +4185,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 +4223,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 +4237,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 +4281,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 +4317,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 +4350,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 +4360,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 +4383,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 +4395,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 +4419,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 +4431,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 +4457,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 +4488,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 +4606,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 +4621,7 @@ class IoTSecuritySolutionModel(Model): 'display_name': {'required': True}, 'iot_hubs': {'required': True}, 'auto_discovered_resources': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -4926,99 +4640,46 @@ 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 - self.type = None - self.tags = tags - self.location = location - self.workspace = workspace - self.display_name = display_name - self.status = status - self.export = export - self.disabled_data_sources = disabled_data_sources - self.iot_hubs = iot_hubs - self.user_defined_resources = user_defined_resources - self.auto_discovered_resources = None - self.recommendations_configuration = recommendations_configuration - self.unmasked_ip_logging_status = unmasked_ip_logging_status - - -class IotSensor(Resource): - """IoT sensor. - - 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: IoT sensor properties - :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(IotSensor, self).__init__(**kwargs) - self.properties = properties - - -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.IotSensor] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[IotSensor]'}, - } - - def __init__(self, **kwargs) -> None: - super(IotSensorsList, self).__init__(**kwargs) - self.value = None + self.id = None + self.name = None + self.type = None + self.tags = tags + self.location = location + self.workspace = workspace + self.display_name = display_name + self.status = status + self.export = export + self.disabled_data_sources = disabled_data_sources + self.iot_hubs = iot_hubs + self.user_defined_resources = user_defined_resources + self.auto_discovered_resources = None + self.recommendations_configuration = recommendations_configuration + self.unmasked_ip_logging_status = unmasked_ip_logging_status + self.additional_workspaces = additional_workspaces + self.system_data = None class IoTSeverityMetrics(Model): """IoT Security solution analytics severity metrics. :param high: Count of high severity alerts/recommendations. - :type high: int + :type high: long :param medium: Count of medium severity alerts/recommendations. - :type medium: int + :type medium: long :param low: Count of low severity alerts/recommendations. - :type low: int + :type low: long """ _attribute_map = { - 'high': {'key': 'high', 'type': 'int'}, - 'medium': {'key': 'medium', 'type': 'int'}, - 'low': {'key': 'low', 'type': 'int'}, + 'high': {'key': 'high', 'type': 'long'}, + 'medium': {'key': 'medium', 'type': 'long'}, + 'low': {'key': 'low', 'type': 'long'}, } def __init__(self, *, high: int=None, medium: int=None, low: int=None, **kwargs) -> None: @@ -5028,49 +4689,6 @@ def __init__(self, *, high: int=None, medium: int=None, low: int=None, **kwargs) self.low = low -class IpAddress(Model): - """IP Address information. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar v4_address: IPV4 address - :vartype v4_address: str - :ivar detection_time: Detection time of the ip address. - :vartype detection_time: datetime - :ivar subnet_cidr: Subnet Classless Inter-Domain Routing - :vartype subnet_cidr: str - :ivar fqdn: Fully qualified domain name - :vartype fqdn: str - :ivar fqdn_last_lookup_time: FQDN last lookup time. - :vartype fqdn_last_lookup_time: datetime - """ - - _validation = { - 'v4_address': {'readonly': True}, - 'detection_time': {'readonly': True}, - 'subnet_cidr': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'fqdn_last_lookup_time': {'readonly': True}, - } - - _attribute_map = { - 'v4_address': {'key': 'v4Address', 'type': 'str'}, - 'detection_time': {'key': 'detectionTime', 'type': 'iso-8601'}, - 'subnet_cidr': {'key': 'subnetCidr', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'fqdn_last_lookup_time': {'key': 'fqdnLastLookupTime', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs) -> None: - super(IpAddress, self).__init__(**kwargs) - self.v4_address = None - self.detection_time = None - self.subnet_cidr = None - self.fqdn = None - self.fqdn_last_lookup_time = None - - class JitNetworkAccessPolicy(Model): """JitNetworkAccessPolicy. @@ -5558,48 +5176,6 @@ def __init__(self, **kwargs) -> None: self.type = 'LogAnalytics' -class MacAddress(Model): - """MAC Address information. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar address: MAC address - :vartype address: str - :ivar detection_time: Detection time of the mac address. - :vartype detection_time: datetime - :ivar significance: Indicates whether this is the primary secondary MAC - address of the device. Possible values include: 'Primary', 'Secondary' - :vartype significance: str or ~azure.mgmt.security.models.MacSignificance - :ivar relation_to_ip_status: Indicates whether the relation of the mac to - the ip address is certain or a guess. Possible values include: 'Guess', - 'Certain' - :vartype relation_to_ip_status: str or - ~azure.mgmt.security.models.RelationToIpStatus - """ - - _validation = { - 'address': {'readonly': True}, - 'detection_time': {'readonly': True}, - 'significance': {'readonly': True}, - 'relation_to_ip_status': {'readonly': True}, - } - - _attribute_map = { - 'address': {'key': 'address', 'type': 'str'}, - 'detection_time': {'key': 'detectionTime', 'type': 'iso-8601'}, - 'significance': {'key': 'significance', 'type': 'str'}, - 'relation_to_ip_status': {'key': 'relationToIpStatus', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(MacAddress, self).__init__(**kwargs) - self.address = None - self.detection_time = None - self.significance = None - self.relation_to_ip_status = None - - class MqttC2DMessagesNotInAllowedRange(TimeWindowCustomAlertRule): """Number of cloud to device messages (MQTT protocol) is not in allowed range. @@ -5748,94 +5324,6 @@ def __init__(self, *, is_enabled: bool, min_threshold: int, max_threshold: int, self.rule_type = 'MqttD2CMessagesNotInAllowedRange' -class NetworkInterface(Model): - """Network interface. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param ip_address: - :type ip_address: ~azure.mgmt.security.models.IpAddress - :param mac_address: - :type mac_address: ~azure.mgmt.security.models.MacAddress - :ivar vlans: List of device vlans. - :vartype vlans: list[str] - """ - - _validation = { - 'vlans': {'readonly': True}, - } - - _attribute_map = { - 'ip_address': {'key': 'ipAddress', 'type': 'IpAddress'}, - 'mac_address': {'key': 'macAddress', 'type': 'MacAddress'}, - 'vlans': {'key': 'vlans', 'type': '[str]'}, - } - - def __init__(self, *, ip_address=None, mac_address=None, **kwargs) -> None: - super(NetworkInterface, self).__init__(**kwargs) - self.ip_address = ip_address - self.mac_address = mac_address - self.vlans = None - - -class OnPremiseIotSensor(Resource): - """On-premise IoT sensor. - - 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: On-premise IoT sensor properties - :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(OnPremiseIotSensor, self).__init__(**kwargs) - self.properties = properties - - -class OnPremiseIotSensorsList(Model): - """List of on-premise 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.OnPremiseIotSensor] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OnPremiseIotSensor]'}, - } - - def __init__(self, **kwargs) -> None: - super(OnPremiseIotSensorsList, self).__init__(**kwargs) - self.value = None - - class OnPremiseResourceDetails(ResourceDetails): """Details of the On Premise resource that was assessed. @@ -6008,280 +5496,6 @@ def __init__(self, **kwargs) -> None: self.description = None -class PackageDownloadInfo(Model): - """Information on a specific package 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 - """ - - _validation = { - 'version': {'readonly': True}, - 'version_kind': {'readonly': True}, - } - - _attribute_map = { - 'version': {'key': 'version', 'type': 'str'}, - 'link': {'key': 'link', 'type': 'str'}, - 'version_kind': {'key': 'versionKind', 'type': 'str'}, - } - - def __init__(self, *, link: str=None, **kwargs) -> None: - super(PackageDownloadInfo, self).__init__(**kwargs) - self.version = None - self.link = link - self.version_kind = None - - -class PackageDownloads(Model): - """Information about package downloads. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar sensor: Contains all Sensor binary downloads - :vartype sensor: ~azure.mgmt.security.models.PackageDownloadsSensor - :ivar central_manager: All downloads for Central Manager - :vartype central_manager: - ~azure.mgmt.security.models.PackageDownloadsCentralManager - :ivar threat_intelligence: All downloads for threat intelligence - :vartype threat_intelligence: - ~azure.mgmt.security.models.PackageDownloadsThreatIntelligence - """ - - _validation = { - 'sensor': {'readonly': True}, - 'central_manager': {'readonly': True}, - 'threat_intelligence': {'readonly': True}, - } - - _attribute_map = { - 'sensor': {'key': 'sensor', 'type': 'PackageDownloadsSensor'}, - 'central_manager': {'key': 'centralManager', 'type': 'PackageDownloadsCentralManager'}, - 'threat_intelligence': {'key': 'threatIntelligence', 'type': 'PackageDownloadsThreatIntelligence'}, - } - - def __init__(self, **kwargs) -> None: - super(PackageDownloads, self).__init__(**kwargs) - self.sensor = None - self.central_manager = None - self.threat_intelligence = None - - -class PackageDownloadsCentralManager(Model): - """All downloads for Central Manager. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar full: Contains full package downloads - :vartype full: - ~azure.mgmt.security.models.PackageDownloadsCentralManagerFull - :ivar upgrade: Central Manager upgrade package downloads (on existing - installations) - :vartype upgrade: list[~azure.mgmt.security.models.PackageDownloadInfo] - """ - - _validation = { - 'full': {'readonly': True}, - 'upgrade': {'readonly': True}, - } - - _attribute_map = { - 'full': {'key': 'full', 'type': 'PackageDownloadsCentralManagerFull'}, - 'upgrade': {'key': 'upgrade', 'type': '[PackageDownloadInfo]'}, - } - - def __init__(self, **kwargs) -> None: - super(PackageDownloadsCentralManager, self).__init__(**kwargs) - self.full = None - self.upgrade = None - - -class PackageDownloadsCentralManagerFull(Model): - """Contains full package downloads. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar iso: Contains all ISO full versions of the Central Manager - :vartype iso: list[~azure.mgmt.security.models.PackageDownloadInfo] - :ivar ovf: Contains all OVF (virtual machine) full versions of the Central - Manager - :vartype ovf: - ~azure.mgmt.security.models.PackageDownloadsCentralManagerFullOvf - """ - - _validation = { - 'iso': {'readonly': True}, - 'ovf': {'readonly': True}, - } - - _attribute_map = { - 'iso': {'key': 'iso', 'type': '[PackageDownloadInfo]'}, - 'ovf': {'key': 'ovf', 'type': 'PackageDownloadsCentralManagerFullOvf'}, - } - - def __init__(self, **kwargs) -> None: - super(PackageDownloadsCentralManagerFull, self).__init__(**kwargs) - self.iso = None - self.ovf = None - - -class PackageDownloadsCentralManagerFullOvf(Model): - """Contains all OVF (virtual machine) full versions of the Central Manager. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar enterprise: The Enterprise package type - :vartype enterprise: list[~azure.mgmt.security.models.PackageDownloadInfo] - :ivar enterprise_high_availability: The EnterpriseHighAvailability package - type - :vartype enterprise_high_availability: - list[~azure.mgmt.security.models.PackageDownloadInfo] - :ivar medium: The Medium package type - :vartype medium: list[~azure.mgmt.security.models.PackageDownloadInfo] - :ivar medium_high_availability: The MediumHighAvailability package type - :vartype medium_high_availability: - list[~azure.mgmt.security.models.PackageDownloadInfo] - """ - - _validation = { - 'enterprise': {'readonly': True}, - 'enterprise_high_availability': {'readonly': True}, - 'medium': {'readonly': True}, - 'medium_high_availability': {'readonly': True}, - } - - _attribute_map = { - 'enterprise': {'key': 'enterprise', 'type': '[PackageDownloadInfo]'}, - 'enterprise_high_availability': {'key': 'enterpriseHighAvailability', 'type': '[PackageDownloadInfo]'}, - 'medium': {'key': 'medium', 'type': '[PackageDownloadInfo]'}, - 'medium_high_availability': {'key': 'mediumHighAvailability', 'type': '[PackageDownloadInfo]'}, - } - - def __init__(self, **kwargs) -> None: - super(PackageDownloadsCentralManagerFullOvf, self).__init__(**kwargs) - self.enterprise = None - self.enterprise_high_availability = None - self.medium = None - self.medium_high_availability = None - - -class PackageDownloadsSensor(Model): - """Contains all Sensor binary downloads. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar full: Contains full package downloads - :vartype full: ~azure.mgmt.security.models.PackageDownloadsSensorFull - :param upgrade: Sensor upgrade package downloads (on existing - installations) - :type upgrade: list[~azure.mgmt.security.models.PackageDownloadInfo] - """ - - _validation = { - 'full': {'readonly': True}, - } - - _attribute_map = { - 'full': {'key': 'full', 'type': 'PackageDownloadsSensorFull'}, - 'upgrade': {'key': 'upgrade', 'type': '[PackageDownloadInfo]'}, - } - - def __init__(self, *, upgrade=None, **kwargs) -> None: - super(PackageDownloadsSensor, self).__init__(**kwargs) - self.full = None - self.upgrade = upgrade - - -class PackageDownloadsSensorFull(Model): - """Contains full package downloads. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar iso: Contains all ISO full versions for the sensor - :vartype iso: list[~azure.mgmt.security.models.PackageDownloadInfo] - :param ovf: Contains all OVF (virtual machine) full versions for the - sensor - :type ovf: ~azure.mgmt.security.models.PackageDownloadsSensorFullOvf - """ - - _validation = { - 'iso': {'readonly': True}, - } - - _attribute_map = { - 'iso': {'key': 'iso', 'type': '[PackageDownloadInfo]'}, - 'ovf': {'key': 'ovf', 'type': 'PackageDownloadsSensorFullOvf'}, - } - - def __init__(self, *, ovf=None, **kwargs) -> None: - super(PackageDownloadsSensorFull, self).__init__(**kwargs) - self.iso = None - self.ovf = ovf - - -class PackageDownloadsSensorFullOvf(Model): - """Contains all OVF (virtual machine) full versions for the sensor. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar enterprise: Enterprise package type - :vartype enterprise: list[~azure.mgmt.security.models.PackageDownloadInfo] - :ivar medium: Medium package type - :vartype medium: list[~azure.mgmt.security.models.PackageDownloadInfo] - :ivar line: Line package type - :vartype line: list[~azure.mgmt.security.models.PackageDownloadInfo] - """ - - _validation = { - 'enterprise': {'readonly': True}, - 'medium': {'readonly': True}, - 'line': {'readonly': True}, - } - - _attribute_map = { - 'enterprise': {'key': 'enterprise', 'type': '[PackageDownloadInfo]'}, - 'medium': {'key': 'medium', 'type': '[PackageDownloadInfo]'}, - 'line': {'key': 'line', 'type': '[PackageDownloadInfo]'}, - } - - def __init__(self, **kwargs) -> None: - super(PackageDownloadsSensorFullOvf, self).__init__(**kwargs) - self.enterprise = None - self.medium = 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. @@ -6481,34 +5695,7 @@ def __init__(self, *, exe=None, msi=None, script=None, executable=None, **kwargs self.exe = exe self.msi = msi self.script = script - self.executable = executable - - -class Protocol1(Model): - """Protocol data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: Protocol name - :vartype name: str - :param identifiers: list of protocol identifiers. - :type identifiers: str - """ - - _validation = { - 'name': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'identifiers': {'key': 'identifiers', 'type': 'str'}, - } - - def __init__(self, *, identifiers: str=None, **kwargs) -> None: - super(Protocol1, self).__init__(**kwargs) - self.name = None - self.identifiers = identifiers + self.executable = executable class ProxyServerProperties(Model): @@ -7558,8 +6745,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 +6755,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 +6774,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 +6817,8 @@ class SecurityAssessmentMetadata(Resource): :param remediation_description: Human readable description of what you should do to mitigate this security issue :type remediation_description: str - :param category: - :type category: list[str or ~azure.mgmt.security.models.Category] + :param categories: + :type categories: list[str or ~azure.mgmt.security.models.Categories] :param severity: Required. The severity level of the assessment. Possible values include: 'Low', 'Medium', 'High' :type severity: str or ~azure.mgmt.security.models.Severity @@ -7675,7 +6862,7 @@ class SecurityAssessmentMetadata(Resource): 'policy_definition_id': {'key': 'properties.policyDefinitionId', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'remediation_description': {'key': 'properties.remediationDescription', 'type': 'str'}, - 'category': {'key': 'properties.category', 'type': '[str]'}, + 'categories': {'key': 'properties.categories', 'type': '[str]'}, 'severity': {'key': 'properties.severity', 'type': 'str'}, 'user_impact': {'key': 'properties.userImpact', 'type': 'str'}, 'implementation_effort': {'key': 'properties.implementationEffort', 'type': 'str'}, @@ -7685,13 +6872,13 @@ class SecurityAssessmentMetadata(Resource): 'partner_data': {'key': 'properties.partnerData', 'type': 'SecurityAssessmentMetadataPartnerData'}, } - def __init__(self, *, display_name: str, severity, assessment_type, description: str=None, remediation_description: str=None, category=None, user_impact=None, implementation_effort=None, threats=None, preview: bool=None, partner_data=None, **kwargs) -> None: + def __init__(self, *, display_name: str, severity, assessment_type, description: str=None, remediation_description: str=None, categories=None, user_impact=None, implementation_effort=None, threats=None, preview: bool=None, partner_data=None, **kwargs) -> None: super(SecurityAssessmentMetadata, self).__init__(**kwargs) self.display_name = display_name self.policy_definition_id = None self.description = description self.remediation_description = remediation_description - self.category = category + self.categories = categories self.severity = severity self.user_impact = user_impact self.implementation_effort = implementation_effort @@ -7753,8 +6940,8 @@ class SecurityAssessmentMetadataProperties(Model): :param remediation_description: Human readable description of what you should do to mitigate this security issue :type remediation_description: str - :param category: - :type category: list[str or ~azure.mgmt.security.models.Category] + :param categories: + :type categories: list[str or ~azure.mgmt.security.models.Categories] :param severity: Required. The severity level of the assessment. Possible values include: 'Low', 'Medium', 'High' :type severity: str or ~azure.mgmt.security.models.Severity @@ -7792,7 +6979,7 @@ class SecurityAssessmentMetadataProperties(Model): 'policy_definition_id': {'key': 'policyDefinitionId', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'remediation_description': {'key': 'remediationDescription', 'type': 'str'}, - 'category': {'key': 'category', 'type': '[str]'}, + 'categories': {'key': 'categories', 'type': '[str]'}, 'severity': {'key': 'severity', 'type': 'str'}, 'user_impact': {'key': 'userImpact', 'type': 'str'}, 'implementation_effort': {'key': 'implementationEffort', 'type': 'str'}, @@ -7802,13 +6989,150 @@ class SecurityAssessmentMetadataProperties(Model): 'partner_data': {'key': 'partnerData', 'type': 'SecurityAssessmentMetadataPartnerData'}, } - def __init__(self, *, display_name: str, severity, assessment_type, description: str=None, remediation_description: str=None, category=None, user_impact=None, implementation_effort=None, threats=None, preview: bool=None, partner_data=None, **kwargs) -> None: + def __init__(self, *, display_name: str, severity, assessment_type, description: str=None, remediation_description: str=None, categories=None, user_impact=None, implementation_effort=None, threats=None, preview: bool=None, partner_data=None, **kwargs) -> None: super(SecurityAssessmentMetadataProperties, self).__init__(**kwargs) self.display_name = display_name self.policy_definition_id = None self.description = description self.remediation_description = remediation_description - self.category = category + self.categories = categories + self.severity = severity + self.user_impact = user_impact + self.implementation_effort = implementation_effort + self.threats = threats + self.preview = preview + self.assessment_type = assessment_type + self.partner_data = partner_data + + +class SecurityAssessmentMetadataPropertiesResponsePublishDates(Model): + """SecurityAssessmentMetadataPropertiesResponsePublishDates. + + All required parameters must be populated in order to send to Azure. + + :param ga: + :type ga: str + :param public: Required. + :type public: str + """ + + _validation = { + 'ga': {'pattern': r'^([0-9]{2}/){2}[0-9]{4}$'}, + 'public': {'required': True, 'pattern': r'^([0-9]{2}/){2}[0-9]{4}$'}, + } + + _attribute_map = { + 'ga': {'key': 'GA', 'type': 'str'}, + 'public': {'key': 'public', 'type': 'str'}, + } + + def __init__(self, *, public: str, ga: str=None, **kwargs) -> None: + super(SecurityAssessmentMetadataPropertiesResponsePublishDates, self).__init__(**kwargs) + self.ga = ga + self.public = public + + +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 + :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 + :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 + :param publish_dates: + :type publish_dates: + ~azure.mgmt.security.models.SecurityAssessmentMetadataPropertiesResponsePublishDates + :param planned_deprecation_date: + :type planned_deprecation_date: str + :param tactics: + :type tactics: list[str or ~azure.mgmt.security.models.Tactics] + :param techniques: + :type techniques: list[str or ~azure.mgmt.security.models.Techniques] + """ + + _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 = { + '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'}, + 'tactics': {'key': 'properties.tactics', 'type': '[str]'}, + 'techniques': {'key': 'properties.techniques', 'type': '[str]'}, + } + + 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, tactics=None, techniques=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.categories = categories self.severity = severity self.user_impact = user_impact self.implementation_effort = implementation_effort @@ -7816,6 +7140,10 @@ 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 + self.tactics = tactics + self.techniques = techniques class SecurityAssessmentPartnerData(Model): @@ -7845,6 +7173,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. @@ -8253,34 +7694,6 @@ def __init__(self, *, display_name: str=None, description: str=None, rank=None, self.enabled = enabled -class Sensor(Model): - """Sensor data. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: Sensor name - :vartype name: str - :ivar zone: Zone Name. - :vartype zone: str - """ - - _validation = { - 'name': {'readonly': True}, - 'zone': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'zone': {'key': 'zone', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(Sensor, self).__init__(**kwargs) - self.name = None - self.zone = None - - class ServerVulnerabilityAssessment(Resource): """Describes the server vulnerability assessment details on a resource. @@ -8418,27 +7831,76 @@ def __init__(self, *, application_id: str=None, secret: str=None, **kwargs) -> N self.secret = secret -class Site(Model): - """Site data. +class Software(Resource): + """Represents a software data. Variables are only populated by the server, and will be ignored when sending a request. - :ivar display_name: Site display name - :vartype display_name: str + :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 = { - 'display_name': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, } _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(Site, self).__init__(**kwargs) - self.display_name = None + '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): @@ -8541,6 +8003,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. 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 5dcf2e2766af..d9e29a285b1a 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 @@ -506,16 +428,55 @@ class ConnectorSettingPaged(Paged): def __init__(self, *args, **kwargs): super(ConnectorSettingPaged, self).__init__(*args, **kwargs) -class DevicePaged(Paged): +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:`Device ` object + 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': '[Device]'} + 'current_page': {'key': 'value', 'type': '[Software]'} } def __init__(self, *args, **kwargs): - super(DevicePaged, self).__init__(*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 651c39085b1f..50fc93033e25 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,133 @@ class RuleState(str, Enum): expired = "Expired" -class Category(str, Enum): +class Tactics(str, Enum): + + reconnaissance = "Reconnaissance" + resource_development = "Resource Development" + initial_access = "Initial Access" + execution = "Execution" + persistence = "Persistence" + privilege_escalation = "Privilege Escalation" + defense_evasion = "Defense Evasion" + credential_access = "Credential Access" + discovery = "Discovery" + lateral_movement = "Lateral Movement" + collection = "Collection" + commandand_control = "Command and Control" + exfiltration = "Exfiltration" + impact = "Impact" + + +class Techniques(str, Enum): + + abuse_elevation_control_mechanism = "Abuse Elevation Control Mechanism" + access_token_manipulation = "Access Token Manipulation" + account_discovery = "Account Discovery" + account_manipulation = "Account Manipulation" + active_scanning = "Active Scanning" + application_layer_protocol = "Application Layer Protocol" + audio_capture = "Audio Capture" + bootor_logon_autostart_execution = "Boot or Logon Autostart Execution" + bootor_logon_initialization_scripts = "Boot or Logon Initialization Scripts" + brute_force = "Brute Force" + cloud_infrastructure_discovery = "Cloud Infrastructure Discovery" + cloud_service_dashboard = "Cloud Service Dashboard" + cloud_service_discovery = "Cloud Service Discovery" + commandand_scripting_interpreter = "Command and Scripting Interpreter" + compromise_client_software_binary = "Compromise Client Software Binary" + compromise_infrastructure = "Compromise Infrastructure" + containerand_resource_discovery = "Container and Resource Discovery" + create_account = "Create Account" + createor_modify_system_process = "Create or Modify System Process" + credentialsfrom_password_stores = "Credentials from Password Stores" + data_destruction = "Data Destruction" + data_encryptedfor_impact = "Data Encrypted for Impact" + datafrom_cloud_storage_object = "Data from Cloud Storage Object" + datafrom_configuration_repository = "Data from Configuration Repository" + datafrom_information_repositories = "Data from Information Repositories" + datafrom_local_system = "Data from Local System" + data_manipulation = "Data Manipulation" + data_staged = "Data Staged" + defacement = "Defacement" + deobfuscate_decode_filesor_information = "Deobfuscate/Decode Files or Information" + disk_wipe = "Disk Wipe" + domain_trust_discovery = "Domain Trust Discovery" + drive_by_compromise = "Drive-by Compromise" + dynamic_resolution = "Dynamic Resolution" + endpoint_denialof_service = "Endpoint Denial of Service" + event_triggered_execution = "Event Triggered Execution" + exfiltration_over_alternative_protocol = "Exfiltration Over Alternative Protocol" + exploit_public_facing_application = "Exploit Public-Facing Application" + exploitationfor_client_execution = "Exploitation for Client Execution" + exploitationfor_credential_access = "Exploitation for Credential Access" + exploitationfor_defense_evasion = "Exploitation for Defense Evasion" + exploitationfor_privilege_escalation = "Exploitation for Privilege Escalation" + exploitationof_remote_services = "Exploitation of Remote Services" + external_remote_services = "External Remote Services" + fallback_channels = "Fallback Channels" + fileand_directory_discovery = "File and Directory Discovery" + gather_victim_network_information = "Gather Victim Network Information" + hide_artifacts = "Hide Artifacts" + hijack_execution_flow = "Hijack Execution Flow" + impair_defenses = "Impair Defenses" + implant_container_image = "Implant Container Image" + indicator_removalon_host = "Indicator Removal on Host" + indirect_command_execution = "Indirect Command Execution" + ingress_tool_transfer = "Ingress Tool Transfer" + input_capture = "Input Capture" + inter_process_communication = "Inter-Process Communication" + lateral_tool_transfer = "Lateral Tool Transfer" + man_in_the_middle = "Man-in-the-Middle" + masquerading = "Masquerading" + modify_authentication_process = "Modify Authentication Process" + modify_registry = "Modify Registry" + network_denialof_service = "Network Denial of Service" + network_service_scanning = "Network Service Scanning" + network_sniffing = "Network Sniffing" + non_application_layer_protocol = "Non-Application Layer Protocol" + non_standard_port = "Non-Standard Port" + obtain_capabilities = "Obtain Capabilities" + obfuscated_filesor_information = "Obfuscated Files or Information" + office_application_startup = "Office Application Startup" + os_credential_dumping = "OS Credential Dumping" + permission_groups_discovery = "Permission Groups Discovery" + phishing = "Phishing" + pre_osboot = "Pre-OS Boot" + process_discovery = "Process Discovery" + process_injection = "Process Injection" + protocol_tunneling = "Protocol Tunneling" + proxy = "Proxy" + query_registry = "Query Registry" + remote_access_software = "Remote Access Software" + remote_service_session_hijacking = "Remote Service Session Hijacking" + remote_services = "Remote Services" + remote_system_discovery = "Remote System Discovery" + resource_hijacking = "Resource Hijacking" + scheduled_task_job = "Scheduled Task/Job" + screen_capture = "Screen Capture" + search_victim_owned_websites = "Search Victim-Owned Websites" + server_software_component = "Server Software Component" + service_stop = "Service Stop" + signed_binary_proxy_execution = "Signed Binary Proxy Execution" + software_deployment_tools = "Software Deployment Tools" + sql_stored_procedures = "SQL Stored Procedures" + stealor_forge_kerberos_tickets = "Steal or Forge Kerberos Tickets" + subvert_trust_controls = "Subvert Trust Controls" + supply_chain_compromise = "Supply Chain Compromise" + system_information_discovery = "System Information Discovery" + taint_shared_content = "Taint Shared Content" + traffic_signaling = "Traffic Signaling" + transfer_datato_cloud_account = "Transfer Data to Cloud Account" + trusted_relationship = "Trusted Relationship" + unsecured_credentials = "Unsecured Credentials" + user_execution = "User Execution" + valid_accounts = "Valid Accounts" + windows_management_instrumentation = "Windows Management Instrumentation" + fileand_directory_permissions_modification = "File and Directory Permissions Modification" + + +class Categories(str, Enum): compute = "Compute" networking = "Networking" @@ -273,33 +385,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,66 +501,60 @@ class RuleType(str, Enum): negative_list = "NegativeList" #: NegativeList -class VersionKind(str, Enum): - - latest = "Latest" - previous = "Previous" - preview = "Preview" - - -class MacSignificance(str, Enum): - - primary = "Primary" - secondary = "Secondary" - - -class RelationToIpStatus(str, Enum): - - guess = "Guess" - certain = "Certain" - - -class ManagementState(str, Enum): - - managed = "Managed" - unmanaged = "Unmanaged" - - -class AuthorizationState(str, Enum): - - authorized = "Authorized" - unauthorized = "Unauthorized" - - -class DeviceCriticality(str, Enum): +class AlertSeverity(str, Enum): - important = "Important" - standard = "Standard" + informational = "Informational" #: Informational + low = "Low" #: Low + medium = "Medium" #: Medium + high = "High" #: High -class PurdueLevel(str, Enum): +class Intent(str, Enum): - process_control = "ProcessControl" - supervisory = "Supervisory" - enterprise = "Enterprise" + 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 ProgrammingState(str, Enum): +class AlertStatus(str, Enum): - programming_device = "ProgrammingDevice" - not_programming_device = "NotProgrammingDevice" + 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 ScanningFunctionality(str, Enum): +class BundleType(str, Enum): - scanner_device = "ScannerDevice" - not_scanner_device = "NotScannerDevice" + app_services = "AppServices" + dns = "DNS" + key_vaults = "KeyVaults" + kubernetes_service = "KubernetesService" + resource_manager = "ResourceManager" + sql_servers = "SqlServers" + storage_accounts = "StorageAccounts" + virtual_machines = "VirtualMachines" -class DeviceStatus(str, Enum): +class EndOfSupportStatus(str, Enum): - active = "Active" - removed = "Removed" + 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): 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 751d0d5098d5..c0f01bc8ea1c 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 @@ -56,27 +50,20 @@ from ._sql_vulnerability_assessment_scans_operations import SqlVulnerabilityAssessmentScansOperations from ._sql_vulnerability_assessment_scan_results_operations import SqlVulnerabilityAssessmentScanResultsOperations from ._sql_vulnerability_assessment_baseline_rules_operations import SqlVulnerabilityAssessmentBaselineRulesOperations -from ._iot_defender_settings_operations import IotDefenderSettingsOperations -from ._iot_sensors_operations import IotSensorsOperations -from ._devices_for_subscription_operations import DevicesForSubscriptionOperations -from ._devices_for_hub_operations import DevicesForHubOperations -from ._device_operations import DeviceOperations -from ._on_premise_iot_sensors_operations import OnPremiseIotSensorsOperations +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 +85,6 @@ 'AdaptiveNetworkHardeningsOperations', 'AllowedConnectionsOperations', 'TopologyOperations', - 'AlertsOperations', 'JitNetworkAccessPoliciesOperations', 'DiscoveredSecuritySolutionsOperations', 'SecuritySolutionsReferenceDataOperations', @@ -111,10 +97,8 @@ 'SqlVulnerabilityAssessmentScansOperations', 'SqlVulnerabilityAssessmentScanResultsOperations', 'SqlVulnerabilityAssessmentBaselineRulesOperations', - 'IotDefenderSettingsOperations', - 'IotSensorsOperations', - 'DevicesForSubscriptionOperations', - 'DevicesForHubOperations', - 'DeviceOperations', - 'OnPremiseIotSensorsOperations', + '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 3c069f9610fb..e15d81e6e575 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 9a5350d93fa9..72b8d45691cd 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) @@ -296,15 +300,16 @@ def create_in_subscription( :type assessment_metadata_name: str :param assessment_metadata: AssessmentMetadata object :type assessment_metadata: - ~azure.mgmt.security.models.SecurityAssessmentMetadata + ~azure.mgmt.security.models.SecurityAssessmentMetadataResponse :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: SecurityAssessmentMetadata or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadata or - ~msrest.pipeline.ClientRawResponse + :return: SecurityAssessmentMetadataResponse or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadataResponse + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL @@ -331,7 +336,7 @@ def create_in_subscription( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(assessment_metadata, 'SecurityAssessmentMetadata') + body_content = self._serialize.body(assessment_metadata, 'SecurityAssessmentMetadataResponse') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -344,7 +349,7 @@ def create_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 2c4c32bdf45e..d8a76ddfbc10 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/_device_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_device_operations.py deleted file mode 100644 index 7ce8a22a772e..000000000000 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_device_operations.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class DeviceOperations(object): - """DeviceOperations 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 get( - self, resource_id, device_id, custom_headers=None, raw=False, **operation_config): - """Get device. - - :param resource_id: The identifier of the resource. - :type resource_id: str - :param device_id: Identifier of the device. - :type device_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: Device or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.Device or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceId': self._serialize.url("resource_id", resource_id, 'str', skip_quote=True), - 'deviceId': self._serialize.url("device_id", device_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # 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('Device', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/devices/{deviceId}'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_devices_for_hub_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_devices_for_hub_operations.py deleted file mode 100644 index dd6a38a42a09..000000000000 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_devices_for_hub_operations.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class DevicesForHubOperations(object): - """DevicesForHubOperations 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, resource_id, limit=None, skip_token=None, device_management_type=None, custom_headers=None, raw=False, **operation_config): - """Get list of the devices for the specified IoT Hub resource. - - :param resource_id: The identifier of the resource. - :type resource_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 device_management_type: Get devices only from specific type, - Managed or Unmanaged. Possible values include: 'Managed', 'Unmanaged' - :type device_management_type: str or - ~azure.mgmt.security.models.ManagementState - :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 Device - :rtype: - ~azure.mgmt.security.models.DevicePaged[~azure.mgmt.security.models.Device] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'resourceId': self._serialize.url("resource_id", resource_id, 'str', 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') - 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') - if device_management_type is not None: - query_parameters['deviceManagementType'] = self._serialize.query("device_management_type", device_management_type, '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.DevicePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/devices'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_devices_for_subscription_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_devices_for_subscription_operations.py deleted file mode 100644 index 5309e01e1114..000000000000 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_devices_for_subscription_operations.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class DevicesForSubscriptionOperations(object): - """DevicesForSubscriptionOperations 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, limit=None, skip_token=None, device_management_type=None, custom_headers=None, raw=False, **operation_config): - """Get list of the devices by their subscription. - - :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 device_management_type: Get devices only from specific type, - Managed or Unmanaged. Possible values include: 'Managed', 'Unmanaged' - :type device_management_type: str or - ~azure.mgmt.security.models.ManagementState - :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 Device - :rtype: - ~azure.mgmt.security.models.DevicePaged[~azure.mgmt.security.models.Device] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if 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') - if device_management_type is not None: - query_parameters['deviceManagementType'] = self._serialize.query("device_management_type", device_management_type, '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.DevicePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/devices'} 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/_ingestion_settings_operations.py similarity index 60% rename from sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_defender_settings_operations.py rename to sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_ingestion_settings_operations.py index 679341957e37..67f6ce4ea26d 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/_ingestion_settings_operations.py @@ -16,8 +16,8 @@ from .. import models -class IotDefenderSettingsOperations(object): - """IotDefenderSettingsOperations operations. +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. @@ -25,7 +25,7 @@ class IotDefenderSettingsOperations(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". + :ivar api_version: API version for the operation. Constant value: "2021-01-15-preview". """ models = models @@ -35,28 +35,99 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-08-06-preview" + self.api_version = "2021-01-15-preview" self.config = config def list( self, custom_headers=None, raw=False, **operation_config): - """List IoT Defender Settings. + """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: IotDefenderSettingsList or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotDefenderSettingsList or + :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.list.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}$') + '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) @@ -85,33 +156,41 @@ def list( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('IotDefenderSettingsList', response) + deserialized = self._deserialize('IngestionSetting', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}'} - def get( - self, custom_headers=None, raw=False, **operation_config): - """Get IoT Defender Settings. + 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: IotDefenderSettingsModel or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotDefenderSettingsModel or + :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.get.metadata['url'] + url = self.create.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + '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) @@ -122,6 +201,7 @@ def get( # 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: @@ -129,8 +209,11 @@ def get( 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.get(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]: @@ -140,42 +223,35 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('IotDefenderSettingsModel', response) + 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/iotDefenderSettings/default'} - - def create_or_update( - self, device_quota, sentinel_workspace_resource_ids, 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] + 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: IotDefenderSettingsModel or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotDefenderSettingsModel or - ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~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'] + 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}$') + '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) @@ -185,8 +261,6 @@ 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: @@ -194,48 +268,42 @@ 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_defender_settings_model, 'IotDefenderSettingsModel') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + 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, 201]: + if response.status_code not in [200, 204]: 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('IotDefenderSettingsModel', response) - if response.status_code == 201: - deserialized = self._deserialize('IotDefenderSettingsModel', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}'} - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default'} - - def delete( - self, custom_headers=None, raw=False, **operation_config): - """Delete IoT Defender settings. + 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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: IngestionSettingToken or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IngestionSettingToken or + ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.delete.metadata['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}$') + '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) @@ -245,6 +313,7 @@ def delete( # 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: @@ -253,37 +322,46 @@ def delete( 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) + 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, 204]: + 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(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default'} - def package_downloads_method( - self, custom_headers=None, raw=False, **operation_config): - """Information about downloadable packages. + 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: PackageDownloads or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.PackageDownloads or + :return: ConnectionStrings or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.ConnectionStrings or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.package_downloads_method.metadata['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}$') + '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) @@ -312,11 +390,11 @@ def package_downloads_method( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('PackageDownloads', response) + deserialized = self._deserialize('ConnectionStrings', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - package_downloads_method.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default/packageDownloads'} + 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 deleted file mode 100644 index 68a582e8109d..000000000000 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_alert_types_operations.py +++ /dev/null @@ -1,286 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class IotAlertTypesOperations(object): - """IotAlertTypesOperations 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. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - - 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. - - :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 = "2020-08-06-preview" - - # Construct URL - url = self.list1.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("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 - list1.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes'} - - def get1( - self, iot_alert_type_name, custom_headers=None, raw=False, **operation_config): - """Get IoT alert type. - - :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 = "2020-08-06-preview" - - # Construct URL - url = self.get1.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') - } - 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 - get1.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 deleted file mode 100644 index 8f4e3128008b..000000000000 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_alerts_operations.py +++ /dev/null @@ -1,374 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class IotAlertsOperations(object): - """IotAlertsOperations 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. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - - 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. - - :param scope: Scope of the query: Subscription (i.e. - /subscriptions/{subscriptionId}) or IoT Hub (i.e. - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}) - :type scope: 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 device_management_type: Get devices only from specific type, - Managed or Unmanaged. Possible values include: 'Managed', 'Unmanaged' - :type device_management_type: str or - ~azure.mgmt.security.models.ManagementState - :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 IotAlertModel - :rtype: - ~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'] - 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("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 device_management_type is not None: - query_parameters['deviceManagementType'] = self._serialize.query("device_management_type", device_management_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.IotAlertModelPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list1.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotAlerts'} - - def get1( - self, scope, iot_alert_id, custom_headers=None, raw=False, **operation_config): - """Get IoT alert. - - :param scope: Scope of the query: Subscription (i.e. - /subscriptions/{subscriptionId}) or IoT Hub (i.e. - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}) - :type scope: 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: IotAlertModel or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotAlertModel or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2020-08-06-preview" - - # Construct URL - url = self.get1.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') - } - 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('IotAlertModel', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get1.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotAlerts/{iotAlertId}'} 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 deleted file mode 100644 index 2ac1dadc2e86..000000000000 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_recommendation_types_operations.py +++ /dev/null @@ -1,286 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class IotRecommendationTypesOperations(object): - """IotRecommendationTypesOperations 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. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - - 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. - - :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 = "2020-08-06-preview" - - # Construct URL - url = self.list1.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("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 - list1.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes'} - - def get1( - self, iot_recommendation_type_name, custom_headers=None, raw=False, **operation_config): - """Get IoT recommendation type. - - :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 = "2020-08-06-preview" - - # Construct URL - url = self.get1.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') - } - 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 - get1.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes/{iotRecommendationTypeName}'} 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 deleted file mode 100644 index 0565ee6ba734..000000000000 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sensors_operations.py +++ /dev/null @@ -1,338 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class IotSensorsOperations(object): - """IotSensorsOperations 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 sensors. - - :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: IotSensorsList or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotSensorsList 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('IotSensorsList', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSensors'} - - def get( - self, scope, iot_sensor_name, custom_headers=None, raw=False, **operation_config): - """Get IoT 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 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 - ~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), - '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/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('IotSensor', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - 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): - """Create or update IoT 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 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 - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.create_or_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 = {} - 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.put(url, query_parameters, header_parameters) - 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('IotSensor', response) - if response.status_code == 201: - deserialized = self._deserialize('IotSensor', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}'} - - def delete( - self, scope, iot_sensor_name, custom_headers=None, raw=False, **operation_config): - """Delete IoT 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 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), - '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.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/iotSensors/{iotSensorName}'} - - def download_activation( - self, scope, iot_sensor_name, custom_headers=None, raw=False, callback=None, **operation_config): - """Download sensor activation file. - - :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 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_activation.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' - 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_activation.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}/downloadActivation'} 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 deleted file mode 100644 index bd5c73f7dcd8..000000000000 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_on_premise_iot_sensors_operations.py +++ /dev/null @@ -1,323 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class OnPremiseIotSensorsOperations(object): - """OnPremiseIotSensorsOperations 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, custom_headers=None, raw=False, **operation_config): - """List on-premise IoT sensors. - - :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: OnPremiseIotSensorsList or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.OnPremiseIotSensorsList or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # 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') - - # 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('OnPremiseIotSensorsList', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors'} - - def get( - self, on_premise_iot_sensor_name, custom_headers=None, raw=False, **operation_config): - """Get on-premise IoT sensor. - - :param on_premise_iot_sensor_name: Name of the on-premise IoT sensor - :type on_premise_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: OnPremiseIotSensor or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.OnPremiseIotSensor 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}$'), - '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/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('OnPremiseIotSensor', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}'} - - def create_or_update( - self, on_premise_iot_sensor_name, custom_headers=None, raw=False, **operation_config): - """Create or update on-premise IoT sensor. - - :param on_premise_iot_sensor_name: Name of the on-premise IoT sensor - :type on_premise_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: OnPremiseIotSensor or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.OnPremiseIotSensor or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - '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/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.put(url, query_parameters, header_parameters) - 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('OnPremiseIotSensor', response) - if response.status_code == 201: - deserialized = self._deserialize('OnPremiseIotSensor', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}'} - - def delete( - self, on_premise_iot_sensor_name, custom_headers=None, raw=False, **operation_config): - """Delete on-premise IoT sensor. - - :param on_premise_iot_sensor_name: Name of the on-premise IoT sensor - :type on_premise_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.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}$'), - '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 = {} - 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/onPremiseIotSensors/{onPremiseIotSensorName}'} - - def download_activation( - self, on_premise_iot_sensor_name, custom_headers=None, raw=False, callback=None, **operation_config): - """Download sensor activation file. - - :param on_premise_iot_sensor_name: Name of the on-premise IoT sensor - :type on_premise_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 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_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}$'), - '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' - 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_activation.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}/downloadActivation'} 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 b3e51771853c..841109ee0ce6 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 0fd17bfc35f6..514e8f95e91b 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-07-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-07-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', 'WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW', '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', 'WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW', '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/_iot_recommendations_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_software_inventories_operations.py similarity index 50% rename from sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_recommendations_operations.py rename to sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_software_inventories_operations.py index 36af51bc0cdf..94624a4c5cdd 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/_software_inventories_operations.py @@ -16,8 +16,8 @@ from .. import models -class IotRecommendationsOperations(object): - """IotRecommendationsOperations operations. +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. @@ -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: "2021-05-01-preview". """ models = models @@ -34,60 +35,49 @@ 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( - 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. + 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 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 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 IotRecommendation + :return: An iterator like instance of Software :rtype: - ~azure.mgmt.security.models.IotRecommendationPaged[~azure.mgmt.security.models.IotRecommendation] + ~azure.mgmt.security.models.SoftwarePaged[~azure.mgmt.security.models.Software] :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'] + 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\._\(\)]+$'), - 'solutionName': self._serialize.url("solution_name", solution_name, 'str') + '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("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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: url = next_link @@ -123,126 +113,38 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.IotRecommendationPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.SoftwarePaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotRecommendations'} + list_by_extended_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories'} - def get( - self, resource_group_name, solution_name, iot_recommendation_id, custom_headers=None, raw=False, **operation_config): - """Get IoT recommendation. + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Gets the software inventory of all virtual machines in the + subscriptions. - :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. - - :param scope: Scope of the query: Subscription (i.e. - /subscriptions/{subscriptionId}) or IoT Hub (i.e. - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}) - :type scope: 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 IotRecommendationModel + :return: An iterator like instance of Software :rtype: - ~azure.mgmt.security.models.IotRecommendationModelPaged[~azure.mgmt.security.models.IotRecommendationModel] + ~azure.mgmt.security.models.SoftwarePaged[~azure.mgmt.security.models.Software] :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_by_subscription.metadata['url'] path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + '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("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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: url = next_link @@ -278,44 +180,51 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.IotRecommendationModelPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.SoftwarePaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list1.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotRecommendations'} - - def get1( - self, scope, iot_recommendation_id, custom_headers=None, raw=False, **operation_config): - """Get IoT recommendation. - - :param scope: Scope of the query: Subscription (i.e. - /subscriptions/{subscriptionId}) or IoT Hub (i.e. - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}) - :type scope: str - :param iot_recommendation_id: Id of the recommendation - :type iot_recommendation_id: str + 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: IotRecommendationModel or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotRecommendationModel or + :return: Software or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.Software or ~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') + '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("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -338,11 +247,11 @@ def get1( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('IotRecommendationModel', response) + deserialized = self._deserialize('Software', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get1.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotRecommendations/{iotRecommendationId}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName}'}