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 556353b79cbc..f1df443132ff 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 @@ -47,6 +47,14 @@ from .jit_network_access_policy_initiate_virtual_machine_py3 import JitNetworkAccessPolicyInitiateVirtualMachine from .jit_network_access_policy_initiate_request_py3 import JitNetworkAccessPolicyInitiateRequest from .kind_py3 import Kind + from .app_whitelisting_issue_summary_py3 import AppWhitelistingIssueSummary + from .vm_recommendation_py3 import VmRecommendation + from .publisher_info_py3 import PublisherInfo + from .user_recommendation_py3 import UserRecommendation + from .path_recommendation_py3 import PathRecommendation + from .app_whitelisting_group_py3 import AppWhitelistingGroup + from .app_whitelisting_groups_py3 import AppWhitelistingGroups + from .app_whitelisting_put_group_data_py3 import AppWhitelistingPutGroupData from .operation_display_py3 import OperationDisplay from .operation_py3 import Operation from .security_task_parameters_py3 import SecurityTaskParameters @@ -125,6 +133,14 @@ from .jit_network_access_policy_initiate_virtual_machine import JitNetworkAccessPolicyInitiateVirtualMachine from .jit_network_access_policy_initiate_request import JitNetworkAccessPolicyInitiateRequest from .kind import Kind + from .app_whitelisting_issue_summary import AppWhitelistingIssueSummary + from .vm_recommendation import VmRecommendation + from .publisher_info import PublisherInfo + from .user_recommendation import UserRecommendation + from .path_recommendation import PathRecommendation + from .app_whitelisting_group import AppWhitelistingGroup + from .app_whitelisting_groups import AppWhitelistingGroups + from .app_whitelisting_put_group_data import AppWhitelistingPutGroupData from .operation_display import OperationDisplay from .operation import Operation from .security_task_parameters import SecurityTaskParameters @@ -248,6 +264,14 @@ 'JitNetworkAccessPolicyInitiateVirtualMachine', 'JitNetworkAccessPolicyInitiateRequest', 'Kind', + 'AppWhitelistingIssueSummary', + 'VmRecommendation', + 'PublisherInfo', + 'UserRecommendation', + 'PathRecommendation', + 'AppWhitelistingGroup', + 'AppWhitelistingGroups', + 'AppWhitelistingPutGroupData', 'OperationDisplay', 'Operation', 'SecurityTaskParameters', diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/app_whitelisting_group.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/app_whitelisting_group.py new file mode 100644 index 000000000000..cf255612c901 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/app_whitelisting_group.py @@ -0,0 +1,84 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AppWhitelistingGroup(Model): + """AppWhitelistingGroup. + + 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 location: Location where the resource is stored + :vartype location: str + :param enforcement_mode: Possible values include: 'Audit', 'Enforce' + :type enforcement_mode: str or ~azure.mgmt.security.models.enum + :param configuration_status: Possible values include: 'Configured', + 'NotConfigured', 'InProgress', 'Failed', 'NoStatus' + :type configuration_status: str or ~azure.mgmt.security.models.enum + :param recommendation_status: Possible values include: 'Recommended', + 'NotRecommended', 'NotAvailable', 'NoStatus' + :type recommendation_status: str or ~azure.mgmt.security.models.enum + :param issues: + :type issues: + list[~azure.mgmt.security.models.AppWhitelistingIssueSummary] + :param source_system: Possible values include: 'Azure_AppLocker', + 'Azure_AuditD', 'NonAzure_AppLocker', 'NonAzure_AuditD', 'None' + :type source_system: str or ~azure.mgmt.security.models.enum + :param vm_recommendations: + :type vm_recommendations: + list[~azure.mgmt.security.models.VmRecommendation] + :param path_recommendations: + :type path_recommendations: + list[~azure.mgmt.security.models.PathRecommendation] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'enforcement_mode': {'key': 'properties.enforcementMode', 'type': 'str'}, + 'configuration_status': {'key': 'properties.configurationStatus', 'type': 'str'}, + 'recommendation_status': {'key': 'properties.recommendationStatus', 'type': 'str'}, + 'issues': {'key': 'properties.issues', 'type': '[AppWhitelistingIssueSummary]'}, + 'source_system': {'key': 'properties.sourceSystem', 'type': 'str'}, + 'vm_recommendations': {'key': 'properties.vmRecommendations', 'type': '[VmRecommendation]'}, + 'path_recommendations': {'key': 'properties.pathRecommendations', 'type': '[PathRecommendation]'}, + } + + def __init__(self, **kwargs): + super(AppWhitelistingGroup, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = None + self.enforcement_mode = kwargs.get('enforcement_mode', None) + self.configuration_status = kwargs.get('configuration_status', None) + self.recommendation_status = kwargs.get('recommendation_status', None) + self.issues = kwargs.get('issues', None) + self.source_system = kwargs.get('source_system', None) + self.vm_recommendations = kwargs.get('vm_recommendations', None) + self.path_recommendations = kwargs.get('path_recommendations', None) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/app_whitelisting_group_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/app_whitelisting_group_py3.py new file mode 100644 index 000000000000..fd2bd774269e --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/app_whitelisting_group_py3.py @@ -0,0 +1,84 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AppWhitelistingGroup(Model): + """AppWhitelistingGroup. + + 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 location: Location where the resource is stored + :vartype location: str + :param enforcement_mode: Possible values include: 'Audit', 'Enforce' + :type enforcement_mode: str or ~azure.mgmt.security.models.enum + :param configuration_status: Possible values include: 'Configured', + 'NotConfigured', 'InProgress', 'Failed', 'NoStatus' + :type configuration_status: str or ~azure.mgmt.security.models.enum + :param recommendation_status: Possible values include: 'Recommended', + 'NotRecommended', 'NotAvailable', 'NoStatus' + :type recommendation_status: str or ~azure.mgmt.security.models.enum + :param issues: + :type issues: + list[~azure.mgmt.security.models.AppWhitelistingIssueSummary] + :param source_system: Possible values include: 'Azure_AppLocker', + 'Azure_AuditD', 'NonAzure_AppLocker', 'NonAzure_AuditD', 'None' + :type source_system: str or ~azure.mgmt.security.models.enum + :param vm_recommendations: + :type vm_recommendations: + list[~azure.mgmt.security.models.VmRecommendation] + :param path_recommendations: + :type path_recommendations: + list[~azure.mgmt.security.models.PathRecommendation] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'enforcement_mode': {'key': 'properties.enforcementMode', 'type': 'str'}, + 'configuration_status': {'key': 'properties.configurationStatus', 'type': 'str'}, + 'recommendation_status': {'key': 'properties.recommendationStatus', 'type': 'str'}, + 'issues': {'key': 'properties.issues', 'type': '[AppWhitelistingIssueSummary]'}, + 'source_system': {'key': 'properties.sourceSystem', 'type': 'str'}, + 'vm_recommendations': {'key': 'properties.vmRecommendations', 'type': '[VmRecommendation]'}, + 'path_recommendations': {'key': 'properties.pathRecommendations', 'type': '[PathRecommendation]'}, + } + + def __init__(self, *, enforcement_mode=None, configuration_status=None, recommendation_status=None, issues=None, source_system=None, vm_recommendations=None, path_recommendations=None, **kwargs) -> None: + super(AppWhitelistingGroup, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = None + self.enforcement_mode = enforcement_mode + self.configuration_status = configuration_status + self.recommendation_status = recommendation_status + self.issues = issues + self.source_system = source_system + self.vm_recommendations = vm_recommendations + self.path_recommendations = path_recommendations diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/app_whitelisting_groups.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/app_whitelisting_groups.py new file mode 100644 index 000000000000..4ce207c91020 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/app_whitelisting_groups.py @@ -0,0 +1,29 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AppWhitelistingGroups(Model): + """Represents a list of VM/server groups and set of rules that are Recommended + by Azure Security Center to be allowed. + + :param value: + :type value: list[~azure.mgmt.security.models.AppWhitelistingGroup] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppWhitelistingGroup]'}, + } + + def __init__(self, **kwargs): + super(AppWhitelistingGroups, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/app_whitelisting_groups_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/app_whitelisting_groups_py3.py new file mode 100644 index 000000000000..0217485e4167 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/app_whitelisting_groups_py3.py @@ -0,0 +1,29 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AppWhitelistingGroups(Model): + """Represents a list of VM/server groups and set of rules that are Recommended + by Azure Security Center to be allowed. + + :param value: + :type value: list[~azure.mgmt.security.models.AppWhitelistingGroup] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppWhitelistingGroup]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(AppWhitelistingGroups, self).__init__(**kwargs) + self.value = value diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/app_whitelisting_issue_summary.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/app_whitelisting_issue_summary.py new file mode 100644 index 000000000000..f7719c626ca4 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/app_whitelisting_issue_summary.py @@ -0,0 +1,36 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AppWhitelistingIssueSummary(Model): + """Represents a summary of the alerts of the VM/server group. + + :param issue: Possible values include: 'ViolationsAudited', + 'ViolationsBlocked', 'MsiAndScriptViolationsAudited', + 'MsiAndScriptViolationsBlocked', 'ExecutableViolationsAudited', + 'RulesViolatedManually' + :type issue: str or ~azure.mgmt.security.models.enum + :param number_of_vms: The number of machines in the VM/server group that + have this alert + :type number_of_vms: float + """ + + _attribute_map = { + 'issue': {'key': 'issue', 'type': 'str'}, + 'number_of_vms': {'key': 'numberOfVms', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(AppWhitelistingIssueSummary, self).__init__(**kwargs) + self.issue = kwargs.get('issue', None) + self.number_of_vms = kwargs.get('number_of_vms', None) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/app_whitelisting_issue_summary_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/app_whitelisting_issue_summary_py3.py new file mode 100644 index 000000000000..e30ac478ae6f --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/app_whitelisting_issue_summary_py3.py @@ -0,0 +1,36 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AppWhitelistingIssueSummary(Model): + """Represents a summary of the alerts of the VM/server group. + + :param issue: Possible values include: 'ViolationsAudited', + 'ViolationsBlocked', 'MsiAndScriptViolationsAudited', + 'MsiAndScriptViolationsBlocked', 'ExecutableViolationsAudited', + 'RulesViolatedManually' + :type issue: str or ~azure.mgmt.security.models.enum + :param number_of_vms: The number of machines in the VM/server group that + have this alert + :type number_of_vms: float + """ + + _attribute_map = { + 'issue': {'key': 'issue', 'type': 'str'}, + 'number_of_vms': {'key': 'numberOfVms', 'type': 'float'}, + } + + def __init__(self, *, issue=None, number_of_vms: float=None, **kwargs) -> None: + super(AppWhitelistingIssueSummary, self).__init__(**kwargs) + self.issue = issue + self.number_of_vms = number_of_vms diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/app_whitelisting_put_group_data.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/app_whitelisting_put_group_data.py new file mode 100644 index 000000000000..6523df18b81a --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/app_whitelisting_put_group_data.py @@ -0,0 +1,38 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AppWhitelistingPutGroupData(Model): + """The altered data of the recommended VM/server group policy. + + :param enforcement_mode: Possible values include: 'Audit', 'Enforce' + :type enforcement_mode: str or ~azure.mgmt.security.models.enum + :param vm_recommendations: + :type vm_recommendations: + list[~azure.mgmt.security.models.VmRecommendation] + :param path_recommendations: + :type path_recommendations: + list[~azure.mgmt.security.models.PathRecommendation] + """ + + _attribute_map = { + 'enforcement_mode': {'key': 'enforcementMode', 'type': 'str'}, + 'vm_recommendations': {'key': 'vmRecommendations', 'type': '[VmRecommendation]'}, + 'path_recommendations': {'key': 'pathRecommendations', 'type': '[PathRecommendation]'}, + } + + def __init__(self, **kwargs): + super(AppWhitelistingPutGroupData, self).__init__(**kwargs) + self.enforcement_mode = kwargs.get('enforcement_mode', None) + self.vm_recommendations = kwargs.get('vm_recommendations', None) + self.path_recommendations = kwargs.get('path_recommendations', None) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/app_whitelisting_put_group_data_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/app_whitelisting_put_group_data_py3.py new file mode 100644 index 000000000000..3c79e5071858 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/app_whitelisting_put_group_data_py3.py @@ -0,0 +1,38 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AppWhitelistingPutGroupData(Model): + """The altered data of the recommended VM/server group policy. + + :param enforcement_mode: Possible values include: 'Audit', 'Enforce' + :type enforcement_mode: str or ~azure.mgmt.security.models.enum + :param vm_recommendations: + :type vm_recommendations: + list[~azure.mgmt.security.models.VmRecommendation] + :param path_recommendations: + :type path_recommendations: + list[~azure.mgmt.security.models.PathRecommendation] + """ + + _attribute_map = { + 'enforcement_mode': {'key': 'enforcementMode', 'type': 'str'}, + 'vm_recommendations': {'key': 'vmRecommendations', 'type': '[VmRecommendation]'}, + 'path_recommendations': {'key': 'pathRecommendations', 'type': '[PathRecommendation]'}, + } + + def __init__(self, *, enforcement_mode=None, vm_recommendations=None, path_recommendations=None, **kwargs) -> None: + super(AppWhitelistingPutGroupData, self).__init__(**kwargs) + self.enforcement_mode = enforcement_mode + self.vm_recommendations = vm_recommendations + self.path_recommendations = path_recommendations diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/path_recommendation.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/path_recommendation.py new file mode 100644 index 000000000000..982362a57d1c --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/path_recommendation.py @@ -0,0 +1,64 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PathRecommendation(Model): + """Represents a path that is recommended to be allowed and its properties. + + :param path: The full path to whitelist + :type path: str + :param action: Possible values include: 'Recommended', 'Add', 'Remove' + :type action: str or ~azure.mgmt.security.models.enum + :param type: Possible values include: 'File', 'FileHash', + 'PublisherSignature', 'ProductSignature', 'BinarySignature', + 'VersionAndAboveSignature' + :type type: str or ~azure.mgmt.security.models.enum + :param publisher_info: + :type publisher_info: ~azure.mgmt.security.models.PublisherInfo + :param common: Whether the path is commonly run on the machine + :type common: bool + :param user_sids: + :type user_sids: list[str] + :param usernames: + :type usernames: list[~azure.mgmt.security.models.UserRecommendation] + :param file_type: Possible values include: 'Exe', 'Dll', 'Msi', 'Script', + 'Executable', 'Unknown' + :type file_type: str or ~azure.mgmt.security.models.enum + :param configuration_status: Possible values include: 'Configured', + 'NotConfigured', 'InProgress', 'Failed', 'NoStatus' + :type configuration_status: str or ~azure.mgmt.security.models.enum + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'publisher_info': {'key': 'publisherInfo', 'type': 'PublisherInfo'}, + 'common': {'key': 'common', 'type': 'bool'}, + 'user_sids': {'key': 'userSids', 'type': '[str]'}, + 'usernames': {'key': 'usernames', 'type': '[UserRecommendation]'}, + 'file_type': {'key': 'fileType', 'type': 'str'}, + 'configuration_status': {'key': 'configurationStatus', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PathRecommendation, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.action = kwargs.get('action', None) + self.type = kwargs.get('type', None) + self.publisher_info = kwargs.get('publisher_info', None) + self.common = kwargs.get('common', None) + self.user_sids = kwargs.get('user_sids', None) + self.usernames = kwargs.get('usernames', None) + self.file_type = kwargs.get('file_type', None) + self.configuration_status = kwargs.get('configuration_status', None) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/path_recommendation_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/path_recommendation_py3.py new file mode 100644 index 000000000000..1563e8dce516 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/path_recommendation_py3.py @@ -0,0 +1,64 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PathRecommendation(Model): + """Represents a path that is recommended to be allowed and its properties. + + :param path: The full path to whitelist + :type path: str + :param action: Possible values include: 'Recommended', 'Add', 'Remove' + :type action: str or ~azure.mgmt.security.models.enum + :param type: Possible values include: 'File', 'FileHash', + 'PublisherSignature', 'ProductSignature', 'BinarySignature', + 'VersionAndAboveSignature' + :type type: str or ~azure.mgmt.security.models.enum + :param publisher_info: + :type publisher_info: ~azure.mgmt.security.models.PublisherInfo + :param common: Whether the path is commonly run on the machine + :type common: bool + :param user_sids: + :type user_sids: list[str] + :param usernames: + :type usernames: list[~azure.mgmt.security.models.UserRecommendation] + :param file_type: Possible values include: 'Exe', 'Dll', 'Msi', 'Script', + 'Executable', 'Unknown' + :type file_type: str or ~azure.mgmt.security.models.enum + :param configuration_status: Possible values include: 'Configured', + 'NotConfigured', 'InProgress', 'Failed', 'NoStatus' + :type configuration_status: str or ~azure.mgmt.security.models.enum + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'publisher_info': {'key': 'publisherInfo', 'type': 'PublisherInfo'}, + 'common': {'key': 'common', 'type': 'bool'}, + 'user_sids': {'key': 'userSids', 'type': '[str]'}, + 'usernames': {'key': 'usernames', 'type': '[UserRecommendation]'}, + 'file_type': {'key': 'fileType', 'type': 'str'}, + 'configuration_status': {'key': 'configurationStatus', 'type': 'str'}, + } + + def __init__(self, *, path: str=None, action=None, type=None, publisher_info=None, common: bool=None, user_sids=None, usernames=None, file_type=None, configuration_status=None, **kwargs) -> None: + super(PathRecommendation, self).__init__(**kwargs) + self.path = path + self.action = action + self.type = type + self.publisher_info = publisher_info + self.common = common + self.user_sids = user_sids + self.usernames = usernames + self.file_type = file_type + self.configuration_status = configuration_status diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/publisher_info.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/publisher_info.py new file mode 100644 index 000000000000..653bffbbb364 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/publisher_info.py @@ -0,0 +1,45 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PublisherInfo(Model): + """Represents the publisher information of a process/rule. + + :param publisher_name: The Subject field of the x.509 certificate used to + sign the code, using the following fields - O = Organization, L = + Locality, S = State or Province, and C = Country + :type publisher_name: str + :param product_name: The product name taken from the file's version + resource + :type product_name: str + :param binary_name: The "OriginalName" field taken from the file's version + resource + :type binary_name: str + :param version: The binary file version taken from the file's version + resource + :type version: str + """ + + _attribute_map = { + 'publisher_name': {'key': 'publisherName', 'type': 'str'}, + 'product_name': {'key': 'productName', 'type': 'str'}, + 'binary_name': {'key': 'binaryName', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PublisherInfo, self).__init__(**kwargs) + self.publisher_name = kwargs.get('publisher_name', None) + self.product_name = kwargs.get('product_name', None) + self.binary_name = kwargs.get('binary_name', None) + self.version = kwargs.get('version', None) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/publisher_info_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/publisher_info_py3.py new file mode 100644 index 000000000000..8c6eecc16ed0 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/publisher_info_py3.py @@ -0,0 +1,45 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PublisherInfo(Model): + """Represents the publisher information of a process/rule. + + :param publisher_name: The Subject field of the x.509 certificate used to + sign the code, using the following fields - O = Organization, L = + Locality, S = State or Province, and C = Country + :type publisher_name: str + :param product_name: The product name taken from the file's version + resource + :type product_name: str + :param binary_name: The "OriginalName" field taken from the file's version + resource + :type binary_name: str + :param version: The binary file version taken from the file's version + resource + :type version: str + """ + + _attribute_map = { + 'publisher_name': {'key': 'publisherName', 'type': 'str'}, + 'product_name': {'key': 'productName', 'type': 'str'}, + 'binary_name': {'key': 'binaryName', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, publisher_name: str=None, product_name: str=None, binary_name: str=None, version: str=None, **kwargs) -> None: + super(PublisherInfo, self).__init__(**kwargs) + self.publisher_name = publisher_name + self.product_name = product_name + self.binary_name = binary_name + self.version = version diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/user_recommendation.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/user_recommendation.py new file mode 100644 index 000000000000..1f22c9903f23 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/user_recommendation.py @@ -0,0 +1,34 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UserRecommendation(Model): + """Represents a user that is recommended to be allowed for a certain rule. + + :param username: Represents a user that is recommended to be allowed for a + certain rule + :type username: str + :param recommendation_action: Possible values include: 'Recommended', + 'Add', 'Remove' + :type recommendation_action: str or ~azure.mgmt.security.models.enum + """ + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'recommendation_action': {'key': 'recommendationAction', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UserRecommendation, self).__init__(**kwargs) + self.username = kwargs.get('username', None) + self.recommendation_action = kwargs.get('recommendation_action', None) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/user_recommendation_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/user_recommendation_py3.py new file mode 100644 index 000000000000..cd014bb35e42 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/user_recommendation_py3.py @@ -0,0 +1,34 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UserRecommendation(Model): + """Represents a user that is recommended to be allowed for a certain rule. + + :param username: Represents a user that is recommended to be allowed for a + certain rule + :type username: str + :param recommendation_action: Possible values include: 'Recommended', + 'Add', 'Remove' + :type recommendation_action: str or ~azure.mgmt.security.models.enum + """ + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'recommendation_action': {'key': 'recommendationAction', 'type': 'str'}, + } + + def __init__(self, *, username: str=None, recommendation_action=None, **kwargs) -> None: + super(UserRecommendation, self).__init__(**kwargs) + self.username = username + self.recommendation_action = recommendation_action diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/vm_recommendation.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/vm_recommendation.py new file mode 100644 index 000000000000..40fdda652372 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/vm_recommendation.py @@ -0,0 +1,38 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VmRecommendation(Model): + """Represents a machine that is part of a VM/server group. + + :param configuration_status: Possible values include: 'Configured', + 'NotConfigured', 'InProgress', 'Failed', 'NoStatus' + :type configuration_status: str or ~azure.mgmt.security.models.enum + :param recommendation_action: Possible values include: 'Recommended', + 'Add', 'Remove' + :type recommendation_action: str or ~azure.mgmt.security.models.enum + :param resource_id: + :type resource_id: str + """ + + _attribute_map = { + 'configuration_status': {'key': 'configurationStatus', 'type': 'str'}, + 'recommendation_action': {'key': 'recommendationAction', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VmRecommendation, self).__init__(**kwargs) + self.configuration_status = kwargs.get('configuration_status', None) + self.recommendation_action = kwargs.get('recommendation_action', None) + self.resource_id = kwargs.get('resource_id', None) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/vm_recommendation_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/vm_recommendation_py3.py new file mode 100644 index 000000000000..64aa15c40383 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/vm_recommendation_py3.py @@ -0,0 +1,38 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VmRecommendation(Model): + """Represents a machine that is part of a VM/server group. + + :param configuration_status: Possible values include: 'Configured', + 'NotConfigured', 'InProgress', 'Failed', 'NoStatus' + :type configuration_status: str or ~azure.mgmt.security.models.enum + :param recommendation_action: Possible values include: 'Recommended', + 'Add', 'Remove' + :type recommendation_action: str or ~azure.mgmt.security.models.enum + :param resource_id: + :type resource_id: str + """ + + _attribute_map = { + 'configuration_status': {'key': 'configurationStatus', 'type': 'str'}, + 'recommendation_action': {'key': 'recommendationAction', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + } + + def __init__(self, *, configuration_status=None, recommendation_action=None, resource_id: str=None, **kwargs) -> None: + super(VmRecommendation, self).__init__(**kwargs) + self.configuration_status = configuration_status + self.recommendation_action = recommendation_action + self.resource_id = resource_id 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 405e1f50d534..37ff3d1bf412 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 @@ -17,6 +17,7 @@ from .discovered_security_solutions_operations import DiscoveredSecuritySolutionsOperations from .external_security_solutions_operations import ExternalSecuritySolutionsOperations from .jit_network_access_policies_operations import JitNetworkAccessPoliciesOperations +from .adaptive_application_controls_operations import AdaptiveApplicationControlsOperations from .locations_operations import LocationsOperations from .operations import Operations from .tasks_operations import TasksOperations @@ -49,6 +50,7 @@ 'DiscoveredSecuritySolutionsOperations', 'ExternalSecuritySolutionsOperations', 'JitNetworkAccessPoliciesOperations', + 'AdaptiveApplicationControlsOperations', 'LocationsOperations', 'Operations', 'TasksOperations', diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/adaptive_application_controls_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/adaptive_application_controls_operations.py new file mode 100644 index 000000000000..1f77939b79a5 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/adaptive_application_controls_operations.py @@ -0,0 +1,229 @@ +# 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 AdaptiveApplicationControlsOperations(object): + """AdaptiveApplicationControlsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2015-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-06-01-preview" + + self.config = config + + def list( + self, include_path_recommendations=None, summary=None, custom_headers=None, raw=False, **operation_config): + """Gets a list of application control VM/server groups for the + subscription. + + :param include_path_recommendations: Include the policy rules + :type include_path_recommendations: bool + :param summary: Return output in a summarized form + :type summary: bool + :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: AppWhitelistingGroups or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.AppWhitelistingGroups or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if include_path_recommendations is not None: + query_parameters['includePathRecommendations'] = self._serialize.query("include_path_recommendations", include_path_recommendations, 'bool') + if summary is not None: + query_parameters['summary'] = self._serialize.query("summary", summary, 'bool') + + # 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('AppWhitelistingGroups', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/applicationWhitelistings'} + + def get( + self, group_name, custom_headers=None, raw=False, **operation_config): + """Gets an application control VM/server group. + + :param group_name: Name of an application control VM/server group + :type group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AppWhitelistingGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.AppWhitelistingGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), + 'groupName': self._serialize.url("group_name", group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + 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('AppWhitelistingGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}'} + + def put( + self, group_name, body, custom_headers=None, raw=False, **operation_config): + """Update an application control VM/server group. + + :param group_name: Name of an application control VM/server group + :type group_name: str + :param body: The updated VM/server group data + :type body: ~azure.mgmt.security.models.AppWhitelistingPutGroupData + :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: AppWhitelistingGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.AppWhitelistingGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.put.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), + 'groupName': self._serialize.url("group_name", group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(body, 'AppWhitelistingPutGroupData') + + # 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('AppWhitelistingGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}'} 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 27c5f08754c8..86f623d0de22 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 @@ -21,6 +21,7 @@ from .operations.discovered_security_solutions_operations import DiscoveredSecuritySolutionsOperations from .operations.external_security_solutions_operations import ExternalSecuritySolutionsOperations from .operations.jit_network_access_policies_operations import JitNetworkAccessPoliciesOperations +from .operations.adaptive_application_controls_operations import AdaptiveApplicationControlsOperations from .operations.locations_operations import LocationsOperations from .operations.operations import Operations from .operations.tasks_operations import TasksOperations @@ -106,6 +107,8 @@ class SecurityCenter(SDKClient): :vartype external_security_solutions: azure.mgmt.security.operations.ExternalSecuritySolutionsOperations :ivar jit_network_access_policies: JitNetworkAccessPolicies operations :vartype jit_network_access_policies: azure.mgmt.security.operations.JitNetworkAccessPoliciesOperations + :ivar adaptive_application_controls: AdaptiveApplicationControls operations + :vartype adaptive_application_controls: azure.mgmt.security.operations.AdaptiveApplicationControlsOperations :ivar locations: Locations operations :vartype locations: azure.mgmt.security.operations.LocationsOperations :ivar operations: Operations operations @@ -188,6 +191,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.jit_network_access_policies = JitNetworkAccessPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) + self.adaptive_application_controls = AdaptiveApplicationControlsOperations( + self._client, self.config, self._serialize, self._deserialize) self.locations = LocationsOperations( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations(