Skip to content

[AutoPR azure-mgmt-security] Add Microsoft.Security views API spec #11791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 22 additions & 0 deletions sdk/security/azure-mgmt-security/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Release History

## 8.0.0 (2025-05-12)

### Features Added

- Added operation group CustomRecommendationsOperations
- Added operation group SecurityStandardsOperations
- Added operation group StandardAssignmentsOperations
- Model DefenderForStorageSetting has a new parameter properties

### Breaking Changes

- Model DefenderForStorageSetting no longer has parameter cap_gb_per_month
- Model DefenderForStorageSetting no longer has parameter is_enabled_properties_is_enabled
- Model DefenderForStorageSetting no longer has parameter is_enabled_properties_malware_scanning_on_upload_is_enabled
- Model DefenderForStorageSetting no longer has parameter is_enabled_properties_sensitive_data_discovery_is_enabled
- Model DefenderForStorageSetting no longer has parameter operation_status_properties_malware_scanning_operation_status
- Model DefenderForStorageSetting no longer has parameter operation_status_properties_sensitive_data_discovery_operation_status
- Model DefenderForStorageSetting no longer has parameter override_subscription_level_settings
- Model DefenderForStorageSetting no longer has parameter scan_results_event_grid_topic_resource_id
- Removed operation group AdaptiveApplicationControlsOperations
- Removed operation group AdaptiveNetworkHardeningsOperations

## 7.0.0 (2024-05-20)

### Features Added
Expand Down
6 changes: 3 additions & 3 deletions sdk/security/azure-mgmt-security/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Microsoft Azure SDK for Python

This is the Microsoft Azure Security Center Management Client Library.
This package has been tested with Python 3.8+.
This package has been tested with Python 3.9+.
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).

## _Disclaimer_
Expand All @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For

### Prerequisites

- Python 3.8+ is required to use this package.
- Python 3.9+ is required to use this package.
- [Azure subscription](https://azure.microsoft.com/free/)

### Install the package
Expand All @@ -24,7 +24,7 @@ pip install azure-identity

### Authentication

By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.

- `AZURE_CLIENT_ID` for Azure client ID.
- `AZURE_TENANT_ID` for Azure tenant ID.
Expand Down
6 changes: 3 additions & 3 deletions sdk/security/azure-mgmt-security/_meta.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"commit": "5485fc4eb11debd9cc8d92ec156b573998aae977",
"commit": "6a95c757593e04a726c01db8144c8f343ac3cff5",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.10.2",
"use": [
"@autorest/python@6.13.16",
"@autorest/python@6.34.1",
"@autorest/[email protected]"
],
"autorest_command": "autorest specification/security/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.13.16 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
"autorest_command": "autorest specification/security/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.34.1 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
"readme": "specification/security/resource-manager/readme.md",
"package-2023-11-15": "2023-09-12 12:04:57 -0700 32c178f2467f792a322f56174be244135d2c907f Microsoft.Security/stable/2023-11-15/apiCollections.json",
"package-preview-2023-03-only": "2023-03-23 11:34:42 +0200 2db2beee2fed67b08d273fdac7a51aba02ac2f80 Microsoft.Security/preview/2023-03-01-preview/securityConnectors.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,17 @@ class SecurityCenterConfiguration:

:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
"""

def __init__(
self,
credential: "TokenCredential",
subscription_id: str,
**kwargs: Any
):
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")

self.credential = credential
self.subscription_id = subscription_id
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'azure-mgmt-security/{}'.format(VERSION))
self.polling_interval = kwargs.get("polling_interval", 30)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,27 @@
# regenerated.
# --------------------------------------------------------------------------

from typing import Any, Optional, TYPE_CHECKING
from typing import Any, Optional, TYPE_CHECKING, cast
from typing_extensions import Self

from azure.core.pipeline import policies
from azure.core.settings import settings
from azure.mgmt.core import ARMPipelineClient
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
from azure.mgmt.core.tools import get_arm_endpoints
from azure.profiles import KnownProfiles, ProfileDefinition
from azure.profiles.multiapiclient import MultiApiClientMixin

from ._configuration import SecurityCenterConfiguration
from ._serialization import Deserializer, Serializer
from ._utils.serialization import Deserializer, Serializer

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential

class _SDKClient(object):
def __init__(self, *args, **kwargs):
"""This is a fake class to support current implemetation of MultiApiClientMixin."
"""This is a fake class to support current implementation of MultiApiClientMixin."
Will be removed in final version of multiapi azure-core based client
"""
pass
Expand All @@ -44,8 +47,6 @@ class SecurityCenter(MultiApiClientMixin, _SDKClient):

:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:param api_version: API version to use if no profile is provided, or if missing in profile.
:type api_version: str
:param base_url: Service URL
Expand All @@ -55,13 +56,11 @@ class SecurityCenter(MultiApiClientMixin, _SDKClient):
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""

DEFAULT_API_VERSION = '2024-04-01'
DEFAULT_API_VERSION = '2024-08-01'
_PROFILE_TAG = "azure.mgmt.security.SecurityCenter"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
None: DEFAULT_API_VERSION,
'adaptive_application_controls': '2020-01-01',
'adaptive_network_hardenings': '2020-01-01',
'advanced_threat_protection': '2019-01-01',
'alerts': '2022-01-01',
'alerts_suppression_rules': '2019-01-01-preview',
Expand All @@ -76,15 +75,25 @@ class SecurityCenter(MultiApiClientMixin, _SDKClient):
'assessments_metadata': '2021-06-01',
'auto_provisioning_settings': '2017-08-01-preview',
'automations': '2019-01-01-preview',
'azure_dev_ops_orgs': '2024-04-01',
'azure_dev_ops_projects': '2024-04-01',
'azure_dev_ops_repos': '2024-04-01',
'compliance_results': '2017-08-01',
'compliances': '2017-08-01-preview',
'connectors': '2020-01-01-preview',
'custom_assessment_automations': '2021-07-01-preview',
'custom_entity_store_assignments': '2021-07-01-preview',
'defender_for_storage': '2022-12-01-preview',
'dev_ops_configurations': '2024-04-01',
'dev_ops_operation_results': '2024-04-01',
'device_security_groups': '2019-08-01',
'discovered_security_solutions': '2020-01-01',
'external_security_solutions': '2020-01-01',
'git_hub_owners': '2024-04-01',
'git_hub_repos': '2024-04-01',
'git_lab_groups': '2024-04-01',
'git_lab_projects': '2024-04-01',
'git_lab_subgroups': '2024-04-01',
'governance_assignments': '2022-01-01-preview',
'governance_rules': '2022-01-01-preview',
'health_report': '2023-02-01-preview',
Expand Down Expand Up @@ -131,15 +140,19 @@ class SecurityCenter(MultiApiClientMixin, _SDKClient):
def __init__(
self,
credential: "TokenCredential",
subscription_id: str,
api_version: Optional[str]=None,
base_url: str = "https://management.azure.com",
base_url: Optional[str] = None,
profile: KnownProfiles=KnownProfiles.default,
**kwargs: Any
):
if api_version:
kwargs.setdefault('api_version', api_version)
self._config = SecurityCenterConfiguration(credential, subscription_id, **kwargs)
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
_endpoints = get_arm_endpoints(_cloud)
if not base_url:
base_url = _endpoints["resource_manager"]
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
self._config = SecurityCenterConfiguration(credential, credential_scopes=credential_scopes, **kwargs)
_policies = kwargs.pop("policies", None)
if _policies is None:
_policies = [
Expand All @@ -158,7 +171,7 @@ def __init__(
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
super(SecurityCenter, self).__init__(
api_version=api_version,
profile=profile
Expand Down Expand Up @@ -209,6 +222,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2023-11-15: :mod:`v2023_11_15.models<azure.mgmt.security.v2023_11_15.models>`
* 2024-01-01: :mod:`v2024_01_01.models<azure.mgmt.security.v2024_01_01.models>`
* 2024-04-01: :mod:`v2024_04_01.models<azure.mgmt.security.v2024_04_01.models>`
* 2024-08-01: :mod:`v2024_08_01.models<azure.mgmt.security.v2024_08_01.models>`
"""
if api_version == '2015-06-01-preview':
from .v2015_06_01_preview import models
Expand Down Expand Up @@ -321,36 +335,11 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2024-04-01':
from .v2024_04_01 import models
return models
elif api_version == '2024-08-01':
from .v2024_08_01 import models
return models
raise ValueError("API version {} is not available".format(api_version))

@property
def adaptive_application_controls(self):
"""Instance depends on the API version:

* 2020-01-01: :class:`AdaptiveApplicationControlsOperations<azure.mgmt.security.v2020_01_01.operations.AdaptiveApplicationControlsOperations>`
"""
api_version = self._get_api_version('adaptive_application_controls')
if api_version == '2020-01-01':
from .v2020_01_01.operations import AdaptiveApplicationControlsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'adaptive_application_controls'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)

@property
def adaptive_network_hardenings(self):
"""Instance depends on the API version:

* 2020-01-01: :class:`AdaptiveNetworkHardeningsOperations<azure.mgmt.security.v2020_01_01.operations.AdaptiveNetworkHardeningsOperations>`
"""
api_version = self._get_api_version('adaptive_network_hardenings')
if api_version == '2020-01-01':
from .v2020_01_01.operations import AdaptiveNetworkHardeningsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'adaptive_network_hardenings'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)

@property
def advanced_threat_protection(self):
"""Instance depends on the API version:
Expand Down Expand Up @@ -677,6 +666,20 @@ def custom_entity_store_assignments(self):
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)

@property
def custom_recommendations(self):
"""Instance depends on the API version:

* 2024-08-01: :class:`CustomRecommendationsOperations<azure.mgmt.security.v2024_08_01.operations.CustomRecommendationsOperations>`
"""
api_version = self._get_api_version('custom_recommendations')
if api_version == '2024-08-01':
from .v2024_08_01.operations import CustomRecommendationsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'custom_recommendations'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)

@property
def defender_for_storage(self):
"""Instance depends on the API version:
Expand Down Expand Up @@ -1257,6 +1260,20 @@ def security_solutions_reference_data(self):
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)

@property
def security_standards(self):
"""Instance depends on the API version:

* 2024-08-01: :class:`SecurityStandardsOperations<azure.mgmt.security.v2024_08_01.operations.SecurityStandardsOperations>`
"""
api_version = self._get_api_version('security_standards')
if api_version == '2024-08-01':
from .v2024_08_01.operations import SecurityStandardsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'security_standards'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)

@property
def sensitivity_settings(self):
"""Instance depends on the API version:
Expand Down Expand Up @@ -1384,6 +1401,20 @@ def sql_vulnerability_assessment_scans(self):
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)

@property
def standard_assignments(self):
"""Instance depends on the API version:

* 2024-08-01: :class:`StandardAssignmentsOperations<azure.mgmt.security.v2024_08_01.operations.StandardAssignmentsOperations>`
"""
api_version = self._get_api_version('standard_assignments')
if api_version == '2024-08-01':
from .v2024_08_01.operations import StandardAssignmentsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'standard_assignments'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)

@property
def sub_assessments(self):
"""Instance depends on the API version:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 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.
# --------------------------------------------------------------------------
Loading