From f9058eb0fb367a4e4f133809d6b0b6ae571754be Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Mon, 9 Nov 2020 07:54:57 +0000 Subject: [PATCH] Generated from e40fb021db7713b24d02e2880d139b6570bcd866 --- .../azure/mgmt/security/_security_center.py | 15 + .../azure/mgmt/security/models/__init__.py | 80 +- .../azure/mgmt/security/models/_models.py | 761 ++++++++++++++++-- .../azure/mgmt/security/models/_models_py3.py | 761 ++++++++++++++++-- .../mgmt/security/models/_paged_models.py | 26 + .../security/models/_security_center_enums.py | 40 +- .../mgmt/security/operations/__init__.py | 6 + .../operations/_connectors_operations.py | 9 +- .../operations/_iot_alert_types_operations.py | 127 ++- .../operations/_iot_alerts_operations.py | 178 +++- .../_iot_recommendation_types_operations.py | 127 ++- .../_iot_recommendations_operations.py | 162 +++- ...ty_assessment_baseline_rules_operations.py | 383 +++++++++ ...lity_assessment_scan_results_operations.py | 173 ++++ ...lnerability_assessment_scans_operations.py | 166 ++++ 15 files changed, 2832 insertions(+), 182 deletions(-) create mode 100644 sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_sql_vulnerability_assessment_baseline_rules_operations.py create mode 100644 sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_sql_vulnerability_assessment_scan_results_operations.py create mode 100644 sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_sql_vulnerability_assessment_scans_operations.py 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 ae045fa6ea81..de0ae7d443e3 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 @@ -57,6 +57,9 @@ from .operations import SecureScoreControlDefinitionsOperations from .operations import SecuritySolutionsOperations from .operations import ConnectorsOperations +from .operations import SqlVulnerabilityAssessmentScansOperations +from .operations import SqlVulnerabilityAssessmentScanResultsOperations +from .operations import SqlVulnerabilityAssessmentBaselineRulesOperations from .operations import IotDefenderSettingsOperations from .operations import IotSensorsOperations from .operations import DevicesForSubscriptionOperations @@ -160,6 +163,12 @@ class SecurityCenter(SDKClient): :vartype security_solutions: azure.mgmt.security.operations.SecuritySolutionsOperations :ivar connectors: Connectors operations :vartype connectors: azure.mgmt.security.operations.ConnectorsOperations + :ivar sql_vulnerability_assessment_scans: SqlVulnerabilityAssessmentScans operations + :vartype sql_vulnerability_assessment_scans: azure.mgmt.security.operations.SqlVulnerabilityAssessmentScansOperations + :ivar sql_vulnerability_assessment_scan_results: SqlVulnerabilityAssessmentScanResults operations + :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 @@ -282,6 +291,12 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.connectors = ConnectorsOperations( self._client, self.config, self._serialize, self._deserialize) + self.sql_vulnerability_assessment_scans = SqlVulnerabilityAssessmentScansOperations( + self._client, self.config, self._serialize, self._deserialize) + self.sql_vulnerability_assessment_scan_results = SqlVulnerabilityAssessmentScanResultsOperations( + 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( 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 fa0e0280c09a..0eb015d6dd7e 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 @@ -52,6 +52,9 @@ from ._models_py3 import AzureResourceIdentifier from ._models_py3 import AzureResourceLink from ._models_py3 import AzureTrackedResourceLocation + from ._models_py3 import Baseline + from ._models_py3 import BaselineAdjustedResult + from ._models_py3 import BenchmarkReference from ._models_py3 import CefExternalSecuritySolution from ._models_py3 import CefSolutionProperties from ._models_py3 import Compliance @@ -89,11 +92,13 @@ 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 IoTSecurityAggregatedAlert @@ -152,15 +157,28 @@ from ._models_py3 import Protocol1 from ._models_py3 import ProxyServerProperties from ._models_py3 import PublisherInfo + from ._models_py3 import QueryCheck from ._models_py3 import QueuePurgesNotInAllowedRange from ._models_py3 import RecommendationConfigurationProperties from ._models_py3 import RegulatoryComplianceAssessment from ._models_py3 import RegulatoryComplianceControl from ._models_py3 import RegulatoryComplianceStandard + from ._models_py3 import Remediation from ._models_py3 import Resource from ._models_py3 import ResourceDetails from ._models_py3 import ResourceIdentifier from ._models_py3 import Rule + from ._models_py3 import RuleResults + from ._models_py3 import RuleResultsInput + from ._models_py3 import RuleResultsProperties + from ._models_py3 import RulesResults + from ._models_py3 import RulesResultsInput + from ._models_py3 import Scan + from ._models_py3 import ScanProperties + from ._models_py3 import ScanResult + from ._models_py3 import ScanResultProperties + from ._models_py3 import ScanResults + from ._models_py3 import Scans from ._models_py3 import ScopeElement from ._models_py3 import SecureScoreControlDefinitionItem from ._models_py3 import SecureScoreControlDefinitionSource @@ -180,12 +198,13 @@ 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 SqlServerVulnerabilityProperties from ._models_py3 import SubAssessmentStatus from ._models_py3 import SuppressionAlertsScope @@ -203,6 +222,7 @@ from ._models_py3 import UpdateIotSecuritySolutionData from ._models_py3 import UserDefinedResourcesProperties from ._models_py3 import UserRecommendation + from ._models_py3 import VaRule from ._models_py3 import VendorReference from ._models_py3 import VmRecommendation from ._models_py3 import WorkspaceSetting @@ -249,6 +269,9 @@ from ._models import AzureResourceIdentifier from ._models import AzureResourceLink from ._models import AzureTrackedResourceLocation + from ._models import Baseline + from ._models import BaselineAdjustedResult + from ._models import BenchmarkReference from ._models import CefExternalSecuritySolution from ._models import CefSolutionProperties from ._models import Compliance @@ -286,11 +309,13 @@ 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 IoTSecurityAggregatedAlert @@ -349,15 +374,28 @@ from ._models import Protocol1 from ._models import ProxyServerProperties from ._models import PublisherInfo + from ._models import QueryCheck from ._models import QueuePurgesNotInAllowedRange from ._models import RecommendationConfigurationProperties from ._models import RegulatoryComplianceAssessment from ._models import RegulatoryComplianceControl from ._models import RegulatoryComplianceStandard + from ._models import Remediation from ._models import Resource from ._models import ResourceDetails from ._models import ResourceIdentifier from ._models import Rule + from ._models import RuleResults + from ._models import RuleResultsInput + from ._models import RuleResultsProperties + from ._models import RulesResults + from ._models import RulesResultsInput + from ._models import Scan + from ._models import ScanProperties + from ._models import ScanResult + from ._models import ScanResultProperties + from ._models import ScanResults + from ._models import Scans from ._models import ScopeElement from ._models import SecureScoreControlDefinitionItem from ._models import SecureScoreControlDefinitionSource @@ -377,12 +415,13 @@ 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 SqlServerVulnerabilityProperties from ._models import SubAssessmentStatus from ._models import SuppressionAlertsScope @@ -400,6 +439,7 @@ from ._models import UpdateIotSecuritySolutionData from ._models import UserDefinedResourcesProperties from ._models import UserRecommendation + from ._models import VaRule from ._models import VendorReference from ._models import VmRecommendation from ._models import WorkspaceSetting @@ -418,7 +458,9 @@ 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 IoTSecurityAggregatedAlertPaged from ._paged_models import IoTSecurityAggregatedRecommendationPaged @@ -486,6 +528,11 @@ HybridComputeProvisioningState, AuthenticationProvisioningState, PermissionProperty, + ScanTriggerType, + ScanState, + RuleStatus, + RuleSeverity, + RuleType, VersionKind, MacSignificance, RelationToIpStatus, @@ -544,6 +591,9 @@ 'AzureResourceIdentifier', 'AzureResourceLink', 'AzureTrackedResourceLocation', + 'Baseline', + 'BaselineAdjustedResult', + 'BenchmarkReference', 'CefExternalSecuritySolution', 'CefSolutionProperties', 'Compliance', @@ -581,11 +631,13 @@ 'InformationProtectionPolicy', 'InformationType', 'IotAlert', + 'IotAlertModel', 'IotAlertType', 'IotAlertTypeList', 'IotDefenderSettingsList', 'IotDefenderSettingsModel', 'IotRecommendation', + 'IotRecommendationModel', 'IotRecommendationType', 'IotRecommendationTypeList', 'IoTSecurityAggregatedAlert', @@ -644,15 +696,28 @@ 'Protocol1', 'ProxyServerProperties', 'PublisherInfo', + 'QueryCheck', 'QueuePurgesNotInAllowedRange', 'RecommendationConfigurationProperties', 'RegulatoryComplianceAssessment', 'RegulatoryComplianceControl', 'RegulatoryComplianceStandard', + 'Remediation', 'Resource', 'ResourceDetails', 'ResourceIdentifier', 'Rule', + 'RuleResults', + 'RuleResultsInput', + 'RuleResultsProperties', + 'RulesResults', + 'RulesResultsInput', + 'Scan', + 'ScanProperties', + 'ScanResult', + 'ScanResultProperties', + 'ScanResults', + 'Scans', 'ScopeElement', 'SecureScoreControlDefinitionItem', 'SecureScoreControlDefinitionSource', @@ -672,12 +737,13 @@ 'SecurityTask', 'SecurityTaskParameters', 'SensitivityLabel', + 'Sensor', 'ServerVulnerabilityAssessment', 'ServerVulnerabilityAssessmentsList', 'ServerVulnerabilityProperties', 'ServicePrincipalProperties', 'Setting', - 'SettingResource', + 'Site', 'SqlServerVulnerabilityProperties', 'SubAssessmentStatus', 'SuppressionAlertsScope', @@ -695,6 +761,7 @@ 'UpdateIotSecuritySolutionData', 'UserDefinedResourcesProperties', 'UserRecommendation', + 'VaRule', 'VendorReference', 'VmRecommendation', 'WorkspaceSetting', @@ -705,7 +772,9 @@ 'IoTSecurityAggregatedAlertPaged', 'IoTSecurityAggregatedRecommendationPaged', 'IotAlertPaged', + 'IotAlertModelPaged', 'IotRecommendationPaged', + 'IotRecommendationModelPaged', 'AscLocationPaged', 'OperationPaged', 'SecurityTaskPaged', @@ -780,6 +849,11 @@ 'HybridComputeProvisioningState', 'AuthenticationProvisioningState', 'PermissionProperty', + 'ScanTriggerType', + 'ScanState', + 'RuleStatus', + 'RuleSeverity', + 'RuleType', 'VersionKind', 'MacSignificance', 'RelationToIpStatus', 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 66bda5c2b521..e1a038916250 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 @@ -1911,8 +1911,8 @@ def __init__(self, **kwargs): class AwAssumeRoleAuthenticationDetailsProperties(AuthenticationDetailsProperties): """AWS cloud account connector based assume role, the role enables delegating - access to your AWS resources. The role is composed of role arn and external - id, for more details, refer to Creating a Role to Delegate Permissions to an IAM User (write only). @@ -1969,7 +1969,7 @@ def __init__(self, **kwargs): class AwsCredsAuthenticationDetailsProperties(AuthenticationDetailsProperties): """AWS cloud account connector based credentials, the credentials is composed - of access key id and secret key, for more details, refer to Creating an IAM User in Your AWS Account (write only). @@ -2183,6 +2183,75 @@ def __init__(self, **kwargs): self.location = kwargs.get('location', None) +class Baseline(Model): + """Baseline details. + + :param expected_results: Expected results. + :type expected_results: list[list[str]] + :param updated_time: Baseline update time (UTC). + :type updated_time: datetime + """ + + _attribute_map = { + 'expected_results': {'key': 'expectedResults', 'type': '[[str]]'}, + 'updated_time': {'key': 'updatedTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(Baseline, self).__init__(**kwargs) + self.expected_results = kwargs.get('expected_results', None) + self.updated_time = kwargs.get('updated_time', None) + + +class BaselineAdjustedResult(Model): + """The rule result adjusted with baseline. + + :param baseline: + :type baseline: ~azure.mgmt.security.models.Baseline + :param status: Possible values include: 'NonFinding', 'Finding', + 'InternalError' + :type status: str or ~azure.mgmt.security.models.RuleStatus + :param results_not_in_baseline: Results the are not in baseline. + :type results_not_in_baseline: list[list[str]] + :param results_only_in_baseline: Results the are in baseline. + :type results_only_in_baseline: list[list[str]] + """ + + _attribute_map = { + 'baseline': {'key': 'baseline', 'type': 'Baseline'}, + 'status': {'key': 'status', 'type': 'str'}, + 'results_not_in_baseline': {'key': 'resultsNotInBaseline', 'type': '[[str]]'}, + 'results_only_in_baseline': {'key': 'resultsOnlyInBaseline', 'type': '[[str]]'}, + } + + def __init__(self, **kwargs): + super(BaselineAdjustedResult, self).__init__(**kwargs) + self.baseline = kwargs.get('baseline', None) + self.status = kwargs.get('status', None) + self.results_not_in_baseline = kwargs.get('results_not_in_baseline', None) + self.results_only_in_baseline = kwargs.get('results_only_in_baseline', None) + + +class BenchmarkReference(Model): + """The benchmark references. + + :param benchmark: The benchmark name. + :type benchmark: str + :param reference: The benchmark reference. + :type reference: str + """ + + _attribute_map = { + 'benchmark': {'key': 'benchmark', 'type': 'str'}, + 'reference': {'key': 'reference', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BenchmarkReference, self).__init__(**kwargs) + self.benchmark = kwargs.get('benchmark', None) + self.reference = kwargs.get('reference', None) + + class CefExternalSecuritySolution(ExternalSecuritySolution): """Represents a security solution which sends CEF logs to an OMS workspace. @@ -2571,8 +2640,8 @@ class ConnectorSetting(Resource): :vartype name: str :ivar type: Resource type :vartype type: str - :param hybrid_compute_settings: Settings for hybrid compute management, - these settings are relevant only Arc autoProvision (Hybrid Compute). + :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, @@ -2720,54 +2789,9 @@ def __init__(self, **kwargs): self.base = None -class SettingResource(Resource): +class Setting(Resource): """The kind of the security setting. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Setting - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param kind: Required. Constant filled by server. - :type kind: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - } - - _subtype_map = { - 'kind': {'Setting': 'Setting'} - } - - def __init__(self, **kwargs): - super(SettingResource, self).__init__(**kwargs) - self.kind = None - self.kind = 'SettingResource' - - -class Setting(SettingResource): - """Represents a security setting in Azure Security Center. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: DataExportSettings @@ -2806,6 +2830,7 @@ class Setting(SettingResource): def __init__(self, **kwargs): super(Setting, self).__init__(**kwargs) + self.kind = None self.kind = 'Setting' @@ -2969,13 +2994,10 @@ class Device(Resource): :vartype last_scan_time: datetime :ivar risk_score: risk score of the device. :vartype risk_score: int - :ivar sensor_name: When the device is unmanaged, the sensor that scanned - this device. - :vartype sensor_name: str - :ivar site_name: The sensor site name. - :vartype site_name: str - :ivar zone_name: The sensor zone name. - :vartype zone_name: str + :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 @@ -2999,9 +3021,8 @@ class Device(Resource): 'scanning_functionality': {'readonly': True}, 'last_scan_time': {'readonly': True}, 'risk_score': {'readonly': True, 'maximum': 100, 'minimum': 0}, - 'sensor_name': {'readonly': True}, - 'site_name': {'readonly': True}, - 'zone_name': {'readonly': True}, + 'sensors': {'readonly': True}, + 'site': {'readonly': True}, 'device_status': {'readonly': True}, } @@ -3030,9 +3051,8 @@ class Device(Resource): 'scanning_functionality': {'key': 'properties.scanningFunctionality', 'type': 'str'}, 'last_scan_time': {'key': 'properties.lastScanTime', 'type': 'iso-8601'}, 'risk_score': {'key': 'properties.riskScore', 'type': 'int'}, - 'sensor_name': {'key': 'properties.sensorName', 'type': 'str'}, - 'site_name': {'key': 'properties.siteName', 'type': 'str'}, - 'zone_name': {'key': 'properties.zoneName', 'type': 'str'}, + 'sensors': {'key': 'properties.sensors', 'type': '[Sensor]'}, + 'site': {'key': 'properties.site', 'type': 'Site'}, 'device_status': {'key': 'properties.deviceStatus', 'type': 'str'}, } @@ -3059,9 +3079,8 @@ def __init__(self, **kwargs): self.scanning_functionality = None self.last_scan_time = None self.risk_score = None - self.sensor_name = None - self.site_name = None - self.zone_name = None + self.sensors = None + self.site = None self.device_status = None @@ -3437,8 +3456,8 @@ def __init__(self, **kwargs): class GcpCredentialsDetailsProperties(AuthenticationDetailsProperties): """GCP cloud account connector based service to service credentials, the - credentials is composed of organization id and json api key (write - only). + credentials are composed of the organization ID and a JSON API key (write + only). Variables are only populated by the server, and will be ignored when sending a request. @@ -3455,14 +3474,14 @@ class GcpCredentialsDetailsProperties(AuthenticationDetailsProperties): ~azure.mgmt.security.models.PermissionProperty] :param authentication_type: Required. Constant filled by server. :type authentication_type: str - :param organization_id: Required. The Organization ID of the GCP cloud + :param organization_id: Required. The organization ID of the GCP cloud account :type organization_id: str :param type: Required. Type field of the API key (write only) :type type: str - :param project_id: Required. Project Id field of the API key (write only) + :param project_id: Required. Project ID field of the API key (write only) :type project_id: str - :param private_key_id: Required. Private key Id field of the API key + :param private_key_id: Required. Private key ID field of the API key (write only) :type private_key_id: str :param private_key: Required. Private key field of the API key (write @@ -3471,16 +3490,16 @@ class GcpCredentialsDetailsProperties(AuthenticationDetailsProperties): :param client_email: Required. Client email field of the API key (write only) :type client_email: str - :param client_id: Required. Client Id field of the API key (write only) + :param client_id: Required. Client ID field of the API key (write only) :type client_id: str - :param auth_uri: Required. Auth Uri field of the API key (write only) + :param auth_uri: Required. Auth URI field of the API key (write only) :type auth_uri: str - :param token_uri: Required. Token Uri field of the API key (write only) + :param token_uri: Required. Token URI field of the API key (write only) :type token_uri: str :param auth_provider_x509_cert_url: Required. Auth provider x509 - certificate url field of the API key (write only) + certificate URL field of the API key (write only) :type auth_provider_x509_cert_url: str - :param client_x509_cert_url: Required. Client x509 certificate url field + :param client_x509_cert_url: Required. Client x509 certificate URL field of the API key (write only) :type client_x509_cert_url: str """ @@ -3702,7 +3721,7 @@ class HybridComputeSettingsProperties(Model): :param resource_group_name: The name of the resource group where Arc (Hybrid Compute) connectors are connected. :type resource_group_name: str - :param region: The location where the meta data of machines will be stored + :param region: The location where the metadata of machines will be stored :type region: str :param proxy_server: For a non-Azure machine that is not connected directly to the internet, specify a proxy server that the non-Azure @@ -3915,6 +3934,62 @@ def __init__(self, **kwargs): 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. @@ -4132,6 +4207,56 @@ def __init__(self, **kwargs): self.recommendation_additional_data = kwargs.get('recommendation_additional_data', None) +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 + """ + + _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, **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. @@ -6396,6 +6521,30 @@ def __init__(self, **kwargs): self.version = kwargs.get('version', None) +class QueryCheck(Model): + """The rule query details. + + :param query: The rule query. + :type query: str + :param expected_result: Expected result. + :type expected_result: list[list[str]] + :param column_names: Column names of expected result. + :type column_names: list[str] + """ + + _attribute_map = { + 'query': {'key': 'query', 'type': 'str'}, + 'expected_result': {'key': 'expectedResult', 'type': '[[str]]'}, + 'column_names': {'key': 'columnNames', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(QueryCheck, self).__init__(**kwargs) + self.query = kwargs.get('query', None) + self.expected_result = kwargs.get('expected_result', None) + self.column_names = kwargs.get('column_names', None) + + class QueuePurgesNotInAllowedRange(TimeWindowCustomAlertRule): """Number of device queue purges is not in allowed range. @@ -6688,6 +6837,34 @@ def __init__(self, **kwargs): self.unsupported_controls = None +class Remediation(Model): + """Remediation details. + + :param description: Remediation description. + :type description: str + :param scripts: Remediation script. + :type scripts: list[str] + :param automated: Is remediation automated. + :type automated: bool + :param portal_link: Optional link to remediate in Azure Portal. + :type portal_link: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'scripts': {'key': 'scripts', 'type': '[str]'}, + 'automated': {'key': 'automated', 'type': 'bool'}, + 'portal_link': {'key': 'portalLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Remediation, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.scripts = kwargs.get('scripts', None) + self.automated = kwargs.get('automated', None) + self.portal_link = kwargs.get('portal_link', None) + + class Rule(Model): """Describes remote addresses that is recommended to communicate with the Azure resource on some (Protocol, Port, Direction). All other remote @@ -6726,6 +6903,330 @@ def __init__(self, **kwargs): self.ip_addresses = kwargs.get('ip_addresses', None) +class RuleResults(Resource): + """Rule results. + + 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: + :type properties: ~azure.mgmt.security.models.RuleResultsProperties + """ + + _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': 'RuleResultsProperties'}, + } + + def __init__(self, **kwargs): + super(RuleResults, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class RuleResultsInput(Model): + """Rule results input. + + :param latest_scan: Take results from latest scan. + :type latest_scan: bool + :param results: Expected results to be inserted into the baseline. + Leave this field empty it LatestScan == true. + :type results: list[list[str]] + """ + + _attribute_map = { + 'latest_scan': {'key': 'latestScan', 'type': 'bool'}, + 'results': {'key': 'results', 'type': '[[str]]'}, + } + + def __init__(self, **kwargs): + super(RuleResultsInput, self).__init__(**kwargs) + self.latest_scan = kwargs.get('latest_scan', None) + self.results = kwargs.get('results', None) + + +class RuleResultsProperties(Model): + """Rule results properties. + + :param results: Expected results in the baseline. + :type results: list[list[str]] + """ + + _attribute_map = { + 'results': {'key': 'results', 'type': '[[str]]'}, + } + + def __init__(self, **kwargs): + super(RuleResultsProperties, self).__init__(**kwargs) + self.results = kwargs.get('results', None) + + +class RulesResults(Model): + """A list of rules results. + + :param value: List of rule results. + :type value: list[~azure.mgmt.security.models.RuleResults] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RuleResults]'}, + } + + def __init__(self, **kwargs): + super(RulesResults, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class RulesResultsInput(Model): + """Rules results input. + + :param latest_scan: Take results from latest scan. + :type latest_scan: bool + :param results: Expected results to be inserted into the baseline. + Leave this field empty it LatestScan == true. + :type results: dict[str, list[list[str]]] + """ + + _attribute_map = { + 'latest_scan': {'key': 'latestScan', 'type': 'bool'}, + 'results': {'key': 'results', 'type': '{[[str]]}'}, + } + + def __init__(self, **kwargs): + super(RulesResultsInput, self).__init__(**kwargs) + self.latest_scan = kwargs.get('latest_scan', None) + self.results = kwargs.get('results', None) + + +class Scan(Resource): + """A vulnerability assessment scan record. + + 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: + :type properties: ~azure.mgmt.security.models.ScanProperties + """ + + _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': 'ScanProperties'}, + } + + def __init__(self, **kwargs): + super(Scan, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ScanProperties(Model): + """A vulnerability assessment scan record properties. + + :param trigger_type: Possible values include: 'OnDemand', 'Recurring' + :type trigger_type: str or ~azure.mgmt.security.models.ScanTriggerType + :param state: Possible values include: 'Failed', 'FailedToRun', + 'InProgress', 'Passed' + :type state: str or ~azure.mgmt.security.models.ScanState + :param server: The server name. + :type server: str + :param database: The database name. + :type database: str + :param sql_version: The SQL version. + :type sql_version: str + :param start_time: The scan start time (UTC). + :type start_time: datetime + :param end_time: Scan results are valid until end time (UTC). + :type end_time: datetime + :param high_severity_failed_rules_count: The number of failed rules with + high severity. + :type high_severity_failed_rules_count: int + :param medium_severity_failed_rules_count: The number of failed rules with + medium severity. + :type medium_severity_failed_rules_count: int + :param low_severity_failed_rules_count: The number of failed rules with + low severity. + :type low_severity_failed_rules_count: int + :param total_passed_rules_count: The number of total passed rules. + :type total_passed_rules_count: int + :param total_failed_rules_count: The number of total failed rules. + :type total_failed_rules_count: int + :param total_rules_count: The number of total rules assessed. + :type total_rules_count: int + :param is_baseline_applied: Baseline created for this database, and has + one or more rules. + :type is_baseline_applied: bool + """ + + _attribute_map = { + 'trigger_type': {'key': 'triggerType', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'server': {'key': 'server', 'type': 'str'}, + 'database': {'key': 'database', 'type': 'str'}, + 'sql_version': {'key': 'sqlVersion', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'high_severity_failed_rules_count': {'key': 'highSeverityFailedRulesCount', 'type': 'int'}, + 'medium_severity_failed_rules_count': {'key': 'mediumSeverityFailedRulesCount', 'type': 'int'}, + 'low_severity_failed_rules_count': {'key': 'lowSeverityFailedRulesCount', 'type': 'int'}, + 'total_passed_rules_count': {'key': 'totalPassedRulesCount', 'type': 'int'}, + 'total_failed_rules_count': {'key': 'totalFailedRulesCount', 'type': 'int'}, + 'total_rules_count': {'key': 'totalRulesCount', 'type': 'int'}, + 'is_baseline_applied': {'key': 'isBaselineApplied', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ScanProperties, self).__init__(**kwargs) + self.trigger_type = kwargs.get('trigger_type', None) + self.state = kwargs.get('state', None) + self.server = kwargs.get('server', None) + self.database = kwargs.get('database', None) + self.sql_version = kwargs.get('sql_version', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.high_severity_failed_rules_count = kwargs.get('high_severity_failed_rules_count', None) + self.medium_severity_failed_rules_count = kwargs.get('medium_severity_failed_rules_count', None) + self.low_severity_failed_rules_count = kwargs.get('low_severity_failed_rules_count', None) + self.total_passed_rules_count = kwargs.get('total_passed_rules_count', None) + self.total_failed_rules_count = kwargs.get('total_failed_rules_count', None) + self.total_rules_count = kwargs.get('total_rules_count', None) + self.is_baseline_applied = kwargs.get('is_baseline_applied', None) + + +class ScanResult(Resource): + """A vulnerability assessment scan result for a single rule. + + 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: + :type properties: ~azure.mgmt.security.models.ScanResultProperties + """ + + _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': 'ScanResultProperties'}, + } + + def __init__(self, **kwargs): + super(ScanResult, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ScanResultProperties(Model): + """A vulnerability assessment scan result properties for a single rule. + + :param rule_id: The rule Id. + :type rule_id: str + :param status: Possible values include: 'NonFinding', 'Finding', + 'InternalError' + :type status: str or ~azure.mgmt.security.models.RuleStatus + :param is_trimmed: Indicated whether the results specified here are + trimmed. + :type is_trimmed: bool + :param query_results: The results of the query that was run. + :type query_results: list[list[str]] + :param remediation: + :type remediation: ~azure.mgmt.security.models.Remediation + :param baseline_adjusted_result: + :type baseline_adjusted_result: + ~azure.mgmt.security.models.BaselineAdjustedResult + :param rule_metadata: + :type rule_metadata: ~azure.mgmt.security.models.VaRule + """ + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'is_trimmed': {'key': 'isTrimmed', 'type': 'bool'}, + 'query_results': {'key': 'queryResults', 'type': '[[str]]'}, + 'remediation': {'key': 'remediation', 'type': 'Remediation'}, + 'baseline_adjusted_result': {'key': 'baselineAdjustedResult', 'type': 'BaselineAdjustedResult'}, + 'rule_metadata': {'key': 'ruleMetadata', 'type': 'VaRule'}, + } + + def __init__(self, **kwargs): + super(ScanResultProperties, self).__init__(**kwargs) + self.rule_id = kwargs.get('rule_id', None) + self.status = kwargs.get('status', None) + self.is_trimmed = kwargs.get('is_trimmed', None) + self.query_results = kwargs.get('query_results', None) + self.remediation = kwargs.get('remediation', None) + self.baseline_adjusted_result = kwargs.get('baseline_adjusted_result', None) + self.rule_metadata = kwargs.get('rule_metadata', None) + + +class ScanResults(Model): + """A list of vulnerability assessment scan results. + + :param value: List of vulnerability assessment scan results. + :type value: list[~azure.mgmt.security.models.ScanResult] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ScanResult]'}, + } + + def __init__(self, **kwargs): + super(ScanResults, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class Scans(Model): + """A list of vulnerability assessment scan records. + + :param value: List of vulnerability assessment scan records. + :type value: list[~azure.mgmt.security.models.Scan] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Scan]'}, + } + + def __init__(self, **kwargs): + super(Scans, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + class ScopeElement(Model): """A more specific scope used to identify the alerts to suppress. @@ -7708,6 +8209,34 @@ 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. @@ -7827,7 +8356,7 @@ def __init__(self, **kwargs): class ServicePrincipalProperties(Model): """Details of the service principal. - :param application_id: Application id of service principal. + :param application_id: Application ID of service principal. :type application_id: str :param secret: A secret string that the application uses to prove its identity, also can be referred to as application password (write only). @@ -7845,6 +8374,29 @@ def __init__(self, **kwargs): self.secret = kwargs.get('secret', None) +class Site(Model): + """Site 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 + """ + + _validation = { + 'display_name': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Site, self).__init__(**kwargs) + self.display_name = None + + class SqlServerVulnerabilityProperties(AdditionalData): """Details of the resource that was assessed. @@ -8316,6 +8868,57 @@ def __init__(self, **kwargs): self.recommendation_action = kwargs.get('recommendation_action', None) +class VaRule(Model): + """vulnerability assessment rule metadata details. + + :param rule_id: The rule Id. + :type rule_id: str + :param severity: Possible values include: 'High', 'Medium', 'Low', + 'Informational', 'Obsolete' + :type severity: str or ~azure.mgmt.security.models.RuleSeverity + :param category: The rule category. + :type category: str + :param rule_type: Possible values include: 'Binary', 'BaselineExpected', + 'PositiveList', 'NegativeList' + :type rule_type: str or ~azure.mgmt.security.models.RuleType + :param title: The rule title. + :type title: str + :param description: The rule description. + :type description: str + :param rationale: The rule rationale. + :type rationale: str + :param query_check: + :type query_check: ~azure.mgmt.security.models.QueryCheck + :param benchmark_references: The benchmark references. + :type benchmark_references: + list[~azure.mgmt.security.models.BenchmarkReference] + """ + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'title': {'key': 'title', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rationale': {'key': 'rationale', 'type': 'str'}, + 'query_check': {'key': 'queryCheck', 'type': 'QueryCheck'}, + 'benchmark_references': {'key': 'benchmarkReferences', 'type': '[BenchmarkReference]'}, + } + + def __init__(self, **kwargs): + super(VaRule, self).__init__(**kwargs) + self.rule_id = kwargs.get('rule_id', None) + self.severity = kwargs.get('severity', None) + self.category = kwargs.get('category', None) + self.rule_type = kwargs.get('rule_type', None) + self.title = kwargs.get('title', None) + self.description = kwargs.get('description', None) + self.rationale = kwargs.get('rationale', None) + self.query_check = kwargs.get('query_check', None) + self.benchmark_references = kwargs.get('benchmark_references', None) + + class VendorReference(Model): """Vendor reference. 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 75e17c9195ef..71a9b98bdae5 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 @@ -1911,8 +1911,8 @@ def __init__(self, *, auto_provision, **kwargs) -> None: class AwAssumeRoleAuthenticationDetailsProperties(AuthenticationDetailsProperties): """AWS cloud account connector based assume role, the role enables delegating - access to your AWS resources. The role is composed of role arn and external - id, for more details, refer to Creating a Role to Delegate Permissions to an IAM User (write only). @@ -1969,7 +1969,7 @@ def __init__(self, *, aws_assume_role_arn: str, aws_external_id: str, **kwargs) class AwsCredsAuthenticationDetailsProperties(AuthenticationDetailsProperties): """AWS cloud account connector based credentials, the credentials is composed - of access key id and secret key, for more details, refer to Creating an IAM User in Your AWS Account (write only). @@ -2183,6 +2183,75 @@ def __init__(self, *, location: str=None, **kwargs) -> None: self.location = location +class Baseline(Model): + """Baseline details. + + :param expected_results: Expected results. + :type expected_results: list[list[str]] + :param updated_time: Baseline update time (UTC). + :type updated_time: datetime + """ + + _attribute_map = { + 'expected_results': {'key': 'expectedResults', 'type': '[[str]]'}, + 'updated_time': {'key': 'updatedTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, expected_results=None, updated_time=None, **kwargs) -> None: + super(Baseline, self).__init__(**kwargs) + self.expected_results = expected_results + self.updated_time = updated_time + + +class BaselineAdjustedResult(Model): + """The rule result adjusted with baseline. + + :param baseline: + :type baseline: ~azure.mgmt.security.models.Baseline + :param status: Possible values include: 'NonFinding', 'Finding', + 'InternalError' + :type status: str or ~azure.mgmt.security.models.RuleStatus + :param results_not_in_baseline: Results the are not in baseline. + :type results_not_in_baseline: list[list[str]] + :param results_only_in_baseline: Results the are in baseline. + :type results_only_in_baseline: list[list[str]] + """ + + _attribute_map = { + 'baseline': {'key': 'baseline', 'type': 'Baseline'}, + 'status': {'key': 'status', 'type': 'str'}, + 'results_not_in_baseline': {'key': 'resultsNotInBaseline', 'type': '[[str]]'}, + 'results_only_in_baseline': {'key': 'resultsOnlyInBaseline', 'type': '[[str]]'}, + } + + def __init__(self, *, baseline=None, status=None, results_not_in_baseline=None, results_only_in_baseline=None, **kwargs) -> None: + super(BaselineAdjustedResult, self).__init__(**kwargs) + self.baseline = baseline + self.status = status + self.results_not_in_baseline = results_not_in_baseline + self.results_only_in_baseline = results_only_in_baseline + + +class BenchmarkReference(Model): + """The benchmark references. + + :param benchmark: The benchmark name. + :type benchmark: str + :param reference: The benchmark reference. + :type reference: str + """ + + _attribute_map = { + 'benchmark': {'key': 'benchmark', 'type': 'str'}, + 'reference': {'key': 'reference', 'type': 'str'}, + } + + def __init__(self, *, benchmark: str=None, reference: str=None, **kwargs) -> None: + super(BenchmarkReference, self).__init__(**kwargs) + self.benchmark = benchmark + self.reference = reference + + class CefExternalSecuritySolution(ExternalSecuritySolution): """Represents a security solution which sends CEF logs to an OMS workspace. @@ -2571,8 +2640,8 @@ class ConnectorSetting(Resource): :vartype name: str :ivar type: Resource type :vartype type: str - :param hybrid_compute_settings: Settings for hybrid compute management, - these settings are relevant only Arc autoProvision (Hybrid Compute). + :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, @@ -2720,54 +2789,9 @@ def __init__(self, **kwargs) -> None: self.base = None -class SettingResource(Resource): +class Setting(Resource): """The kind of the security setting. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Setting - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param kind: Required. Constant filled by server. - :type kind: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - } - - _subtype_map = { - 'kind': {'Setting': 'Setting'} - } - - def __init__(self, **kwargs) -> None: - super(SettingResource, self).__init__(**kwargs) - self.kind = None - self.kind = 'SettingResource' - - -class Setting(SettingResource): - """Represents a security setting in Azure Security Center. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: DataExportSettings @@ -2806,6 +2830,7 @@ class Setting(SettingResource): def __init__(self, **kwargs) -> None: super(Setting, self).__init__(**kwargs) + self.kind = None self.kind = 'Setting' @@ -2969,13 +2994,10 @@ class Device(Resource): :vartype last_scan_time: datetime :ivar risk_score: risk score of the device. :vartype risk_score: int - :ivar sensor_name: When the device is unmanaged, the sensor that scanned - this device. - :vartype sensor_name: str - :ivar site_name: The sensor site name. - :vartype site_name: str - :ivar zone_name: The sensor zone name. - :vartype zone_name: str + :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 @@ -2999,9 +3021,8 @@ class Device(Resource): 'scanning_functionality': {'readonly': True}, 'last_scan_time': {'readonly': True}, 'risk_score': {'readonly': True, 'maximum': 100, 'minimum': 0}, - 'sensor_name': {'readonly': True}, - 'site_name': {'readonly': True}, - 'zone_name': {'readonly': True}, + 'sensors': {'readonly': True}, + 'site': {'readonly': True}, 'device_status': {'readonly': True}, } @@ -3030,9 +3051,8 @@ class Device(Resource): 'scanning_functionality': {'key': 'properties.scanningFunctionality', 'type': 'str'}, 'last_scan_time': {'key': 'properties.lastScanTime', 'type': 'iso-8601'}, 'risk_score': {'key': 'properties.riskScore', 'type': 'int'}, - 'sensor_name': {'key': 'properties.sensorName', 'type': 'str'}, - 'site_name': {'key': 'properties.siteName', 'type': 'str'}, - 'zone_name': {'key': 'properties.zoneName', 'type': 'str'}, + 'sensors': {'key': 'properties.sensors', 'type': '[Sensor]'}, + 'site': {'key': 'properties.site', 'type': 'Site'}, 'device_status': {'key': 'properties.deviceStatus', 'type': 'str'}, } @@ -3059,9 +3079,8 @@ def __init__(self, *, display_name: str=None, device_type: str=None, os_name: st self.scanning_functionality = None self.last_scan_time = None self.risk_score = None - self.sensor_name = None - self.site_name = None - self.zone_name = None + self.sensors = None + self.site = None self.device_status = None @@ -3437,8 +3456,8 @@ def __init__(self, **kwargs) -> None: class GcpCredentialsDetailsProperties(AuthenticationDetailsProperties): """GCP cloud account connector based service to service credentials, the - credentials is composed of organization id and json api key (write - only). + credentials are composed of the organization ID and a JSON API key (write + only). Variables are only populated by the server, and will be ignored when sending a request. @@ -3455,14 +3474,14 @@ class GcpCredentialsDetailsProperties(AuthenticationDetailsProperties): ~azure.mgmt.security.models.PermissionProperty] :param authentication_type: Required. Constant filled by server. :type authentication_type: str - :param organization_id: Required. The Organization ID of the GCP cloud + :param organization_id: Required. The organization ID of the GCP cloud account :type organization_id: str :param type: Required. Type field of the API key (write only) :type type: str - :param project_id: Required. Project Id field of the API key (write only) + :param project_id: Required. Project ID field of the API key (write only) :type project_id: str - :param private_key_id: Required. Private key Id field of the API key + :param private_key_id: Required. Private key ID field of the API key (write only) :type private_key_id: str :param private_key: Required. Private key field of the API key (write @@ -3471,16 +3490,16 @@ class GcpCredentialsDetailsProperties(AuthenticationDetailsProperties): :param client_email: Required. Client email field of the API key (write only) :type client_email: str - :param client_id: Required. Client Id field of the API key (write only) + :param client_id: Required. Client ID field of the API key (write only) :type client_id: str - :param auth_uri: Required. Auth Uri field of the API key (write only) + :param auth_uri: Required. Auth URI field of the API key (write only) :type auth_uri: str - :param token_uri: Required. Token Uri field of the API key (write only) + :param token_uri: Required. Token URI field of the API key (write only) :type token_uri: str :param auth_provider_x509_cert_url: Required. Auth provider x509 - certificate url field of the API key (write only) + certificate URL field of the API key (write only) :type auth_provider_x509_cert_url: str - :param client_x509_cert_url: Required. Client x509 certificate url field + :param client_x509_cert_url: Required. Client x509 certificate URL field of the API key (write only) :type client_x509_cert_url: str """ @@ -3702,7 +3721,7 @@ class HybridComputeSettingsProperties(Model): :param resource_group_name: The name of the resource group where Arc (Hybrid Compute) connectors are connected. :type resource_group_name: str - :param region: The location where the meta data of machines will be stored + :param region: The location where the metadata of machines will be stored :type region: str :param proxy_server: For a non-Azure machine that is not connected directly to the internet, specify a proxy server that the non-Azure @@ -3915,6 +3934,62 @@ def __init__(self, *, entities=None, extended_properties=None, **kwargs) -> None 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. @@ -4132,6 +4207,56 @@ def __init__(self, *, recommendation_additional_data=None, **kwargs) -> 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 + """ + + _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(IotRecommendationModel, self).__init__(**kwargs) + self.device_id = None + self.recommendation_type = None + self.discovered_time_utc = None + self.recommendation_additional_data = recommendation_additional_data + + class IotRecommendationType(Resource): """IoT recommendation type. @@ -6396,6 +6521,30 @@ def __init__(self, *, publisher_name: str=None, product_name: str=None, binary_n self.version = version +class QueryCheck(Model): + """The rule query details. + + :param query: The rule query. + :type query: str + :param expected_result: Expected result. + :type expected_result: list[list[str]] + :param column_names: Column names of expected result. + :type column_names: list[str] + """ + + _attribute_map = { + 'query': {'key': 'query', 'type': 'str'}, + 'expected_result': {'key': 'expectedResult', 'type': '[[str]]'}, + 'column_names': {'key': 'columnNames', 'type': '[str]'}, + } + + def __init__(self, *, query: str=None, expected_result=None, column_names=None, **kwargs) -> None: + super(QueryCheck, self).__init__(**kwargs) + self.query = query + self.expected_result = expected_result + self.column_names = column_names + + class QueuePurgesNotInAllowedRange(TimeWindowCustomAlertRule): """Number of device queue purges is not in allowed range. @@ -6688,6 +6837,34 @@ def __init__(self, *, state=None, **kwargs) -> None: self.unsupported_controls = None +class Remediation(Model): + """Remediation details. + + :param description: Remediation description. + :type description: str + :param scripts: Remediation script. + :type scripts: list[str] + :param automated: Is remediation automated. + :type automated: bool + :param portal_link: Optional link to remediate in Azure Portal. + :type portal_link: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'scripts': {'key': 'scripts', 'type': '[str]'}, + 'automated': {'key': 'automated', 'type': 'bool'}, + 'portal_link': {'key': 'portalLink', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, scripts=None, automated: bool=None, portal_link: str=None, **kwargs) -> None: + super(Remediation, self).__init__(**kwargs) + self.description = description + self.scripts = scripts + self.automated = automated + self.portal_link = portal_link + + class Rule(Model): """Describes remote addresses that is recommended to communicate with the Azure resource on some (Protocol, Port, Direction). All other remote @@ -6726,6 +6903,330 @@ def __init__(self, *, name: str=None, direction=None, destination_port: int=None self.ip_addresses = ip_addresses +class RuleResults(Resource): + """Rule results. + + 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: + :type properties: ~azure.mgmt.security.models.RuleResultsProperties + """ + + _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': 'RuleResultsProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(RuleResults, self).__init__(**kwargs) + self.properties = properties + + +class RuleResultsInput(Model): + """Rule results input. + + :param latest_scan: Take results from latest scan. + :type latest_scan: bool + :param results: Expected results to be inserted into the baseline. + Leave this field empty it LatestScan == true. + :type results: list[list[str]] + """ + + _attribute_map = { + 'latest_scan': {'key': 'latestScan', 'type': 'bool'}, + 'results': {'key': 'results', 'type': '[[str]]'}, + } + + def __init__(self, *, latest_scan: bool=None, results=None, **kwargs) -> None: + super(RuleResultsInput, self).__init__(**kwargs) + self.latest_scan = latest_scan + self.results = results + + +class RuleResultsProperties(Model): + """Rule results properties. + + :param results: Expected results in the baseline. + :type results: list[list[str]] + """ + + _attribute_map = { + 'results': {'key': 'results', 'type': '[[str]]'}, + } + + def __init__(self, *, results=None, **kwargs) -> None: + super(RuleResultsProperties, self).__init__(**kwargs) + self.results = results + + +class RulesResults(Model): + """A list of rules results. + + :param value: List of rule results. + :type value: list[~azure.mgmt.security.models.RuleResults] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RuleResults]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(RulesResults, self).__init__(**kwargs) + self.value = value + + +class RulesResultsInput(Model): + """Rules results input. + + :param latest_scan: Take results from latest scan. + :type latest_scan: bool + :param results: Expected results to be inserted into the baseline. + Leave this field empty it LatestScan == true. + :type results: dict[str, list[list[str]]] + """ + + _attribute_map = { + 'latest_scan': {'key': 'latestScan', 'type': 'bool'}, + 'results': {'key': 'results', 'type': '{[[str]]}'}, + } + + def __init__(self, *, latest_scan: bool=None, results=None, **kwargs) -> None: + super(RulesResultsInput, self).__init__(**kwargs) + self.latest_scan = latest_scan + self.results = results + + +class Scan(Resource): + """A vulnerability assessment scan record. + + 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: + :type properties: ~azure.mgmt.security.models.ScanProperties + """ + + _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': 'ScanProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(Scan, self).__init__(**kwargs) + self.properties = properties + + +class ScanProperties(Model): + """A vulnerability assessment scan record properties. + + :param trigger_type: Possible values include: 'OnDemand', 'Recurring' + :type trigger_type: str or ~azure.mgmt.security.models.ScanTriggerType + :param state: Possible values include: 'Failed', 'FailedToRun', + 'InProgress', 'Passed' + :type state: str or ~azure.mgmt.security.models.ScanState + :param server: The server name. + :type server: str + :param database: The database name. + :type database: str + :param sql_version: The SQL version. + :type sql_version: str + :param start_time: The scan start time (UTC). + :type start_time: datetime + :param end_time: Scan results are valid until end time (UTC). + :type end_time: datetime + :param high_severity_failed_rules_count: The number of failed rules with + high severity. + :type high_severity_failed_rules_count: int + :param medium_severity_failed_rules_count: The number of failed rules with + medium severity. + :type medium_severity_failed_rules_count: int + :param low_severity_failed_rules_count: The number of failed rules with + low severity. + :type low_severity_failed_rules_count: int + :param total_passed_rules_count: The number of total passed rules. + :type total_passed_rules_count: int + :param total_failed_rules_count: The number of total failed rules. + :type total_failed_rules_count: int + :param total_rules_count: The number of total rules assessed. + :type total_rules_count: int + :param is_baseline_applied: Baseline created for this database, and has + one or more rules. + :type is_baseline_applied: bool + """ + + _attribute_map = { + 'trigger_type': {'key': 'triggerType', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'server': {'key': 'server', 'type': 'str'}, + 'database': {'key': 'database', 'type': 'str'}, + 'sql_version': {'key': 'sqlVersion', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'high_severity_failed_rules_count': {'key': 'highSeverityFailedRulesCount', 'type': 'int'}, + 'medium_severity_failed_rules_count': {'key': 'mediumSeverityFailedRulesCount', 'type': 'int'}, + 'low_severity_failed_rules_count': {'key': 'lowSeverityFailedRulesCount', 'type': 'int'}, + 'total_passed_rules_count': {'key': 'totalPassedRulesCount', 'type': 'int'}, + 'total_failed_rules_count': {'key': 'totalFailedRulesCount', 'type': 'int'}, + 'total_rules_count': {'key': 'totalRulesCount', 'type': 'int'}, + 'is_baseline_applied': {'key': 'isBaselineApplied', 'type': 'bool'}, + } + + def __init__(self, *, trigger_type=None, state=None, server: str=None, database: str=None, sql_version: str=None, start_time=None, end_time=None, high_severity_failed_rules_count: int=None, medium_severity_failed_rules_count: int=None, low_severity_failed_rules_count: int=None, total_passed_rules_count: int=None, total_failed_rules_count: int=None, total_rules_count: int=None, is_baseline_applied: bool=None, **kwargs) -> None: + super(ScanProperties, self).__init__(**kwargs) + self.trigger_type = trigger_type + self.state = state + self.server = server + self.database = database + self.sql_version = sql_version + self.start_time = start_time + self.end_time = end_time + self.high_severity_failed_rules_count = high_severity_failed_rules_count + self.medium_severity_failed_rules_count = medium_severity_failed_rules_count + self.low_severity_failed_rules_count = low_severity_failed_rules_count + self.total_passed_rules_count = total_passed_rules_count + self.total_failed_rules_count = total_failed_rules_count + self.total_rules_count = total_rules_count + self.is_baseline_applied = is_baseline_applied + + +class ScanResult(Resource): + """A vulnerability assessment scan result for a single rule. + + 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: + :type properties: ~azure.mgmt.security.models.ScanResultProperties + """ + + _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': 'ScanResultProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(ScanResult, self).__init__(**kwargs) + self.properties = properties + + +class ScanResultProperties(Model): + """A vulnerability assessment scan result properties for a single rule. + + :param rule_id: The rule Id. + :type rule_id: str + :param status: Possible values include: 'NonFinding', 'Finding', + 'InternalError' + :type status: str or ~azure.mgmt.security.models.RuleStatus + :param is_trimmed: Indicated whether the results specified here are + trimmed. + :type is_trimmed: bool + :param query_results: The results of the query that was run. + :type query_results: list[list[str]] + :param remediation: + :type remediation: ~azure.mgmt.security.models.Remediation + :param baseline_adjusted_result: + :type baseline_adjusted_result: + ~azure.mgmt.security.models.BaselineAdjustedResult + :param rule_metadata: + :type rule_metadata: ~azure.mgmt.security.models.VaRule + """ + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'is_trimmed': {'key': 'isTrimmed', 'type': 'bool'}, + 'query_results': {'key': 'queryResults', 'type': '[[str]]'}, + 'remediation': {'key': 'remediation', 'type': 'Remediation'}, + 'baseline_adjusted_result': {'key': 'baselineAdjustedResult', 'type': 'BaselineAdjustedResult'}, + 'rule_metadata': {'key': 'ruleMetadata', 'type': 'VaRule'}, + } + + def __init__(self, *, rule_id: str=None, status=None, is_trimmed: bool=None, query_results=None, remediation=None, baseline_adjusted_result=None, rule_metadata=None, **kwargs) -> None: + super(ScanResultProperties, self).__init__(**kwargs) + self.rule_id = rule_id + self.status = status + self.is_trimmed = is_trimmed + self.query_results = query_results + self.remediation = remediation + self.baseline_adjusted_result = baseline_adjusted_result + self.rule_metadata = rule_metadata + + +class ScanResults(Model): + """A list of vulnerability assessment scan results. + + :param value: List of vulnerability assessment scan results. + :type value: list[~azure.mgmt.security.models.ScanResult] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ScanResult]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ScanResults, self).__init__(**kwargs) + self.value = value + + +class Scans(Model): + """A list of vulnerability assessment scan records. + + :param value: List of vulnerability assessment scan records. + :type value: list[~azure.mgmt.security.models.Scan] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Scan]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(Scans, self).__init__(**kwargs) + self.value = value + + class ScopeElement(Model): """A more specific scope used to identify the alerts to suppress. @@ -7708,6 +8209,34 @@ 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. @@ -7827,7 +8356,7 @@ def __init__(self, **kwargs) -> None: class ServicePrincipalProperties(Model): """Details of the service principal. - :param application_id: Application id of service principal. + :param application_id: Application ID of service principal. :type application_id: str :param secret: A secret string that the application uses to prove its identity, also can be referred to as application password (write only). @@ -7845,6 +8374,29 @@ def __init__(self, *, application_id: str=None, secret: str=None, **kwargs) -> N self.secret = secret +class Site(Model): + """Site 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 + """ + + _validation = { + 'display_name': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Site, self).__init__(**kwargs) + self.display_name = None + + class SqlServerVulnerabilityProperties(AdditionalData): """Details of the resource that was assessed. @@ -8316,6 +8868,57 @@ def __init__(self, *, username: str=None, recommendation_action=None, **kwargs) self.recommendation_action = recommendation_action +class VaRule(Model): + """vulnerability assessment rule metadata details. + + :param rule_id: The rule Id. + :type rule_id: str + :param severity: Possible values include: 'High', 'Medium', 'Low', + 'Informational', 'Obsolete' + :type severity: str or ~azure.mgmt.security.models.RuleSeverity + :param category: The rule category. + :type category: str + :param rule_type: Possible values include: 'Binary', 'BaselineExpected', + 'PositiveList', 'NegativeList' + :type rule_type: str or ~azure.mgmt.security.models.RuleType + :param title: The rule title. + :type title: str + :param description: The rule description. + :type description: str + :param rationale: The rule rationale. + :type rationale: str + :param query_check: + :type query_check: ~azure.mgmt.security.models.QueryCheck + :param benchmark_references: The benchmark references. + :type benchmark_references: + list[~azure.mgmt.security.models.BenchmarkReference] + """ + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'title': {'key': 'title', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rationale': {'key': 'rationale', 'type': 'str'}, + 'query_check': {'key': 'queryCheck', 'type': 'QueryCheck'}, + 'benchmark_references': {'key': 'benchmarkReferences', 'type': '[BenchmarkReference]'}, + } + + def __init__(self, *, rule_id: str=None, severity=None, category: str=None, rule_type=None, title: str=None, description: str=None, rationale: str=None, query_check=None, benchmark_references=None, **kwargs) -> None: + super(VaRule, self).__init__(**kwargs) + self.rule_id = rule_id + self.severity = severity + self.category = category + self.rule_type = rule_type + self.title = title + self.description = description + self.rationale = rationale + self.query_check = query_check + self.benchmark_references = benchmark_references + + class VendorReference(Model): """Vendor reference. 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 deb12454bc0c..5dcf2e2766af 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 @@ -103,6 +103,19 @@ class IotAlertPaged(Paged): 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 @@ -116,6 +129,19 @@ class IotRecommendationPaged(Paged): 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 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 df4796d1eef2..651c39085b1f 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 @@ -366,7 +366,7 @@ class AuthenticationProvisioningState(str, Enum): valid = "Valid" #: Valid connector invalid = "Invalid" #: Invalid connector - expired = "Expired" #: the connection is expired + expired = "Expired" #: the connection has expired incorrect_policy = "IncorrectPolicy" #: Incorrect policy of the connector @@ -378,6 +378,44 @@ class PermissionProperty(str, Enum): gcp_security_center_admin_viewer = "GCP::Security Center Admin Viewer" #: This permission provides read only access to GCP Security Command Center. +class ScanTriggerType(str, Enum): + + on_demand = "OnDemand" #: OnDemand + recurring = "Recurring" #: Recurring + + +class ScanState(str, Enum): + + failed = "Failed" #: Failed + failed_to_run = "FailedToRun" #: FailedToRun + in_progress = "InProgress" #: InProgress + passed = "Passed" #: Passed + + +class RuleStatus(str, Enum): + + non_finding = "NonFinding" #: NonFinding + finding = "Finding" #: Finding + internal_error = "InternalError" #: InternalError + + +class RuleSeverity(str, Enum): + + high = "High" #: High + medium = "Medium" #: Medium + low = "Low" #: Low + informational = "Informational" #: Informational + obsolete = "Obsolete" #: Obsolete + + +class RuleType(str, Enum): + + binary = "Binary" #: Binary + baseline_expected = "BaselineExpected" #: BaselineExpected + positive_list = "PositiveList" #: PositiveList + negative_list = "NegativeList" #: NegativeList + + class VersionKind(str, Enum): latest = "Latest" 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 9a85de922f37..751d0d5098d5 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 @@ -53,6 +53,9 @@ from ._secure_score_control_definitions_operations import SecureScoreControlDefinitionsOperations from ._security_solutions_operations import SecuritySolutionsOperations from ._connectors_operations import ConnectorsOperations +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 @@ -105,6 +108,9 @@ 'SecureScoreControlDefinitionsOperations', 'SecuritySolutionsOperations', 'ConnectorsOperations', + 'SqlVulnerabilityAssessmentScansOperations', + 'SqlVulnerabilityAssessmentScanResultsOperations', + 'SqlVulnerabilityAssessmentBaselineRulesOperations', 'IotDefenderSettingsOperations', 'IotSensorsOperations', 'DevicesForSubscriptionOperations', diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_connectors_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_connectors_operations.py index 3b41670485db..ff353c5f6da7 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_connectors_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_connectors_operations.py @@ -166,14 +166,15 @@ def get( def create_or_update( self, connector_name, hybrid_compute_settings=None, authentication_details=None, custom_headers=None, raw=False, **operation_config): """Create a cloud account connector or update an existing one. Connect to - your AWS cloud account using either account credentials or role-based - authentication. + your cloud account. For AWS, use either account credentials or + role-based authentication. For GCP, use account organization + credentials. :param connector_name: Name of the cloud account connector :type connector_name: str :param hybrid_compute_settings: Settings for hybrid compute - management, these settings are relevant only Arc autoProvision (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, diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_alert_types_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_alert_types_operations.py index 7cf80ec7889b..68a582e8109d 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_alert_types_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_alert_types_operations.py @@ -25,7 +25,6 @@ class IotAlertTypesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2019-08-01". """ models = models @@ -35,7 +34,6 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-08-01" self.config = config @@ -58,6 +56,8 @@ def list( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ + api_version = "2019-08-01" + # Construct URL url = self.list.metadata['url'] path_format_arguments = { @@ -69,7 +69,7 @@ def list( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -122,6 +122,8 @@ def get( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ + api_version = "2019-08-01" + # Construct URL url = self.get.metadata['url'] path_format_arguments = { @@ -134,7 +136,7 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -165,3 +167,120 @@ def get( 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 index a59f568d1920..8f4e3128008b 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_alerts_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_alerts_operations.py @@ -25,7 +25,6 @@ class IotAlertsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2019-08-01". """ models = models @@ -35,7 +34,6 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-08-01" self.config = config @@ -72,6 +70,8 @@ def list( ~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 @@ -85,7 +85,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + 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: @@ -159,6 +159,8 @@ def get( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ + api_version = "2019-08-01" + # Construct URL url = self.get.metadata['url'] path_format_arguments = { @@ -171,7 +173,7 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -202,3 +204,171 @@ def get( 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 index 743ca835bbab..2ac1dadc2e86 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_recommendation_types_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_recommendation_types_operations.py @@ -25,7 +25,6 @@ class IotRecommendationTypesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2019-08-01". """ models = models @@ -35,7 +34,6 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-08-01" self.config = config @@ -58,6 +56,8 @@ def list( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ + api_version = "2019-08-01" + # Construct URL url = self.list.metadata['url'] path_format_arguments = { @@ -69,7 +69,7 @@ def list( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -122,6 +122,8 @@ def get( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ + api_version = "2019-08-01" + # Construct URL url = self.get.metadata['url'] path_format_arguments = { @@ -134,7 +136,7 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -165,3 +167,120 @@ def get( 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_recommendations_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_recommendations_operations.py index 6c4888a82950..36af51bc0cdf 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_recommendations_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_recommendations_operations.py @@ -25,7 +25,6 @@ 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: "2019-08-01". """ models = models @@ -35,7 +34,6 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-08-01" self.config = config @@ -66,6 +64,8 @@ def list( ~azure.mgmt.security.models.IotRecommendationPaged[~azure.mgmt.security.models.IotRecommendation] :raises: :class:`CloudError` """ + api_version = "2019-08-01" + def prepare_request(next_link=None): if not next_link: # Construct URL @@ -79,7 +79,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + 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: @@ -149,6 +149,8 @@ def get( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ + api_version = "2019-08-01" + # Construct URL url = self.get.metadata['url'] path_format_arguments = { @@ -161,7 +163,7 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -192,3 +194,155 @@ def get( 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 + :rtype: + ~azure.mgmt.security.models.IotRecommendationModelPaged[~azure.mgmt.security.models.IotRecommendationModel] + :raises: :class:`CloudError` + """ + api_version = "2020-08-06-preview" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list1.metadata['url'] + 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 recommendation_type is not None: + query_parameters['recommendationType'] = self._serialize.query("recommendation_type", recommendation_type, 'str') + if device_id is not None: + query_parameters['deviceId'] = self._serialize.query("device_id", device_id, 'str') + if limit is not None: + query_parameters['$limit'] = self._serialize.query("limit", limit, 'int') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.IotRecommendationModelPaged(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 + :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 + ~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), + '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('IotRecommendationModel', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get1.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotRecommendations/{iotRecommendationId}'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_sql_vulnerability_assessment_baseline_rules_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_sql_vulnerability_assessment_baseline_rules_operations.py new file mode 100644 index 000000000000..14747a65e390 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_sql_vulnerability_assessment_baseline_rules_operations.py @@ -0,0 +1,383 @@ +# 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 SqlVulnerabilityAssessmentBaselineRulesOperations(object): + """SqlVulnerabilityAssessmentBaselineRulesOperations 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 create_or_update( + self, rule_id, workspace_id, api_version, resource_id, latest_scan=None, results=None, custom_headers=None, raw=False, **operation_config): + """Creates a Baseline for a rule in a database. Will overwrite any + previously existing results. + + :param rule_id: The rule Id. + :type rule_id: str + :param workspace_id: The workspace Id. + :type workspace_id: str + :param api_version: The api version. + :type api_version: str + :param resource_id: The identifier of the resource. + :type resource_id: str + :param latest_scan: Take results from latest scan. + :type latest_scan: bool + :param results: Expected results to be inserted into the baseline. + Leave this field empty it LatestScan == true. + :type results: list[list[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: RuleResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.RuleResults or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + body = None + if latest_scan is not None or results is not None: + body = models.RuleResultsInput(latest_scan=latest_scan, results=results) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'ruleId': self._serialize.url("rule_id", rule_id, 'str'), + '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['workspaceId'] = self._serialize.query("workspace_id", workspace_id, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'RuleResultsInput') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RuleResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}'} + + def get( + self, rule_id, workspace_id, api_version, resource_id, custom_headers=None, raw=False, **operation_config): + """Gets the results for a given rule in the Baseline. + + :param rule_id: The rule Id. + :type rule_id: str + :param workspace_id: The workspace Id. + :type workspace_id: str + :param api_version: The api version. + :type api_version: str + :param resource_id: The identifier of the resource. + :type resource_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RuleResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.RuleResults or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'ruleId': self._serialize.url("rule_id", rule_id, 'str'), + '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['workspaceId'] = self._serialize.query("workspace_id", workspace_id, 'str') + 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('RuleResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}'} + + def delete( + self, rule_id, workspace_id, api_version, resource_id, custom_headers=None, raw=False, **operation_config): + """Deletes a rule from the Baseline of a given database. + + :param rule_id: The rule Id. + :type rule_id: str + :param workspace_id: The workspace Id. + :type workspace_id: str + :param api_version: The api version. + :type api_version: str + :param resource_id: The identifier of the resource. + :type resource_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: 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 = { + 'ruleId': self._serialize.url("rule_id", rule_id, 'str'), + '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['workspaceId'] = self._serialize.query("workspace_id", workspace_id, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}'} + + def list( + self, workspace_id, api_version, resource_id, custom_headers=None, raw=False, **operation_config): + """Gets the results for all rules in the Baseline. + + :param workspace_id: The workspace Id. + :type workspace_id: str + :param api_version: The api version. + :type api_version: str + :param resource_id: The identifier of the resource. + :type resource_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RulesResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.RulesResults or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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['workspaceId'] = self._serialize.query("workspace_id", workspace_id, 'str') + 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('RulesResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules'} + + def add( + self, workspace_id, api_version, resource_id, latest_scan=None, results=None, custom_headers=None, raw=False, **operation_config): + """Add a list of baseline rules. Will overwrite any previously existing + results (for all rules). + + :param workspace_id: The workspace Id. + :type workspace_id: str + :param api_version: The api version. + :type api_version: str + :param resource_id: The identifier of the resource. + :type resource_id: str + :param latest_scan: Take results from latest scan. + :type latest_scan: bool + :param results: Expected results to be inserted into the baseline. + Leave this field empty it LatestScan == true. + :type results: dict[str, list[list[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: RulesResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.RulesResults or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + body = None + if latest_scan is not None or results is not None: + body = models.RulesResultsInput(latest_scan=latest_scan, results=results) + + # Construct URL + url = self.add.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['workspaceId'] = self._serialize.query("workspace_id", workspace_id, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'RulesResultsInput') + else: + body_content = None + + # 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 [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('RulesResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_sql_vulnerability_assessment_scan_results_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_sql_vulnerability_assessment_scan_results_operations.py new file mode 100644 index 000000000000..31acb40b53ba --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_sql_vulnerability_assessment_scan_results_operations.py @@ -0,0 +1,173 @@ +# 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 SqlVulnerabilityAssessmentScanResultsOperations(object): + """SqlVulnerabilityAssessmentScanResultsOperations 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 get( + self, scan_id, scan_result_id, workspace_id, api_version, resource_id, custom_headers=None, raw=False, **operation_config): + """Gets the scan results of a single rule in a scan record. + + :param scan_id: The scan Id. Type 'latest' to get the scan results for + the latest scan. + :type scan_id: str + :param scan_result_id: The rule Id of the results. + :type scan_result_id: str + :param workspace_id: The workspace Id. + :type workspace_id: str + :param api_version: The api version. + :type api_version: str + :param resource_id: The identifier of the resource. + :type resource_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ScanResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.ScanResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scanId': self._serialize.url("scan_id", scan_id, 'str'), + 'scanResultId': self._serialize.url("scan_result_id", scan_result_id, 'str'), + '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['workspaceId'] = self._serialize.query("workspace_id", workspace_id, 'str') + 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('ScanResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults/{scanResultId}'} + + def list( + self, scan_id, workspace_id, api_version, resource_id, custom_headers=None, raw=False, **operation_config): + """Gets a list of scan results for a single scan record. + + :param scan_id: The scan Id. Type 'latest' to get the scan results for + the latest scan. + :type scan_id: str + :param workspace_id: The workspace Id. + :type workspace_id: str + :param api_version: The api version. + :type api_version: str + :param resource_id: The identifier of the resource. + :type resource_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ScanResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.ScanResults or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'scanId': self._serialize.url("scan_id", scan_id, 'str'), + '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['workspaceId'] = self._serialize.query("workspace_id", workspace_id, 'str') + 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('ScanResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_sql_vulnerability_assessment_scans_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_sql_vulnerability_assessment_scans_operations.py new file mode 100644 index 000000000000..0b6e34d106c3 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_sql_vulnerability_assessment_scans_operations.py @@ -0,0 +1,166 @@ +# 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 SqlVulnerabilityAssessmentScansOperations(object): + """SqlVulnerabilityAssessmentScansOperations 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 get( + self, scan_id, workspace_id, api_version, resource_id, custom_headers=None, raw=False, **operation_config): + """Gets the scan details of a single scan record. + + :param scan_id: The scan Id. Type 'latest' to get the scan record for + the latest scan. + :type scan_id: str + :param workspace_id: The workspace Id. + :type workspace_id: str + :param api_version: The api version. + :type api_version: str + :param resource_id: The identifier of the resource. + :type resource_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Scan or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.Scan or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scanId': self._serialize.url("scan_id", scan_id, 'str'), + '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['workspaceId'] = self._serialize.query("workspace_id", workspace_id, 'str') + 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('Scan', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}'} + + def list( + self, workspace_id, api_version, resource_id, custom_headers=None, raw=False, **operation_config): + """Gets a list of scan records. + + :param workspace_id: The workspace Id. + :type workspace_id: str + :param api_version: The api version. + :type api_version: str + :param resource_id: The identifier of the resource. + :type resource_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Scans or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.Scans or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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['workspaceId'] = self._serialize.query("workspace_id", workspace_id, 'str') + 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('Scans', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans'}