diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/AzSdk.RP.props b/src/SDKs/SecurityCenter/Management.SecurityCenter/AzSdk.RP.props new file mode 100644 index 000000000000..07452198cd6d --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/AzSdk.RP.props @@ -0,0 +1,7 @@ + + + + Security_2015-06-01_preview;Security_2017_08_01_preview; + $(PackageTags);$(CommonTags);$(AzureApiTag); + + \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/AlertsOperations.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/AlertsOperations.cs new file mode 100644 index 000000000000..2f1403fbafe7 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/AlertsOperations.cs @@ -0,0 +1,2455 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// AlertsOperations operations. + /// + internal partial class AlertsOperations : IServiceOperations, IAlertsOperations + { + /// + /// Initializes a new instance of the AlertsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal AlertsOperations(SecurityCenterClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SecurityCenterClient + /// + public SecurityCenterClient Client { get; private set; } + + /// + /// List all the alerts that are associated with the subscription + /// + /// + /// OData filter. Optional. + /// + /// + /// OData select. Optional. + /// + /// + /// OData expand. Optional. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string filter = default(string), string select = default(string), string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("filter", filter); + tracingParameters.Add("select", select); + tracingParameters.Add("expand", expand); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/alerts").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (select != null) + { + _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); + } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List all the alerts alerts that are associated with the resource group + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// OData filter. Optional. + /// + /// + /// OData select. Optional. + /// + /// + /// OData expand. Optional. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string filter = default(string), string select = default(string), string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("filter", filter); + tracingParameters.Add("select", select); + tracingParameters.Add("expand", expand); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (select != null) + { + _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); + } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List all the alerts that are associated with the subscription that are + /// stored in a specific location + /// + /// + /// OData filter. Optional. + /// + /// + /// OData select. Optional. + /// + /// + /// OData expand. Optional. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListSubscriptionLevelAlertsByRegionWithHttpMessagesAsync(string filter = default(string), string select = default(string), string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (Client.AscLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("filter", filter); + tracingParameters.Add("select", select); + tracingParameters.Add("expand", expand); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListSubscriptionLevelAlertsByRegion", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (select != null) + { + _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); + } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List all the alerts that are associated with the resource group that are + /// stored in a specific location + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// OData filter. Optional. + /// + /// + /// OData select. Optional. + /// + /// + /// OData expand. Optional. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListResourceGroupLevelAlertsByRegionWithHttpMessagesAsync(string resourceGroupName, string filter = default(string), string select = default(string), string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (Client.AscLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("filter", filter); + tracingParameters.Add("select", select); + tracingParameters.Add("expand", expand); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListResourceGroupLevelAlertsByRegion", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (select != null) + { + _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); + } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get an alert that is associated with a subscription + /// + /// + /// Name of the alert object + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetSubscriptionLevelAlertWithHttpMessagesAsync(string alertName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (Client.AscLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); + } + if (alertName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "alertName"); + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("alertName", alertName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetSubscriptionLevelAlert", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation)); + _url = _url.Replace("{alertName}", System.Uri.EscapeDataString(alertName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get an alert that is associated a resource group or a resource in a + /// resource group + /// + /// + /// Name of the alert object + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetResourceGroupLevelAlertsWithHttpMessagesAsync(string alertName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (Client.AscLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); + } + if (alertName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "alertName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("alertName", alertName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetResourceGroupLevelAlerts", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation)); + _url = _url.Replace("{alertName}", System.Uri.EscapeDataString(alertName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Update the alert's state + /// + /// + /// Name of the alert object + /// + /// + /// Type of the action to do on the alert. Possible values include: 'Dismiss', + /// 'Reactivate' + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task UpdateSubscriptionLevelAlertStateWithHttpMessagesAsync(string alertName, string alertUpdateActionType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (Client.AscLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); + } + if (alertName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "alertName"); + } + if (alertUpdateActionType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "alertUpdateActionType"); + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("alertName", alertName); + tracingParameters.Add("alertUpdateActionType", alertUpdateActionType); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "UpdateSubscriptionLevelAlertState", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/{alertUpdateActionType}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation)); + _url = _url.Replace("{alertName}", System.Uri.EscapeDataString(alertName)); + _url = _url.Replace("{alertUpdateActionType}", System.Uri.EscapeDataString(alertUpdateActionType)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Update the alert's state + /// + /// + /// Name of the alert object + /// + /// + /// Type of the action to do on the alert. Possible values include: 'Dismiss', + /// 'Reactivate' + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task UpdateResourceGroupLevelAlertStateWithHttpMessagesAsync(string alertName, string alertUpdateActionType, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (Client.AscLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); + } + if (alertName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "alertName"); + } + if (alertUpdateActionType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "alertUpdateActionType"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("alertName", alertName); + tracingParameters.Add("alertUpdateActionType", alertUpdateActionType); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "UpdateResourceGroupLevelAlertState", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/{alertUpdateActionType}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation)); + _url = _url.Replace("{alertName}", System.Uri.EscapeDataString(alertName)); + _url = _url.Replace("{alertUpdateActionType}", System.Uri.EscapeDataString(alertUpdateActionType)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List all the alerts that are associated with the subscription + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List all the alerts alerts that are associated with the resource group + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List all the alerts that are associated with the subscription that are + /// stored in a specific location + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListSubscriptionLevelAlertsByRegionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListSubscriptionLevelAlertsByRegionNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List all the alerts that are associated with the resource group that are + /// stored in a specific location + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListResourceGroupLevelAlertsByRegionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListResourceGroupLevelAlertsByRegionNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/AlertsOperationsExtensions.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/AlertsOperationsExtensions.cs new file mode 100644 index 000000000000..53c45ab565d2 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/AlertsOperationsExtensions.cs @@ -0,0 +1,533 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for AlertsOperations. + /// + public static partial class AlertsOperationsExtensions + { + /// + /// List all the alerts that are associated with the subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// OData filter. Optional. + /// + /// + /// OData select. Optional. + /// + /// + /// OData expand. Optional. + /// + public static IPage List(this IAlertsOperations operations, string filter = default(string), string select = default(string), string expand = default(string)) + { + return operations.ListAsync(filter, select, expand).GetAwaiter().GetResult(); + } + + /// + /// List all the alerts that are associated with the subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// OData filter. Optional. + /// + /// + /// OData select. Optional. + /// + /// + /// OData expand. Optional. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IAlertsOperations operations, string filter = default(string), string select = default(string), string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(filter, select, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all the alerts alerts that are associated with the resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// OData filter. Optional. + /// + /// + /// OData select. Optional. + /// + /// + /// OData expand. Optional. + /// + public static IPage ListByResourceGroup(this IAlertsOperations operations, string resourceGroupName, string filter = default(string), string select = default(string), string expand = default(string)) + { + return operations.ListByResourceGroupAsync(resourceGroupName, filter, select, expand).GetAwaiter().GetResult(); + } + + /// + /// List all the alerts alerts that are associated with the resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// OData filter. Optional. + /// + /// + /// OData select. Optional. + /// + /// + /// OData expand. Optional. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IAlertsOperations operations, string resourceGroupName, string filter = default(string), string select = default(string), string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, filter, select, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all the alerts that are associated with the subscription that are + /// stored in a specific location + /// + /// + /// The operations group for this extension method. + /// + /// + /// OData filter. Optional. + /// + /// + /// OData select. Optional. + /// + /// + /// OData expand. Optional. + /// + public static IPage ListSubscriptionLevelAlertsByRegion(this IAlertsOperations operations, string filter = default(string), string select = default(string), string expand = default(string)) + { + return operations.ListSubscriptionLevelAlertsByRegionAsync(filter, select, expand).GetAwaiter().GetResult(); + } + + /// + /// List all the alerts that are associated with the subscription that are + /// stored in a specific location + /// + /// + /// The operations group for this extension method. + /// + /// + /// OData filter. Optional. + /// + /// + /// OData select. Optional. + /// + /// + /// OData expand. Optional. + /// + /// + /// The cancellation token. + /// + public static async Task> ListSubscriptionLevelAlertsByRegionAsync(this IAlertsOperations operations, string filter = default(string), string select = default(string), string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListSubscriptionLevelAlertsByRegionWithHttpMessagesAsync(filter, select, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all the alerts that are associated with the resource group that are + /// stored in a specific location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// OData filter. Optional. + /// + /// + /// OData select. Optional. + /// + /// + /// OData expand. Optional. + /// + public static IPage ListResourceGroupLevelAlertsByRegion(this IAlertsOperations operations, string resourceGroupName, string filter = default(string), string select = default(string), string expand = default(string)) + { + return operations.ListResourceGroupLevelAlertsByRegionAsync(resourceGroupName, filter, select, expand).GetAwaiter().GetResult(); + } + + /// + /// List all the alerts that are associated with the resource group that are + /// stored in a specific location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// OData filter. Optional. + /// + /// + /// OData select. Optional. + /// + /// + /// OData expand. Optional. + /// + /// + /// The cancellation token. + /// + public static async Task> ListResourceGroupLevelAlertsByRegionAsync(this IAlertsOperations operations, string resourceGroupName, string filter = default(string), string select = default(string), string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListResourceGroupLevelAlertsByRegionWithHttpMessagesAsync(resourceGroupName, filter, select, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get an alert that is associated with a subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the alert object + /// + public static Alert GetSubscriptionLevelAlert(this IAlertsOperations operations, string alertName) + { + return operations.GetSubscriptionLevelAlertAsync(alertName).GetAwaiter().GetResult(); + } + + /// + /// Get an alert that is associated with a subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the alert object + /// + /// + /// The cancellation token. + /// + public static async Task GetSubscriptionLevelAlertAsync(this IAlertsOperations operations, string alertName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSubscriptionLevelAlertWithHttpMessagesAsync(alertName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get an alert that is associated a resource group or a resource in a + /// resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the alert object + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + public static Alert GetResourceGroupLevelAlerts(this IAlertsOperations operations, string alertName, string resourceGroupName) + { + return operations.GetResourceGroupLevelAlertsAsync(alertName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Get an alert that is associated a resource group or a resource in a + /// resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the alert object + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task GetResourceGroupLevelAlertsAsync(this IAlertsOperations operations, string alertName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetResourceGroupLevelAlertsWithHttpMessagesAsync(alertName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update the alert's state + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the alert object + /// + /// + /// Type of the action to do on the alert. Possible values include: 'Dismiss', + /// 'Reactivate' + /// + public static void UpdateSubscriptionLevelAlertState(this IAlertsOperations operations, string alertName, string alertUpdateActionType) + { + operations.UpdateSubscriptionLevelAlertStateAsync(alertName, alertUpdateActionType).GetAwaiter().GetResult(); + } + + /// + /// Update the alert's state + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the alert object + /// + /// + /// Type of the action to do on the alert. Possible values include: 'Dismiss', + /// 'Reactivate' + /// + /// + /// The cancellation token. + /// + public static async Task UpdateSubscriptionLevelAlertStateAsync(this IAlertsOperations operations, string alertName, string alertUpdateActionType, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.UpdateSubscriptionLevelAlertStateWithHttpMessagesAsync(alertName, alertUpdateActionType, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Update the alert's state + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the alert object + /// + /// + /// Type of the action to do on the alert. Possible values include: 'Dismiss', + /// 'Reactivate' + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + public static void UpdateResourceGroupLevelAlertState(this IAlertsOperations operations, string alertName, string alertUpdateActionType, string resourceGroupName) + { + operations.UpdateResourceGroupLevelAlertStateAsync(alertName, alertUpdateActionType, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Update the alert's state + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the alert object + /// + /// + /// Type of the action to do on the alert. Possible values include: 'Dismiss', + /// 'Reactivate' + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateResourceGroupLevelAlertStateAsync(this IAlertsOperations operations, string alertName, string alertUpdateActionType, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.UpdateResourceGroupLevelAlertStateWithHttpMessagesAsync(alertName, alertUpdateActionType, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// List all the alerts that are associated with the subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IAlertsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all the alerts that are associated with the subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IAlertsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all the alerts alerts that are associated with the resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IAlertsOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all the alerts alerts that are associated with the resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IAlertsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all the alerts that are associated with the subscription that are + /// stored in a specific location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListSubscriptionLevelAlertsByRegionNext(this IAlertsOperations operations, string nextPageLink) + { + return operations.ListSubscriptionLevelAlertsByRegionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all the alerts that are associated with the subscription that are + /// stored in a specific location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListSubscriptionLevelAlertsByRegionNextAsync(this IAlertsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListSubscriptionLevelAlertsByRegionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all the alerts that are associated with the resource group that are + /// stored in a specific location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListResourceGroupLevelAlertsByRegionNext(this IAlertsOperations operations, string nextPageLink) + { + return operations.ListResourceGroupLevelAlertsByRegionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all the alerts that are associated with the resource group that are + /// stored in a specific location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListResourceGroupLevelAlertsByRegionNextAsync(this IAlertsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListResourceGroupLevelAlertsByRegionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/AutoProvisioningSettingsOperations.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/AutoProvisioningSettingsOperations.cs new file mode 100644 index 000000000000..bac4d7455e1c --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/AutoProvisioningSettingsOperations.cs @@ -0,0 +1,814 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// AutoProvisioningSettingsOperations operations. + /// + internal partial class AutoProvisioningSettingsOperations : IServiceOperations, IAutoProvisioningSettingsOperations + { + /// + /// Initializes a new instance of the AutoProvisioningSettingsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal AutoProvisioningSettingsOperations(SecurityCenterClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SecurityCenterClient + /// + public SecurityCenterClient Client { get; private set; } + + /// + /// Exposes the auto provisioning settings of the subscriptions + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + string apiVersion = "2017-08-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Details of a specific setting + /// + /// + /// Auto provisioning setting key + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string settingName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (settingName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "settingName"); + } + string apiVersion = "2017-08-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("settingName", settingName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{settingName}", System.Uri.EscapeDataString(settingName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Details of a specific setting + /// + /// + /// Auto provisioning setting key + /// + /// + /// Describes what kind of security agent provisioning action to take. Possible + /// values include: 'On', 'Off' + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateWithHttpMessagesAsync(string settingName, string autoProvision, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (settingName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "settingName"); + } + if (autoProvision == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "autoProvision"); + } + string apiVersion = "2017-08-01-preview"; + AutoProvisioningSetting setting = new AutoProvisioningSetting(); + if (autoProvision != null) + { + setting.AutoProvision = autoProvision; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("settingName", settingName); + tracingParameters.Add("setting", setting); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{settingName}", System.Uri.EscapeDataString(settingName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(setting != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(setting, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Exposes the auto provisioning settings of the subscriptions + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/AutoProvisioningSettingsOperationsExtensions.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/AutoProvisioningSettingsOperationsExtensions.cs new file mode 100644 index 000000000000..12b72c1a682c --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/AutoProvisioningSettingsOperationsExtensions.cs @@ -0,0 +1,163 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for AutoProvisioningSettingsOperations. + /// + public static partial class AutoProvisioningSettingsOperationsExtensions + { + /// + /// Exposes the auto provisioning settings of the subscriptions + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IAutoProvisioningSettingsOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Exposes the auto provisioning settings of the subscriptions + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IAutoProvisioningSettingsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Details of a specific setting + /// + /// + /// The operations group for this extension method. + /// + /// + /// Auto provisioning setting key + /// + public static AutoProvisioningSetting Get(this IAutoProvisioningSettingsOperations operations, string settingName) + { + return operations.GetAsync(settingName).GetAwaiter().GetResult(); + } + + /// + /// Details of a specific setting + /// + /// + /// The operations group for this extension method. + /// + /// + /// Auto provisioning setting key + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IAutoProvisioningSettingsOperations operations, string settingName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(settingName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Details of a specific setting + /// + /// + /// The operations group for this extension method. + /// + /// + /// Auto provisioning setting key + /// + /// + /// Describes what kind of security agent provisioning action to take. Possible + /// values include: 'On', 'Off' + /// + public static AutoProvisioningSetting Create(this IAutoProvisioningSettingsOperations operations, string settingName, string autoProvision) + { + return operations.CreateAsync(settingName, autoProvision).GetAwaiter().GetResult(); + } + + /// + /// Details of a specific setting + /// + /// + /// The operations group for this extension method. + /// + /// + /// Auto provisioning setting key + /// + /// + /// Describes what kind of security agent provisioning action to take. Possible + /// values include: 'On', 'Off' + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IAutoProvisioningSettingsOperations operations, string settingName, string autoProvision, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(settingName, autoProvision, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Exposes the auto provisioning settings of the subscriptions + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IAutoProvisioningSettingsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Exposes the auto provisioning settings of the subscriptions + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IAutoProvisioningSettingsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/CompliancesOperations.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/CompliancesOperations.cs new file mode 100644 index 000000000000..301070d6be91 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/CompliancesOperations.cs @@ -0,0 +1,600 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// CompliancesOperations operations. + /// + internal partial class CompliancesOperations : IServiceOperations, ICompliancesOperations + { + /// + /// Initializes a new instance of the CompliancesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal CompliancesOperations(SecurityCenterClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SecurityCenterClient + /// + public SecurityCenterClient Client { get; private set; } + + /// + /// The Compliance scores of the specific management group. + /// + /// + /// Scope of the query, can be subscription + /// (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group + /// (/providers/Microsoft.Management/managementGroups/mgName). + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (scope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scope"); + } + string apiVersion = "2017-08-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("scope", scope); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.Security/compliances").ToString(); + _url = _url.Replace("{scope}", System.Uri.EscapeDataString(scope)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Details of a specific Compliance. + /// + /// + /// Scope of the query, can be subscription + /// (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group + /// (/providers/Microsoft.Management/managementGroups/mgName). + /// + /// + /// name of the Compliance + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string scope, string complianceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (scope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scope"); + } + if (complianceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "complianceName"); + } + string apiVersion = "2017-08-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("scope", scope); + tracingParameters.Add("complianceName", complianceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.Security/compliances/{complianceName}").ToString(); + _url = _url.Replace("{scope}", System.Uri.EscapeDataString(scope)); + _url = _url.Replace("{complianceName}", System.Uri.EscapeDataString(complianceName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// The Compliance scores of the specific management group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/CompliancesOperationsExtensions.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/CompliancesOperationsExtensions.cs new file mode 100644 index 000000000000..5221eb55ab00 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/CompliancesOperationsExtensions.cs @@ -0,0 +1,141 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for CompliancesOperations. + /// + public static partial class CompliancesOperationsExtensions + { + /// + /// The Compliance scores of the specific management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Scope of the query, can be subscription + /// (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group + /// (/providers/Microsoft.Management/managementGroups/mgName). + /// + public static IPage List(this ICompliancesOperations operations, string scope) + { + return operations.ListAsync(scope).GetAwaiter().GetResult(); + } + + /// + /// The Compliance scores of the specific management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Scope of the query, can be subscription + /// (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group + /// (/providers/Microsoft.Management/managementGroups/mgName). + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ICompliancesOperations operations, string scope, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(scope, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Details of a specific Compliance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Scope of the query, can be subscription + /// (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group + /// (/providers/Microsoft.Management/managementGroups/mgName). + /// + /// + /// name of the Compliance + /// + public static Compliance Get(this ICompliancesOperations operations, string scope, string complianceName) + { + return operations.GetAsync(scope, complianceName).GetAwaiter().GetResult(); + } + + /// + /// Details of a specific Compliance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Scope of the query, can be subscription + /// (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group + /// (/providers/Microsoft.Management/managementGroups/mgName). + /// + /// + /// name of the Compliance + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ICompliancesOperations operations, string scope, string complianceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(scope, complianceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// The Compliance scores of the specific management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this ICompliancesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// The Compliance scores of the specific management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this ICompliancesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/DiscoveredSecuritySolutionsOperations.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/DiscoveredSecuritySolutionsOperations.cs new file mode 100644 index 000000000000..b359d01b3d1f --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/DiscoveredSecuritySolutionsOperations.cs @@ -0,0 +1,995 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DiscoveredSecuritySolutionsOperations operations. + /// + internal partial class DiscoveredSecuritySolutionsOperations : IServiceOperations, IDiscoveredSecuritySolutionsOperations + { + /// + /// Initializes a new instance of the DiscoveredSecuritySolutionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DiscoveredSecuritySolutionsOperations(SecurityCenterClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SecurityCenterClient + /// + public SecurityCenterClient Client { get; private set; } + + /// + /// Gets a list of discovered Security Solutions for the subscription. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/discoveredSecuritySolutions").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of discovered Security Solutions for the subscription and + /// location. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByHomeRegionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (Client.AscLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByHomeRegion", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a specific discovered Security Solution. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Name of a discovered security solution. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string discoveredSecuritySolutionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.AscLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); + } + if (discoveredSecuritySolutionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "discoveredSecuritySolutionName"); + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("discoveredSecuritySolutionName", discoveredSecuritySolutionName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions/{discoveredSecuritySolutionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation)); + _url = _url.Replace("{discoveredSecuritySolutionName}", System.Uri.EscapeDataString(discoveredSecuritySolutionName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of discovered Security Solutions for the subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of discovered Security Solutions for the subscription and + /// location. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByHomeRegionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByHomeRegionNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/DiscoveredSecuritySolutionsOperationsExtensions.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/DiscoveredSecuritySolutionsOperationsExtensions.cs new file mode 100644 index 000000000000..33eab088f695 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/DiscoveredSecuritySolutionsOperationsExtensions.cs @@ -0,0 +1,195 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for DiscoveredSecuritySolutionsOperations. + /// + public static partial class DiscoveredSecuritySolutionsOperationsExtensions + { + /// + /// Gets a list of discovered Security Solutions for the subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IDiscoveredSecuritySolutionsOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets a list of discovered Security Solutions for the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IDiscoveredSecuritySolutionsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of discovered Security Solutions for the subscription and + /// location. + /// + /// + /// The operations group for this extension method. + /// + public static IPage ListByHomeRegion(this IDiscoveredSecuritySolutionsOperations operations) + { + return operations.ListByHomeRegionAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets a list of discovered Security Solutions for the subscription and + /// location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByHomeRegionAsync(this IDiscoveredSecuritySolutionsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByHomeRegionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a specific discovered Security Solution. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Name of a discovered security solution. + /// + public static DiscoveredSecuritySolution Get(this IDiscoveredSecuritySolutionsOperations operations, string resourceGroupName, string discoveredSecuritySolutionName) + { + return operations.GetAsync(resourceGroupName, discoveredSecuritySolutionName).GetAwaiter().GetResult(); + } + + /// + /// Gets a specific discovered Security Solution. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Name of a discovered security solution. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IDiscoveredSecuritySolutionsOperations operations, string resourceGroupName, string discoveredSecuritySolutionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, discoveredSecuritySolutionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of discovered Security Solutions for the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IDiscoveredSecuritySolutionsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of discovered Security Solutions for the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IDiscoveredSecuritySolutionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of discovered Security Solutions for the subscription and + /// location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByHomeRegionNext(this IDiscoveredSecuritySolutionsOperations operations, string nextPageLink) + { + return operations.ListByHomeRegionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of discovered Security Solutions for the subscription and + /// location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByHomeRegionNextAsync(this IDiscoveredSecuritySolutionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByHomeRegionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/ExternalSecuritySolutionsOperations.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/ExternalSecuritySolutionsOperations.cs new file mode 100644 index 000000000000..6d64b5b99e63 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/ExternalSecuritySolutionsOperations.cs @@ -0,0 +1,995 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ExternalSecuritySolutionsOperations operations. + /// + internal partial class ExternalSecuritySolutionsOperations : IServiceOperations, IExternalSecuritySolutionsOperations + { + /// + /// Initializes a new instance of the ExternalSecuritySolutionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ExternalSecuritySolutionsOperations(SecurityCenterClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SecurityCenterClient + /// + public SecurityCenterClient Client { get; private set; } + + /// + /// Gets a list of external security solutions for the subscription. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/externalSecuritySolutions").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of external Security Solutions for the subscription and + /// location. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByHomeRegionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (Client.AscLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByHomeRegion", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a specific external Security Solution. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Name of an external security solution. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string externalSecuritySolutionsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.AscLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); + } + if (externalSecuritySolutionsName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "externalSecuritySolutionsName"); + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("externalSecuritySolutionsName", externalSecuritySolutionsName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions/{externalSecuritySolutionsName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation)); + _url = _url.Replace("{externalSecuritySolutionsName}", System.Uri.EscapeDataString(externalSecuritySolutionsName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of external security solutions for the subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of external Security Solutions for the subscription and + /// location. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByHomeRegionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByHomeRegionNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/ExternalSecuritySolutionsOperationsExtensions.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/ExternalSecuritySolutionsOperationsExtensions.cs new file mode 100644 index 000000000000..49c9f429e7b9 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/ExternalSecuritySolutionsOperationsExtensions.cs @@ -0,0 +1,195 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ExternalSecuritySolutionsOperations. + /// + public static partial class ExternalSecuritySolutionsOperationsExtensions + { + /// + /// Gets a list of external security solutions for the subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IExternalSecuritySolutionsOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets a list of external security solutions for the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IExternalSecuritySolutionsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of external Security Solutions for the subscription and + /// location. + /// + /// + /// The operations group for this extension method. + /// + public static IPage ListByHomeRegion(this IExternalSecuritySolutionsOperations operations) + { + return operations.ListByHomeRegionAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets a list of external Security Solutions for the subscription and + /// location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByHomeRegionAsync(this IExternalSecuritySolutionsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByHomeRegionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a specific external Security Solution. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Name of an external security solution. + /// + public static ExternalSecuritySolution Get(this IExternalSecuritySolutionsOperations operations, string resourceGroupName, string externalSecuritySolutionsName) + { + return operations.GetAsync(resourceGroupName, externalSecuritySolutionsName).GetAwaiter().GetResult(); + } + + /// + /// Gets a specific external Security Solution. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Name of an external security solution. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IExternalSecuritySolutionsOperations operations, string resourceGroupName, string externalSecuritySolutionsName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, externalSecuritySolutionsName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of external security solutions for the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IExternalSecuritySolutionsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of external security solutions for the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IExternalSecuritySolutionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of external Security Solutions for the subscription and + /// location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByHomeRegionNext(this IExternalSecuritySolutionsOperations operations, string nextPageLink) + { + return operations.ListByHomeRegionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of external Security Solutions for the subscription and + /// location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByHomeRegionNextAsync(this IExternalSecuritySolutionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByHomeRegionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/IAlertsOperations.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/IAlertsOperations.cs new file mode 100644 index 000000000000..7b4c3118ed92 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/IAlertsOperations.cs @@ -0,0 +1,340 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// AlertsOperations operations. + /// + public partial interface IAlertsOperations + { + /// + /// List all the alerts that are associated with the subscription + /// + /// + /// OData filter. Optional. + /// + /// + /// OData select. Optional. + /// + /// + /// OData expand. Optional. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string filter = default(string), string select = default(string), string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all the alerts alerts that are associated with the resource + /// group + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// OData filter. Optional. + /// + /// + /// OData select. Optional. + /// + /// + /// OData expand. Optional. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string filter = default(string), string select = default(string), string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all the alerts that are associated with the subscription that + /// are stored in a specific location + /// + /// + /// OData filter. Optional. + /// + /// + /// OData select. Optional. + /// + /// + /// OData expand. Optional. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListSubscriptionLevelAlertsByRegionWithHttpMessagesAsync(string filter = default(string), string select = default(string), string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all the alerts that are associated with the resource group + /// that are stored in a specific location + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// OData filter. Optional. + /// + /// + /// OData select. Optional. + /// + /// + /// OData expand. Optional. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListResourceGroupLevelAlertsByRegionWithHttpMessagesAsync(string resourceGroupName, string filter = default(string), string select = default(string), string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get an alert that is associated with a subscription + /// + /// + /// Name of the alert object + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetSubscriptionLevelAlertWithHttpMessagesAsync(string alertName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get an alert that is associated a resource group or a resource in a + /// resource group + /// + /// + /// Name of the alert object + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetResourceGroupLevelAlertsWithHttpMessagesAsync(string alertName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update the alert's state + /// + /// + /// Name of the alert object + /// + /// + /// Type of the action to do on the alert. Possible values include: + /// 'Dismiss', 'Reactivate' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task UpdateSubscriptionLevelAlertStateWithHttpMessagesAsync(string alertName, string alertUpdateActionType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update the alert's state + /// + /// + /// Name of the alert object + /// + /// + /// Type of the action to do on the alert. Possible values include: + /// 'Dismiss', 'Reactivate' + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task UpdateResourceGroupLevelAlertStateWithHttpMessagesAsync(string alertName, string alertUpdateActionType, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all the alerts that are associated with the subscription + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all the alerts alerts that are associated with the resource + /// group + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all the alerts that are associated with the subscription that + /// are stored in a specific location + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListSubscriptionLevelAlertsByRegionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all the alerts that are associated with the resource group + /// that are stored in a specific location + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListResourceGroupLevelAlertsByRegionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/IAutoProvisioningSettingsOperations.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/IAutoProvisioningSettingsOperations.cs new file mode 100644 index 000000000000..571b1fea820f --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/IAutoProvisioningSettingsOperations.cs @@ -0,0 +1,116 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// AutoProvisioningSettingsOperations operations. + /// + public partial interface IAutoProvisioningSettingsOperations + { + /// + /// Exposes the auto provisioning settings of the subscriptions + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Details of a specific setting + /// + /// + /// Auto provisioning setting key + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string settingName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Details of a specific setting + /// + /// + /// Auto provisioning setting key + /// + /// + /// Describes what kind of security agent provisioning action to take. + /// Possible values include: 'On', 'Off' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateWithHttpMessagesAsync(string settingName, string autoProvision, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Exposes the auto provisioning settings of the subscriptions + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/ICompliancesOperations.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/ICompliancesOperations.cs new file mode 100644 index 000000000000..7fe5b67bd1c7 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/ICompliancesOperations.cs @@ -0,0 +1,100 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// CompliancesOperations operations. + /// + public partial interface ICompliancesOperations + { + /// + /// The Compliance scores of the specific management group. + /// + /// + /// Scope of the query, can be subscription + /// (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management + /// group (/providers/Microsoft.Management/managementGroups/mgName). + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Details of a specific Compliance. + /// + /// + /// Scope of the query, can be subscription + /// (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management + /// group (/providers/Microsoft.Management/managementGroups/mgName). + /// + /// + /// name of the Compliance + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string scope, string complianceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// The Compliance scores of the specific management group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/IDiscoveredSecuritySolutionsOperations.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/IDiscoveredSecuritySolutionsOperations.cs new file mode 100644 index 000000000000..729cbdd31541 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/IDiscoveredSecuritySolutionsOperations.cs @@ -0,0 +1,137 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DiscoveredSecuritySolutionsOperations operations. + /// + public partial interface IDiscoveredSecuritySolutionsOperations + { + /// + /// Gets a list of discovered Security Solutions for the subscription. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of discovered Security Solutions for the subscription + /// and location. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByHomeRegionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a specific discovered Security Solution. + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// Name of a discovered security solution. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string discoveredSecuritySolutionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of discovered Security Solutions for the subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of discovered Security Solutions for the subscription + /// and location. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByHomeRegionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/IExternalSecuritySolutionsOperations.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/IExternalSecuritySolutionsOperations.cs new file mode 100644 index 000000000000..f258aaadccdb --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/IExternalSecuritySolutionsOperations.cs @@ -0,0 +1,137 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ExternalSecuritySolutionsOperations operations. + /// + public partial interface IExternalSecuritySolutionsOperations + { + /// + /// Gets a list of external security solutions for the subscription. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of external Security Solutions for the subscription and + /// location. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByHomeRegionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a specific external Security Solution. + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// Name of an external security solution. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string externalSecuritySolutionsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of external security solutions for the subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of external Security Solutions for the subscription and + /// location. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByHomeRegionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/IJitNetworkAccessPoliciesOperations.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/IJitNetworkAccessPoliciesOperations.cs new file mode 100644 index 000000000000..44a7354265cc --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/IJitNetworkAccessPoliciesOperations.cs @@ -0,0 +1,316 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// JitNetworkAccessPoliciesOperations operations. + /// + public partial interface IJitNetworkAccessPoliciesOperations + { + /// + /// Policies for protecting resources using Just-in-Time access + /// control. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Policies for protecting resources using Just-in-Time access control + /// for the subscription, location + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByRegionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Policies for protecting resources using Just-in-Time access control + /// for the subscription, location + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Policies for protecting resources using Just-in-Time access control + /// for the subscription, location + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupAndRegionWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Policies for protecting resources using Just-in-Time access control + /// for the subscription, location + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// Name of a Just-in-Time access configuration policy. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string jitNetworkAccessPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create a policy for protecting resources using Just-in-Time access + /// control + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// Name of a Just-in-Time access configuration policy. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string jitNetworkAccessPolicyName, JitNetworkAccessPolicy body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a Just-in-Time access control policy. + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// Name of a Just-in-Time access configuration policy. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string jitNetworkAccessPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Initiate a JIT access from a specific Just-in-Time policy + /// configuration. + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// Name of a Just-in-Time access configuration policy. + /// + /// + /// A list of virtual machines & ports to open access for + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> InitiateWithHttpMessagesAsync(string resourceGroupName, string jitNetworkAccessPolicyName, IList virtualMachines, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Policies for protecting resources using Just-in-Time access + /// control. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Policies for protecting resources using Just-in-Time access control + /// for the subscription, location + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByRegionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Policies for protecting resources using Just-in-Time access control + /// for the subscription, location + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Policies for protecting resources using Just-in-Time access control + /// for the subscription, location + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupAndRegionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/ILocationsOperations.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/ILocationsOperations.cs new file mode 100644 index 000000000000..f8aa5ec2d81e --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/ILocationsOperations.cs @@ -0,0 +1,93 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// LocationsOperations operations. + /// + public partial interface ILocationsOperations + { + /// + /// The location of the responsible ASC of the specific subscription + /// (home region). For each subscription there is only one responsible + /// location. The location in the response should be used to read or + /// write other resources in ASC according to their ID. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Details of a specific location + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// The location of the responsible ASC of the specific subscription + /// (home region). For each subscription there is only one responsible + /// location. The location in the response should be used to read or + /// write other resources in ASC according to their ID. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/IOperations.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/IOperations.cs new file mode 100644 index 000000000000..dff12f4f27ac --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/IOperations.cs @@ -0,0 +1,68 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Operations operations. + /// + public partial interface IOperations + { + /// + /// Exposes all available operations for discovery purposes. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Exposes all available operations for discovery purposes. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/IPricingsOperations.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/IPricingsOperations.cs new file mode 100644 index 000000000000..2fc785ec08a2 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/IPricingsOperations.cs @@ -0,0 +1,216 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PricingsOperations operations. + /// + public partial interface IPricingsOperations + { + /// + /// Security pricing configurations in the subscription + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Security pricing configurations in the resource group + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Security pricing configuration in the subscriptionSecurity pricing + /// configuration in the subscription + /// + /// + /// name of the pricing configuration + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetSubscriptionPricingWithHttpMessagesAsync(string pricingName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Security pricing configuration in the subscription + /// + /// + /// name of the pricing configuration + /// + /// + /// Pricing tier type. Possible values include: 'Free', 'Standard' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateSubscriptionPricingWithHttpMessagesAsync(string pricingName, string pricingTier, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Security pricing configuration in the resource group + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// name of the pricing configuration + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetResourceGroupPricingWithHttpMessagesAsync(string resourceGroupName, string pricingName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Security pricing configuration in the resource group + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// name of the pricing configuration + /// + /// + /// Pricing tier type. Possible values include: 'Free', 'Standard' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateResourceGroupPricingWithHttpMessagesAsync(string resourceGroupName, string pricingName, string pricingTier, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Security pricing configurations in the subscription + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Security pricing configurations in the resource group + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/ISecurityCenterClient.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/ISecurityCenterClient.cs new file mode 100644 index 000000000000..81a2e07411f8 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/ISecurityCenterClient.cs @@ -0,0 +1,134 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + + /// + /// API spec for Microsoft.Security (Azure Security Center) resource + /// provider + /// + public partial interface ISecurityCenterClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + ServiceClientCredentials Credentials { get; } + + /// + /// Azure subscription ID + /// + string SubscriptionId { get; set; } + + /// + /// The location where ASC stores the data of the subscription. can be + /// retrieved from Get locations + /// + string AscLocation { get; set; } + + /// + /// Gets or sets the preferred language for the response. + /// + string AcceptLanguage { get; set; } + + /// + /// Gets or sets the retry timeout in seconds for Long Running + /// Operations. Default value is 30. + /// + int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// When set to true a unique x-ms-client-request-id value is generated + /// and included in each request. Default is true. + /// + bool? GenerateClientRequestId { get; set; } + + + /// + /// Gets the IPricingsOperations. + /// + IPricingsOperations Pricings { get; } + + /// + /// Gets the ISecurityContactsOperations. + /// + ISecurityContactsOperations SecurityContacts { get; } + + /// + /// Gets the IWorkspaceSettingsOperations. + /// + IWorkspaceSettingsOperations WorkspaceSettings { get; } + + /// + /// Gets the IAutoProvisioningSettingsOperations. + /// + IAutoProvisioningSettingsOperations AutoProvisioningSettings { get; } + + /// + /// Gets the ICompliancesOperations. + /// + ICompliancesOperations Compliances { get; } + + /// + /// Gets the IOperations. + /// + IOperations Operations { get; } + + /// + /// Gets the ILocationsOperations. + /// + ILocationsOperations Locations { get; } + + /// + /// Gets the ITasksOperations. + /// + ITasksOperations Tasks { get; } + + /// + /// Gets the IAlertsOperations. + /// + IAlertsOperations Alerts { get; } + + /// + /// Gets the IDiscoveredSecuritySolutionsOperations. + /// + IDiscoveredSecuritySolutionsOperations DiscoveredSecuritySolutions { get; } + + /// + /// Gets the IJitNetworkAccessPoliciesOperations. + /// + IJitNetworkAccessPoliciesOperations JitNetworkAccessPolicies { get; } + + /// + /// Gets the IExternalSecuritySolutionsOperations. + /// + IExternalSecuritySolutionsOperations ExternalSecuritySolutions { get; } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/ISecurityContactsOperations.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/ISecurityContactsOperations.cs new file mode 100644 index 000000000000..426343a00e3e --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/ISecurityContactsOperations.cs @@ -0,0 +1,159 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SecurityContactsOperations operations. + /// + public partial interface ISecurityContactsOperations + { + /// + /// Security contact configurations for the subscription + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Security contact configurations for the subscription + /// + /// + /// Name of the security contact object + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string securityContactName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Security contact configurations for the subscription + /// + /// + /// Name of the security contact object + /// + /// + /// Security contact object + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateWithHttpMessagesAsync(string securityContactName, SecurityContact securityContact, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Security contact configurations for the subscription + /// + /// + /// Name of the security contact object + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string securityContactName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Security contact configurations for the subscription + /// + /// + /// Name of the security contact object + /// + /// + /// Security contact object + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string securityContactName, SecurityContact securityContact, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Security contact configurations for the subscription + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/ITasksOperations.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/ITasksOperations.cs new file mode 100644 index 000000000000..ee472989bb53 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/ITasksOperations.cs @@ -0,0 +1,271 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// TasksOperations operations. + /// + public partial interface ITasksOperations + { + /// + /// Recommended tasks that will help improve the security of the + /// subscription proactively + /// + /// + /// OData filter. Optional. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Recommended tasks that will help improve the security of the + /// subscription proactively + /// + /// + /// OData filter. Optional. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByHomeRegionWithHttpMessagesAsync(string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Recommended tasks that will help improve the security of the + /// subscription proactively + /// + /// + /// Name of the task object, will be a GUID + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetSubscriptionLevelTaskWithHttpMessagesAsync(string taskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Recommended tasks that will help improve the security of the + /// subscription proactively + /// + /// + /// Name of the task object, will be a GUID + /// + /// + /// Type of the action to do on the task. Possible values include: + /// 'Activate', 'Dismiss', 'Start', 'Resolve', 'Close' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task UpdateSubscriptionLevelTaskStateWithHttpMessagesAsync(string taskName, string taskUpdateActionType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Recommended tasks that will help improve the security of the + /// subscription proactively + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// OData filter. Optional. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Recommended tasks that will help improve the security of the + /// subscription proactively + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// Name of the task object, will be a GUID + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetResourceGroupLevelTaskWithHttpMessagesAsync(string resourceGroupName, string taskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Recommended tasks that will help improve the security of the + /// subscription proactively + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// Name of the task object, will be a GUID + /// + /// + /// Type of the action to do on the task. Possible values include: + /// 'Activate', 'Dismiss', 'Start', 'Resolve', 'Close' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task UpdateResourceGroupLevelTaskStateWithHttpMessagesAsync(string resourceGroupName, string taskName, string taskUpdateActionType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Recommended tasks that will help improve the security of the + /// subscription proactively + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Recommended tasks that will help improve the security of the + /// subscription proactively + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByHomeRegionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Recommended tasks that will help improve the security of the + /// subscription proactively + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/IWorkspaceSettingsOperations.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/IWorkspaceSettingsOperations.cs new file mode 100644 index 000000000000..8cb451717610 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/IWorkspaceSettingsOperations.cs @@ -0,0 +1,171 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WorkspaceSettingsOperations operations. + /// + public partial interface IWorkspaceSettingsOperations + { + /// + /// Settings about where we should store your security data and logs + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Settings about where we should store your security data and logs + /// + /// + /// Name of the security setting + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string workspaceSettingName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// creating settings about where we should store your security data + /// and logs + /// + /// + /// Name of the security setting + /// + /// + /// The full Azure ID of the workspace to save the data in + /// + /// + /// All the VMs in this scope will send their security data to the + /// mentioned workspace unless overridden by a setting with more + /// specific scope + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateWithHttpMessagesAsync(string workspaceSettingName, string workspaceId, string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Settings about where we should store your security data and logs + /// + /// + /// Name of the security setting + /// + /// + /// The full Azure ID of the workspace to save the data in + /// + /// + /// All the VMs in this scope will send their security data to the + /// mentioned workspace unless overridden by a setting with more + /// specific scope + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string workspaceSettingName, string workspaceId, string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the custom workspace settings for this subscription. new + /// VMs will report to the default workspace + /// + /// + /// Name of the security setting + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string workspaceSettingName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Settings about where we should store your security data and logs + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/JitNetworkAccessPoliciesOperations.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/JitNetworkAccessPoliciesOperations.cs new file mode 100644 index 000000000000..b45acb68db02 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/JitNetworkAccessPoliciesOperations.cs @@ -0,0 +1,2461 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// JitNetworkAccessPoliciesOperations operations. + /// + internal partial class JitNetworkAccessPoliciesOperations : IServiceOperations, IJitNetworkAccessPoliciesOperations + { + /// + /// Initializes a new instance of the JitNetworkAccessPoliciesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal JitNetworkAccessPoliciesOperations(SecurityCenterClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SecurityCenterClient + /// + public SecurityCenterClient Client { get; private set; } + + /// + /// Policies for protecting resources using Just-in-Time access control. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/jitNetworkAccessPolicies").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the + /// subscription, location + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByRegionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (Client.AscLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByRegion", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the + /// subscription, location + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/jitNetworkAccessPolicies").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the + /// subscription, location + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupAndRegionWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.AscLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupAndRegion", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the + /// subscription, location + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Name of a Just-in-Time access configuration policy. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string jitNetworkAccessPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.AscLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); + } + if (jitNetworkAccessPolicyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "jitNetworkAccessPolicyName"); + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("jitNetworkAccessPolicyName", jitNetworkAccessPolicyName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation)); + _url = _url.Replace("{jitNetworkAccessPolicyName}", System.Uri.EscapeDataString(jitNetworkAccessPolicyName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create a policy for protecting resources using Just-in-Time access control + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Name of a Just-in-Time access configuration policy. + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string jitNetworkAccessPolicyName, JitNetworkAccessPolicy body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.AscLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); + } + if (jitNetworkAccessPolicyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "jitNetworkAccessPolicyName"); + } + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + if (body != null) + { + body.Validate(); + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("jitNetworkAccessPolicyName", jitNetworkAccessPolicyName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation)); + _url = _url.Replace("{jitNetworkAccessPolicyName}", System.Uri.EscapeDataString(jitNetworkAccessPolicyName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete a Just-in-Time access control policy. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Name of a Just-in-Time access configuration policy. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string jitNetworkAccessPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.AscLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); + } + if (jitNetworkAccessPolicyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "jitNetworkAccessPolicyName"); + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("jitNetworkAccessPolicyName", jitNetworkAccessPolicyName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation)); + _url = _url.Replace("{jitNetworkAccessPolicyName}", System.Uri.EscapeDataString(jitNetworkAccessPolicyName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Initiate a JIT access from a specific Just-in-Time policy configuration. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Name of a Just-in-Time access configuration policy. + /// + /// + /// A list of virtual machines & ports to open access for + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> InitiateWithHttpMessagesAsync(string resourceGroupName, string jitNetworkAccessPolicyName, IList virtualMachines, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.AscLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); + } + if (jitNetworkAccessPolicyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "jitNetworkAccessPolicyName"); + } + if (virtualMachines == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachines"); + } + if (virtualMachines != null) + { + foreach (var element in virtualMachines) + { + if (element != null) + { + element.Validate(); + } + } + } + string jitNetworkAccessPolicyInitiateType = "initiate"; + string apiVersion = "2015-06-01-preview"; + JitNetworkAccessPolicyInitiateRequest body = new JitNetworkAccessPolicyInitiateRequest(); + if (virtualMachines != null) + { + body.VirtualMachines = virtualMachines; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("jitNetworkAccessPolicyName", jitNetworkAccessPolicyName); + tracingParameters.Add("jitNetworkAccessPolicyInitiateType", jitNetworkAccessPolicyInitiateType); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Initiate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}/{jitNetworkAccessPolicyInitiateType}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation)); + _url = _url.Replace("{jitNetworkAccessPolicyName}", System.Uri.EscapeDataString(jitNetworkAccessPolicyName)); + _url = _url.Replace("{jitNetworkAccessPolicyInitiateType}", System.Uri.EscapeDataString(jitNetworkAccessPolicyInitiateType)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Policies for protecting resources using Just-in-Time access control. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the + /// subscription, location + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByRegionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByRegionNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the + /// subscription, location + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the + /// subscription, location + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupAndRegionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupAndRegionNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/JitNetworkAccessPoliciesOperationsExtensions.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/JitNetworkAccessPoliciesOperationsExtensions.cs new file mode 100644 index 000000000000..388476ee545a --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/JitNetworkAccessPoliciesOperationsExtensions.cs @@ -0,0 +1,480 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for JitNetworkAccessPoliciesOperations. + /// + public static partial class JitNetworkAccessPoliciesOperationsExtensions + { + /// + /// Policies for protecting resources using Just-in-Time access control. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IJitNetworkAccessPoliciesOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Policies for protecting resources using Just-in-Time access control. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IJitNetworkAccessPoliciesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the + /// subscription, location + /// + /// + /// The operations group for this extension method. + /// + public static IPage ListByRegion(this IJitNetworkAccessPoliciesOperations operations) + { + return operations.ListByRegionAsync().GetAwaiter().GetResult(); + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the + /// subscription, location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByRegionAsync(this IJitNetworkAccessPoliciesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByRegionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the + /// subscription, location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + public static IPage ListByResourceGroup(this IJitNetworkAccessPoliciesOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the + /// subscription, location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IJitNetworkAccessPoliciesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the + /// subscription, location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + public static IPage ListByResourceGroupAndRegion(this IJitNetworkAccessPoliciesOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAndRegionAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the + /// subscription, location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAndRegionAsync(this IJitNetworkAccessPoliciesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupAndRegionWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the + /// subscription, location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Name of a Just-in-Time access configuration policy. + /// + public static JitNetworkAccessPolicy Get(this IJitNetworkAccessPoliciesOperations operations, string resourceGroupName, string jitNetworkAccessPolicyName) + { + return operations.GetAsync(resourceGroupName, jitNetworkAccessPolicyName).GetAwaiter().GetResult(); + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the + /// subscription, location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Name of a Just-in-Time access configuration policy. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IJitNetworkAccessPoliciesOperations operations, string resourceGroupName, string jitNetworkAccessPolicyName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, jitNetworkAccessPolicyName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create a policy for protecting resources using Just-in-Time access control + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Name of a Just-in-Time access configuration policy. + /// + /// + /// + public static JitNetworkAccessPolicy CreateOrUpdate(this IJitNetworkAccessPoliciesOperations operations, string resourceGroupName, string jitNetworkAccessPolicyName, JitNetworkAccessPolicy body) + { + return operations.CreateOrUpdateAsync(resourceGroupName, jitNetworkAccessPolicyName, body).GetAwaiter().GetResult(); + } + + /// + /// Create a policy for protecting resources using Just-in-Time access control + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Name of a Just-in-Time access configuration policy. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IJitNetworkAccessPoliciesOperations operations, string resourceGroupName, string jitNetworkAccessPolicyName, JitNetworkAccessPolicy body, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, jitNetworkAccessPolicyName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a Just-in-Time access control policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Name of a Just-in-Time access configuration policy. + /// + public static void Delete(this IJitNetworkAccessPoliciesOperations operations, string resourceGroupName, string jitNetworkAccessPolicyName) + { + operations.DeleteAsync(resourceGroupName, jitNetworkAccessPolicyName).GetAwaiter().GetResult(); + } + + /// + /// Delete a Just-in-Time access control policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Name of a Just-in-Time access configuration policy. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IJitNetworkAccessPoliciesOperations operations, string resourceGroupName, string jitNetworkAccessPolicyName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, jitNetworkAccessPolicyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Initiate a JIT access from a specific Just-in-Time policy configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Name of a Just-in-Time access configuration policy. + /// + /// + /// A list of virtual machines & ports to open access for + /// + public static JitNetworkAccessRequest Initiate(this IJitNetworkAccessPoliciesOperations operations, string resourceGroupName, string jitNetworkAccessPolicyName, IList virtualMachines) + { + return operations.InitiateAsync(resourceGroupName, jitNetworkAccessPolicyName, virtualMachines).GetAwaiter().GetResult(); + } + + /// + /// Initiate a JIT access from a specific Just-in-Time policy configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Name of a Just-in-Time access configuration policy. + /// + /// + /// A list of virtual machines & ports to open access for + /// + /// + /// The cancellation token. + /// + public static async Task InitiateAsync(this IJitNetworkAccessPoliciesOperations operations, string resourceGroupName, string jitNetworkAccessPolicyName, IList virtualMachines, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.InitiateWithHttpMessagesAsync(resourceGroupName, jitNetworkAccessPolicyName, virtualMachines, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Policies for protecting resources using Just-in-Time access control. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IJitNetworkAccessPoliciesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Policies for protecting resources using Just-in-Time access control. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IJitNetworkAccessPoliciesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the + /// subscription, location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByRegionNext(this IJitNetworkAccessPoliciesOperations operations, string nextPageLink) + { + return operations.ListByRegionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the + /// subscription, location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByRegionNextAsync(this IJitNetworkAccessPoliciesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByRegionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the + /// subscription, location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IJitNetworkAccessPoliciesOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the + /// subscription, location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IJitNetworkAccessPoliciesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the + /// subscription, location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupAndRegionNext(this IJitNetworkAccessPoliciesOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupAndRegionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the + /// subscription, location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAndRegionNextAsync(this IJitNetworkAccessPoliciesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupAndRegionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/LocationsOperations.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/LocationsOperations.cs new file mode 100644 index 000000000000..456e5d1aa5a0 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/LocationsOperations.cs @@ -0,0 +1,604 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// LocationsOperations operations. + /// + internal partial class LocationsOperations : IServiceOperations, ILocationsOperations + { + /// + /// Initializes a new instance of the LocationsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal LocationsOperations(SecurityCenterClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SecurityCenterClient + /// + public SecurityCenterClient Client { get; private set; } + + /// + /// The location of the responsible ASC of the specific subscription (home + /// region). For each subscription there is only one responsible location. The + /// location in the response should be used to read or write other resources in + /// ASC according to their ID. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/locations").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Details of a specific location + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (Client.AscLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// The location of the responsible ASC of the specific subscription (home + /// region). For each subscription there is only one responsible location. The + /// location in the response should be used to read or write other resources in + /// ASC according to their ID. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/LocationsOperationsExtensions.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/LocationsOperationsExtensions.cs new file mode 100644 index 000000000000..2352a413ee62 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/LocationsOperationsExtensions.cs @@ -0,0 +1,127 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for LocationsOperations. + /// + public static partial class LocationsOperationsExtensions + { + /// + /// The location of the responsible ASC of the specific subscription (home + /// region). For each subscription there is only one responsible location. The + /// location in the response should be used to read or write other resources in + /// ASC according to their ID. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this ILocationsOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// The location of the responsible ASC of the specific subscription (home + /// region). For each subscription there is only one responsible location. The + /// location in the response should be used to read or write other resources in + /// ASC according to their ID. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ILocationsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Details of a specific location + /// + /// + /// The operations group for this extension method. + /// + public static AscLocation Get(this ILocationsOperations operations) + { + return operations.GetAsync().GetAwaiter().GetResult(); + } + + /// + /// Details of a specific location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ILocationsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// The location of the responsible ASC of the specific subscription (home + /// region). For each subscription there is only one responsible location. The + /// location in the response should be used to read or write other resources in + /// ASC according to their ID. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this ILocationsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// The location of the responsible ASC of the specific subscription (home + /// region). For each subscription there is only one responsible location. The + /// location in the response should be used to read or write other resources in + /// ASC according to their ID. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this ILocationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AadConnectivityState.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AadConnectivityState.cs new file mode 100644 index 000000000000..e6dc14a7b834 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AadConnectivityState.cs @@ -0,0 +1,23 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + + /// + /// Defines values for AadConnectivityState. + /// + public static class AadConnectivityState + { + public const string Discovered = "Discovered"; + public const string NotLicensed = "NotLicensed"; + public const string Connected = "Connected"; + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AadConnectivityState1.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AadConnectivityState1.cs new file mode 100644 index 000000000000..4ecf3bb262b8 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AadConnectivityState1.cs @@ -0,0 +1,55 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes an Azure resource with kind + /// + public partial class AadConnectivityState1 + { + /// + /// Initializes a new instance of the AadConnectivityState1 class. + /// + public AadConnectivityState1() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AadConnectivityState1 class. + /// + /// The connectivity state of the + /// external AAD solution + public AadConnectivityState1(string connectivityState = default(string)) + { + ConnectivityState = connectivityState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the connectivity state of the external AAD solution + /// + /// + /// Possible values include: 'Discovered', 'NotLicensed', 'Connected' + /// + [JsonProperty(PropertyName = "connectivityState")] + public string ConnectivityState { get; set; } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AadExternalSecuritySolution.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AadExternalSecuritySolution.cs new file mode 100644 index 000000000000..96b281d985c0 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AadExternalSecuritySolution.cs @@ -0,0 +1,59 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Represents an AAD identity protection solution which sends logs to an + /// OMS workspace. + /// + [Newtonsoft.Json.JsonObject("AAD")] + public partial class AadExternalSecuritySolution : ExternalSecuritySolution + { + /// + /// Initializes a new instance of the AadExternalSecuritySolution + /// class. + /// + public AadExternalSecuritySolution() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AadExternalSecuritySolution + /// class. + /// + /// Resource Id + /// Resource name + /// Resource type + /// Location where the resource is + /// stored + public AadExternalSecuritySolution(string id = default(string), string name = default(string), string type = default(string), string location = default(string), AadSolutionProperties properties = default(AadSolutionProperties)) + : base(id, name, type, location) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties")] + public AadSolutionProperties Properties { get; set; } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AadSolutionProperties.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AadSolutionProperties.cs new file mode 100644 index 000000000000..8c4467443ee6 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AadSolutionProperties.cs @@ -0,0 +1,73 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The external security solution properties for AAD solutions + /// + public partial class AadSolutionProperties + { + /// + /// Initializes a new instance of the AadSolutionProperties class. + /// + public AadSolutionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AadSolutionProperties class. + /// + /// The connectivity state of the + /// external AAD solution + public AadSolutionProperties(string deviceVendor = default(string), string deviceType = default(string), ConnectedWorkspace workspace = default(ConnectedWorkspace), string connectivityState = default(string)) + { + DeviceVendor = deviceVendor; + DeviceType = deviceType; + Workspace = workspace; + ConnectivityState = connectivityState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "deviceVendor")] + public string DeviceVendor { get; set; } + + /// + /// + [JsonProperty(PropertyName = "deviceType")] + public string DeviceType { get; set; } + + /// + /// + [JsonProperty(PropertyName = "workspace")] + public ConnectedWorkspace Workspace { get; set; } + + /// + /// Gets or sets the connectivity state of the external AAD solution + /// + /// + /// Possible values include: 'Discovered', 'NotLicensed', 'Connected' + /// + [JsonProperty(PropertyName = "connectivityState")] + public string ConnectivityState { get; set; } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Alert.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Alert.cs new file mode 100644 index 000000000000..a75fdbdda378 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Alert.cs @@ -0,0 +1,260 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Security alert + /// + [Rest.Serialization.JsonTransformation] + public partial class Alert : Resource + { + /// + /// Initializes a new instance of the Alert class. + /// + public Alert() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Alert class. + /// + /// Resource Id + /// Resource name + /// Resource type + /// State of the alert (Active, Dismissed + /// etc.) + /// The time the incident was reported to + /// Microsoft.Security in UTC + /// Name of the vendor that discovered the + /// incident + /// Name of the alert type + /// Display name of the alert + /// type + /// The time the incident was detected by + /// the vendor + /// Description of the incident and what it + /// means + /// Recommended steps to reradiate the + /// incident + /// The action that was taken as a response + /// to the alert (Active, Blocked etc.) + /// Estimated severity of this + /// alert + /// The entity that the incident + /// happened on + /// Azure resource ID of the + /// associated resource + /// The type of the alerted resource (Azure, + /// Non-Azure) + /// Whether this alert can be + /// investigated with Azure Security Center + /// objects that are related to this + /// alerts + /// level of confidence we have on the + /// alert + /// reasons the alert got the + /// confidenceScore value + /// Azure subscription ID of the resource + /// that had the security alert or the subscription ID of the workspace + /// that this resource reports to + /// Instance ID of the alert. + /// Azure resource ID of the workspace + /// that the alert was reported to. + public Alert(string id = default(string), string name = default(string), string type = default(string), string state = default(string), System.DateTime? reportedTimeUtc = default(System.DateTime?), string vendorName = default(string), string alertName = default(string), string alertDisplayName = default(string), System.DateTime? detectedTimeUtc = default(System.DateTime?), string description = default(string), string remediationSteps = default(string), string actionTaken = default(string), string reportedSeverity = default(string), string compromisedEntity = default(string), string associatedResource = default(string), IDictionary extendedProperties = default(IDictionary), string systemSource = default(string), bool? canBeInvestigated = default(bool?), IList entities = default(IList), double? confidenceScore = default(double?), IList confidenceReasons = default(IList), string subscriptionId = default(string), string instanceId = default(string), string workspaceArmId = default(string)) + : base(id, name, type) + { + State = state; + ReportedTimeUtc = reportedTimeUtc; + VendorName = vendorName; + AlertName = alertName; + AlertDisplayName = alertDisplayName; + DetectedTimeUtc = detectedTimeUtc; + Description = description; + RemediationSteps = remediationSteps; + ActionTaken = actionTaken; + ReportedSeverity = reportedSeverity; + CompromisedEntity = compromisedEntity; + AssociatedResource = associatedResource; + ExtendedProperties = extendedProperties; + SystemSource = systemSource; + CanBeInvestigated = canBeInvestigated; + Entities = entities; + ConfidenceScore = confidenceScore; + ConfidenceReasons = confidenceReasons; + SubscriptionId = subscriptionId; + InstanceId = instanceId; + WorkspaceArmId = workspaceArmId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets state of the alert (Active, Dismissed etc.) + /// + [JsonProperty(PropertyName = "properties.state")] + public string State { get; private set; } + + /// + /// Gets the time the incident was reported to Microsoft.Security in + /// UTC + /// + [JsonProperty(PropertyName = "properties.reportedTimeUtc")] + public System.DateTime? ReportedTimeUtc { get; private set; } + + /// + /// Gets name of the vendor that discovered the incident + /// + [JsonProperty(PropertyName = "properties.vendorName")] + public string VendorName { get; private set; } + + /// + /// Gets name of the alert type + /// + [JsonProperty(PropertyName = "properties.alertName")] + public string AlertName { get; private set; } + + /// + /// Gets display name of the alert type + /// + [JsonProperty(PropertyName = "properties.alertDisplayName")] + public string AlertDisplayName { get; private set; } + + /// + /// Gets the time the incident was detected by the vendor + /// + [JsonProperty(PropertyName = "properties.detectedTimeUtc")] + public System.DateTime? DetectedTimeUtc { get; private set; } + + /// + /// Gets description of the incident and what it means + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; private set; } + + /// + /// Gets recommended steps to reradiate the incident + /// + [JsonProperty(PropertyName = "properties.remediationSteps")] + public string RemediationSteps { get; private set; } + + /// + /// Gets the action that was taken as a response to the alert (Active, + /// Blocked etc.) + /// + [JsonProperty(PropertyName = "properties.actionTaken")] + public string ActionTaken { get; private set; } + + /// + /// Gets estimated severity of this alert + /// + [JsonProperty(PropertyName = "properties.reportedSeverity")] + public string ReportedSeverity { get; private set; } + + /// + /// Gets the entity that the incident happened on + /// + [JsonProperty(PropertyName = "properties.compromisedEntity")] + public string CompromisedEntity { get; private set; } + + /// + /// Gets azure resource ID of the associated resource + /// + [JsonProperty(PropertyName = "properties.associatedResource")] + public string AssociatedResource { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "properties.extendedProperties")] + public IDictionary ExtendedProperties { get; set; } + + /// + /// Gets the type of the alerted resource (Azure, Non-Azure) + /// + [JsonProperty(PropertyName = "properties.systemSource")] + public string SystemSource { get; private set; } + + /// + /// Gets whether this alert can be investigated with Azure Security + /// Center + /// + [JsonProperty(PropertyName = "properties.canBeInvestigated")] + public bool? CanBeInvestigated { get; private set; } + + /// + /// Gets or sets objects that are related to this alerts + /// + [JsonProperty(PropertyName = "properties.entities")] + public IList Entities { get; set; } + + /// + /// Gets level of confidence we have on the alert + /// + [JsonProperty(PropertyName = "properties.confidenceScore")] + public double? ConfidenceScore { get; private set; } + + /// + /// Gets or sets reasons the alert got the confidenceScore value + /// + [JsonProperty(PropertyName = "properties.confidenceReasons")] + public IList ConfidenceReasons { get; set; } + + /// + /// Gets azure subscription ID of the resource that had the security + /// alert or the subscription ID of the workspace that this resource + /// reports to + /// + [JsonProperty(PropertyName = "properties.subscriptionId")] + public string SubscriptionId { get; private set; } + + /// + /// Gets instance ID of the alert. + /// + [JsonProperty(PropertyName = "properties.instanceId")] + public string InstanceId { get; private set; } + + /// + /// Gets azure resource ID of the workspace that the alert was reported + /// to. + /// + [JsonProperty(PropertyName = "properties.workspaceArmId")] + public string WorkspaceArmId { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ConfidenceScore > 1) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "ConfidenceScore", 1); + } + if (ConfidenceScore < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "ConfidenceScore", 0); + } + } + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AlertConfidenceReason.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AlertConfidenceReason.cs new file mode 100644 index 000000000000..1dcc3003f5ce --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AlertConfidenceReason.cs @@ -0,0 +1,59 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Factors that increase our confidence that the alert is a true positive + /// + public partial class AlertConfidenceReason + { + /// + /// Initializes a new instance of the AlertConfidenceReason class. + /// + public AlertConfidenceReason() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AlertConfidenceReason class. + /// + /// Type of confidence factor + /// description of the confidence reason + public AlertConfidenceReason(string type = default(string), string reason = default(string)) + { + Type = type; + Reason = reason; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets type of confidence factor + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets description of the confidence reason + /// + [JsonProperty(PropertyName = "reason")] + public string Reason { get; private set; } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AlertEntity.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AlertEntity.cs new file mode 100644 index 000000000000..538b3dceaaee --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AlertEntity.cs @@ -0,0 +1,63 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Changing set of properties depending on the entity type. + /// + public partial class AlertEntity + { + /// + /// Initializes a new instance of the AlertEntity class. + /// + public AlertEntity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AlertEntity class. + /// + /// Unmatched properties from the + /// message are deserialized this collection + /// Type of entity + public AlertEntity(IDictionary additionalProperties = default(IDictionary), string type = default(string)) + { + AdditionalProperties = additionalProperties; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets unmatched properties from the message are deserialized + /// this collection + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Gets type of entity + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AlertNotifications.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AlertNotifications.cs new file mode 100644 index 000000000000..8fc97ff0f268 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AlertNotifications.cs @@ -0,0 +1,28 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + + /// + /// Defines values for AlertNotifications. + /// + public static class AlertNotifications + { + /// + /// Get notifications on new alerts + /// + public const string On = "On"; + /// + /// Don't get notifications on new alerts + /// + public const string Off = "Off"; + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AlertsToAdmins.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AlertsToAdmins.cs new file mode 100644 index 000000000000..56987d2649e6 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AlertsToAdmins.cs @@ -0,0 +1,28 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + + /// + /// Defines values for AlertsToAdmins. + /// + public static class AlertsToAdmins + { + /// + /// Send notification on new alerts to the subscription's admins + /// + public const string On = "On"; + /// + /// Don't send notification on new alerts to the subscription's admins + /// + public const string Off = "Off"; + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AscLocation.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AscLocation.cs new file mode 100644 index 000000000000..720b19953282 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AscLocation.cs @@ -0,0 +1,53 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The ASC location of the subscription is in the "name" field + /// + public partial class AscLocation : Resource + { + /// + /// Initializes a new instance of the AscLocation class. + /// + public AscLocation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AscLocation class. + /// + /// Resource Id + /// Resource name + /// Resource type + public AscLocation(string id = default(string), string name = default(string), string type = default(string), object properties = default(object)) + : base(id, name, type) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties")] + public object Properties { get; set; } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AtaExternalSecuritySolution.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AtaExternalSecuritySolution.cs new file mode 100644 index 000000000000..e4c37c3b9e05 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AtaExternalSecuritySolution.cs @@ -0,0 +1,59 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Represents an ATA security solution which sends logs to an OMS + /// workspace + /// + [Newtonsoft.Json.JsonObject("ATA")] + public partial class AtaExternalSecuritySolution : ExternalSecuritySolution + { + /// + /// Initializes a new instance of the AtaExternalSecuritySolution + /// class. + /// + public AtaExternalSecuritySolution() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AtaExternalSecuritySolution + /// class. + /// + /// Resource Id + /// Resource name + /// Resource type + /// Location where the resource is + /// stored + public AtaExternalSecuritySolution(string id = default(string), string name = default(string), string type = default(string), string location = default(string), AtaSolutionProperties properties = default(AtaSolutionProperties)) + : base(id, name, type, location) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties")] + public AtaSolutionProperties Properties { get; set; } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AtaSolutionProperties.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AtaSolutionProperties.cs new file mode 100644 index 000000000000..482a89428aee --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AtaSolutionProperties.cs @@ -0,0 +1,54 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The external security solution properties for ATA solutions + /// + public partial class AtaSolutionProperties : ExternalSecuritySolutionProperties + { + /// + /// Initializes a new instance of the AtaSolutionProperties class. + /// + public AtaSolutionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AtaSolutionProperties class. + /// + /// Unmatched properties from the + /// message are deserialized this collection + public AtaSolutionProperties(IDictionary additionalProperties = default(IDictionary), string deviceVendor = default(string), string deviceType = default(string), ConnectedWorkspace workspace = default(ConnectedWorkspace), string lastEventReceived = default(string)) + : base(additionalProperties, deviceVendor, deviceType, workspace) + { + LastEventReceived = lastEventReceived; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "lastEventReceived")] + public string LastEventReceived { get; set; } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AutoProvision.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AutoProvision.cs new file mode 100644 index 000000000000..4f43de04f692 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AutoProvision.cs @@ -0,0 +1,28 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + + /// + /// Defines values for AutoProvision. + /// + public static class AutoProvision + { + /// + /// Install missing security agent on VMs automatically + /// + public const string On = "On"; + /// + /// Do not install security agent on the VMs automatically + /// + public const string Off = "Off"; + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AutoProvisioningSetting.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AutoProvisioningSetting.cs new file mode 100644 index 000000000000..c91262555845 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/AutoProvisioningSetting.cs @@ -0,0 +1,74 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Auto provisioning setting + /// + [Rest.Serialization.JsonTransformation] + public partial class AutoProvisioningSetting : Resource + { + /// + /// Initializes a new instance of the AutoProvisioningSetting class. + /// + public AutoProvisioningSetting() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AutoProvisioningSetting class. + /// + /// Describes what kind of security agent + /// provisioning action to take. Possible values include: 'On', + /// 'Off' + /// Resource Id + /// Resource name + /// Resource type + public AutoProvisioningSetting(string autoProvision, string id = default(string), string name = default(string), string type = default(string)) + : base(id, name, type) + { + AutoProvision = autoProvision; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets describes what kind of security agent provisioning + /// action to take. Possible values include: 'On', 'Off' + /// + [JsonProperty(PropertyName = "properties.autoProvision")] + public string AutoProvision { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (AutoProvision == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AutoProvision"); + } + } + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/CefExternalSecuritySolution.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/CefExternalSecuritySolution.cs new file mode 100644 index 000000000000..71f7f935f574 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/CefExternalSecuritySolution.cs @@ -0,0 +1,58 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Represents a security solution which sends CEF logs to an OMS workspace + /// + [Newtonsoft.Json.JsonObject("CEF")] + public partial class CefExternalSecuritySolution : ExternalSecuritySolution + { + /// + /// Initializes a new instance of the CefExternalSecuritySolution + /// class. + /// + public CefExternalSecuritySolution() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CefExternalSecuritySolution + /// class. + /// + /// Resource Id + /// Resource name + /// Resource type + /// Location where the resource is + /// stored + public CefExternalSecuritySolution(string id = default(string), string name = default(string), string type = default(string), string location = default(string), CefSolutionProperties properties = default(CefSolutionProperties)) + : base(id, name, type, location) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties")] + public CefSolutionProperties Properties { get; set; } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/CefSolutionProperties.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/CefSolutionProperties.cs new file mode 100644 index 000000000000..03694767fcec --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/CefSolutionProperties.cs @@ -0,0 +1,66 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The external security solution properties for CEF solutions + /// + public partial class CefSolutionProperties : ExternalSecuritySolutionProperties + { + /// + /// Initializes a new instance of the CefSolutionProperties class. + /// + public CefSolutionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CefSolutionProperties class. + /// + /// Unmatched properties from the + /// message are deserialized this collection + public CefSolutionProperties(IDictionary additionalProperties = default(IDictionary), string deviceVendor = default(string), string deviceType = default(string), ConnectedWorkspace workspace = default(ConnectedWorkspace), string hostname = default(string), string agent = default(string), string lastEventReceived = default(string)) + : base(additionalProperties, deviceVendor, deviceType, workspace) + { + Hostname = hostname; + Agent = agent; + LastEventReceived = lastEventReceived; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "hostname")] + public string Hostname { get; set; } + + /// + /// + [JsonProperty(PropertyName = "agent")] + public string Agent { get; set; } + + /// + /// + [JsonProperty(PropertyName = "lastEventReceived")] + public string LastEventReceived { get; set; } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Compliance.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Compliance.cs new file mode 100644 index 000000000000..4004358f771f --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Compliance.cs @@ -0,0 +1,83 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Compliance of a scope + /// + [Rest.Serialization.JsonTransformation] + public partial class Compliance : Resource + { + /// + /// Initializes a new instance of the Compliance class. + /// + public Compliance() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Compliance class. + /// + /// Resource Id + /// Resource name + /// Resource type + /// The timestamp when the + /// Compliance calculation was conducted. + /// The resource count of the given + /// subscription for which the Compliance calculation was conducted + /// (needed for Management Group Compliance calculation). + /// An array of segment, which is the + /// actually the compliance assessment. + public Compliance(string id = default(string), string name = default(string), string type = default(string), System.DateTime? assessmentTimestampUtcDate = default(System.DateTime?), int? resourceCount = default(int?), IList assessmentResult = default(IList)) + : base(id, name, type) + { + AssessmentTimestampUtcDate = assessmentTimestampUtcDate; + ResourceCount = resourceCount; + AssessmentResult = assessmentResult; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the timestamp when the Compliance calculation was conducted. + /// + [JsonProperty(PropertyName = "properties.assessmentTimestampUtcDate")] + public System.DateTime? AssessmentTimestampUtcDate { get; private set; } + + /// + /// Gets the resource count of the given subscription for which the + /// Compliance calculation was conducted (needed for Management Group + /// Compliance calculation). + /// + [JsonProperty(PropertyName = "properties.resourceCount")] + public int? ResourceCount { get; private set; } + + /// + /// Gets an array of segment, which is the actually the compliance + /// assessment. + /// + [JsonProperty(PropertyName = "properties.assessmentResult")] + public IList AssessmentResult { get; private set; } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/ComplianceSegment.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/ComplianceSegment.cs new file mode 100644 index 000000000000..326a57a4e2cb --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/ComplianceSegment.cs @@ -0,0 +1,61 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// A segment of a compliance assessment. + /// + public partial class ComplianceSegment + { + /// + /// Initializes a new instance of the ComplianceSegment class. + /// + public ComplianceSegment() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComplianceSegment class. + /// + /// The segment type, e.g. compliant, + /// non-compliance, insufficient coverage, N/A, etc. + /// The size (%) of the segment. + public ComplianceSegment(string segmentType = default(string), double? percentage = default(double?)) + { + SegmentType = segmentType; + Percentage = percentage; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the segment type, e.g. compliant, non-compliance, insufficient + /// coverage, N/A, etc. + /// + [JsonProperty(PropertyName = "segmentType")] + public string SegmentType { get; private set; } + + /// + /// Gets the size (%) of the segment. + /// + [JsonProperty(PropertyName = "percentage")] + public double? Percentage { get; private set; } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/ConnectedWorkspace.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/ConnectedWorkspace.cs new file mode 100644 index 000000000000..ede95550d65f --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/ConnectedWorkspace.cs @@ -0,0 +1,52 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Represents an OMS workspace to which the solution is connected + /// + public partial class ConnectedWorkspace + { + /// + /// Initializes a new instance of the ConnectedWorkspace class. + /// + public ConnectedWorkspace() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConnectedWorkspace class. + /// + /// Azure resource ID of the connected OMS + /// workspace + public ConnectedWorkspace(string id = default(string)) + { + Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets azure resource ID of the connected OMS workspace + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/DiscoveredSecuritySolution.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/DiscoveredSecuritySolution.cs new file mode 100644 index 000000000000..dcd1ce59ccfb --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/DiscoveredSecuritySolution.cs @@ -0,0 +1,137 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] + public partial class DiscoveredSecuritySolution + { + /// + /// Initializes a new instance of the DiscoveredSecuritySolution class. + /// + public DiscoveredSecuritySolution() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DiscoveredSecuritySolution class. + /// + /// The security family of the discovered + /// solution. Possible values include: 'Waf', 'Ngfw', 'SaasWaf', + /// 'Va' + /// The security solutions' image offer + /// The security solutions' image + /// publisher + /// The security solutions' image sku + /// Resource Id + /// Resource name + /// Resource type + /// Location where the resource is + /// stored + public DiscoveredSecuritySolution(string securityFamily, string offer, string publisher, string sku, string id = default(string), string name = default(string), string type = default(string), string location = default(string)) + { + Id = id; + Name = name; + Type = type; + Location = location; + SecurityFamily = securityFamily; + Offer = offer; + Publisher = publisher; + Sku = sku; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource Id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets resource name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets location where the resource is stored + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; private set; } + + /// + /// Gets or sets the security family of the discovered solution. + /// Possible values include: 'Waf', 'Ngfw', 'SaasWaf', 'Va' + /// + [JsonProperty(PropertyName = "properties.securityFamily")] + public string SecurityFamily { get; set; } + + /// + /// Gets or sets the security solutions' image offer + /// + [JsonProperty(PropertyName = "properties.offer")] + public string Offer { get; set; } + + /// + /// Gets or sets the security solutions' image publisher + /// + [JsonProperty(PropertyName = "properties.publisher")] + public string Publisher { get; set; } + + /// + /// Gets or sets the security solutions' image sku + /// + [JsonProperty(PropertyName = "properties.sku")] + public string Sku { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (SecurityFamily == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SecurityFamily"); + } + if (Offer == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Offer"); + } + if (Publisher == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Publisher"); + } + if (Sku == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Sku"); + } + } + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/ExternalSecuritySolution.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/ExternalSecuritySolution.cs new file mode 100644 index 000000000000..d443d9f4d353 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/ExternalSecuritySolution.cs @@ -0,0 +1,78 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Represents a security solution external to Azure Security Center which + /// sends information to an OMS workspace and whos data is displayed by + /// Azure Security Center. + /// + public partial class ExternalSecuritySolution + { + /// + /// Initializes a new instance of the ExternalSecuritySolution class. + /// + public ExternalSecuritySolution() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExternalSecuritySolution class. + /// + /// Resource Id + /// Resource name + /// Resource type + /// Location where the resource is + /// stored + public ExternalSecuritySolution(string id = default(string), string name = default(string), string type = default(string), string location = default(string)) + { + Id = id; + Name = name; + Type = type; + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource Id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets resource name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets location where the resource is stored + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; private set; } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/ExternalSecuritySolutionKind.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/ExternalSecuritySolutionKind.cs new file mode 100644 index 000000000000..06da0714d086 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/ExternalSecuritySolutionKind.cs @@ -0,0 +1,23 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + + /// + /// Defines values for ExternalSecuritySolutionKind. + /// + public static class ExternalSecuritySolutionKind + { + public const string CEF = "CEF"; + public const string ATA = "ATA"; + public const string AAD = "AAD"; + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/ExternalSecuritySolutionKind1.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/ExternalSecuritySolutionKind1.cs new file mode 100644 index 000000000000..7a1246b2fade --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/ExternalSecuritySolutionKind1.cs @@ -0,0 +1,55 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes an Azure resource with kind + /// + public partial class ExternalSecuritySolutionKind1 + { + /// + /// Initializes a new instance of the ExternalSecuritySolutionKind1 + /// class. + /// + public ExternalSecuritySolutionKind1() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExternalSecuritySolutionKind1 + /// class. + /// + /// The kind of the external solution. Possible + /// values include: 'CEF', 'ATA', 'AAD' + public ExternalSecuritySolutionKind1(string kind = default(string)) + { + Kind = kind; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the kind of the external solution. Possible values + /// include: 'CEF', 'ATA', 'AAD' + /// + [JsonProperty(PropertyName = "kind")] + public string Kind { get; set; } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/ExternalSecuritySolutionProperties.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/ExternalSecuritySolutionProperties.cs new file mode 100644 index 000000000000..0d621f57ed66 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/ExternalSecuritySolutionProperties.cs @@ -0,0 +1,75 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The solution properties (correspond to the solution kind) + /// + public partial class ExternalSecuritySolutionProperties + { + /// + /// Initializes a new instance of the + /// ExternalSecuritySolutionProperties class. + /// + public ExternalSecuritySolutionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ExternalSecuritySolutionProperties class. + /// + /// Unmatched properties from the + /// message are deserialized this collection + public ExternalSecuritySolutionProperties(IDictionary additionalProperties = default(IDictionary), string deviceVendor = default(string), string deviceType = default(string), ConnectedWorkspace workspace = default(ConnectedWorkspace)) + { + AdditionalProperties = additionalProperties; + DeviceVendor = deviceVendor; + DeviceType = deviceType; + Workspace = workspace; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets unmatched properties from the message are deserialized + /// this collection + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// + [JsonProperty(PropertyName = "deviceVendor")] + public string DeviceVendor { get; set; } + + /// + /// + [JsonProperty(PropertyName = "deviceType")] + public string DeviceType { get; set; } + + /// + /// + [JsonProperty(PropertyName = "workspace")] + public ConnectedWorkspace Workspace { get; set; } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessPolicy.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessPolicy.cs new file mode 100644 index 000000000000..dd50ff3c5eb5 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessPolicy.cs @@ -0,0 +1,144 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + [Rest.Serialization.JsonTransformation] + public partial class JitNetworkAccessPolicy + { + /// + /// Initializes a new instance of the JitNetworkAccessPolicy class. + /// + public JitNetworkAccessPolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the JitNetworkAccessPolicy class. + /// + /// Configurations for + /// Microsoft.Compute/virtualMachines resource type. + /// Resource Id + /// Resource name + /// Resource type + /// Kind of the resource + /// Location where the resource is + /// stored + /// Gets the provisioning state of the + /// Just-in-Time policy. + public JitNetworkAccessPolicy(IList virtualMachines, string id = default(string), string name = default(string), string type = default(string), string kind = default(string), string location = default(string), IList requests = default(IList), string provisioningState = default(string)) + { + Id = id; + Name = name; + Type = type; + Kind = kind; + Location = location; + VirtualMachines = virtualMachines; + Requests = requests; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource Id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets resource name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets kind of the resource + /// + [JsonProperty(PropertyName = "kind")] + public string Kind { get; set; } + + /// + /// Gets location where the resource is stored + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; private set; } + + /// + /// Gets or sets configurations for Microsoft.Compute/virtualMachines + /// resource type. + /// + [JsonProperty(PropertyName = "properties.virtualMachines")] + public IList VirtualMachines { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.requests")] + public IList Requests { get; set; } + + /// + /// Gets the provisioning state of the Just-in-Time policy. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (VirtualMachines == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "VirtualMachines"); + } + if (VirtualMachines != null) + { + foreach (var element in VirtualMachines) + { + if (element != null) + { + element.Validate(); + } + } + } + if (Requests != null) + { + foreach (var element1 in Requests) + { + if (element1 != null) + { + element1.Validate(); + } + } + } + } + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessPolicyInitiatePort.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessPolicyInitiatePort.cs new file mode 100644 index 000000000000..3ba8881a47ae --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessPolicyInitiatePort.cs @@ -0,0 +1,78 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class JitNetworkAccessPolicyInitiatePort + { + /// + /// Initializes a new instance of the + /// JitNetworkAccessPolicyInitiatePort class. + /// + public JitNetworkAccessPolicyInitiatePort() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// JitNetworkAccessPolicyInitiatePort class. + /// + /// The time to close the request in + /// UTC + /// Source of the allowed + /// traffic. If omitted, the request will be for the source IP address + /// of the initiate request. + public JitNetworkAccessPolicyInitiatePort(int number, System.DateTime endTimeUtc, string allowedSourceAddressPrefix = default(string)) + { + Number = number; + AllowedSourceAddressPrefix = allowedSourceAddressPrefix; + EndTimeUtc = endTimeUtc; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "number")] + public int Number { get; set; } + + /// + /// Gets or sets source of the allowed traffic. If omitted, the request + /// will be for the source IP address of the initiate request. + /// + [JsonProperty(PropertyName = "allowedSourceAddressPrefix")] + public string AllowedSourceAddressPrefix { get; set; } + + /// + /// Gets or sets the time to close the request in UTC + /// + [JsonProperty(PropertyName = "endTimeUtc")] + public System.DateTime EndTimeUtc { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + //Nothing to validate + } + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessPolicyInitiateRequest.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessPolicyInitiateRequest.cs new file mode 100644 index 000000000000..a17751c48a05 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessPolicyInitiateRequest.cs @@ -0,0 +1,78 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class JitNetworkAccessPolicyInitiateRequest + { + /// + /// Initializes a new instance of the + /// JitNetworkAccessPolicyInitiateRequest class. + /// + public JitNetworkAccessPolicyInitiateRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// JitNetworkAccessPolicyInitiateRequest class. + /// + /// A list of virtual machines & + /// ports to open access for + public JitNetworkAccessPolicyInitiateRequest(IList virtualMachines) + { + VirtualMachines = virtualMachines; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a list of virtual machines &amp; ports to open + /// access for + /// + [JsonProperty(PropertyName = "virtualMachines")] + public IList VirtualMachines { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (VirtualMachines == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "VirtualMachines"); + } + if (VirtualMachines != null) + { + foreach (var element in VirtualMachines) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessPolicyInitiateVirtualMachine.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessPolicyInitiateVirtualMachine.cs new file mode 100644 index 000000000000..184efe058a64 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessPolicyInitiateVirtualMachine.cs @@ -0,0 +1,91 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class JitNetworkAccessPolicyInitiateVirtualMachine + { + /// + /// Initializes a new instance of the + /// JitNetworkAccessPolicyInitiateVirtualMachine class. + /// + public JitNetworkAccessPolicyInitiateVirtualMachine() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// JitNetworkAccessPolicyInitiateVirtualMachine class. + /// + /// Resource ID of the virtual machine that is linked + /// to this policy + /// The ports to open for the resource with the + /// `id` + public JitNetworkAccessPolicyInitiateVirtualMachine(string id, IList ports) + { + Id = id; + Ports = ports; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource ID of the virtual machine that is linked to + /// this policy + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets the ports to open for the resource with the `id` + /// + [JsonProperty(PropertyName = "ports")] + public IList Ports { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Id == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Id"); + } + if (Ports == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Ports"); + } + if (Ports != null) + { + foreach (var element in Ports) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessPolicyVirtualMachine.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessPolicyVirtualMachine.cs new file mode 100644 index 000000000000..8e5b8e74b786 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessPolicyVirtualMachine.cs @@ -0,0 +1,91 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class JitNetworkAccessPolicyVirtualMachine + { + /// + /// Initializes a new instance of the + /// JitNetworkAccessPolicyVirtualMachine class. + /// + public JitNetworkAccessPolicyVirtualMachine() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// JitNetworkAccessPolicyVirtualMachine class. + /// + /// Resource ID of the virtual machine that is linked + /// to this policy + /// Port configurations for the virtual + /// machine + public JitNetworkAccessPolicyVirtualMachine(string id, IList ports) + { + Id = id; + Ports = ports; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource ID of the virtual machine that is linked to + /// this policy + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets port configurations for the virtual machine + /// + [JsonProperty(PropertyName = "ports")] + public IList Ports { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Id == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Id"); + } + if (Ports == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Ports"); + } + if (Ports != null) + { + foreach (var element in Ports) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessPortRule.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessPortRule.cs new file mode 100644 index 000000000000..bf465a75df8e --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessPortRule.cs @@ -0,0 +1,109 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class JitNetworkAccessPortRule + { + /// + /// Initializes a new instance of the JitNetworkAccessPortRule class. + /// + public JitNetworkAccessPortRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the JitNetworkAccessPortRule class. + /// + /// Possible values include: 'TCP', 'UDP', + /// 'All' + /// Maximum duration requests + /// can be made for. In ISO 8601 duration format. Minimum 5 minutes, + /// maximum 1 day + /// Mutually exclusive with + /// the "allowedSourceAddressPrefixes" parameter. Should be an IP + /// address or CIDR, for example "192.168.0.3" or + /// "192.168.0.0/16". + /// Mutually exclusive with + /// the "allowedSourceAddressPrefix" parameter. + public JitNetworkAccessPortRule(int number, string protocol, string maxRequestAccessDuration, string allowedSourceAddressPrefix = default(string), IList allowedSourceAddressPrefixes = default(IList)) + { + Number = number; + Protocol = protocol; + AllowedSourceAddressPrefix = allowedSourceAddressPrefix; + AllowedSourceAddressPrefixes = allowedSourceAddressPrefixes; + MaxRequestAccessDuration = maxRequestAccessDuration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "number")] + public int Number { get; set; } + + /// + /// Gets or sets possible values include: 'TCP', 'UDP', 'All' + /// + [JsonProperty(PropertyName = "protocol")] + public string Protocol { get; set; } + + /// + /// Gets or sets mutually exclusive with the + /// "allowedSourceAddressPrefixes" parameter. Should be an IP address + /// or CIDR, for example "192.168.0.3" or "192.168.0.0/16". + /// + [JsonProperty(PropertyName = "allowedSourceAddressPrefix")] + public string AllowedSourceAddressPrefix { get; set; } + + /// + /// Gets or sets mutually exclusive with the + /// "allowedSourceAddressPrefix" parameter. + /// + [JsonProperty(PropertyName = "allowedSourceAddressPrefixes")] + public IList AllowedSourceAddressPrefixes { get; set; } + + /// + /// Gets or sets maximum duration requests can be made for. In ISO 8601 + /// duration format. Minimum 5 minutes, maximum 1 day + /// + [JsonProperty(PropertyName = "maxRequestAccessDuration")] + public string MaxRequestAccessDuration { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Protocol == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); + } + if (MaxRequestAccessDuration == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "MaxRequestAccessDuration"); + } + } + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessRequest.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessRequest.cs new file mode 100644 index 000000000000..a613853e3aba --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessRequest.cs @@ -0,0 +1,94 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class JitNetworkAccessRequest + { + /// + /// Initializes a new instance of the JitNetworkAccessRequest class. + /// + public JitNetworkAccessRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the JitNetworkAccessRequest class. + /// + /// The start time of the request in + /// UTC + /// The identity of the person who made the + /// request + public JitNetworkAccessRequest(IList virtualMachines, System.DateTime startTimeUtc, string requestor) + { + VirtualMachines = virtualMachines; + StartTimeUtc = startTimeUtc; + Requestor = requestor; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "virtualMachines")] + public IList VirtualMachines { get; set; } + + /// + /// Gets or sets the start time of the request in UTC + /// + [JsonProperty(PropertyName = "startTimeUtc")] + public System.DateTime StartTimeUtc { get; set; } + + /// + /// Gets or sets the identity of the person who made the request + /// + [JsonProperty(PropertyName = "requestor")] + public string Requestor { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (VirtualMachines == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "VirtualMachines"); + } + if (Requestor == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Requestor"); + } + if (VirtualMachines != null) + { + foreach (var element in VirtualMachines) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessRequestPort.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessRequestPort.cs new file mode 100644 index 000000000000..cdc7305cc79d --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessRequestPort.cs @@ -0,0 +1,123 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class JitNetworkAccessRequestPort + { + /// + /// Initializes a new instance of the JitNetworkAccessRequestPort + /// class. + /// + public JitNetworkAccessRequestPort() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the JitNetworkAccessRequestPort + /// class. + /// + /// The date & time at which the request + /// ends in UTC + /// The status of the port. Possible values + /// include: 'Revoked', 'Initiated' + /// A description of why the `status` has + /// its value. Possible values include: 'Expired', 'UserRequested', + /// 'NewerRequestInitiated' + /// Mutually exclusive with + /// the "allowedSourceAddressPrefixes" parameter. Should be an IP + /// address or CIDR, for example "192.168.0.3" or + /// "192.168.0.0/16". + /// Mutually exclusive with + /// the "allowedSourceAddressPrefix" parameter. + public JitNetworkAccessRequestPort(int number, System.DateTime endTimeUtc, string status, string statusReason, string allowedSourceAddressPrefix = default(string), IList allowedSourceAddressPrefixes = default(IList)) + { + Number = number; + AllowedSourceAddressPrefix = allowedSourceAddressPrefix; + AllowedSourceAddressPrefixes = allowedSourceAddressPrefixes; + EndTimeUtc = endTimeUtc; + Status = status; + StatusReason = statusReason; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "number")] + public int Number { get; set; } + + /// + /// Gets or sets mutually exclusive with the + /// "allowedSourceAddressPrefixes" parameter. Should be an IP address + /// or CIDR, for example "192.168.0.3" or "192.168.0.0/16". + /// + [JsonProperty(PropertyName = "allowedSourceAddressPrefix")] + public string AllowedSourceAddressPrefix { get; set; } + + /// + /// Gets or sets mutually exclusive with the + /// "allowedSourceAddressPrefix" parameter. + /// + [JsonProperty(PropertyName = "allowedSourceAddressPrefixes")] + public IList AllowedSourceAddressPrefixes { get; set; } + + /// + /// Gets or sets the date &amp; time at which the request ends in + /// UTC + /// + [JsonProperty(PropertyName = "endTimeUtc")] + public System.DateTime EndTimeUtc { get; set; } + + /// + /// Gets or sets the status of the port. Possible values include: + /// 'Revoked', 'Initiated' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets a description of why the `status` has its value. + /// Possible values include: 'Expired', 'UserRequested', + /// 'NewerRequestInitiated' + /// + [JsonProperty(PropertyName = "statusReason")] + public string StatusReason { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Status == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Status"); + } + if (StatusReason == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "StatusReason"); + } + } + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessRequestVirtualMachine.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessRequestVirtualMachine.cs new file mode 100644 index 000000000000..38f2fe3c1c8c --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/JitNetworkAccessRequestVirtualMachine.cs @@ -0,0 +1,91 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class JitNetworkAccessRequestVirtualMachine + { + /// + /// Initializes a new instance of the + /// JitNetworkAccessRequestVirtualMachine class. + /// + public JitNetworkAccessRequestVirtualMachine() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// JitNetworkAccessRequestVirtualMachine class. + /// + /// Resource ID of the virtual machine that is linked + /// to this policy + /// The ports that were opened for the virtual + /// machine + public JitNetworkAccessRequestVirtualMachine(string id, IList ports) + { + Id = id; + Ports = ports; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource ID of the virtual machine that is linked to + /// this policy + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets the ports that were opened for the virtual machine + /// + [JsonProperty(PropertyName = "ports")] + public IList Ports { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Id == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Id"); + } + if (Ports == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Ports"); + } + if (Ports != null) + { + foreach (var element in Ports) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Kind.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Kind.cs new file mode 100644 index 000000000000..1f323cae2c56 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Kind.cs @@ -0,0 +1,51 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes an Azure resource with kind + /// + public partial class Kind + { + /// + /// Initializes a new instance of the Kind class. + /// + public Kind() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Kind class. + /// + /// Kind of the resource + public Kind(string kindProperty = default(string)) + { + KindProperty = kindProperty; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets kind of the resource + /// + [JsonProperty(PropertyName = "kind")] + public string KindProperty { get; set; } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Location.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Location.cs new file mode 100644 index 000000000000..a35eb9fed24e --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Location.cs @@ -0,0 +1,52 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes an Azure resource with location + /// + public partial class Location + { + /// + /// Initializes a new instance of the Location class. + /// + public Location() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Location class. + /// + /// Location where the resource is + /// stored + public Location(string locationProperty = default(string)) + { + LocationProperty = locationProperty; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets location where the resource is stored + /// + [JsonProperty(PropertyName = "location")] + public string LocationProperty { get; private set; } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Operation.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Operation.cs new file mode 100644 index 000000000000..ca7b8be3c64a --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Operation.cs @@ -0,0 +1,65 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Possible operation in the REST API of Microsoft.Security + /// + public partial class Operation + { + /// + /// Initializes a new instance of the Operation class. + /// + public Operation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Operation class. + /// + /// Name of the operation + /// Where the operation is originated + public Operation(string name = default(string), string origin = default(string), OperationDisplay display = default(OperationDisplay)) + { + Name = name; + Origin = origin; + Display = display; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets name of the operation + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets where the operation is originated + /// + [JsonProperty(PropertyName = "origin")] + public string Origin { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "display")] + public OperationDisplay Display { get; set; } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/OperationDisplay.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/OperationDisplay.cs new file mode 100644 index 000000000000..0da7bfb68a89 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/OperationDisplay.cs @@ -0,0 +1,78 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Security operation display + /// + public partial class OperationDisplay + { + /// + /// Initializes a new instance of the OperationDisplay class. + /// + public OperationDisplay() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationDisplay class. + /// + /// The resource provider for the + /// operation. + /// The display name of the resource the + /// operation applies to. + /// The display name of the security + /// operation. + /// The description of the operation. + public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) + { + Provider = provider; + Resource = resource; + Operation = operation; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the resource provider for the operation. + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; private set; } + + /// + /// Gets the display name of the resource the operation applies to. + /// + [JsonProperty(PropertyName = "resource")] + public string Resource { get; private set; } + + /// + /// Gets the display name of the security operation. + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; private set; } + + /// + /// Gets the description of the operation. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; private set; } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Page.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Page.cs new file mode 100644 index 000000000000..3fd68902cfcb --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Page.cs @@ -0,0 +1,53 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("nextLink")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Pricing.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Pricing.cs new file mode 100644 index 000000000000..d0b63ffee127 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Pricing.cs @@ -0,0 +1,73 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Pricing tier will be applied for the scope based on the resource ID + /// + [Rest.Serialization.JsonTransformation] + public partial class Pricing : Resource + { + /// + /// Initializes a new instance of the Pricing class. + /// + public Pricing() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Pricing class. + /// + /// Pricing tier type. Possible values + /// include: 'Free', 'Standard' + /// Resource Id + /// Resource name + /// Resource type + public Pricing(string pricingTier, string id = default(string), string name = default(string), string type = default(string)) + : base(id, name, type) + { + PricingTier = pricingTier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets pricing tier type. Possible values include: 'Free', + /// 'Standard' + /// + [JsonProperty(PropertyName = "properties.pricingTier")] + public string PricingTier { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PricingTier == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PricingTier"); + } + } + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/PricingTier.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/PricingTier.cs new file mode 100644 index 000000000000..6f0a6270308e --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/PricingTier.cs @@ -0,0 +1,30 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + + /// + /// Defines values for PricingTier. + /// + public static class PricingTier + { + /// + /// Get free Azure security center experience with basic security + /// features + /// + public const string Free = "Free"; + /// + /// Get the standard Azure security center experience with advanced + /// security features + /// + public const string Standard = "Standard"; + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Protocol.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Protocol.cs new file mode 100644 index 000000000000..e73c096a0219 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Protocol.cs @@ -0,0 +1,23 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + + /// + /// Defines values for Protocol. + /// + public static class Protocol + { + public const string TCP = "TCP"; + public const string UDP = "UDP"; + public const string All = "*"; + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Resource.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Resource.cs new file mode 100644 index 000000000000..d1b0f61c4799 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Resource.cs @@ -0,0 +1,69 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes an Azure resource. + /// + public partial class Resource : IResource + { + /// + /// Initializes a new instance of the Resource class. + /// + public Resource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Resource class. + /// + /// Resource Id + /// Resource name + /// Resource type + public Resource(string id = default(string), string name = default(string), string type = default(string)) + { + Id = id; + Name = name; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource Id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets resource name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/SecurityContact.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/SecurityContact.cs new file mode 100644 index 000000000000..41310b3fb3cf --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/SecurityContact.cs @@ -0,0 +1,114 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Contact details for security issues + /// + [Rest.Serialization.JsonTransformation] + public partial class SecurityContact : Resource + { + /// + /// Initializes a new instance of the SecurityContact class. + /// + public SecurityContact() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SecurityContact class. + /// + /// The email of this security contact + /// The phone number of this security + /// contact + /// Whether to send security alerts + /// notifications to the security contact. Possible values include: + /// 'On', 'Off' + /// Whether to send security alerts + /// notifications to subscription admins. Possible values include: + /// 'On', 'Off' + /// Resource Id + /// Resource name + /// Resource type + public SecurityContact(string email, string phone, string alertNotifications, string alertsToAdmins, string id = default(string), string name = default(string), string type = default(string)) + : base(id, name, type) + { + Email = email; + Phone = phone; + AlertNotifications = alertNotifications; + AlertsToAdmins = alertsToAdmins; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the email of this security contact + /// + [JsonProperty(PropertyName = "properties.email")] + public string Email { get; set; } + + /// + /// Gets or sets the phone number of this security contact + /// + [JsonProperty(PropertyName = "properties.phone")] + public string Phone { get; set; } + + /// + /// Gets or sets whether to send security alerts notifications to the + /// security contact. Possible values include: 'On', 'Off' + /// + [JsonProperty(PropertyName = "properties.alertNotifications")] + public string AlertNotifications { get; set; } + + /// + /// Gets or sets whether to send security alerts notifications to + /// subscription admins. Possible values include: 'On', 'Off' + /// + [JsonProperty(PropertyName = "properties.alertsToAdmins")] + public string AlertsToAdmins { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Email == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Email"); + } + if (Phone == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Phone"); + } + if (AlertNotifications == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AlertNotifications"); + } + if (AlertsToAdmins == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AlertsToAdmins"); + } + } + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/SecurityFamily.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/SecurityFamily.cs new file mode 100644 index 000000000000..5c56967d3c07 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/SecurityFamily.cs @@ -0,0 +1,24 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + + /// + /// Defines values for SecurityFamily. + /// + public static class SecurityFamily + { + public const string Waf = "Waf"; + public const string Ngfw = "Ngfw"; + public const string SaasWaf = "SaasWaf"; + public const string Va = "Va"; + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/SecurityTask.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/SecurityTask.cs new file mode 100644 index 000000000000..c220f050da08 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/SecurityTask.cs @@ -0,0 +1,92 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Security task that we recommend to do in order to strengthen security + /// + [Rest.Serialization.JsonTransformation] + public partial class SecurityTask : Resource + { + /// + /// Initializes a new instance of the SecurityTask class. + /// + public SecurityTask() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SecurityTask class. + /// + /// Resource Id + /// Resource name + /// Resource type + /// State of the task (Active, Resolved + /// etc.) + /// The time this task was discovered in + /// UTC + /// The time this task's details + /// were last changed in UTC + /// Additional data on the state of the + /// task + public SecurityTask(string id = default(string), string name = default(string), string type = default(string), string state = default(string), System.DateTime? creationTimeUtc = default(System.DateTime?), SecurityTaskParameters securityTaskParameters = default(SecurityTaskParameters), System.DateTime? lastStateChangeTimeUtc = default(System.DateTime?), string subState = default(string)) + : base(id, name, type) + { + State = state; + CreationTimeUtc = creationTimeUtc; + SecurityTaskParameters = securityTaskParameters; + LastStateChangeTimeUtc = lastStateChangeTimeUtc; + SubState = subState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets state of the task (Active, Resolved etc.) + /// + [JsonProperty(PropertyName = "properties.state")] + public string State { get; private set; } + + /// + /// Gets the time this task was discovered in UTC + /// + [JsonProperty(PropertyName = "properties.creationTimeUtc")] + public System.DateTime? CreationTimeUtc { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "properties.securityTaskParameters")] + public SecurityTaskParameters SecurityTaskParameters { get; set; } + + /// + /// Gets the time this task's details were last changed in UTC + /// + [JsonProperty(PropertyName = "properties.lastStateChangeTimeUtc")] + public System.DateTime? LastStateChangeTimeUtc { get; private set; } + + /// + /// Gets additional data on the state of the task + /// + [JsonProperty(PropertyName = "properties.subState")] + public string SubState { get; private set; } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/SecurityTaskParameters.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/SecurityTaskParameters.cs new file mode 100644 index 000000000000..c4fe6ec39563 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/SecurityTaskParameters.cs @@ -0,0 +1,64 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Changing set of properties, depending on the task type that is derived + /// from the name field + /// + public partial class SecurityTaskParameters + { + /// + /// Initializes a new instance of the SecurityTaskParameters class. + /// + public SecurityTaskParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SecurityTaskParameters class. + /// + /// Unmatched properties from the + /// message are deserialized this collection + /// Name of the task type + public SecurityTaskParameters(IDictionary additionalProperties = default(IDictionary), string name = default(string)) + { + AdditionalProperties = additionalProperties; + Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets unmatched properties from the message are deserialized + /// this collection + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Gets name of the task type + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Status.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Status.cs new file mode 100644 index 000000000000..73043aabe2a4 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/Status.cs @@ -0,0 +1,22 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + + /// + /// Defines values for Status. + /// + public static class Status + { + public const string Revoked = "Revoked"; + public const string Initiated = "Initiated"; + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/StatusReason.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/StatusReason.cs new file mode 100644 index 000000000000..05827e56b0e3 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/StatusReason.cs @@ -0,0 +1,23 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + + /// + /// Defines values for StatusReason. + /// + public static class StatusReason + { + public const string Expired = "Expired"; + public const string UserRequested = "UserRequested"; + public const string NewerRequestInitiated = "NewerRequestInitiated"; + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/WorkspaceSetting.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/WorkspaceSetting.cs new file mode 100644 index 000000000000..a3d55c0c0494 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Models/WorkspaceSetting.cs @@ -0,0 +1,89 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Configures where to store the OMS agent data for workspaces under a + /// scope + /// + [Rest.Serialization.JsonTransformation] + public partial class WorkspaceSetting : Resource + { + /// + /// Initializes a new instance of the WorkspaceSetting class. + /// + public WorkspaceSetting() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspaceSetting class. + /// + /// The full Azure ID of the workspace to + /// save the data in + /// All the VMs in this scope will send their + /// security data to the mentioned workspace unless overridden by a + /// setting with more specific scope + /// Resource Id + /// Resource name + /// Resource type + public WorkspaceSetting(string workspaceId, string scope, string id = default(string), string name = default(string), string type = default(string)) + : base(id, name, type) + { + WorkspaceId = workspaceId; + Scope = scope; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the full Azure ID of the workspace to save the data in + /// + [JsonProperty(PropertyName = "properties.workspaceId")] + public string WorkspaceId { get; set; } + + /// + /// Gets or sets all the VMs in this scope will send their security + /// data to the mentioned workspace unless overridden by a setting with + /// more specific scope + /// + [JsonProperty(PropertyName = "properties.scope")] + public string Scope { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (WorkspaceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "WorkspaceId"); + } + if (Scope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Scope"); + } + } + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Operations.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Operations.cs new file mode 100644 index 000000000000..98734535b88e --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/Operations.cs @@ -0,0 +1,392 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Operations operations. + /// + internal partial class Operations : IServiceOperations, IOperations + { + /// + /// Initializes a new instance of the Operations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal Operations(SecurityCenterClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SecurityCenterClient + /// + public SecurityCenterClient Client { get; private set; } + + /// + /// Exposes all available operations for discovery purposes. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Security/operations").ToString(); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Exposes all available operations for discovery purposes. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/OperationsExtensions.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/OperationsExtensions.cs new file mode 100644 index 000000000000..3c376d08fd0d --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/OperationsExtensions.cs @@ -0,0 +1,87 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for Operations. + /// + public static partial class OperationsExtensions + { + /// + /// Exposes all available operations for discovery purposes. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Exposes all available operations for discovery purposes. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Exposes all available operations for discovery purposes. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Exposes all available operations for discovery purposes. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/PricingsOperations.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/PricingsOperations.cs new file mode 100644 index 000000000000..6d140543965f --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/PricingsOperations.cs @@ -0,0 +1,1648 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PricingsOperations operations. + /// + internal partial class PricingsOperations : IServiceOperations, IPricingsOperations + { + /// + /// Initializes a new instance of the PricingsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PricingsOperations(SecurityCenterClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SecurityCenterClient + /// + public SecurityCenterClient Client { get; private set; } + + /// + /// Security pricing configurations in the subscription + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + string apiVersion = "2017-08-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Security pricing configurations in the resource group + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + string apiVersion = "2017-08-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/pricings").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Security pricing configuration in the subscriptionSecurity pricing + /// configuration in the subscription + /// + /// + /// name of the pricing configuration + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetSubscriptionPricingWithHttpMessagesAsync(string pricingName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (pricingName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "pricingName"); + } + string apiVersion = "2017-08-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("pricingName", pricingName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetSubscriptionPricing", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{pricingName}", System.Uri.EscapeDataString(pricingName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Security pricing configuration in the subscription + /// + /// + /// name of the pricing configuration + /// + /// + /// Pricing tier type. Possible values include: 'Free', 'Standard' + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> UpdateSubscriptionPricingWithHttpMessagesAsync(string pricingName, string pricingTier, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (pricingName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "pricingName"); + } + if (pricingTier == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "pricingTier"); + } + string apiVersion = "2017-08-01-preview"; + Pricing pricing = new Pricing(); + if (pricingTier != null) + { + pricing.PricingTier = pricingTier; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("pricingName", pricingName); + tracingParameters.Add("pricing", pricing); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "UpdateSubscriptionPricing", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{pricingName}", System.Uri.EscapeDataString(pricingName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(pricing != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(pricing, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Security pricing configuration in the resource group + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// name of the pricing configuration + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetResourceGroupPricingWithHttpMessagesAsync(string resourceGroupName, string pricingName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (pricingName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "pricingName"); + } + string apiVersion = "2017-08-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("pricingName", pricingName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetResourceGroupPricing", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/pricings/{pricingName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{pricingName}", System.Uri.EscapeDataString(pricingName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Security pricing configuration in the resource group + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// name of the pricing configuration + /// + /// + /// Pricing tier type. Possible values include: 'Free', 'Standard' + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateResourceGroupPricingWithHttpMessagesAsync(string resourceGroupName, string pricingName, string pricingTier, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (pricingName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "pricingName"); + } + if (pricingTier == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "pricingTier"); + } + string apiVersion = "2017-08-01-preview"; + Pricing pricing = new Pricing(); + if (pricingTier != null) + { + pricing.PricingTier = pricingTier; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("pricingName", pricingName); + tracingParameters.Add("pricing", pricing); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateResourceGroupPricing", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/pricings/{pricingName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{pricingName}", System.Uri.EscapeDataString(pricingName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(pricing != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(pricing, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Security pricing configurations in the subscription + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Security pricing configurations in the resource group + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/PricingsOperationsExtensions.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/PricingsOperationsExtensions.cs new file mode 100644 index 000000000000..87005ea699b4 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/PricingsOperationsExtensions.cs @@ -0,0 +1,323 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for PricingsOperations. + /// + public static partial class PricingsOperationsExtensions + { + /// + /// Security pricing configurations in the subscription + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IPricingsOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Security pricing configurations in the subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IPricingsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Security pricing configurations in the resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + public static IPage ListByResourceGroup(this IPricingsOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Security pricing configurations in the resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IPricingsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Security pricing configuration in the subscriptionSecurity pricing + /// configuration in the subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// name of the pricing configuration + /// + public static Pricing GetSubscriptionPricing(this IPricingsOperations operations, string pricingName) + { + return operations.GetSubscriptionPricingAsync(pricingName).GetAwaiter().GetResult(); + } + + /// + /// Security pricing configuration in the subscriptionSecurity pricing + /// configuration in the subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// name of the pricing configuration + /// + /// + /// The cancellation token. + /// + public static async Task GetSubscriptionPricingAsync(this IPricingsOperations operations, string pricingName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSubscriptionPricingWithHttpMessagesAsync(pricingName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Security pricing configuration in the subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// name of the pricing configuration + /// + /// + /// Pricing tier type. Possible values include: 'Free', 'Standard' + /// + public static Pricing UpdateSubscriptionPricing(this IPricingsOperations operations, string pricingName, string pricingTier) + { + return operations.UpdateSubscriptionPricingAsync(pricingName, pricingTier).GetAwaiter().GetResult(); + } + + /// + /// Security pricing configuration in the subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// name of the pricing configuration + /// + /// + /// Pricing tier type. Possible values include: 'Free', 'Standard' + /// + /// + /// The cancellation token. + /// + public static async Task UpdateSubscriptionPricingAsync(this IPricingsOperations operations, string pricingName, string pricingTier, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateSubscriptionPricingWithHttpMessagesAsync(pricingName, pricingTier, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Security pricing configuration in the resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// name of the pricing configuration + /// + public static Pricing GetResourceGroupPricing(this IPricingsOperations operations, string resourceGroupName, string pricingName) + { + return operations.GetResourceGroupPricingAsync(resourceGroupName, pricingName).GetAwaiter().GetResult(); + } + + /// + /// Security pricing configuration in the resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// name of the pricing configuration + /// + /// + /// The cancellation token. + /// + public static async Task GetResourceGroupPricingAsync(this IPricingsOperations operations, string resourceGroupName, string pricingName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetResourceGroupPricingWithHttpMessagesAsync(resourceGroupName, pricingName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Security pricing configuration in the resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// name of the pricing configuration + /// + /// + /// Pricing tier type. Possible values include: 'Free', 'Standard' + /// + public static Pricing CreateOrUpdateResourceGroupPricing(this IPricingsOperations operations, string resourceGroupName, string pricingName, string pricingTier) + { + return operations.CreateOrUpdateResourceGroupPricingAsync(resourceGroupName, pricingName, pricingTier).GetAwaiter().GetResult(); + } + + /// + /// Security pricing configuration in the resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// name of the pricing configuration + /// + /// + /// Pricing tier type. Possible values include: 'Free', 'Standard' + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateResourceGroupPricingAsync(this IPricingsOperations operations, string resourceGroupName, string pricingName, string pricingTier, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateResourceGroupPricingWithHttpMessagesAsync(resourceGroupName, pricingName, pricingTier, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Security pricing configurations in the subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IPricingsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Security pricing configurations in the subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IPricingsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Security pricing configurations in the resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IPricingsOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Security pricing configurations in the resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IPricingsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/SdkInfo_SecurityCenter.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/SdkInfo_SecurityCenter.cs new file mode 100644 index 000000000000..30d267223106 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/SdkInfo_SecurityCenter.cs @@ -0,0 +1,38 @@ + +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_SecurityCenter + { + get + { + return new Tuple[] + { + new Tuple("Security", "Alerts", "2015-06-01-preview"), + new Tuple("Security", "AutoProvisioningSettings", "2017-08-01-preview"), + new Tuple("Security", "Compliances", "2017-08-01-preview"), + new Tuple("Security", "DiscoveredSecuritySolutions", "2015-06-01-preview"), + new Tuple("Security", "ExternalSecuritySolutions", "2015-06-01-preview"), + new Tuple("Security", "JitNetworkAccessPolicies", "2015-06-01-preview"), + new Tuple("Security", "Locations", "2015-06-01-preview"), + new Tuple("Security", "Operations", "2015-06-01-preview"), + new Tuple("Security", "Pricings", "2017-08-01-preview"), + new Tuple("Security", "SecurityContacts", "2017-08-01-preview"), + new Tuple("Security", "Tasks", "2015-06-01-preview"), + new Tuple("Security", "WorkspaceSettings", "2017-08-01-preview"), + }.AsEnumerable(); + } + } + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/SecurityCenterClient.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/SecurityCenterClient.cs new file mode 100644 index 000000000000..36e1eb321bb8 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/SecurityCenterClient.cs @@ -0,0 +1,388 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + + /// + /// API spec for Microsoft.Security (Azure Security Center) resource + /// provider + /// + public partial class SecurityCenterClient : ServiceClient, ISecurityCenterClient, IAzureClient + { + /// + /// The base URI of the service. + /// + public System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + public JsonSerializerSettings SerializationSettings { get; private set; } + + /// + /// Gets or sets json deserialization settings. + /// + public JsonSerializerSettings DeserializationSettings { get; private set; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + public ServiceClientCredentials Credentials { get; private set; } + + /// + /// Azure subscription ID + /// + public string SubscriptionId { get; set; } + + /// + /// The location where ASC stores the data of the subscription. can be + /// retrieved from Get locations + /// + public string AscLocation { get; set; } + + /// + /// Gets or sets the preferred language for the response. + /// + public string AcceptLanguage { get; set; } + + /// + /// Gets or sets the retry timeout in seconds for Long Running Operations. + /// Default value is 30. + /// + public int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// When set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. + /// + public bool? GenerateClientRequestId { get; set; } + + /// + /// Gets the IPricingsOperations. + /// + public virtual IPricingsOperations Pricings { get; private set; } + + /// + /// Gets the ISecurityContactsOperations. + /// + public virtual ISecurityContactsOperations SecurityContacts { get; private set; } + + /// + /// Gets the IWorkspaceSettingsOperations. + /// + public virtual IWorkspaceSettingsOperations WorkspaceSettings { get; private set; } + + /// + /// Gets the IAutoProvisioningSettingsOperations. + /// + public virtual IAutoProvisioningSettingsOperations AutoProvisioningSettings { get; private set; } + + /// + /// Gets the ICompliancesOperations. + /// + public virtual ICompliancesOperations Compliances { get; private set; } + + /// + /// Gets the IOperations. + /// + public virtual IOperations Operations { get; private set; } + + /// + /// Gets the ILocationsOperations. + /// + public virtual ILocationsOperations Locations { get; private set; } + + /// + /// Gets the ITasksOperations. + /// + public virtual ITasksOperations Tasks { get; private set; } + + /// + /// Gets the IAlertsOperations. + /// + public virtual IAlertsOperations Alerts { get; private set; } + + /// + /// Gets the IDiscoveredSecuritySolutionsOperations. + /// + public virtual IDiscoveredSecuritySolutionsOperations DiscoveredSecuritySolutions { get; private set; } + + /// + /// Gets the IJitNetworkAccessPoliciesOperations. + /// + public virtual IJitNetworkAccessPoliciesOperations JitNetworkAccessPolicies { get; private set; } + + /// + /// Gets the IExternalSecuritySolutionsOperations. + /// + public virtual IExternalSecuritySolutionsOperations ExternalSecuritySolutions { get; private set; } + + /// + /// Initializes a new instance of the SecurityCenterClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected SecurityCenterClient(params DelegatingHandler[] handlers) : base(handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the SecurityCenterClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected SecurityCenterClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the SecurityCenterClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected SecurityCenterClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the SecurityCenterClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected SecurityCenterClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the SecurityCenterClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public SecurityCenterClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the SecurityCenterClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public SecurityCenterClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the SecurityCenterClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public SecurityCenterClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the SecurityCenterClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public SecurityCenterClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); + /// + /// Initializes client properties. + /// + private void Initialize() + { + Pricings = new PricingsOperations(this); + SecurityContacts = new SecurityContactsOperations(this); + WorkspaceSettings = new WorkspaceSettingsOperations(this); + AutoProvisioningSettings = new AutoProvisioningSettingsOperations(this); + Compliances = new CompliancesOperations(this); + Operations = new Operations(this); + Locations = new LocationsOperations(this); + Tasks = new TasksOperations(this); + Alerts = new AlertsOperations(this); + DiscoveredSecuritySolutions = new DiscoveredSecuritySolutionsOperations(this); + JitNetworkAccessPolicies = new JitNetworkAccessPoliciesOperations(this); + ExternalSecuritySolutions = new ExternalSecuritySolutionsOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + AcceptLanguage = "en-US"; + LongRunningOperationRetryTimeout = 30; + GenerateClientRequestId = true; + SerializationSettings = new JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + SerializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings = new JsonSerializerSettings + { + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); + CustomInitialize(); + DeserializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/SecurityContactsOperations.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/SecurityContactsOperations.cs new file mode 100644 index 000000000000..000a662531e5 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/SecurityContactsOperations.cs @@ -0,0 +1,1189 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SecurityContactsOperations operations. + /// + internal partial class SecurityContactsOperations : IServiceOperations, ISecurityContactsOperations + { + /// + /// Initializes a new instance of the SecurityContactsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SecurityContactsOperations(SecurityCenterClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SecurityCenterClient + /// + public SecurityCenterClient Client { get; private set; } + + /// + /// Security contact configurations for the subscription + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + string apiVersion = "2017-08-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Security contact configurations for the subscription + /// + /// + /// Name of the security contact object + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string securityContactName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (securityContactName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "securityContactName"); + } + string apiVersion = "2017-08-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("securityContactName", securityContactName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{securityContactName}", System.Uri.EscapeDataString(securityContactName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Security contact configurations for the subscription + /// + /// + /// Name of the security contact object + /// + /// + /// Security contact object + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateWithHttpMessagesAsync(string securityContactName, SecurityContact securityContact, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (securityContactName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "securityContactName"); + } + if (securityContact == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "securityContact"); + } + if (securityContact != null) + { + securityContact.Validate(); + } + string apiVersion = "2017-08-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("securityContactName", securityContactName); + tracingParameters.Add("securityContact", securityContact); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{securityContactName}", System.Uri.EscapeDataString(securityContactName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(securityContact != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(securityContact, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Security contact configurations for the subscription + /// + /// + /// Name of the security contact object + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string securityContactName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (securityContactName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "securityContactName"); + } + string apiVersion = "2017-08-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("securityContactName", securityContactName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{securityContactName}", System.Uri.EscapeDataString(securityContactName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Security contact configurations for the subscription + /// + /// + /// Name of the security contact object + /// + /// + /// Security contact object + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> UpdateWithHttpMessagesAsync(string securityContactName, SecurityContact securityContact, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (securityContactName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "securityContactName"); + } + if (securityContact == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "securityContact"); + } + string apiVersion = "2017-08-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("securityContactName", securityContactName); + tracingParameters.Add("securityContact", securityContact); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{securityContactName}", System.Uri.EscapeDataString(securityContactName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(securityContact != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(securityContact, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Security contact configurations for the subscription + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/SecurityContactsOperationsExtensions.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/SecurityContactsOperationsExtensions.cs new file mode 100644 index 000000000000..41e4dd05d05d --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/SecurityContactsOperationsExtensions.cs @@ -0,0 +1,232 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SecurityContactsOperations. + /// + public static partial class SecurityContactsOperationsExtensions + { + /// + /// Security contact configurations for the subscription + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this ISecurityContactsOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Security contact configurations for the subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ISecurityContactsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Security contact configurations for the subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the security contact object + /// + public static SecurityContact Get(this ISecurityContactsOperations operations, string securityContactName) + { + return operations.GetAsync(securityContactName).GetAwaiter().GetResult(); + } + + /// + /// Security contact configurations for the subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the security contact object + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISecurityContactsOperations operations, string securityContactName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(securityContactName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Security contact configurations for the subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the security contact object + /// + /// + /// Security contact object + /// + public static SecurityContact Create(this ISecurityContactsOperations operations, string securityContactName, SecurityContact securityContact) + { + return operations.CreateAsync(securityContactName, securityContact).GetAwaiter().GetResult(); + } + + /// + /// Security contact configurations for the subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the security contact object + /// + /// + /// Security contact object + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this ISecurityContactsOperations operations, string securityContactName, SecurityContact securityContact, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(securityContactName, securityContact, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Security contact configurations for the subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the security contact object + /// + public static void Delete(this ISecurityContactsOperations operations, string securityContactName) + { + operations.DeleteAsync(securityContactName).GetAwaiter().GetResult(); + } + + /// + /// Security contact configurations for the subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the security contact object + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ISecurityContactsOperations operations, string securityContactName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(securityContactName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Security contact configurations for the subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the security contact object + /// + /// + /// Security contact object + /// + public static SecurityContact Update(this ISecurityContactsOperations operations, string securityContactName, SecurityContact securityContact) + { + return operations.UpdateAsync(securityContactName, securityContact).GetAwaiter().GetResult(); + } + + /// + /// Security contact configurations for the subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the security contact object + /// + /// + /// Security contact object + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this ISecurityContactsOperations operations, string securityContactName, SecurityContact securityContact, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(securityContactName, securityContact, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Security contact configurations for the subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this ISecurityContactsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Security contact configurations for the subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this ISecurityContactsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/TasksOperations.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/TasksOperations.cs new file mode 100644 index 000000000000..7f16ee354316 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/TasksOperations.cs @@ -0,0 +1,2007 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// TasksOperations operations. + /// + internal partial class TasksOperations : IServiceOperations, ITasksOperations + { + /// + /// Initializes a new instance of the TasksOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal TasksOperations(SecurityCenterClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SecurityCenterClient + /// + public SecurityCenterClient Client { get; private set; } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// OData filter. Optional. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("filter", filter); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/tasks").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// OData filter. Optional. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByHomeRegionWithHttpMessagesAsync(string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (Client.AscLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("filter", filter); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByHomeRegion", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// Name of the task object, will be a GUID + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetSubscriptionLevelTaskWithHttpMessagesAsync(string taskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (Client.AscLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); + } + if (taskName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "taskName"); + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("taskName", taskName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetSubscriptionLevelTask", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation)); + _url = _url.Replace("{taskName}", System.Uri.EscapeDataString(taskName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// Name of the task object, will be a GUID + /// + /// + /// Type of the action to do on the task. Possible values include: 'Activate', + /// 'Dismiss', 'Start', 'Resolve', 'Close' + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task UpdateSubscriptionLevelTaskStateWithHttpMessagesAsync(string taskName, string taskUpdateActionType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (Client.AscLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); + } + if (taskName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "taskName"); + } + if (taskUpdateActionType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "taskUpdateActionType"); + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("taskName", taskName); + tracingParameters.Add("taskUpdateActionType", taskUpdateActionType); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "UpdateSubscriptionLevelTaskState", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation)); + _url = _url.Replace("{taskName}", System.Uri.EscapeDataString(taskName)); + _url = _url.Replace("{taskUpdateActionType}", System.Uri.EscapeDataString(taskUpdateActionType)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// OData filter. Optional. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.AscLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("filter", filter); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Name of the task object, will be a GUID + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetResourceGroupLevelTaskWithHttpMessagesAsync(string resourceGroupName, string taskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.AscLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); + } + if (taskName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "taskName"); + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("taskName", taskName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetResourceGroupLevelTask", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation)); + _url = _url.Replace("{taskName}", System.Uri.EscapeDataString(taskName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Name of the task object, will be a GUID + /// + /// + /// Type of the action to do on the task. Possible values include: 'Activate', + /// 'Dismiss', 'Start', 'Resolve', 'Close' + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task UpdateResourceGroupLevelTaskStateWithHttpMessagesAsync(string resourceGroupName, string taskName, string taskUpdateActionType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.AscLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); + } + if (taskName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "taskName"); + } + if (taskUpdateActionType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "taskUpdateActionType"); + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("taskName", taskName); + tracingParameters.Add("taskUpdateActionType", taskUpdateActionType); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "UpdateResourceGroupLevelTaskState", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation)); + _url = _url.Replace("{taskName}", System.Uri.EscapeDataString(taskName)); + _url = _url.Replace("{taskUpdateActionType}", System.Uri.EscapeDataString(taskUpdateActionType)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByHomeRegionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByHomeRegionNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/TasksOperationsExtensions.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/TasksOperationsExtensions.cs new file mode 100644 index 000000000000..45a9bdd70a7b --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/TasksOperationsExtensions.cs @@ -0,0 +1,419 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for TasksOperations. + /// + public static partial class TasksOperationsExtensions + { + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The operations group for this extension method. + /// + /// + /// OData filter. Optional. + /// + public static IPage List(this ITasksOperations operations, string filter = default(string)) + { + return operations.ListAsync(filter).GetAwaiter().GetResult(); + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The operations group for this extension method. + /// + /// + /// OData filter. Optional. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ITasksOperations operations, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(filter, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The operations group for this extension method. + /// + /// + /// OData filter. Optional. + /// + public static IPage ListByHomeRegion(this ITasksOperations operations, string filter = default(string)) + { + return operations.ListByHomeRegionAsync(filter).GetAwaiter().GetResult(); + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The operations group for this extension method. + /// + /// + /// OData filter. Optional. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByHomeRegionAsync(this ITasksOperations operations, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByHomeRegionWithHttpMessagesAsync(filter, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the task object, will be a GUID + /// + public static SecurityTask GetSubscriptionLevelTask(this ITasksOperations operations, string taskName) + { + return operations.GetSubscriptionLevelTaskAsync(taskName).GetAwaiter().GetResult(); + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the task object, will be a GUID + /// + /// + /// The cancellation token. + /// + public static async Task GetSubscriptionLevelTaskAsync(this ITasksOperations operations, string taskName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSubscriptionLevelTaskWithHttpMessagesAsync(taskName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the task object, will be a GUID + /// + /// + /// Type of the action to do on the task. Possible values include: 'Activate', + /// 'Dismiss', 'Start', 'Resolve', 'Close' + /// + public static void UpdateSubscriptionLevelTaskState(this ITasksOperations operations, string taskName, string taskUpdateActionType) + { + operations.UpdateSubscriptionLevelTaskStateAsync(taskName, taskUpdateActionType).GetAwaiter().GetResult(); + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the task object, will be a GUID + /// + /// + /// Type of the action to do on the task. Possible values include: 'Activate', + /// 'Dismiss', 'Start', 'Resolve', 'Close' + /// + /// + /// The cancellation token. + /// + public static async Task UpdateSubscriptionLevelTaskStateAsync(this ITasksOperations operations, string taskName, string taskUpdateActionType, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.UpdateSubscriptionLevelTaskStateWithHttpMessagesAsync(taskName, taskUpdateActionType, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// OData filter. Optional. + /// + public static IPage ListByResourceGroup(this ITasksOperations operations, string resourceGroupName, string filter = default(string)) + { + return operations.ListByResourceGroupAsync(resourceGroupName, filter).GetAwaiter().GetResult(); + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// OData filter. Optional. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this ITasksOperations operations, string resourceGroupName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, filter, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Name of the task object, will be a GUID + /// + public static SecurityTask GetResourceGroupLevelTask(this ITasksOperations operations, string resourceGroupName, string taskName) + { + return operations.GetResourceGroupLevelTaskAsync(resourceGroupName, taskName).GetAwaiter().GetResult(); + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Name of the task object, will be a GUID + /// + /// + /// The cancellation token. + /// + public static async Task GetResourceGroupLevelTaskAsync(this ITasksOperations operations, string resourceGroupName, string taskName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetResourceGroupLevelTaskWithHttpMessagesAsync(resourceGroupName, taskName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Name of the task object, will be a GUID + /// + /// + /// Type of the action to do on the task. Possible values include: 'Activate', + /// 'Dismiss', 'Start', 'Resolve', 'Close' + /// + public static void UpdateResourceGroupLevelTaskState(this ITasksOperations operations, string resourceGroupName, string taskName, string taskUpdateActionType) + { + operations.UpdateResourceGroupLevelTaskStateAsync(resourceGroupName, taskName, taskUpdateActionType).GetAwaiter().GetResult(); + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// Name of the task object, will be a GUID + /// + /// + /// Type of the action to do on the task. Possible values include: 'Activate', + /// 'Dismiss', 'Start', 'Resolve', 'Close' + /// + /// + /// The cancellation token. + /// + public static async Task UpdateResourceGroupLevelTaskStateAsync(this ITasksOperations operations, string resourceGroupName, string taskName, string taskUpdateActionType, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.UpdateResourceGroupLevelTaskStateWithHttpMessagesAsync(resourceGroupName, taskName, taskUpdateActionType, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this ITasksOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this ITasksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByHomeRegionNext(this ITasksOperations operations, string nextPageLink) + { + return operations.ListByHomeRegionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByHomeRegionNextAsync(this ITasksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByHomeRegionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this ITasksOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Recommended tasks that will help improve the security of the subscription + /// proactively + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this ITasksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/WorkspaceSettingsOperations.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/WorkspaceSettingsOperations.cs new file mode 100644 index 000000000000..f77ed444a61f --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/WorkspaceSettingsOperations.cs @@ -0,0 +1,1214 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WorkspaceSettingsOperations operations. + /// + internal partial class WorkspaceSettingsOperations : IServiceOperations, IWorkspaceSettingsOperations + { + /// + /// Initializes a new instance of the WorkspaceSettingsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal WorkspaceSettingsOperations(SecurityCenterClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SecurityCenterClient + /// + public SecurityCenterClient Client { get; private set; } + + /// + /// Settings about where we should store your security data and logs + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + string apiVersion = "2017-08-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Settings about where we should store your security data and logs + /// + /// + /// Name of the security setting + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string workspaceSettingName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (workspaceSettingName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceSettingName"); + } + string apiVersion = "2017-08-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("workspaceSettingName", workspaceSettingName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{workspaceSettingName}", System.Uri.EscapeDataString(workspaceSettingName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// creating settings about where we should store your security data and logs + /// + /// + /// Name of the security setting + /// + /// + /// The full Azure ID of the workspace to save the data in + /// + /// + /// All the VMs in this scope will send their security data to the mentioned + /// workspace unless overridden by a setting with more specific scope + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateWithHttpMessagesAsync(string workspaceSettingName, string workspaceId, string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (workspaceSettingName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceSettingName"); + } + if (workspaceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceId"); + } + if (scope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scope"); + } + string apiVersion = "2017-08-01-preview"; + WorkspaceSetting workspaceSetting = new WorkspaceSetting(); + if (workspaceId != null || scope != null) + { + workspaceSetting.WorkspaceId = workspaceId; + workspaceSetting.Scope = scope; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("workspaceSettingName", workspaceSettingName); + tracingParameters.Add("workspaceSetting", workspaceSetting); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{workspaceSettingName}", System.Uri.EscapeDataString(workspaceSettingName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(workspaceSetting != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workspaceSetting, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Settings about where we should store your security data and logs + /// + /// + /// Name of the security setting + /// + /// + /// The full Azure ID of the workspace to save the data in + /// + /// + /// All the VMs in this scope will send their security data to the mentioned + /// workspace unless overridden by a setting with more specific scope + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> UpdateWithHttpMessagesAsync(string workspaceSettingName, string workspaceId, string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (workspaceSettingName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceSettingName"); + } + if (workspaceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceId"); + } + if (scope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scope"); + } + string apiVersion = "2017-08-01-preview"; + WorkspaceSetting workspaceSetting = new WorkspaceSetting(); + if (workspaceId != null || scope != null) + { + workspaceSetting.WorkspaceId = workspaceId; + workspaceSetting.Scope = scope; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("workspaceSettingName", workspaceSettingName); + tracingParameters.Add("workspaceSetting", workspaceSetting); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{workspaceSettingName}", System.Uri.EscapeDataString(workspaceSettingName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(workspaceSetting != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workspaceSetting, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes the custom workspace settings for this subscription. new VMs will + /// report to the default workspace + /// + /// + /// Name of the security setting + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string workspaceSettingName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (workspaceSettingName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceSettingName"); + } + string apiVersion = "2017-08-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("workspaceSettingName", workspaceSettingName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{workspaceSettingName}", System.Uri.EscapeDataString(workspaceSettingName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Settings about where we should store your security data and logs + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/WorkspaceSettingsOperationsExtensions.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/WorkspaceSettingsOperationsExtensions.cs new file mode 100644 index 000000000000..d6ecede8e74e --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Generated/WorkspaceSettingsOperationsExtensions.cs @@ -0,0 +1,250 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for WorkspaceSettingsOperations. + /// + public static partial class WorkspaceSettingsOperationsExtensions + { + /// + /// Settings about where we should store your security data and logs + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IWorkspaceSettingsOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Settings about where we should store your security data and logs + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IWorkspaceSettingsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Settings about where we should store your security data and logs + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the security setting + /// + public static WorkspaceSetting Get(this IWorkspaceSettingsOperations operations, string workspaceSettingName) + { + return operations.GetAsync(workspaceSettingName).GetAwaiter().GetResult(); + } + + /// + /// Settings about where we should store your security data and logs + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the security setting + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IWorkspaceSettingsOperations operations, string workspaceSettingName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(workspaceSettingName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// creating settings about where we should store your security data and logs + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the security setting + /// + /// + /// The full Azure ID of the workspace to save the data in + /// + /// + /// All the VMs in this scope will send their security data to the mentioned + /// workspace unless overridden by a setting with more specific scope + /// + public static WorkspaceSetting Create(this IWorkspaceSettingsOperations operations, string workspaceSettingName, string workspaceId, string scope) + { + return operations.CreateAsync(workspaceSettingName, workspaceId, scope).GetAwaiter().GetResult(); + } + + /// + /// creating settings about where we should store your security data and logs + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the security setting + /// + /// + /// The full Azure ID of the workspace to save the data in + /// + /// + /// All the VMs in this scope will send their security data to the mentioned + /// workspace unless overridden by a setting with more specific scope + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IWorkspaceSettingsOperations operations, string workspaceSettingName, string workspaceId, string scope, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(workspaceSettingName, workspaceId, scope, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Settings about where we should store your security data and logs + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the security setting + /// + /// + /// The full Azure ID of the workspace to save the data in + /// + /// + /// All the VMs in this scope will send their security data to the mentioned + /// workspace unless overridden by a setting with more specific scope + /// + public static WorkspaceSetting Update(this IWorkspaceSettingsOperations operations, string workspaceSettingName, string workspaceId, string scope) + { + return operations.UpdateAsync(workspaceSettingName, workspaceId, scope).GetAwaiter().GetResult(); + } + + /// + /// Settings about where we should store your security data and logs + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the security setting + /// + /// + /// The full Azure ID of the workspace to save the data in + /// + /// + /// All the VMs in this scope will send their security data to the mentioned + /// workspace unless overridden by a setting with more specific scope + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IWorkspaceSettingsOperations operations, string workspaceSettingName, string workspaceId, string scope, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(workspaceSettingName, workspaceId, scope, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the custom workspace settings for this subscription. new VMs will + /// report to the default workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the security setting + /// + public static void Delete(this IWorkspaceSettingsOperations operations, string workspaceSettingName) + { + operations.DeleteAsync(workspaceSettingName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the custom workspace settings for this subscription. new VMs will + /// report to the default workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the security setting + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IWorkspaceSettingsOperations operations, string workspaceSettingName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(workspaceSettingName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Settings about where we should store your security data and logs + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IWorkspaceSettingsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Settings about where we should store your security data and logs + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IWorkspaceSettingsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Microsoft.Azure.Management.SecurityCenter.csproj b/src/SDKs/SecurityCenter/Management.SecurityCenter/Microsoft.Azure.Management.SecurityCenter.csproj new file mode 100644 index 000000000000..88a58053ecd6 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Microsoft.Azure.Management.SecurityCenter.csproj @@ -0,0 +1,25 @@ + + + + + + + Microsoft.Azure.Management.SecurityCenter + Provides developers with libraries for the updated Azure Security Center platform under Azure Resource manager to view and manage security posture in and outside Azure. + 0.9.0-preview + Microsoft.Azure.Management.SecurityCenter + management;security center;security; + + + + + + net452;netstandard1.4 + + + + + + diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/Properties/AssemblyInfo.cs b/src/SDKs/SecurityCenter/Management.SecurityCenter/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..012717972c4e --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Reflection; +using System.Resources; + +[assembly: AssemblyTitle("Microsoft Azure Security Center Library")] +[assembly: AssemblyDescription("Provides management functionality for Microsoft Azure Security Center Resources.")] + +[assembly: AssemblyVersion("0.9.0.0")] +[assembly: AssemblyFileVersion("0.9.0.0")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Microsoft Azure .NET SDK")] +[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: NeutralResourcesLanguage("en")] diff --git a/src/SDKs/SecurityCenter/Management.SecurityCenter/generate.ps1 b/src/SDKs/SecurityCenter/Management.SecurityCenter/generate.ps1 new file mode 100644 index 000000000000..c487c657aa39 --- /dev/null +++ b/src/SDKs/SecurityCenter/Management.SecurityCenter/generate.ps1 @@ -0,0 +1 @@ +Start-AutoRestCodeGeneration -ResourceProvider "security/resource-manager" -AutoRestVersion "latest" diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/Alerts/SecurityAlertsTests.cs b/src/SDKs/SecurityCenter/SecurityCenter.Tests/Alerts/SecurityAlertsTests.cs new file mode 100644 index 000000000000..6a4fe81a319a --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/Alerts/SecurityAlertsTests.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Net; +using Microsoft.Azure.Management.Security; +using Microsoft.Azure.Management.Security.Models; +using Microsoft.Azure.Test.HttpRecorder; +using Microsoft.Rest.Azure; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; +using SecurityCenter.Tests.Helpers; +using Xunit; + +namespace SecurityCenter.Tests +{ + public class SecurityAlertsTests : TestBase + { + #region Test setup + + public static TestEnvironment TestEnvironment { get; private set; } + + private static SecurityCenterClient GetSecurityCenterClient(MockContext context) + { + if (TestEnvironment == null && HttpMockServer.Mode == HttpRecorderMode.Record) + { + TestEnvironment = TestEnvironmentFactory.GetTestEnvironment(); + } + + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK, IsPassThrough = true }; + + var securityCenterClient = HttpMockServer.Mode == HttpRecorderMode.Record + ? context.GetServiceClient(TestEnvironment, handlers: handler) + : context.GetServiceClient(handlers: handler); + + securityCenterClient.AscLocation = "centralus"; + + return securityCenterClient; + } + + #endregion + + #region Alerts + + [Fact] + public void SecurityAlerts_List() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var alerts = securityCenterClient.Alerts.List(); + ValidateAlerts(alerts); + } + } + + [Fact] + public void SecurityAlerts_GetResourceGroupLevelAlerts() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var alert = securityCenterClient.Alerts.GetResourceGroupLevelAlerts("2518710774294070750_FFF23C70-80EF-4A8B-9122-507B0EA8DFFF", "RSG"); + ValidateAlert(alert); + } + } + + [Fact] + public void SecurityAlerts_GetSubscriptionLevelAlert() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var alert = securityCenterClient.Alerts.GetSubscriptionLevelAlert("2518710774894070750_EEE23C70-80EF-4A8B-9122-507B0EA8DFFF"); + ValidateAlert(alert); + } + } + + [Fact] + public void SecurityAlerts_ListByResourceGroup() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var alerts = securityCenterClient.Alerts.ListByResourceGroup("RSG"); + ValidateAlerts(alerts); + } + } + + [Fact] + public void SecurityAlerts_ListResourceGroupLevelAlertsByRegion() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var alerts = securityCenterClient.Alerts.ListResourceGroupLevelAlertsByRegion("RSG"); + ValidateAlerts(alerts); + } + } + + [Fact] + public void SecurityAlerts_ListSubscriptionLevelAlertsByRegion() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var alerts = securityCenterClient.Alerts.ListSubscriptionLevelAlertsByRegion(); + ValidateAlerts(alerts); + } + } + + [Fact] + public void SecurityAlerts_UpdateResourceGroupLevelAlertState() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + securityCenterClient.Alerts.UpdateResourceGroupLevelAlertState("2518710774294070750_FFF23C70-80EF-4A8B-9122-507B0EA8DFFF", "Dismiss", "RSG"); + } + } + + [Fact] + public void SecurityAlerts_UpdateSubscriptionLevelAlertState() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + securityCenterClient.Alerts.UpdateSubscriptionLevelAlertState("2518710774894070750_EEE23C70-80EF-4A8B-9122-507B0EA8DFFF", "Dismiss"); + } + } + + #endregion + + #region Validations + + private void ValidateAlerts(IPage alertPage) + { + Assert.True(alertPage.IsAny()); + + alertPage.ForEach(ValidateAlert); + } + + private void ValidateAlert(Alert alert) + { + Assert.NotNull(alert); + } + + #endregion + } +} diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/AutoProvisionningSettings/AutoProvisioningSettingsTests.cs b/src/SDKs/SecurityCenter/SecurityCenter.Tests/AutoProvisionningSettings/AutoProvisioningSettingsTests.cs new file mode 100644 index 000000000000..778ff82a92d5 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/AutoProvisionningSettings/AutoProvisioningSettingsTests.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Net; +using Microsoft.Azure.Management.Security; +using Microsoft.Azure.Management.Security.Models; +using Microsoft.Azure.Test.HttpRecorder; +using Microsoft.Rest.Azure; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; +using SecurityCenter.Tests.Helpers; +using Xunit; + +namespace SecurityCenter.Tests +{ + public class AutoProvisioningSettingsTests : TestBase + { + #region Test setup + + public static TestEnvironment TestEnvironment { get; private set; } + + private static SecurityCenterClient GetSecurityCenterClient(MockContext context) + { + if (TestEnvironment == null && HttpMockServer.Mode == HttpRecorderMode.Record) + { + TestEnvironment = TestEnvironmentFactory.GetTestEnvironment(); + } + + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK, IsPassThrough = true }; + + var securityCenterClient = HttpMockServer.Mode == HttpRecorderMode.Record + ? context.GetServiceClient(TestEnvironment, handlers: handler) + : context.GetServiceClient(handlers: handler); + + securityCenterClient.AscLocation = "centralus"; + + return securityCenterClient; + } + + #endregion + + #region Auto Provisioning Settings Tests + + [Fact] + public void AutoProvisioningSettings_List() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var autoProvisioningSettings = securityCenterClient.AutoProvisioningSettings.List(); + ValidateAutoProvisioningSettings(autoProvisioningSettings); + } + } + + [Fact] + public void AutoProvisioningSettings_Get() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var autoProvisioningSetting = securityCenterClient.AutoProvisioningSettings.Get("default"); + ValidateAutoProvisioningSetting(autoProvisioningSetting); + } + } + + [Fact] + public void AutoProvisioningSettings_Create() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var autoProvisioningSetting = securityCenterClient.AutoProvisioningSettings.Create("default", "On"); + ValidateAutoProvisioningSetting(autoProvisioningSetting); + } + } + + #endregion + + #region Validations + + private void ValidateAutoProvisioningSettings(IPage autoProvisioningSettingsPage) + { + Assert.True(autoProvisioningSettingsPage.IsAny()); + + autoProvisioningSettingsPage.ForEach(ValidateAutoProvisioningSetting); + } + + private void ValidateAutoProvisioningSetting(AutoProvisioningSetting autoProvisioningSetting) + { + Assert.NotNull(autoProvisioningSetting); + } + + #endregion + } +} diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/Compliances/CompliancesTests.cs b/src/SDKs/SecurityCenter/SecurityCenter.Tests/Compliances/CompliancesTests.cs new file mode 100644 index 000000000000..98bc6b733596 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/Compliances/CompliancesTests.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Net; +using Microsoft.Azure.Management.Security; +using Microsoft.Azure.Management.Security.Models; +using Microsoft.Azure.Test.HttpRecorder; +using Microsoft.Rest.Azure; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; +using SecurityCenter.Tests.Helpers; +using Xunit; + +namespace SecurityCenter.Tests +{ + public class CompliancesTests : TestBase + { + #region Test setup + + private static string SubscriptionId = "487bb485-b5b0-471e-9c0d-10717612f869"; + + public static TestEnvironment TestEnvironment { get; private set; } + + private static SecurityCenterClient GetSecurityCenterClient(MockContext context) + { + if (TestEnvironment == null && HttpMockServer.Mode == HttpRecorderMode.Record) + { + TestEnvironment = TestEnvironmentFactory.GetTestEnvironment(); + } + + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK, IsPassThrough = true }; + + var securityCenterClient = HttpMockServer.Mode == HttpRecorderMode.Record + ? context.GetServiceClient(TestEnvironment, handlers: handler) + : context.GetServiceClient(handlers: handler); + + securityCenterClient.AscLocation = "centralus"; + + return securityCenterClient; + } + + #endregion + + #region Compliances Tests + + [Fact] + public void Compliances_List() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + + var compliances = securityCenterClient.Compliances.List($"/subscriptions/{SubscriptionId}"); + ValidateCompliances(compliances); + } + } + + [Fact] + public void Compliances_Get() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var compliance = securityCenterClient.Compliances.Get($"/subscriptions/{SubscriptionId}", "2018-07-05Z"); + ValidateCompliance(compliance); + } + } + + #endregion + + #region Validations + + private void ValidateCompliances(IPage CompliancesPage) + { + Assert.True(CompliancesPage.IsAny()); + + CompliancesPage.ForEach(ValidateCompliance); + } + + private void ValidateCompliance(Compliance compliance) + { + Assert.NotNull(compliance); + } + + #endregion + } +} diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/DiscoveredSecuritySolutions/DiscoveredSecuritySolutionsTests.cs b/src/SDKs/SecurityCenter/SecurityCenter.Tests/DiscoveredSecuritySolutions/DiscoveredSecuritySolutionsTests.cs new file mode 100644 index 000000000000..6c7e126b5301 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/DiscoveredSecuritySolutions/DiscoveredSecuritySolutionsTests.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Net; +using Microsoft.Azure.Management.Security; +using Microsoft.Azure.Management.Security.Models; +using Microsoft.Azure.Test.HttpRecorder; +using Microsoft.Rest.Azure; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; +using SecurityCenter.Tests.Helpers; +using Xunit; + +namespace SecurityCenter.Tests +{ + public class DiscoveredSecuritySolutionsTests : TestBase + { + #region Test setup + + public static TestEnvironment TestEnvironment { get; private set; } + + private static SecurityCenterClient GetSecurityCenterClient(MockContext context) + { + if (TestEnvironment == null && HttpMockServer.Mode == HttpRecorderMode.Record) + { + TestEnvironment = TestEnvironmentFactory.GetTestEnvironment(); + } + + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK, IsPassThrough = true }; + + var securityCenterClient = HttpMockServer.Mode == HttpRecorderMode.Record + ? context.GetServiceClient(TestEnvironment, handlers: handler) + : context.GetServiceClient(handlers: handler); + + securityCenterClient.AscLocation = "centralus"; + + return securityCenterClient; + } + + #endregion + + #region DiscoveredSecuritySolutions + + [Fact] + public void DiscoveredSecuritySolutions_List() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var discoveredSecuritySolutions = securityCenterClient.DiscoveredSecuritySolutions.List(); + ValidateDiscoveredSecuritySolutions(discoveredSecuritySolutions); + } + } + + [Fact] + public void DiscoveredSecuritySolutions_Get() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var discoveredSecuritySolution = securityCenterClient.DiscoveredSecuritySolutions.Get("myService1", "ContosoWAF2"); + ValidateDiscoveredSecuritySolution(discoveredSecuritySolution); + } + } + + [Fact] + public void DiscoveredSecuritySolutions_ListByHomeRegion() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var discoveredSecuritySolutions = securityCenterClient.DiscoveredSecuritySolutions.ListByHomeRegion(); + ValidateDiscoveredSecuritySolutions(discoveredSecuritySolutions); + } + } + + #endregion + + #region Validations + + private void ValidateDiscoveredSecuritySolutions(IPage discoveredSecuritySolutionPage) + { + Assert.True(discoveredSecuritySolutionPage.IsAny()); + + discoveredSecuritySolutionPage.ForEach(ValidateDiscoveredSecuritySolution); + } + + private void ValidateDiscoveredSecuritySolution(DiscoveredSecuritySolution discoveredSecuritySolution) + { + Assert.NotNull(discoveredSecuritySolution); + } + + #endregion + } +} diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/ExternalSecuritySolutions/ExternalSecuritySolutionsTests.cs b/src/SDKs/SecurityCenter/SecurityCenter.Tests/ExternalSecuritySolutions/ExternalSecuritySolutionsTests.cs new file mode 100644 index 000000000000..4b594c6b70b0 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/ExternalSecuritySolutions/ExternalSecuritySolutionsTests.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Net; +using Microsoft.Azure.Management.Security; +using Microsoft.Azure.Management.Security.Models; +using Microsoft.Azure.Test.HttpRecorder; +using Microsoft.Rest.Azure; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; +using SecurityCenter.Tests.Helpers; +using Xunit; + +namespace SecurityCenter.Tests +{ + public class ExternalSecuritySolutionsTests : TestBase + { + #region Test setup + + public static TestEnvironment TestEnvironment { get; private set; } + + private static SecurityCenterClient GetSecurityCenterClient(MockContext context) + { + if (TestEnvironment == null && HttpMockServer.Mode == HttpRecorderMode.Record) + { + TestEnvironment = TestEnvironmentFactory.GetTestEnvironment(); + } + + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK, IsPassThrough = true }; + + var securityCenterClient = HttpMockServer.Mode == HttpRecorderMode.Record + ? context.GetServiceClient(TestEnvironment, handlers: handler) + : context.GetServiceClient(handlers: handler); + + securityCenterClient.AscLocation = "centralus"; + + return securityCenterClient; + } + + #endregion + + #region ExternalSecuritySolutions + + [Fact] + public void ExternalSecuritySolutions_List() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var externalSecuritySolutions = securityCenterClient.ExternalSecuritySolutions.List(); + ValidateExternalSecuritySolutions(externalSecuritySolutions); + } + } + + [Fact] + public void ExternalSecuritySolutions_Get() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var externalSecuritySolution = securityCenterClient.ExternalSecuritySolutions.Get("defaultresourcegroup-eus", "aad_defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus"); + ValidateExternalSecuritySolution(externalSecuritySolution); + } + } + + [Fact] + public void ExternalSecuritySolutions_ListByHomeRegion() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var externalSecuritySolutions = securityCenterClient.ExternalSecuritySolutions.ListByHomeRegion(); + ValidateExternalSecuritySolutions(externalSecuritySolutions); + } + } + + #endregion + + #region Validations + + private void ValidateExternalSecuritySolutions(IPage externalSecuritySolutionPage) + { + Assert.True(externalSecuritySolutionPage.IsAny()); + + externalSecuritySolutionPage.ForEach(ValidateExternalSecuritySolution); + } + + private void ValidateExternalSecuritySolution(ExternalSecuritySolution externalSecuritySolution) + { + Assert.NotNull(externalSecuritySolution); + } + + #endregion + } +} diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/Helpers/RecordedDelegatingHandler.cs b/src/SDKs/SecurityCenter/SecurityCenter.Tests/Helpers/RecordedDelegatingHandler.cs new file mode 100644 index 000000000000..a14d724028af --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/Helpers/RecordedDelegatingHandler.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Threading.Tasks; + +namespace SecurityCenter.Tests.Helpers +{ + public class RecordedDelegatingHandler : DelegatingHandler + { + private readonly HttpResponseMessage _response; + + public RecordedDelegatingHandler() + { + StatusCodeToReturn = HttpStatusCode.OK; + } + + public RecordedDelegatingHandler(HttpResponseMessage response) + { + StatusCodeToReturn = HttpStatusCode.OK; + + _response = response; + if (null == _response.Content) + { + _response.Content = new StringContent(string.Empty); + } + } + + public HttpStatusCode StatusCodeToReturn { get; set; } + + public string Request { get; private set; } + + public HttpRequestHeaders RequestHeaders { get; private set; } + + public HttpContentHeaders ContentHeaders { get; private set; } + + public HttpMethod Method { get; private set; } + + public Uri Uri { get; private set; } + + public bool IsPassThrough { get; set; } + + protected override async Task SendAsync(HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) + { + // Save request + Request = null == request.Content ? string.Empty : await request.Content.ReadAsStringAsync(); + RequestHeaders = request.Headers; + if (null != request.Content) + { + ContentHeaders = request.Content.Headers; + } + Method = request.Method; + Uri = request.RequestUri; + + if (IsPassThrough) + { + return await base.SendAsync(request, cancellationToken); + } + + return _response ?? new HttpResponseMessage(StatusCodeToReturn) { Content = new StringContent("") }; + } + } +} diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/JitNetworkAccessPolicies/JitNetworkAccessPoliciesTests.cs b/src/SDKs/SecurityCenter/SecurityCenter.Tests/JitNetworkAccessPolicies/JitNetworkAccessPoliciesTests.cs new file mode 100644 index 000000000000..0d68c2cb3e26 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/JitNetworkAccessPolicies/JitNetworkAccessPoliciesTests.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Net; +using Microsoft.Azure.Management.Security; +using Microsoft.Azure.Management.Security.Models; +using Microsoft.Azure.Test.HttpRecorder; +using Microsoft.Rest.Azure; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; +using SecurityCenter.Tests.Helpers; +using Xunit; + +namespace SecurityCenter.Tests +{ + public class JitNetworkAccessPoliciesTests : TestBase + { + #region Test setup + + public static TestEnvironment TestEnvironment { get; private set; } + + private static SecurityCenterClient GetSecurityCenterClient(MockContext context) + { + if (TestEnvironment == null && HttpMockServer.Mode == HttpRecorderMode.Record) + { + TestEnvironment = TestEnvironmentFactory.GetTestEnvironment(); + } + + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK, IsPassThrough = true }; + + var securityCenterClient = HttpMockServer.Mode == HttpRecorderMode.Record + ? context.GetServiceClient(TestEnvironment, handlers: handler) + : context.GetServiceClient(handlers: handler); + + securityCenterClient.AscLocation = "northeurope"; + + return securityCenterClient; + } + + #endregion + + #region JIT Network Access Policies Tests + + [Fact] + public void JitNetworkAccessPolicies_List() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var jitNetworkAccessPolicies = securityCenterClient.JitNetworkAccessPolicies.List(); + ValidateJitNetworkAccessPolicies(jitNetworkAccessPolicies); + } + } + + [Fact] + public void JitNetworkAccessPolicies_Delete() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + securityCenterClient.JitNetworkAccessPolicies.Delete("mainWS", "default"); + } + } + + [Fact] + public void JitNetworkAccessPolicies_Get() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var jitNetworkAccessPolicy = securityCenterClient.JitNetworkAccessPolicies.Get("myService1", "default"); + ValidateJitNetworkAccessPolicy(jitNetworkAccessPolicy); + } + } + + [Fact] + public void JitNetworkAccessPolicies_Initiate() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var vm = new JitNetworkAccessPolicyInitiateVirtualMachine() { + Id = "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService", + Ports = new List() + { + new JitNetworkAccessPolicyInitiatePort(3389, DateTime.UtcNow.AddHours(3)) + } + }; + var virtualMachines = new List() { vm }; + securityCenterClient.JitNetworkAccessPolicies.Initiate("myService1", "default", virtualMachines); + } + } + + [Fact] + public void JitNetworkAccessPolicies_ListByRegion() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var jitNetworkAccessPolicy = securityCenterClient.JitNetworkAccessPolicies.ListByRegion(); + } + } + + [Fact] + public void JitNetworkAccessPolicies_CreateOrUpdate() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var vm = new List() { new JitNetworkAccessPolicyVirtualMachine() { Id = "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/syslogmyservice1vm",Ports = new List() { new JitNetworkAccessPortRule(8080, "TCP", "PT5H", "192.168.0.5") } } }; + var policy = new JitNetworkAccessPolicy() + { + Kind = "Basic", + VirtualMachines = vm + }; + + var jitNetworkAccessPolicy = securityCenterClient.JitNetworkAccessPolicies.CreateOrUpdate("mainWS", "default", policy); + ValidateJitNetworkAccessPolicy(jitNetworkAccessPolicy); + } + } + + [Fact] + public void JitNetworkAccessPolicies_ListByResourceGroup() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var jitNetworkAccessPolicies = securityCenterClient.JitNetworkAccessPolicies.ListByResourceGroup("myService1"); + ValidateJitNetworkAccessPolicies(jitNetworkAccessPolicies); + } + } + + [Fact] + public void JitNetworkAccessPolicies_ListByResourceGroupAndRegion() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var jitNetworkAccessPolicies = securityCenterClient.JitNetworkAccessPolicies.ListByResourceGroupAndRegion("myService1"); + ValidateJitNetworkAccessPolicies(jitNetworkAccessPolicies); + } + } + + #endregion + + #region Validations + + private void ValidateJitNetworkAccessPolicies(IPage jitNetworkAccessPolicyPage) + { + Assert.True(jitNetworkAccessPolicyPage.IsAny()); + + jitNetworkAccessPolicyPage.ForEach(ValidateJitNetworkAccessPolicy); + } + + private void ValidateJitNetworkAccessPolicy(JitNetworkAccessPolicy jitNetworkAccessPolicy) + { + Assert.NotNull(jitNetworkAccessPolicy); + } + + #endregion + } +} diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/Locations/LocationsTests.cs b/src/SDKs/SecurityCenter/SecurityCenter.Tests/Locations/LocationsTests.cs new file mode 100644 index 000000000000..c3c57186a974 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/Locations/LocationsTests.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Net; +using Microsoft.Azure.Management.Security; +using Microsoft.Azure.Management.Security.Models; +using Microsoft.Azure.Test.HttpRecorder; +using Microsoft.Rest.Azure; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; +using SecurityCenter.Tests.Helpers; +using Xunit; + +namespace SecurityCenter.Tests +{ + public class LocationsTests : TestBase + { + #region Test setup + + public static TestEnvironment TestEnvironment { get; private set; } + + private static SecurityCenterClient GetSecurityCenterClient(MockContext context) + { + if (TestEnvironment == null && HttpMockServer.Mode == HttpRecorderMode.Record) + { + TestEnvironment = TestEnvironmentFactory.GetTestEnvironment(); + } + + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK, IsPassThrough = true }; + + var securityCenterClient = HttpMockServer.Mode == HttpRecorderMode.Record + ? context.GetServiceClient(TestEnvironment, handlers: handler) + : context.GetServiceClient(handlers: handler); + + securityCenterClient.AscLocation = "centralus"; + + return securityCenterClient; + } + + #endregion + + #region Locations Tests + + [Fact] + public void SecurityLocations_List() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var locations = securityCenterClient.Locations.List(); + ValidateLocations(locations); + } + } + + [Fact] + public void SecurityLocations_Get() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var location = securityCenterClient.Locations.Get(); + ValidateLocation(location); + } + } + + #endregion + + #region Validations + + private void ValidateLocations(IPage locationPage) + { + Assert.True(locationPage.IsAny()); + + int count = 0; + + locationPage.ForEach(location => + { + ValidateLocation(location); + count++; + }); + + Assert.Equal(1, count); + } + + private void ValidateLocation(AscLocation location) + { + Assert.NotNull(location); + } + + #endregion + } +} diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/Operations/OperationsTests.cs b/src/SDKs/SecurityCenter/SecurityCenter.Tests/Operations/OperationsTests.cs new file mode 100644 index 000000000000..d11c08abdb5f --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/Operations/OperationsTests.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Net; +using Microsoft.Azure.Management.Security; +using Microsoft.Azure.Management.Security.Models; +using Microsoft.Azure.Test.HttpRecorder; +using Microsoft.Rest.Azure; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; +using SecurityCenter.Tests.Helpers; +using Xunit; + +namespace SecurityCenter.Tests +{ + public class OperationsTests : TestBase + { + #region Test setup + + public static TestEnvironment TestEnvironment { get; private set; } + + private static SecurityCenterClient GetSecurityCenterClient(MockContext context) + { + if (TestEnvironment == null && HttpMockServer.Mode == HttpRecorderMode.Record) + { + TestEnvironment = TestEnvironmentFactory.GetTestEnvironment(); + } + + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK, IsPassThrough = true }; + + var securityCenterClient = HttpMockServer.Mode == HttpRecorderMode.Record + ? context.GetServiceClient(TestEnvironment, handlers: handler) + : context.GetServiceClient(handlers: handler); + + securityCenterClient.AscLocation = "centralus"; + + return securityCenterClient; + } + + #endregion + + #region Operations Tests + + [Fact] + public void SecurityOperations_List() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var operations = securityCenterClient.Operations.List(); + ValidateOperations(operations); + } + } + + #endregion + + #region Validations + + private void ValidateOperations(IPage operationPage) + { + Assert.True(operationPage.IsAny()); + + operationPage.ForEach(ValidateOperation); + } + + private void ValidateOperation(Operation operation) + { + Assert.NotNull(operation); + } + + #endregion + } +} diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/Pricings/PricingsTests.cs b/src/SDKs/SecurityCenter/SecurityCenter.Tests/Pricings/PricingsTests.cs new file mode 100644 index 000000000000..1e6dd4a4778e --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/Pricings/PricingsTests.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Net; +using Microsoft.Azure.Management.Security; +using Microsoft.Azure.Management.Security.Models; +using Microsoft.Azure.Test.HttpRecorder; +using Microsoft.Rest.Azure; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; +using SecurityCenter.Tests.Helpers; +using Xunit; + +namespace SecurityCenter.Tests +{ + public class PricingsTests : TestBase + { + #region Test setup + + public static TestEnvironment TestEnvironment { get; private set; } + + private static SecurityCenterClient GetSecurityCenterClient(MockContext context) + { + if (TestEnvironment == null && HttpMockServer.Mode == HttpRecorderMode.Record) + { + TestEnvironment = TestEnvironmentFactory.GetTestEnvironment(); + } + + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK, IsPassThrough = true }; + + var securityCenterClient = HttpMockServer.Mode == HttpRecorderMode.Record + ? context.GetServiceClient(TestEnvironment, handlers: handler) + : context.GetServiceClient(handlers: handler); + + securityCenterClient.AscLocation = "centralus"; + + return securityCenterClient; + } + + #endregion + + #region Pricings Tests + + [Fact] + public void Pricings_List() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var pricings = securityCenterClient.Pricings.List(); + ValidatePricings(pricings); + } + } + + [Fact] + public void Pricings_CreateOrUpdateResourceGroupPricing() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var pricing = securityCenterClient.Pricings.CreateOrUpdateResourceGroupPricing("myService1", "myService1", "Standard"); + ValidatePricing(pricing); + } + } + + [Fact] + public void Pricings_GetResourceGroupPricing() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var pricing = securityCenterClient.Pricings.GetResourceGroupPricing("myService1", "myService1"); + ValidatePricing(pricing); + } + } + + [Fact] + public void Pricings_GetSubscriptionPricing() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var pricing = securityCenterClient.Pricings.GetSubscriptionPricing("default"); + ValidatePricing(pricing); + } + } + + [Fact] + public void Pricings_ListByResourceGroup() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var pricing = securityCenterClient.Pricings.ListByResourceGroup("myService1"); + ValidatePricings(pricing); + } + } + + [Fact] + public void Pricings_UpdateSubscriptionPricing() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var pricing = securityCenterClient.Pricings.UpdateSubscriptionPricing("default", "Standard"); + ValidatePricing(pricing); + } + } + + #endregion + + #region Validations + + private void ValidatePricings(IPage pricingPage) + { + Assert.True(pricingPage.IsAny()); + + pricingPage.ForEach(ValidatePricing); + } + + private void ValidatePricing(Pricing pricing) + { + Assert.NotNull(pricing); + } + + #endregion + } +} diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SecurityCenter.Tests.csproj b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SecurityCenter.Tests.csproj new file mode 100644 index 000000000000..889e15fac3d5 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SecurityCenter.Tests.csproj @@ -0,0 +1,24 @@ + + + + SecurityCenter.Tests + SecurityCenter.Tests Class Library + SecurityCenter.Tests + 1.0.0 + + + + + + + + PreserveNewest + + + + + + + diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SecurityContacts/SecurityContactsTests.cs b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SecurityContacts/SecurityContactsTests.cs new file mode 100644 index 000000000000..c4e3000f5821 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SecurityContacts/SecurityContactsTests.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Net; +using Microsoft.Azure.Management.Security; +using Microsoft.Azure.Management.Security.Models; +using Microsoft.Azure.Test.HttpRecorder; +using Microsoft.Rest.Azure; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; +using SecurityCenter.Tests.Helpers; +using Xunit; + +namespace SecurityCenter.Tests +{ + public class SecurityContactsTests : TestBase + { + #region Test setup + + public static TestEnvironment TestEnvironment { get; private set; } + + private static SecurityCenterClient GetSecurityCenterClient(MockContext context) + { + if (TestEnvironment == null && HttpMockServer.Mode == HttpRecorderMode.Record) + { + TestEnvironment = TestEnvironmentFactory.GetTestEnvironment(); + } + + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK, IsPassThrough = true }; + + var securityCenterClient = HttpMockServer.Mode == HttpRecorderMode.Record + ? context.GetServiceClient(TestEnvironment, handlers: handler) + : context.GetServiceClient(handlers: handler); + + securityCenterClient.AscLocation = "centralus"; + + return securityCenterClient; + } + + #endregion + + #region Security Contacts Tests + + [Fact] + public void SecurityContacts_List() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var securityContacts = securityCenterClient.SecurityContacts.List(); + ValidateSecurityContacts(securityContacts); + } + } + + [Fact] + public void SecurityContacts_Get() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var securityContact = securityCenterClient.SecurityContacts.Get("default2"); + ValidateSecurityContact(securityContact); + } + } + + [Fact] + public void SecurityContacts_Create() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + + var contact = new SecurityContact("barbra@contoso.com", "", "Off", "Off"); + + var securityContact = securityCenterClient.SecurityContacts.Create("default2", contact); + ValidateSecurityContact(securityContact); + } + } + + [Fact] + public void SecurityContacts_Delete() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + securityCenterClient.SecurityContacts.Delete("default2"); + } + } + + [Fact] + public void SecurityContacts_Update() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + + var contact = new SecurityContact("barbra@contoso.com", "", "Off", "Off"); + + var securityContact = securityCenterClient.SecurityContacts.Update("default2", contact); + ValidateSecurityContact(securityContact); + } + } + + #endregion + + #region Validations + + private void ValidateSecurityContacts(IPage securityContactPage) + { + Assert.True(securityContactPage.IsAny()); + + securityContactPage.ForEach(ValidateSecurityContact); + } + + private void ValidateSecurityContact(SecurityContact securityContact) + { + Assert.NotNull(securityContact); + } + + #endregion + } +} diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.AutoProvisioningSettingsTests/AutoProvisioningSettings_Create.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.AutoProvisioningSettingsTests/AutoProvisioningSettings_Create.json new file mode 100644 index 000000000000..7ac83af65de1 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.AutoProvisioningSettingsTests/AutoProvisioningSettings_Create.json @@ -0,0 +1,78 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/autoProvisioningSettings/default?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvYXV0b1Byb3Zpc2lvbmluZ1NldHRpbmdzL2RlZmF1bHQ/YXBpLXZlcnNpb249MjAxNy0wOC0wMS1wcmV2aWV3", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"autoProvision\": \"On\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "55" + ], + "x-ms-client-request-id": [ + "0a50af25-ec2d-4357-8bd5-7b087de6c6e5" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/autoProvisioningSettings/default\",\r\n \"name\": \"default\",\r\n \"type\": \"Microsoft.Security/autoProvisioningSettings\",\r\n \"properties\": {\r\n \"autoProvision\": \"On\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 13:02:07 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "4478f907-a6d5-4c4d-8882-dcd5d5155a09" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "249" + ], + "x-ms-correlation-request-id": [ + "0d9a9eaf-c953-4bf0-87b2-23b5a15e658f" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T130208Z:0d9a9eaf-c953-4bf0-87b2-23b5a15e658f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.AutoProvisioningSettingsTests/AutoProvisioningSettings_Get.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.AutoProvisioningSettingsTests/AutoProvisioningSettings_Get.json new file mode 100644 index 000000000000..59cb6a4856c7 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.AutoProvisioningSettingsTests/AutoProvisioningSettings_Get.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/autoProvisioningSettings/default?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvYXV0b1Byb3Zpc2lvbmluZ1NldHRpbmdzL2RlZmF1bHQ/YXBpLXZlcnNpb249MjAxNy0wOC0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "b3716670-9442-4419-844f-db91071b08a3" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/autoProvisioningSettings/default\",\r\n \"name\": \"default\",\r\n \"type\": \"Microsoft.Security/autoProvisioningSettings\",\r\n \"properties\": {\r\n \"autoProvision\": \"On\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:38 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "42c28975-ec4a-4f4e-b72b-42a6ac5f214f" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-correlation-request-id": [ + "81d7a61c-8e56-4b76-a39a-96f42d5c5939" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125239Z:81d7a61c-8e56-4b76-a39a-96f42d5c5939" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.AutoProvisioningSettingsTests/AutoProvisioningSettings_List.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.AutoProvisioningSettingsTests/AutoProvisioningSettings_List.json new file mode 100644 index 000000000000..0c330c9eb7a5 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.AutoProvisioningSettingsTests/AutoProvisioningSettings_List.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/autoProvisioningSettings?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvYXV0b1Byb3Zpc2lvbmluZ1NldHRpbmdzP2FwaS12ZXJzaW9uPTIwMTctMDgtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "04eb5a8d-0fb4-447b-ac64-959b8cb2e0db" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/autoProvisioningSettings/default\",\r\n \"name\": \"default\",\r\n \"type\": \"Microsoft.Security/autoProvisioningSettings\",\r\n \"properties\": {\r\n \"autoProvision\": \"On\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:37 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "9c76d21d-17f0-48d4-b6ea-88b840b24eb9" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-correlation-request-id": [ + "d28e9575-8893-403d-9295-54c457b9e503" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125237Z:d28e9575-8893-403d-9295-54c457b9e503" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.CompliancesTests/Compliances_Get.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.CompliancesTests/Compliances_Get.json new file mode 100644 index 000000000000..be90e9dc06ff --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.CompliancesTests/Compliances_Get.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/%2Fsubscriptions%2F487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/compliances/2018-07-05Z?api-version=2017-08-01-preview", + "EncodedRequestUri": "LyUyRnN1YnNjcmlwdGlvbnMlMkY0ODdiYjQ4NS1iNWIwLTQ3MWUtOWMwZC0xMDcxNzYxMmY4NjkvcHJvdmlkZXJzL01pY3Jvc29mdC5TZWN1cml0eS9jb21wbGlhbmNlcy8yMDE4LTA3LTA1Wj9hcGktdmVyc2lvbj0yMDE3LTA4LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "c84d3966-c57a-4716-855c-dde4bfeaaebc" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/compliances/2018-07-05Z\",\r\n \"name\": \"2018-07-05Z\",\r\n \"type\": \"Microsoft.Security/compliances\",\r\n \"properties\": {\r\n \"scope\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"assessmentResult\": [\r\n {\r\n \"type\": \"Compliant\",\r\n \"percentage\": 0.33333333333333331\r\n }\r\n ],\r\n \"resourceCount\": 6,\r\n \"assessmentTimestampUtcDate\": \"2018-07-05T00:00:00Z\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:42 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "9495a773-9366-4806-add5-92c05ac99eaf" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-correlation-request-id": [ + "4c71a832-61bc-41e3-8de9-a41f452e0ce8" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125242Z:4c71a832-61bc-41e3-8de9-a41f452e0ce8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.CompliancesTests/Compliances_List.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.CompliancesTests/Compliances_List.json new file mode 100644 index 000000000000..b3ee4dd5b64e --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.CompliancesTests/Compliances_List.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/%2Fsubscriptions%2F487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/compliances?api-version=2017-08-01-preview", + "EncodedRequestUri": "LyUyRnN1YnNjcmlwdGlvbnMlMkY0ODdiYjQ4NS1iNWIwLTQ3MWUtOWMwZC0xMDcxNzYxMmY4NjkvcHJvdmlkZXJzL01pY3Jvc29mdC5TZWN1cml0eS9jb21wbGlhbmNlcz9hcGktdmVyc2lvbj0yMDE3LTA4LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "5acbe1b3-f61d-4258-8c9a-7d864e807e37" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/compliances/2018-07-22Z\",\r\n \"name\": \"2018-07-22Z\",\r\n \"type\": \"Microsoft.Security/compliances\",\r\n \"properties\": {\r\n \"scope\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"assessmentResult\": [\r\n {\r\n \"type\": \"Compliant\",\r\n \"percentage\": 0.27777777777777779\r\n }\r\n ],\r\n \"resourceCount\": 18,\r\n \"assessmentTimestampUtcDate\": \"2018-07-22T00:00:00Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/compliances/2018-07-21Z\",\r\n \"name\": \"2018-07-21Z\",\r\n \"type\": \"Microsoft.Security/compliances\",\r\n \"properties\": {\r\n \"scope\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"assessmentResult\": [\r\n {\r\n \"type\": \"Compliant\",\r\n \"percentage\": 0.27777777777777779\r\n }\r\n ],\r\n \"resourceCount\": 18,\r\n \"assessmentTimestampUtcDate\": \"2018-07-21T00:00:00Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/compliances/2018-07-20Z\",\r\n \"name\": \"2018-07-20Z\",\r\n \"type\": \"Microsoft.Security/compliances\",\r\n \"properties\": {\r\n \"scope\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"assessmentResult\": [\r\n {\r\n \"type\": \"Compliant\",\r\n \"percentage\": 0.27777777777777779\r\n }\r\n ],\r\n \"resourceCount\": 18,\r\n \"assessmentTimestampUtcDate\": \"2018-07-20T00:00:00Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/compliances/2018-07-19Z\",\r\n \"name\": \"2018-07-19Z\",\r\n \"type\": \"Microsoft.Security/compliances\",\r\n \"properties\": {\r\n \"scope\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"assessmentResult\": [\r\n {\r\n \"type\": \"Compliant\",\r\n \"percentage\": 0.27777777777777779\r\n }\r\n ],\r\n \"resourceCount\": 18,\r\n \"assessmentTimestampUtcDate\": \"2018-07-19T00:00:00Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/compliances/2018-07-18Z\",\r\n \"name\": \"2018-07-18Z\",\r\n \"type\": \"Microsoft.Security/compliances\",\r\n \"properties\": {\r\n \"scope\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"assessmentResult\": [\r\n {\r\n \"type\": \"Compliant\",\r\n \"percentage\": 0.27777777777777779\r\n }\r\n ],\r\n \"resourceCount\": 18,\r\n \"assessmentTimestampUtcDate\": \"2018-07-18T00:00:00Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/compliances/2018-07-17Z\",\r\n \"name\": \"2018-07-17Z\",\r\n \"type\": \"Microsoft.Security/compliances\",\r\n \"properties\": {\r\n \"scope\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"assessmentResult\": [\r\n {\r\n \"type\": \"Compliant\",\r\n \"percentage\": 0.27777777777777779\r\n }\r\n ],\r\n \"resourceCount\": 18,\r\n \"assessmentTimestampUtcDate\": \"2018-07-17T00:00:00Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/compliances/2018-07-16Z\",\r\n \"name\": \"2018-07-16Z\",\r\n \"type\": \"Microsoft.Security/compliances\",\r\n \"properties\": {\r\n \"scope\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"assessmentResult\": [\r\n {\r\n \"type\": \"Compliant\",\r\n \"percentage\": 0.27777777777777779\r\n }\r\n ],\r\n \"resourceCount\": 18,\r\n \"assessmentTimestampUtcDate\": \"2018-07-16T00:00:00Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/compliances/2018-07-15Z\",\r\n \"name\": \"2018-07-15Z\",\r\n \"type\": \"Microsoft.Security/compliances\",\r\n \"properties\": {\r\n \"scope\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"assessmentResult\": [\r\n {\r\n \"type\": \"Compliant\",\r\n \"percentage\": 0.27777777777777779\r\n }\r\n ],\r\n \"resourceCount\": 18,\r\n \"assessmentTimestampUtcDate\": \"2018-07-15T00:00:00Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/compliances/2018-07-14Z\",\r\n \"name\": \"2018-07-14Z\",\r\n \"type\": \"Microsoft.Security/compliances\",\r\n \"properties\": {\r\n \"scope\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"assessmentResult\": [\r\n {\r\n \"type\": \"Compliant\",\r\n \"percentage\": 0.27777777777777779\r\n }\r\n ],\r\n \"resourceCount\": 18,\r\n \"assessmentTimestampUtcDate\": \"2018-07-14T00:00:00Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/compliances/2018-07-13Z\",\r\n \"name\": \"2018-07-13Z\",\r\n \"type\": \"Microsoft.Security/compliances\",\r\n \"properties\": {\r\n \"scope\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"assessmentResult\": [\r\n {\r\n \"type\": \"Compliant\",\r\n \"percentage\": 0.27777777777777779\r\n }\r\n ],\r\n \"resourceCount\": 18,\r\n \"assessmentTimestampUtcDate\": \"2018-07-13T00:00:00Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/compliances/2018-07-12Z\",\r\n \"name\": \"2018-07-12Z\",\r\n \"type\": \"Microsoft.Security/compliances\",\r\n \"properties\": {\r\n \"scope\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"assessmentResult\": [\r\n {\r\n \"type\": \"Compliant\",\r\n \"percentage\": 0.27777777777777779\r\n }\r\n ],\r\n \"resourceCount\": 18,\r\n \"assessmentTimestampUtcDate\": \"2018-07-12T00:00:00Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/compliances/2018-07-11Z\",\r\n \"name\": \"2018-07-11Z\",\r\n \"type\": \"Microsoft.Security/compliances\",\r\n \"properties\": {\r\n \"scope\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"assessmentResult\": [\r\n {\r\n \"type\": \"Compliant\",\r\n \"percentage\": 0.27777777777777779\r\n }\r\n ],\r\n \"resourceCount\": 18,\r\n \"assessmentTimestampUtcDate\": \"2018-07-11T00:00:00Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/compliances/2018-07-10Z\",\r\n \"name\": \"2018-07-10Z\",\r\n \"type\": \"Microsoft.Security/compliances\",\r\n \"properties\": {\r\n \"scope\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"assessmentResult\": [\r\n {\r\n \"type\": \"Compliant\",\r\n \"percentage\": 0.42857142857142855\r\n }\r\n ],\r\n \"resourceCount\": 7,\r\n \"assessmentTimestampUtcDate\": \"2018-07-10T00:00:00Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/compliances/2018-07-09Z\",\r\n \"name\": \"2018-07-09Z\",\r\n \"type\": \"Microsoft.Security/compliances\",\r\n \"properties\": {\r\n \"scope\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"assessmentResult\": [\r\n {\r\n \"type\": \"Compliant\",\r\n \"percentage\": 0.42857142857142855\r\n }\r\n ],\r\n \"resourceCount\": 7,\r\n \"assessmentTimestampUtcDate\": \"2018-07-09T00:00:00Z\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:41 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "24da4a1d-1f71-4b0f-a1f8-49707f721e7f" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-correlation-request-id": [ + "12cec76e-ca43-4146-b12f-391bb8380c22" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125241Z:12cec76e-ca43-4146-b12f-391bb8380c22" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.DiscoveredSecuritySolutionsTests/DiscoveredSecuritySolutions_Get.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.DiscoveredSecuritySolutionsTests/DiscoveredSecuritySolutions_Get.json new file mode 100644 index 000000000000..bee98b5a6651 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.DiscoveredSecuritySolutionsTests/DiscoveredSecuritySolutions_Get.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/discoveredSecuritySolutions/ContosoWAF2?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Jlc291cmNlR3JvdXBzL215U2VydmljZTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TZWN1cml0eS9sb2NhdGlvbnMvY2VudHJhbHVzL2Rpc2NvdmVyZWRTZWN1cml0eVNvbHV0aW9ucy9Db250b3NvV0FGMj9hcGktdmVyc2lvbj0yMDE1LTA2LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "7a0acc78-5fca-450e-bfbc-162400e6ae90" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"securityFamily\": \"SaasWaf\",\r\n \"offer\": \"\",\r\n \"publisher\": \"microsoft\",\r\n \"sku\": \"\"\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/discoveredSecuritySolutions/ContosoWAF2\",\r\n \"name\": \"ContosoWAF2\",\r\n \"type\": \"Microsoft.Security/locations/discoveredSecuritySolutions\",\r\n \"location\": \"northeurope\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:34 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "407f7086-e502-425c-8787-73ba213d023f" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-correlation-request-id": [ + "a47248c3-3336-4578-b2e0-22ca42f7d2f4" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125234Z:a47248c3-3336-4578-b2e0-22ca42f7d2f4" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.DiscoveredSecuritySolutionsTests/DiscoveredSecuritySolutions_List.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.DiscoveredSecuritySolutionsTests/DiscoveredSecuritySolutions_List.json new file mode 100644 index 000000000000..d9a5fb32a832 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.DiscoveredSecuritySolutionsTests/DiscoveredSecuritySolutions_List.json @@ -0,0 +1,71 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/discoveredSecuritySolutions?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvZGlzY292ZXJlZFNlY3VyaXR5U29sdXRpb25zP2FwaS12ZXJzaW9uPTIwMTUtMDYtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "50c04243-ad01-4a25-b118-539289429d74" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"securityFamily\": \"SaasWaf\",\r\n \"offer\": \"\",\r\n \"publisher\": \"microsoft\",\r\n \"sku\": \"\"\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/discoveredSecuritySolutions/ContosoWAF2\",\r\n \"name\": \"ContosoWAF2\",\r\n \"type\": \"Microsoft.Security/locations/discoveredSecuritySolutions\",\r\n \"location\": \"northeurope\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:32 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-original-request-ids": [ + "b638c035-1118-470f-99de-7b085205c170", + "", + "" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-request-id": [ + "e5480c2c-ff64-44eb-8f7c-4d2fd81e73f5" + ], + "x-ms-correlation-request-id": [ + "e5480c2c-ff64-44eb-8f7c-4d2fd81e73f5" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125233Z:e5480c2c-ff64-44eb-8f7c-4d2fd81e73f5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.DiscoveredSecuritySolutionsTests/DiscoveredSecuritySolutions_ListByHomeRegion.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.DiscoveredSecuritySolutionsTests/DiscoveredSecuritySolutions_ListByHomeRegion.json new file mode 100644 index 000000000000..9c72cf7282c1 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.DiscoveredSecuritySolutionsTests/DiscoveredSecuritySolutions_ListByHomeRegion.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/discoveredSecuritySolutions?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvbG9jYXRpb25zL2NlbnRyYWx1cy9kaXNjb3ZlcmVkU2VjdXJpdHlTb2x1dGlvbnM/YXBpLXZlcnNpb249MjAxNS0wNi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "d3bc6bea-1992-4689-8c23-6709c8463509" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"securityFamily\": \"SaasWaf\",\r\n \"offer\": \"\",\r\n \"publisher\": \"microsoft\",\r\n \"sku\": \"\"\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/discoveredSecuritySolutions/ContosoWAF2\",\r\n \"name\": \"ContosoWAF2\",\r\n \"type\": \"Microsoft.Security/locations/discoveredSecuritySolutions\",\r\n \"location\": \"northeurope\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:31 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "64070609-a951-47bb-8f3d-626b2c3764e4" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-correlation-request-id": [ + "5a6e998a-ae6c-4926-9a72-24d410949de5" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125232Z:5a6e998a-ae6c-4926-9a72-24d410949de5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.ExternalSecuritySolutionsTests/ExternalSecuritySolutions_Get.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.ExternalSecuritySolutionsTests/ExternalSecuritySolutions_Get.json new file mode 100644 index 000000000000..8d9ee1ab88ce --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.ExternalSecuritySolutionsTests/ExternalSecuritySolutions_Get.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/defaultresourcegroup-eus/providers/Microsoft.Security/locations/centralus/ExternalSecuritySolutions/aad_defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Jlc291cmNlR3JvdXBzL2RlZmF1bHRyZXNvdXJjZWdyb3VwLWV1cy9wcm92aWRlcnMvTWljcm9zb2Z0LlNlY3VyaXR5L2xvY2F0aW9ucy9jZW50cmFsdXMvRXh0ZXJuYWxTZWN1cml0eVNvbHV0aW9ucy9hYWRfZGVmYXVsdHdvcmtzcGFjZS00ODdiYjQ4NS1iNWIwLTQ3MWUtOWMwZC0xMDcxNzYxMmY4NjktZXVzP2FwaS12ZXJzaW9uPTIwMTUtMDYtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "b18778be-95aa-4d96-84c6-42250aad241f" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"AAD\",\r\n \"properties\": {\r\n \"connectivityState\": \"Discovered\",\r\n \"deviceVendor\": \"microsoft\",\r\n \"deviceType\": \"Azure Active Directory Identity Protection\",\r\n \"workspace\": {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\"\r\n }\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/defaultresourcegroup-eus/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"name\": \"aad_defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"type\": \"Microsoft.Security/locations/externalSecuritySolutions\",\r\n \"location\": \"eastus\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:05 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "574d0575-81c5-4cf2-bb73-25317e6d1c3c" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-correlation-request-id": [ + "a50baaad-be48-4502-9690-e4a63dbe245e" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125206Z:a50baaad-be48-4502-9690-e4a63dbe245e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.ExternalSecuritySolutionsTests/ExternalSecuritySolutions_List.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.ExternalSecuritySolutionsTests/ExternalSecuritySolutions_List.json new file mode 100644 index 000000000000..5e2cd3b2d871 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.ExternalSecuritySolutionsTests/ExternalSecuritySolutions_List.json @@ -0,0 +1,71 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/externalSecuritySolutions?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvZXh0ZXJuYWxTZWN1cml0eVNvbHV0aW9ucz9hcGktdmVyc2lvbj0yMDE1LTA2LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "e9a593e4-c14f-4d3a-9987-1e149e6ad887" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"kind\": \"AAD\",\r\n \"properties\": {\r\n \"connectivityState\": \"Discovered\",\r\n \"deviceVendor\": \"microsoft\",\r\n \"deviceType\": \"Azure Active Directory Identity Protection\",\r\n \"workspace\": {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\"\r\n }\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/defaultresourcegroup-eus/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"name\": \"aad_defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"type\": \"Microsoft.Security/locations/externalSecuritySolutions\",\r\n \"location\": \"eastus\"\r\n },\r\n {\r\n \"kind\": \"AAD\",\r\n \"properties\": {\r\n \"connectivityState\": \"Discovered\",\r\n \"deviceVendor\": \"microsoft\",\r\n \"deviceType\": \"Azure Active Directory Identity Protection\",\r\n \"workspace\": {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\"\r\n }\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/defaultresourcegroup-weu/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"name\": \"aad_defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"type\": \"Microsoft.Security/locations/externalSecuritySolutions\",\r\n \"location\": \"westeurope\"\r\n },\r\n {\r\n \"kind\": \"AAD\",\r\n \"properties\": {\r\n \"connectivityState\": \"Discovered\",\r\n \"deviceVendor\": \"microsoft\",\r\n \"deviceType\": \"Azure Active Directory Identity Protection\",\r\n \"workspace\": {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/mainws/providers/microsoft.operationalinsights/workspaces/securityuserws\"\r\n }\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/mainws/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_securityuserws\",\r\n \"name\": \"aad_securityuserws\",\r\n \"type\": \"Microsoft.Security/locations/externalSecuritySolutions\",\r\n \"location\": \"westeurope\"\r\n },\r\n {\r\n \"kind\": \"CEF\",\r\n \"properties\": {\r\n \"lastEventReceived\": \"2018-07-10T12:28:59.607Z\",\r\n \"hostname\": \"syslogmyservice1vm\",\r\n \"deviceVendor\": \"virtualHoneypot\",\r\n \"deviceType\": \"Microsoft\",\r\n \"workspace\": {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/myservice1/providers/microsoft.operationalinsights/workspaces/testservicews\"\r\n }\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myservice1/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/cef_testservicews_virtualhoneypot_microsoft_syslogmyservice1vm\",\r\n \"name\": \"cef_testservicews_virtualhoneypot_microsoft_syslogmyservice1vm\",\r\n \"type\": \"Microsoft.Security/locations/externalSecuritySolutions\",\r\n \"location\": \"westeurope\"\r\n },\r\n {\r\n \"kind\": \"CEF\",\r\n \"properties\": {\r\n \"lastEventReceived\": \"2018-07-10T11:51:45.543Z\",\r\n \"hostname\": \"syslogmyservice1vm\",\r\n \"deviceVendor\": \"f5networks\",\r\n \"deviceType\": \"ASM\",\r\n \"workspace\": {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/myservice1/providers/microsoft.operationalinsights/workspaces/testservicews\"\r\n }\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myservice1/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/cef_testservicews_f5networks_asm_syslogmyservice1vm\",\r\n \"name\": \"cef_testservicews_f5networks_asm_syslogmyservice1vm\",\r\n \"type\": \"Microsoft.Security/locations/externalSecuritySolutions\",\r\n \"location\": \"westeurope\"\r\n },\r\n {\r\n \"kind\": \"CEF\",\r\n \"properties\": {\r\n \"lastEventReceived\": \"2018-07-10T11:52:28.293Z\",\r\n \"hostname\": \"syslogmyservice1vm\",\r\n \"deviceVendor\": \"paloaltonetworks\",\r\n \"deviceType\": \"PAN-OS\",\r\n \"workspace\": {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/myservice1/providers/microsoft.operationalinsights/workspaces/testservicews\"\r\n }\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myservice1/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/cef_testservicews_paloaltonetworks_pan-os_syslogmyservice1vm\",\r\n \"name\": \"cef_testservicews_paloaltonetworks_pan-os_syslogmyservice1vm\",\r\n \"type\": \"Microsoft.Security/locations/externalSecuritySolutions\",\r\n \"location\": \"westeurope\"\r\n },\r\n {\r\n \"kind\": \"AAD\",\r\n \"properties\": {\r\n \"connectivityState\": \"Discovered\",\r\n \"deviceVendor\": \"microsoft\",\r\n \"deviceType\": \"Azure Active Directory Identity Protection\",\r\n \"workspace\": {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/myservice1/providers/microsoft.operationalinsights/workspaces/testservicews\"\r\n }\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myservice1/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_testservicews\",\r\n \"name\": \"aad_testservicews\",\r\n \"type\": \"Microsoft.Security/locations/externalSecuritySolutions\",\r\n \"location\": \"westeurope\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:55:39 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-original-request-ids": [ + "2639a8f9-b5e0-4f9c-95d2-a8b70bda2d7c", + "", + "" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-request-id": [ + "61593909-1bd7-4eaa-916d-16591f578fa8" + ], + "x-ms-correlation-request-id": [ + "61593909-1bd7-4eaa-916d-16591f578fa8" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125540Z:61593909-1bd7-4eaa-916d-16591f578fa8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.ExternalSecuritySolutionsTests/ExternalSecuritySolutions_ListByHomeRegion.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.ExternalSecuritySolutionsTests/ExternalSecuritySolutions_ListByHomeRegion.json new file mode 100644 index 000000000000..de80c41d43bc --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.ExternalSecuritySolutionsTests/ExternalSecuritySolutions_ListByHomeRegion.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/ExternalSecuritySolutions?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvbG9jYXRpb25zL2NlbnRyYWx1cy9FeHRlcm5hbFNlY3VyaXR5U29sdXRpb25zP2FwaS12ZXJzaW9uPTIwMTUtMDYtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "da5d3f6f-6e34-4c8a-8123-51d2d9e68814" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"kind\": \"AAD\",\r\n \"properties\": {\r\n \"connectivityState\": \"Discovered\",\r\n \"deviceVendor\": \"microsoft\",\r\n \"deviceType\": \"Azure Active Directory Identity Protection\",\r\n \"workspace\": {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\"\r\n }\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/defaultresourcegroup-eus/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"name\": \"aad_defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"type\": \"Microsoft.Security/locations/externalSecuritySolutions\",\r\n \"location\": \"eastus\"\r\n },\r\n {\r\n \"kind\": \"AAD\",\r\n \"properties\": {\r\n \"connectivityState\": \"Discovered\",\r\n \"deviceVendor\": \"microsoft\",\r\n \"deviceType\": \"Azure Active Directory Identity Protection\",\r\n \"workspace\": {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\"\r\n }\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/defaultresourcegroup-weu/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"name\": \"aad_defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"type\": \"Microsoft.Security/locations/externalSecuritySolutions\",\r\n \"location\": \"westeurope\"\r\n },\r\n {\r\n \"kind\": \"AAD\",\r\n \"properties\": {\r\n \"connectivityState\": \"Discovered\",\r\n \"deviceVendor\": \"microsoft\",\r\n \"deviceType\": \"Azure Active Directory Identity Protection\",\r\n \"workspace\": {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/mainws/providers/microsoft.operationalinsights/workspaces/securityuserws\"\r\n }\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/mainws/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_securityuserws\",\r\n \"name\": \"aad_securityuserws\",\r\n \"type\": \"Microsoft.Security/locations/externalSecuritySolutions\",\r\n \"location\": \"westeurope\"\r\n },\r\n {\r\n \"kind\": \"CEF\",\r\n \"properties\": {\r\n \"lastEventReceived\": \"2018-07-10T12:28:59.607Z\",\r\n \"hostname\": \"syslogmyservice1vm\",\r\n \"deviceVendor\": \"virtualHoneypot\",\r\n \"deviceType\": \"Microsoft\",\r\n \"workspace\": {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/myservice1/providers/microsoft.operationalinsights/workspaces/testservicews\"\r\n }\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myservice1/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/cef_testservicews_virtualhoneypot_microsoft_syslogmyservice1vm\",\r\n \"name\": \"cef_testservicews_virtualhoneypot_microsoft_syslogmyservice1vm\",\r\n \"type\": \"Microsoft.Security/locations/externalSecuritySolutions\",\r\n \"location\": \"westeurope\"\r\n },\r\n {\r\n \"kind\": \"CEF\",\r\n \"properties\": {\r\n \"lastEventReceived\": \"2018-07-10T11:51:45.543Z\",\r\n \"hostname\": \"syslogmyservice1vm\",\r\n \"deviceVendor\": \"f5networks\",\r\n \"deviceType\": \"ASM\",\r\n \"workspace\": {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/myservice1/providers/microsoft.operationalinsights/workspaces/testservicews\"\r\n }\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myservice1/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/cef_testservicews_f5networks_asm_syslogmyservice1vm\",\r\n \"name\": \"cef_testservicews_f5networks_asm_syslogmyservice1vm\",\r\n \"type\": \"Microsoft.Security/locations/externalSecuritySolutions\",\r\n \"location\": \"westeurope\"\r\n },\r\n {\r\n \"kind\": \"CEF\",\r\n \"properties\": {\r\n \"lastEventReceived\": \"2018-07-10T11:52:28.293Z\",\r\n \"hostname\": \"syslogmyservice1vm\",\r\n \"deviceVendor\": \"paloaltonetworks\",\r\n \"deviceType\": \"PAN-OS\",\r\n \"workspace\": {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/myservice1/providers/microsoft.operationalinsights/workspaces/testservicews\"\r\n }\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myservice1/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/cef_testservicews_paloaltonetworks_pan-os_syslogmyservice1vm\",\r\n \"name\": \"cef_testservicews_paloaltonetworks_pan-os_syslogmyservice1vm\",\r\n \"type\": \"Microsoft.Security/locations/externalSecuritySolutions\",\r\n \"location\": \"westeurope\"\r\n },\r\n {\r\n \"kind\": \"AAD\",\r\n \"properties\": {\r\n \"connectivityState\": \"Discovered\",\r\n \"deviceVendor\": \"microsoft\",\r\n \"deviceType\": \"Azure Active Directory Identity Protection\",\r\n \"workspace\": {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/myservice1/providers/microsoft.operationalinsights/workspaces/testservicews\"\r\n }\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myservice1/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_testservicews\",\r\n \"name\": \"aad_testservicews\",\r\n \"type\": \"Microsoft.Security/locations/externalSecuritySolutions\",\r\n \"location\": \"westeurope\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:55:40 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "fc745aaf-3fa3-43ee-bfa6-046482087441" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "748" + ], + "x-ms-correlation-request-id": [ + "2f68c45b-6fe6-45be-823f-781e06a18574" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125540Z:2f68c45b-6fe6-45be-823f-781e06a18574" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.JitNetworkAccessPoliciesTests/JitNetworkAccessPolicies_CreateOrUpdate.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.JitNetworkAccessPoliciesTests/JitNetworkAccessPolicies_CreateOrUpdate.json new file mode 100644 index 000000000000..34f8d89fe94f --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.JitNetworkAccessPoliciesTests/JitNetworkAccessPolicies_CreateOrUpdate.json @@ -0,0 +1,78 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/mainWS/providers/Microsoft.Security/locations/northeurope/jitNetworkAccessPolicies/default?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Jlc291cmNlR3JvdXBzL21haW5XUy9wcm92aWRlcnMvTWljcm9zb2Z0LlNlY3VyaXR5L2xvY2F0aW9ucy9ub3J0aGV1cm9wZS9qaXROZXR3b3JrQWNjZXNzUG9saWNpZXMvZGVmYXVsdD9hcGktdmVyc2lvbj0yMDE1LTA2LTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"kind\": \"Basic\",\r\n \"properties\": {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/syslogmyservice1vm\",\r\n \"ports\": [\r\n {\r\n \"number\": 8080,\r\n \"protocol\": \"TCP\",\r\n \"allowedSourceAddressPrefix\": \"192.168.0.5\",\r\n \"maxRequestAccessDuration\": \"PT5H\"\r\n }\r\n ]\r\n }\r\n ]\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "482" + ], + "x-ms-client-request-id": [ + "d7de1870-a18c-4c96-b960-270ae1ecb50c" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"Basic\",\r\n \"properties\": {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/syslogmyservice1vm\",\r\n \"ports\": [\r\n {\r\n \"number\": 8080,\r\n \"protocol\": \"TCP\",\r\n \"allowedSourceAddressPrefix\": \"192.168.0.5\",\r\n \"maxRequestAccessDuration\": \"PT5H\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"requests\": [],\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/mainWS/providers/Microsoft.Security/locations/northeurope/jitNetworkAccessPolicies/default\",\r\n \"name\": \"default\",\r\n \"type\": \"Microsoft.Security/locations/jitNetworkAccessPolicies\",\r\n \"location\": \"northeurope\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:51:53 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "1a08f532-837f-4753-98c8-0ab01fb5954d" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "9ae5985b-c949-4973-b962-cf02936544b0" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125153Z:9ae5985b-c949-4973-b962-cf02936544b0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.JitNetworkAccessPoliciesTests/JitNetworkAccessPolicies_Delete.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.JitNetworkAccessPoliciesTests/JitNetworkAccessPolicies_Delete.json new file mode 100644 index 000000000000..7ab2c4171af6 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.JitNetworkAccessPoliciesTests/JitNetworkAccessPolicies_Delete.json @@ -0,0 +1,66 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/mainWS/providers/Microsoft.Security/locations/northeurope/jitNetworkAccessPolicies/default?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Jlc291cmNlR3JvdXBzL21haW5XUy9wcm92aWRlcnMvTWljcm9zb2Z0LlNlY3VyaXR5L2xvY2F0aW9ucy9ub3J0aGV1cm9wZS9qaXROZXR3b3JrQWNjZXNzUG9saWNpZXMvZGVmYXVsdD9hcGktdmVyc2lvbj0yMDE1LTA2LTAxLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "73dfe6ef-67bc-4f6f-81a4-19a6b5fc3fee" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:51:58 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "21cf4645-e6a2-4108-b199-674fbcd0135e" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-correlation-request-id": [ + "2f46a1b1-f4a2-4055-a4da-c178663cc2db" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125158Z:2f46a1b1-f4a2-4055-a4da-c178663cc2db" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.JitNetworkAccessPoliciesTests/JitNetworkAccessPolicies_Get.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.JitNetworkAccessPoliciesTests/JitNetworkAccessPolicies_Get.json new file mode 100644 index 000000000000..a4d7b134a87d --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.JitNetworkAccessPoliciesTests/JitNetworkAccessPolicies_Get.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/northeurope/jitNetworkAccessPolicies/default?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Jlc291cmNlR3JvdXBzL215U2VydmljZTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TZWN1cml0eS9sb2NhdGlvbnMvbm9ydGhldXJvcGUvaml0TmV0d29ya0FjY2Vzc1BvbGljaWVzL2RlZmF1bHQ/YXBpLXZlcnNpb249MjAxNS0wNi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "5870a98d-fbfd-4c82-855c-e91720618eb0" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"kind\": \"Basic\",\r\n \"properties\": {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 22,\r\n \"protocol\": \"*\",\r\n \"allowedSourceAddressPrefix\": \"*\",\r\n \"maxRequestAccessDuration\": \"PT3H\"\r\n },\r\n {\r\n \"number\": 3389,\r\n \"protocol\": \"*\",\r\n \"allowedSourceAddressPrefix\": \"*\",\r\n \"maxRequestAccessDuration\": \"PT3H\"\r\n },\r\n {\r\n \"number\": 5985,\r\n \"protocol\": \"*\",\r\n \"allowedSourceAddressPrefix\": \"*\",\r\n \"maxRequestAccessDuration\": \"PT3H\"\r\n },\r\n {\r\n \"number\": 5986,\r\n \"protocol\": \"*\",\r\n \"allowedSourceAddressPrefix\": \"*\",\r\n \"maxRequestAccessDuration\": \"PT3H\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"requests\": [\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.64\",\r\n \"endTimeUtc\": \"2018-07-16T20:25:38.5048217Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-16T17:25:39.1160131Z\",\r\n \"requestor\": \"\"\r\n },\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.64\",\r\n \"endTimeUtc\": \"2018-07-16T13:49:21.1364532Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-16T10:49:21.9222696Z\",\r\n \"requestor\": \"\"\r\n },\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.64\",\r\n \"endTimeUtc\": \"2018-07-16T18:12:15.8866437Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-16T15:12:17.1929626Z\",\r\n \"requestor\": \"\"\r\n },\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.64\",\r\n \"endTimeUtc\": \"2018-07-22T15:51:55.21337Z\",\r\n \"status\": \"Initiated\",\r\n \"statusReason\": \"UserRequested\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-22T12:51:56.3821741Z\",\r\n \"requestor\": \"\"\r\n },\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.78\",\r\n \"endTimeUtc\": \"2018-07-05T13:19:07.6779647Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-05T12:19:07.6779647Z\",\r\n \"requestor\": \"ordanoch@microsoft.com\"\r\n },\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.64\",\r\n \"endTimeUtc\": \"2018-07-15T11:00:43.5009946Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-15T08:00:44.761037Z\",\r\n \"requestor\": \"\"\r\n }\r\n ],\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/northeurope/jitNetworkAccessPolicies/default\",\r\n \"name\": \"default\",\r\n \"type\": \"Microsoft.Security/locations/jitNetworkAccessPolicies\",\r\n \"location\": \"northeurope\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:51:58 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "e20ebcc7-8134-421c-9293-12e5dcc23652" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "748" + ], + "x-ms-correlation-request-id": [ + "9d9cfe8a-137c-46c6-a3aa-00916f65a548" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125159Z:9d9cfe8a-137c-46c6-a3aa-00916f65a548" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.JitNetworkAccessPoliciesTests/JitNetworkAccessPolicies_Initiate.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.JitNetworkAccessPoliciesTests/JitNetworkAccessPolicies_Initiate.json new file mode 100644 index 000000000000..aa4ff2d8986c --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.JitNetworkAccessPoliciesTests/JitNetworkAccessPolicies_Initiate.json @@ -0,0 +1,75 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/northeurope/jitNetworkAccessPolicies/default/initiate?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Jlc291cmNlR3JvdXBzL215U2VydmljZTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TZWN1cml0eS9sb2NhdGlvbnMvbm9ydGhldXJvcGUvaml0TmV0d29ya0FjY2Vzc1BvbGljaWVzL2RlZmF1bHQvaW5pdGlhdGU/YXBpLXZlcnNpb249MjAxNS0wNi0wMS1wcmV2aWV3", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"endTimeUtc\": \"2018-07-22T15:51:55.21337Z\"\r\n }\r\n ]\r\n }\r\n ]\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "327" + ], + "x-ms-client-request-id": [ + "05ae6019-d915-4557-b894-57ff9ed80d1d" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.64\",\r\n \"endTimeUtc\": \"2018-07-22T15:51:55.21337Z\",\r\n \"status\": \"Initiating\",\r\n \"statusReason\": \"UserRequested\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-22T12:51:56.3821741Z\",\r\n \"requestor\": \"\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "392" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:51:56 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "3346bc8b-4e29-4e6f-b274-7da35e79e4a5" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "654ed1ce-01ab-4264-aa82-68f28ea16f7c" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125156Z:654ed1ce-01ab-4264-aa82-68f28ea16f7c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 202 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.JitNetworkAccessPoliciesTests/JitNetworkAccessPolicies_List.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.JitNetworkAccessPoliciesTests/JitNetworkAccessPolicies_List.json new file mode 100644 index 000000000000..e0ae779978f7 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.JitNetworkAccessPoliciesTests/JitNetworkAccessPolicies_List.json @@ -0,0 +1,71 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/jitNetworkAccessPolicies?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvaml0TmV0d29ya0FjY2Vzc1BvbGljaWVzP2FwaS12ZXJzaW9uPTIwMTUtMDYtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "0e58a9ff-ee05-4982-96dd-2fe672e2f82e" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"kind\": \"Basic\",\r\n \"properties\": {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 22,\r\n \"protocol\": \"*\",\r\n \"allowedSourceAddressPrefix\": \"*\",\r\n \"maxRequestAccessDuration\": \"PT3H\"\r\n },\r\n {\r\n \"number\": 3389,\r\n \"protocol\": \"*\",\r\n \"allowedSourceAddressPrefix\": \"*\",\r\n \"maxRequestAccessDuration\": \"PT3H\"\r\n },\r\n {\r\n \"number\": 5985,\r\n \"protocol\": \"*\",\r\n \"allowedSourceAddressPrefix\": \"*\",\r\n \"maxRequestAccessDuration\": \"PT3H\"\r\n },\r\n {\r\n \"number\": 5986,\r\n \"protocol\": \"*\",\r\n \"allowedSourceAddressPrefix\": \"*\",\r\n \"maxRequestAccessDuration\": \"PT3H\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"requests\": [\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.64\",\r\n \"endTimeUtc\": \"2018-07-16T20:25:38.5048217Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-16T17:25:39.1160131Z\",\r\n \"requestor\": \"\"\r\n },\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.64\",\r\n \"endTimeUtc\": \"2018-07-16T13:49:21.1364532Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-16T10:49:21.9222696Z\",\r\n \"requestor\": \"\"\r\n },\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.64\",\r\n \"endTimeUtc\": \"2018-07-16T18:12:15.8866437Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-16T15:12:17.1929626Z\",\r\n \"requestor\": \"\"\r\n },\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.64\",\r\n \"endTimeUtc\": \"2018-07-22T15:51:55.21337Z\",\r\n \"status\": \"Initiated\",\r\n \"statusReason\": \"UserRequested\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-22T12:51:56.3821741Z\",\r\n \"requestor\": \"\"\r\n },\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.78\",\r\n \"endTimeUtc\": \"2018-07-05T13:19:07.6779647Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-05T12:19:07.6779647Z\",\r\n \"requestor\": \"ordanoch@microsoft.com\"\r\n },\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.64\",\r\n \"endTimeUtc\": \"2018-07-15T11:00:43.5009946Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-15T08:00:44.761037Z\",\r\n \"requestor\": \"\"\r\n }\r\n ],\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/northeurope/jitNetworkAccessPolicies/default\",\r\n \"name\": \"default\",\r\n \"type\": \"Microsoft.Security/locations/jitNetworkAccessPolicies\",\r\n \"location\": \"northeurope\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:00 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-original-request-ids": [ + "16ca17fa-cfb7-4bfa-813a-d75f3c7b1f45", + "cd8bbc10-17db-484f-80e1-c3e86e04b073", + "e584c0f2-bc63-461a-af6a-61b9654a800d" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-request-id": [ + "36cb693b-5ed5-4382-b6ae-7b516373d137" + ], + "x-ms-correlation-request-id": [ + "36cb693b-5ed5-4382-b6ae-7b516373d137" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125200Z:36cb693b-5ed5-4382-b6ae-7b516373d137" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.JitNetworkAccessPoliciesTests/JitNetworkAccessPolicies_ListByRegion.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.JitNetworkAccessPoliciesTests/JitNetworkAccessPolicies_ListByRegion.json new file mode 100644 index 000000000000..4a066a0e0b4e --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.JitNetworkAccessPoliciesTests/JitNetworkAccessPolicies_ListByRegion.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/northeurope/jitNetworkAccessPolicies?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvbG9jYXRpb25zL25vcnRoZXVyb3BlL2ppdE5ldHdvcmtBY2Nlc3NQb2xpY2llcz9hcGktdmVyc2lvbj0yMDE1LTA2LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "858c9ff9-01ce-42ff-afde-85650225ba4e" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"kind\": \"Basic\",\r\n \"properties\": {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/syslogmyservice1vm\",\r\n \"ports\": [\r\n {\r\n \"number\": 8080,\r\n \"protocol\": \"TCP\",\r\n \"allowedSourceAddressPrefix\": \"192.168.0.5\",\r\n \"maxRequestAccessDuration\": \"PT5H\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"requests\": [],\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/mainWS/providers/Microsoft.Security/locations/northeurope/jitNetworkAccessPolicies/default\",\r\n \"name\": \"default\",\r\n \"type\": \"Microsoft.Security/locations/jitNetworkAccessPolicies\",\r\n \"location\": \"northeurope\"\r\n },\r\n {\r\n \"kind\": \"Basic\",\r\n \"properties\": {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 22,\r\n \"protocol\": \"*\",\r\n \"allowedSourceAddressPrefix\": \"*\",\r\n \"maxRequestAccessDuration\": \"PT3H\"\r\n },\r\n {\r\n \"number\": 3389,\r\n \"protocol\": \"*\",\r\n \"allowedSourceAddressPrefix\": \"*\",\r\n \"maxRequestAccessDuration\": \"PT3H\"\r\n },\r\n {\r\n \"number\": 5985,\r\n \"protocol\": \"*\",\r\n \"allowedSourceAddressPrefix\": \"*\",\r\n \"maxRequestAccessDuration\": \"PT3H\"\r\n },\r\n {\r\n \"number\": 5986,\r\n \"protocol\": \"*\",\r\n \"allowedSourceAddressPrefix\": \"*\",\r\n \"maxRequestAccessDuration\": \"PT3H\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"requests\": [\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.64\",\r\n \"endTimeUtc\": \"2018-07-16T20:25:38.5048217Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-16T17:25:39.1160131Z\",\r\n \"requestor\": \"\"\r\n },\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.64\",\r\n \"endTimeUtc\": \"2018-07-16T13:49:21.1364532Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-16T10:49:21.9222696Z\",\r\n \"requestor\": \"\"\r\n },\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.64\",\r\n \"endTimeUtc\": \"2018-07-16T18:12:15.8866437Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-16T15:12:17.1929626Z\",\r\n \"requestor\": \"\"\r\n },\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.78\",\r\n \"endTimeUtc\": \"2018-07-05T13:19:07.6779647Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-05T12:19:07.6779647Z\",\r\n \"requestor\": \"ordanoch@microsoft.com\"\r\n },\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.64\",\r\n \"endTimeUtc\": \"2018-07-15T11:00:43.5009946Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-15T08:00:44.761037Z\",\r\n \"requestor\": \"\"\r\n }\r\n ],\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/northeurope/jitNetworkAccessPolicies/default\",\r\n \"name\": \"default\",\r\n \"type\": \"Microsoft.Security/locations/jitNetworkAccessPolicies\",\r\n \"location\": \"northeurope\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:51:54 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "e6d0a31f-2de3-4427-b311-d5297389a226" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-correlation-request-id": [ + "56103983-b830-4cca-8125-651bdab68dc6" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125155Z:56103983-b830-4cca-8125-651bdab68dc6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.JitNetworkAccessPoliciesTests/JitNetworkAccessPolicies_ListByResourceGroup.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.JitNetworkAccessPoliciesTests/JitNetworkAccessPolicies_ListByResourceGroup.json new file mode 100644 index 000000000000..0130b225e33f --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.JitNetworkAccessPoliciesTests/JitNetworkAccessPolicies_ListByResourceGroup.json @@ -0,0 +1,71 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/jitNetworkAccessPolicies?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Jlc291cmNlR3JvdXBzL215U2VydmljZTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TZWN1cml0eS9qaXROZXR3b3JrQWNjZXNzUG9saWNpZXM/YXBpLXZlcnNpb249MjAxNS0wNi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "b3d622a2-0359-4215-bd00-7a3033a47cea" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"kind\": \"Basic\",\r\n \"properties\": {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 22,\r\n \"protocol\": \"*\",\r\n \"allowedSourceAddressPrefix\": \"*\",\r\n \"maxRequestAccessDuration\": \"PT3H\"\r\n },\r\n {\r\n \"number\": 3389,\r\n \"protocol\": \"*\",\r\n \"allowedSourceAddressPrefix\": \"*\",\r\n \"maxRequestAccessDuration\": \"PT3H\"\r\n },\r\n {\r\n \"number\": 5985,\r\n \"protocol\": \"*\",\r\n \"allowedSourceAddressPrefix\": \"*\",\r\n \"maxRequestAccessDuration\": \"PT3H\"\r\n },\r\n {\r\n \"number\": 5986,\r\n \"protocol\": \"*\",\r\n \"allowedSourceAddressPrefix\": \"*\",\r\n \"maxRequestAccessDuration\": \"PT3H\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"requests\": [\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.64\",\r\n \"endTimeUtc\": \"2018-07-16T20:25:38.5048217Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-16T17:25:39.1160131Z\",\r\n \"requestor\": \"\"\r\n },\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.64\",\r\n \"endTimeUtc\": \"2018-07-16T13:49:21.1364532Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-16T10:49:21.9222696Z\",\r\n \"requestor\": \"\"\r\n },\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.64\",\r\n \"endTimeUtc\": \"2018-07-16T18:12:15.8866437Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-16T15:12:17.1929626Z\",\r\n \"requestor\": \"\"\r\n },\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.64\",\r\n \"endTimeUtc\": \"2018-07-22T15:51:55.21337Z\",\r\n \"status\": \"Initiated\",\r\n \"statusReason\": \"UserRequested\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-22T12:51:56.3821741Z\",\r\n \"requestor\": \"\"\r\n },\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.78\",\r\n \"endTimeUtc\": \"2018-07-05T13:19:07.6779647Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-05T12:19:07.6779647Z\",\r\n \"requestor\": \"ordanoch@microsoft.com\"\r\n },\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.64\",\r\n \"endTimeUtc\": \"2018-07-15T11:00:43.5009946Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-15T08:00:44.761037Z\",\r\n \"requestor\": \"\"\r\n }\r\n ],\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/northeurope/jitNetworkAccessPolicies/default\",\r\n \"name\": \"default\",\r\n \"type\": \"Microsoft.Security/locations/jitNetworkAccessPolicies\",\r\n \"location\": \"northeurope\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:00 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-original-request-ids": [ + "a8bcd082-3dcb-4e94-8d19-2ef67678e44d", + "5d20e6ea-560b-4215-bf3c-ef8826864988", + "97e39af3-7984-4127-891a-e986c2eb63fd" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "748" + ], + "x-ms-request-id": [ + "edbd176b-2957-4b0e-bd0d-7ccb119f268b" + ], + "x-ms-correlation-request-id": [ + "edbd176b-2957-4b0e-bd0d-7ccb119f268b" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125201Z:edbd176b-2957-4b0e-bd0d-7ccb119f268b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.JitNetworkAccessPoliciesTests/JitNetworkAccessPolicies_ListByResourceGroupAndRegion.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.JitNetworkAccessPoliciesTests/JitNetworkAccessPolicies_ListByResourceGroupAndRegion.json new file mode 100644 index 000000000000..8b9c07d8c600 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.JitNetworkAccessPoliciesTests/JitNetworkAccessPolicies_ListByResourceGroupAndRegion.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/northeurope/jitNetworkAccessPolicies?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Jlc291cmNlR3JvdXBzL215U2VydmljZTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TZWN1cml0eS9sb2NhdGlvbnMvbm9ydGhldXJvcGUvaml0TmV0d29ya0FjY2Vzc1BvbGljaWVzP2FwaS12ZXJzaW9uPTIwMTUtMDYtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "7001e8b3-4765-432f-9c6b-06e48aa739a1" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"kind\": \"Basic\",\r\n \"properties\": {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 22,\r\n \"protocol\": \"*\",\r\n \"allowedSourceAddressPrefix\": \"*\",\r\n \"maxRequestAccessDuration\": \"PT3H\"\r\n },\r\n {\r\n \"number\": 3389,\r\n \"protocol\": \"*\",\r\n \"allowedSourceAddressPrefix\": \"*\",\r\n \"maxRequestAccessDuration\": \"PT3H\"\r\n },\r\n {\r\n \"number\": 5985,\r\n \"protocol\": \"*\",\r\n \"allowedSourceAddressPrefix\": \"*\",\r\n \"maxRequestAccessDuration\": \"PT3H\"\r\n },\r\n {\r\n \"number\": 5986,\r\n \"protocol\": \"*\",\r\n \"allowedSourceAddressPrefix\": \"*\",\r\n \"maxRequestAccessDuration\": \"PT3H\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"requests\": [\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.64\",\r\n \"endTimeUtc\": \"2018-07-16T20:25:38.5048217Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-16T17:25:39.1160131Z\",\r\n \"requestor\": \"\"\r\n },\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.64\",\r\n \"endTimeUtc\": \"2018-07-16T13:49:21.1364532Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-16T10:49:21.9222696Z\",\r\n \"requestor\": \"\"\r\n },\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.64\",\r\n \"endTimeUtc\": \"2018-07-16T18:12:15.8866437Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-16T15:12:17.1929626Z\",\r\n \"requestor\": \"\"\r\n },\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.78\",\r\n \"endTimeUtc\": \"2018-07-05T13:19:07.6779647Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-05T12:19:07.6779647Z\",\r\n \"requestor\": \"ordanoch@microsoft.com\"\r\n },\r\n {\r\n \"virtualMachines\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"ports\": [\r\n {\r\n \"number\": 3389,\r\n \"allowedSourceAddressPrefix\": \"167.220.196.64\",\r\n \"endTimeUtc\": \"2018-07-15T11:00:43.5009946Z\",\r\n \"status\": \"Revoked\",\r\n \"statusReason\": \"Expired\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"startTimeUtc\": \"2018-07-15T08:00:44.761037Z\",\r\n \"requestor\": \"\"\r\n }\r\n ],\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/northeurope/jitNetworkAccessPolicies/default\",\r\n \"name\": \"default\",\r\n \"type\": \"Microsoft.Security/locations/jitNetworkAccessPolicies\",\r\n \"location\": \"northeurope\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:51:54 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "299dd91b-c85c-4d61-bd4a-92378a241efa" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-correlation-request-id": [ + "6337207c-f07f-43fb-b003-25b8aea1d2d4" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125154Z:6337207c-f07f-43fb-b003-25b8aea1d2d4" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.LocationsTests/SecurityLocations_Get.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.LocationsTests/SecurityLocations_Get.json new file mode 100644 index 000000000000..c60fd4dd6251 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.LocationsTests/SecurityLocations_Get.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvbG9jYXRpb25zL2NlbnRyYWx1cz9hcGktdmVyc2lvbj0yMDE1LTA2LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "181a1e7f-49ec-4748-8335-75207dddb65e" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus\",\r\n \"name\": \"centralus\",\r\n \"type\": \"Microsoft.Security/locations\",\r\n \"properties\": {\r\n \"homeRegionName\": \"centralus\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:13 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "3f45b197-2ac1-4000-a355-97e138e76ca5" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "99" + ], + "x-ms-correlation-request-id": [ + "48e6ae86-c291-45ee-870a-7ddbd417cb4b" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125214Z:48e6ae86-c291-45ee-870a-7ddbd417cb4b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.LocationsTests/SecurityLocations_List.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.LocationsTests/SecurityLocations_List.json new file mode 100644 index 000000000000..dd312dccbd84 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.LocationsTests/SecurityLocations_List.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvbG9jYXRpb25zP2FwaS12ZXJzaW9uPTIwMTUtMDYtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "7d929b4e-4efa-490d-8bcf-2f055e17c8e9" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus\",\r\n \"name\": \"centralus\",\r\n \"type\": \"Microsoft.Security/locations\",\r\n \"properties\": {\r\n \"homeRegionName\": \"centralus\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:14 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "42dcb881-1ca3-4d45-9f7a-19b841b37fbc" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "99" + ], + "x-ms-correlation-request-id": [ + "73449fae-a01e-4bf4-9f2d-17889b4cdfa6" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125214Z:73449fae-a01e-4bf4-9f2d-17889b4cdfa6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.OperationsTests/SecurityOperations_List.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.OperationsTests/SecurityOperations_List.json new file mode 100644 index 000000000000..23c96fbf4156 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.OperationsTests/SecurityOperations_List.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/providers/Microsoft.Security/operations?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvb3BlcmF0aW9ucz9hcGktdmVyc2lvbj0yMDE1LTA2LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "6c6b6d42-0a1a-420e-8d0f-8e98918b7202" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"name\": \"Microsoft.Security/register/action\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Subscription\",\r\n \"operation\": \"Register Subscription\",\r\n \"description\": \"Registers the subscription for Azure Security Center\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/tasks/read\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Security Recommendations\",\r\n \"operation\": \"Get security recommendations\",\r\n \"description\": \"Gets all available security recommendations\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/locations/tasks/read\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Security Recommendations\",\r\n \"operation\": \"Get security recommendations\",\r\n \"description\": \"Gets all available security recommendations\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/locations/tasks/start/action\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Security Recommendations\",\r\n \"operation\": \"Start Recommendation\",\r\n \"description\": \"Start a security recommendation\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/locations/tasks/resolve/action\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Security Recommendations\",\r\n \"operation\": \"Resolve Recommendation\",\r\n \"description\": \"Resolve a security recommendation\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/locations/tasks/activate/action\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Security Recommendations\",\r\n \"operation\": \"Activate Recommendation\",\r\n \"description\": \"Activate a security recommendation\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/locations/tasks/dismiss/action\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Security Recommendations\",\r\n \"operation\": \"Dismiss Recommendation\",\r\n \"description\": \"Dismiss a security recommendation\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/securityStatuses/read\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Resource Security Health\",\r\n \"operation\": \"Get resource security health\",\r\n \"description\": \"Gets the security health statuses for Azure resources\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/policies/read\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Security Policy\",\r\n \"operation\": \"Get security policy\",\r\n \"description\": \"Gets the security policy\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/policies/write\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Security Policy\",\r\n \"operation\": \"Update security policy\",\r\n \"description\": \"Updates the security policy\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/workspaceSettings/read\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Workspace Settings\",\r\n \"operation\": \"Get workspace settings\",\r\n \"description\": \"Gets the workspace settings\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/workspaceSettings/write\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Workspace Settings\",\r\n \"operation\": \"Update workspace settings\",\r\n \"description\": \"Updates the workspace settings\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/workspaceSettings/delete\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Workspace Settings\",\r\n \"operation\": \"Delete workspace settings\",\r\n \"description\": \"Deletes the workspace settings\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/workspaceSettings/connect/action\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Workspace Settings\",\r\n \"operation\": \"Reconnect vms from system workspaces\",\r\n \"description\": \"Change workspace settings reconnection settings\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/pricings/read\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Pricings\",\r\n \"operation\": \"Get pricing settings\",\r\n \"description\": \"Gets the pricing settings for the scope\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/pricings/write\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Pricings\",\r\n \"operation\": \"Update pricing settings\",\r\n \"description\": \"Updates the pricing settings for the scope\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/pricings/delete\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Pricings\",\r\n \"operation\": \"Delete pricing settings\",\r\n \"description\": \"Deletes the pricing settings for the scope\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/securityContacts/read\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Security Contact\",\r\n \"operation\": \"Get security contact\",\r\n \"description\": \"Gets the security contact\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/securityContacts/write\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Security Contact\",\r\n \"operation\": \"Update security contact\",\r\n \"description\": \"Updates the security contact\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/securityContacts/delete\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Security Contact\",\r\n \"operation\": \"Delete security contact\",\r\n \"description\": \"Deletes the security contact\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/complianceResults/read\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Compliance Results\",\r\n \"operation\": \"Get compliance results\",\r\n \"description\": \"Gets the compliance results for the resource\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/locations/read\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Locations\",\r\n \"operation\": \"Get locations\",\r\n \"description\": \"Gets the security data location\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/securityStatusesSummaries/read\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Security Statuses Summaries\",\r\n \"operation\": \"Get security statuses summaries\",\r\n \"description\": \"Gets the security statuses summaries for the scope\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/alerts/read\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Security Alerts\",\r\n \"operation\": \"Get security alerts\",\r\n \"description\": \"Gets all available security alerts\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/locations/alerts/read\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Security Alerts\",\r\n \"operation\": \"Get security alerts\",\r\n \"description\": \"Gets all available security alerts\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/locations/alerts/dismiss/action\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Security Alerts\",\r\n \"operation\": \"Dismiss Alert\",\r\n \"description\": \"Dismiss a security alert\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/locations/alerts/activate/action\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Security Alerts\",\r\n \"operation\": \"Activate Alert\",\r\n \"description\": \"Activate a security alert\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/locations/jitNetworkAccessPolicies/read\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Just-In-Time Network Access Policies\",\r\n \"operation\": \"Get JIT Network Access Policies\",\r\n \"description\": \"Gets the just-in-time network access policies\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/locations/jitNetworkAccessPolicies/write\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Just-In-Time Network Access Policies\",\r\n \"operation\": \"Create or Update JIT Network Access Policy\",\r\n \"description\": \"Creates a new just-in-time network access policy or updates an existing one\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/locations/jitNetworkAccessPolicies/delete\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Just-In-Time Network Access Policies\",\r\n \"operation\": \"Delete JIT Network Access Policies\",\r\n \"description\": \"Deletes the just-in-time network access policy\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/locations/jitNetworkAccessPolicies/initiate/action\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Just-In-Time Network Access Policies\",\r\n \"operation\": \"Initiate JIT Network Access Policy\",\r\n \"description\": \"Initiates a just-in-time network access policy request\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/applicationWhitelistings/read\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"App Whitelistings\",\r\n \"operation\": \"Get App Whitelisting\",\r\n \"description\": \"Gets the application whitelistings\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/applicationWhitelistings/write\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"App Whitelistings\",\r\n \"operation\": \"Create or Update App Whitelisting\",\r\n \"description\": \"Creates a new application whitelisting or updates an existing one\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/securitySolutionsReferenceData/read\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Reference Data\",\r\n \"operation\": \"Get Reference Data\",\r\n \"description\": \"Gets the security solutions reference data\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/securitySolutions/read\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Security Solutions\",\r\n \"operation\": \"Get Security Solutions\",\r\n \"description\": \"Gets the security solutions\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/securitySolutions/write\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Security Solutions\",\r\n \"operation\": \"Create or Update Security Solutions\",\r\n \"description\": \"Creates a new security solution or updates an existing one\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/securitySolutions/delete\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Security Solutions\",\r\n \"operation\": \"Delete Security Solutions\",\r\n \"description\": \"Deletes a security solution\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/webApplicationFirewalls/read\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Web Application Firewalls\",\r\n \"operation\": \"Get Web Application Firewalls\",\r\n \"description\": \"Gets the web application firewalls\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/webApplicationFirewalls/write\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Web Application Firewalls\",\r\n \"operation\": \"Create or Update Web Application Firewalls\",\r\n \"description\": \"Creates a new web application firewall or updates an existing one\"\r\n },\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.Security/webApplicationFirewalls/delete\",\r\n \"display\": {\r\n \"provider\": \"Microsoft Security\",\r\n \"resource\": \"Web Application Firewalls\",\r\n \"operation\": \"Delete Security Web Application Firewalls\",\r\n \"description\": \"Deletes a web application firewall\"\r\n },\r\n \"origin\": \"user\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:11 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-tenant-reads": [ + "14999" + ], + "x-ms-request-id": [ + "6749b449-2239-4de0-bf36-4dffd4648d4c" + ], + "x-ms-correlation-request-id": [ + "6749b449-2239-4de0-bf36-4dffd4648d4c" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125211Z:6749b449-2239-4de0-bf36-4dffd4648d4c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.PricingsTests/Pricings_CreateOrUpdateResourceGroupPricing.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.PricingsTests/Pricings_CreateOrUpdateResourceGroupPricing.json new file mode 100644 index 000000000000..48bd383eb706 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.PricingsTests/Pricings_CreateOrUpdateResourceGroupPricing.json @@ -0,0 +1,78 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/pricings/myService1?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Jlc291cmNlR3JvdXBzL215U2VydmljZTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TZWN1cml0eS9wcmljaW5ncy9teVNlcnZpY2UxP2FwaS12ZXJzaW9uPTIwMTctMDgtMDEtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"pricingTier\": \"Standard\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "59" + ], + "x-ms-client-request-id": [ + "b0ddd6b5-ee5b-4e36-b3d0-68bc18b7dab1" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"pricingTier\": \"Standard\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:53:04 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "8730d22d-63de-4e71-a2da-0dfefc4d78b7" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "249" + ], + "x-ms-correlation-request-id": [ + "58bd4263-1017-43e5-a018-2e84dc598407" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125304Z:58bd4263-1017-43e5-a018-2e84dc598407" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.PricingsTests/Pricings_GetResourceGroupPricing.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.PricingsTests/Pricings_GetResourceGroupPricing.json new file mode 100644 index 000000000000..a0c412d980cc --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.PricingsTests/Pricings_GetResourceGroupPricing.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/pricings/myService1?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Jlc291cmNlR3JvdXBzL215U2VydmljZTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TZWN1cml0eS9wcmljaW5ncy9teVNlcnZpY2UxP2FwaS12ZXJzaW9uPTIwMTctMDgtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "795f47eb-8c40-4afb-84b2-306621f24f6b" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/pricings/myService1\",\r\n \"name\": \"myService1\",\r\n \"type\": \"Microsoft.Security/pricings\",\r\n \"properties\": {\r\n \"pricingTier\": \"Standard\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:53:01 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "ce82e676-dcbc-4535-9db7-afdd2c4fa711" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-correlation-request-id": [ + "68680e0e-1cdc-49ce-8314-f0be73d54b9c" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125302Z:68680e0e-1cdc-49ce-8314-f0be73d54b9c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.PricingsTests/Pricings_GetSubscriptionPricing.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.PricingsTests/Pricings_GetSubscriptionPricing.json new file mode 100644 index 000000000000..b4c9cb1511aa --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.PricingsTests/Pricings_GetSubscriptionPricing.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/pricings/default?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvcHJpY2luZ3MvZGVmYXVsdD9hcGktdmVyc2lvbj0yMDE3LTA4LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "30ba8a2e-8bcd-402d-8bbb-0ba2a221b9d0" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/pricings/default\",\r\n \"name\": \"default\",\r\n \"type\": \"Microsoft.Security/pricings\",\r\n \"properties\": {\r\n \"pricingTier\": \"Standard\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:53:04 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "e2fafe15-4af4-4b81-97be-c6a77e9b74ba" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-correlation-request-id": [ + "8b0442f6-30a0-4c8e-a5c8-cda3b2c1c2db" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125305Z:8b0442f6-30a0-4c8e-a5c8-cda3b2c1c2db" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.PricingsTests/Pricings_List.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.PricingsTests/Pricings_List.json new file mode 100644 index 000000000000..ab013f27edd2 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.PricingsTests/Pricings_List.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/pricings?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvcHJpY2luZ3M/YXBpLXZlcnNpb249MjAxNy0wOC0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "4ea6ba84-dc59-4e35-84fa-ecb79b351ff6" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/pricings/default\",\r\n \"name\": \"default\",\r\n \"type\": \"Microsoft.Security/pricings\",\r\n \"properties\": {\r\n \"pricingTier\": \"Standard\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/pricings/myService1\",\r\n \"name\": \"myService1\",\r\n \"type\": \"Microsoft.Security/pricings\",\r\n \"properties\": {\r\n \"pricingTier\": \"Standard\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:53:05 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "ceaeb8fe-9071-4136-bfc2-bc75361bf48e" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-correlation-request-id": [ + "e4e11dec-a833-44dd-b03c-9fbcb99c4f9e" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125306Z:e4e11dec-a833-44dd-b03c-9fbcb99c4f9e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.PricingsTests/Pricings_ListByResourceGroup.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.PricingsTests/Pricings_ListByResourceGroup.json new file mode 100644 index 000000000000..4d607298cba6 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.PricingsTests/Pricings_ListByResourceGroup.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/pricings?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Jlc291cmNlR3JvdXBzL215U2VydmljZTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TZWN1cml0eS9wcmljaW5ncz9hcGktdmVyc2lvbj0yMDE3LTA4LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "fa3c156d-71c4-4764-a73c-f67eb630ba2d" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/pricings/myService1\",\r\n \"name\": \"myService1\",\r\n \"type\": \"Microsoft.Security/pricings\",\r\n \"properties\": {\r\n \"pricingTier\": \"Standard\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:53:02 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "27a6f2ba-6db5-45c8-b931-7a1e0816bd32" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-correlation-request-id": [ + "3e579bd3-f800-42e4-9096-c39f8c224761" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125302Z:3e579bd3-f800-42e4-9096-c39f8c224761" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.PricingsTests/Pricings_UpdateSubscriptionPricing.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.PricingsTests/Pricings_UpdateSubscriptionPricing.json new file mode 100644 index 000000000000..9df1c4afcb82 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.PricingsTests/Pricings_UpdateSubscriptionPricing.json @@ -0,0 +1,78 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/pricings/default?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvcHJpY2luZ3MvZGVmYXVsdD9hcGktdmVyc2lvbj0yMDE3LTA4LTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"pricingTier\": \"Standard\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "59" + ], + "x-ms-client-request-id": [ + "23c46a7a-9810-4346-90ef-85c444bd5195" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"pricingTier\": \"Standard\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:53:03 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "840875c9-115c-4938-9bc8-ba045fb2176b" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "249" + ], + "x-ms-correlation-request-id": [ + "0ee452b2-efd1-47d2-ad03-7384f2d6cfbf" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125303Z:0ee452b2-efd1-47d2-ad03-7384f2d6cfbf" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityAlertsTests/SecurityAlerts_GetResourceGroupLevelAlerts.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityAlertsTests/SecurityAlerts_GetResourceGroupLevelAlerts.json new file mode 100644 index 000000000000..6be0fe919260 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityAlertsTests/SecurityAlerts_GetResourceGroupLevelAlerts.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/RSG/providers/Microsoft.Security/locations/centralus/alerts/2518710774294070750_FFF23C70-80EF-4A8B-9122-507B0EA8DFFF?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Jlc291cmNlR3JvdXBzL1JTRy9wcm92aWRlcnMvTWljcm9zb2Z0LlNlY3VyaXR5L2xvY2F0aW9ucy9jZW50cmFsdXMvYWxlcnRzLzI1MTg3MTA3NzQyOTQwNzA3NTBfRkZGMjNDNzAtODBFRi00QThCLTkxMjItNTA3QjBFQThERkZGP2FwaS12ZXJzaW9uPTIwMTUtMDYtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "7e1120d5-9ba6-4617-b125-aebfc570e2b2" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/RSG/providers/Microsoft.Security/locations/centralus/alerts/2518710774294070750_FFF23C70-80EF-4A8B-9122-507B0EA8DFFF\",\r\n \"name\": \"2518710774294070750_FFF23C70-80EF-4A8B-9122-507B0EA8DFFF\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"vendorName\": \"Microsoft\",\r\n \"alertDisplayName\": \"PREVIEW - Vulnerability scanner detected\",\r\n \"alertName\": \"APPS_WpScanner\",\r\n \"detectedTimeUtc\": \"2018-07-10T11:49:30.5929249Z\",\r\n \"description\": \"Azure App Services activity log indicates a possible vulnerability scanner usage on your App Service resource.\\r\\nThe suspicious activity detected resembles that of tools targeting WordPress applications.\",\r\n \"remediationSteps\": \"1. If WordPress is installed, make sure that the application is up to date and automatic updates are enabled.\\r\\n2. If only specific IPs should access to the web application, use IP Restrictions (https://docs.microsoft.com/en-us/azure/app-service/app-service-ip-restrictions).\",\r\n \"actionTaken\": \"Undefined\",\r\n \"reportedSeverity\": \"High\",\r\n \"compromisedEntity\": \"testSite1\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/RSG/providers/Microsoft.Web/sites/testSite1\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"fff23c70-80ef-4a8b-9122-507b0ea8dfff\",\r\n \"extendedProperties\": {\r\n \"sample User Agents\": \"WPScan+v2.9.3+(http://wpscan.org)\",\r\n \"last Event Time\": \"6/23/2018 12:18:58 AM\",\r\n \"sample URIs\": \"/wp-config.php.original, /wp-includes/css/editor.min.css, /wp-includes/js/wp-emoji.js, /wp-config.old, /xmlrpc.php, /wp-admin/css/wp-admin-rtl.css, /#wp-config.php#, /wp-includes/js/tinymce/plugins/wplink/plugin.js, /wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js, /wp-admin/js/post.js\",\r\n \"sample Referer\": \"https://www.stone.com.br/\",\r\n \"resourceType\": \"App Service\",\r\n \"end Time UTC\": \"2018-07-10T11:54:30.5929249Z\"\r\n },\r\n \"state\": \"Dismissed\",\r\n \"reportedTimeUtc\": \"2018-07-10T16:31:52.4195616Z\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:50 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "70061a18-461f-43fb-ba85-48c35707e7ec" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-correlation-request-id": [ + "2c53d420-45f7-498c-8bb1-34a7eb9cd7f8" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125251Z:2c53d420-45f7-498c-8bb1-34a7eb9cd7f8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityAlertsTests/SecurityAlerts_GetSubscriptionLevelAlert.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityAlertsTests/SecurityAlerts_GetSubscriptionLevelAlert.json new file mode 100644 index 000000000000..07d87264d2ea --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityAlertsTests/SecurityAlerts_GetSubscriptionLevelAlert.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/alerts/2518710774894070750_EEE23C70-80EF-4A8B-9122-507B0EA8DFFF?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvbG9jYXRpb25zL2NlbnRyYWx1cy9hbGVydHMvMjUxODcxMDc3NDg5NDA3MDc1MF9FRUUyM0M3MC04MEVGLTRBOEItOTEyMi01MDdCMEVBOERGRkY/YXBpLXZlcnNpb249MjAxNS0wNi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "fe64d014-144e-4340-9564-bf42ef02008c" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/alerts/2518710774894070750_EEE23C70-80EF-4A8B-9122-507B0EA8DFFF\",\r\n \"name\": \"2518710774894070750_EEE23C70-80EF-4A8B-9122-507B0EA8DFFF\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"vendorName\": \"Microsoft\",\r\n \"alertDisplayName\": \"PREVIEW - Spam folder referrer detected\",\r\n \"alertName\": \"APPS_SpamReferrer\",\r\n \"detectedTimeUtc\": \"2018-07-10T11:48:30Z\",\r\n \"description\": \"Azure App Services activity log indicates web activity that was identified as originating from a web site associated with SPAM activity.\\r\\nThis could occur if your web site is compromised and used for spam activity.\",\r\n \"remediationSteps\": \"Review the URIs in the alert details. Check whether the corresponding files contain malicious or suspicious content. \\r\\nIf they do, escalate the alert to the information security team.\",\r\n \"actionTaken\": \"Undefined\",\r\n \"reportedSeverity\": \"High\",\r\n \"compromisedEntity\": \"testSite2\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Web/sites/testSite2\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"eee23c70-80ef-4a8b-9122-507b0ea8dfff\",\r\n \"extendedProperties\": {\r\n \"sample User Agents\": \"Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1)\",\r\n \"last Event Time\": \"6/23/2018 4:53:58 PM\",\r\n \"sample URIs\": \"/acropolis.php, /wp-content/animator.php, /bandpass.php, /wp-content/base.php, /candid.php, /wp-content/uploads/2018/christina.php, /wp-content/climax.php, /wp-content/uploads/conditioning.php, /wp-content/corkscrew.php, /wp-content/uploads/2018/countermeasures.php\",\r\n \"sample Referer\": \"https://google.com/mail/inbox/spam/\",\r\n \"resourceType\": \"App Service\",\r\n \"end Time UTC\": \"2018-07-10T11:53:30.5929249Z\"\r\n },\r\n \"state\": \"Dismissed\",\r\n \"reportedTimeUtc\": \"2018-07-10T16:31:52Z\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:45 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "16090f53-08a3-4c33-9c3b-11502f95e6f7" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-correlation-request-id": [ + "c561ff6d-8216-40b0-9413-ac91294047a5" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125245Z:c561ff6d-8216-40b0-9413-ac91294047a5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityAlertsTests/SecurityAlerts_List.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityAlertsTests/SecurityAlerts_List.json new file mode 100644 index 000000000000..1d9cd4ad18c8 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityAlertsTests/SecurityAlerts_List.json @@ -0,0 +1,70 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/alerts?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvYWxlcnRzP2FwaS12ZXJzaW9uPTIwMTUtMDYtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "726f5f79-b92b-483f-8f40-f4e8d11e2d0e" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/RSG/providers/Microsoft.Security/locations/centralus/alerts/2518710774294070750_FFF23C70-80EF-4A8B-9122-507B0EA8DFFF\",\r\n \"name\": \"2518710774294070750_FFF23C70-80EF-4A8B-9122-507B0EA8DFFF\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"vendorName\": \"Microsoft\",\r\n \"alertDisplayName\": \"PREVIEW - Vulnerability scanner detected\",\r\n \"alertName\": \"APPS_WpScanner\",\r\n \"detectedTimeUtc\": \"2018-07-10T11:49:30.5929249Z\",\r\n \"description\": \"Azure App Services activity log indicates a possible vulnerability scanner usage on your App Service resource.\\r\\nThe suspicious activity detected resembles that of tools targeting WordPress applications.\",\r\n \"remediationSteps\": \"1. If WordPress is installed, make sure that the application is up to date and automatic updates are enabled.\\r\\n2. If only specific IPs should access to the web application, use IP Restrictions (https://docs.microsoft.com/en-us/azure/app-service/app-service-ip-restrictions).\",\r\n \"actionTaken\": \"Undefined\",\r\n \"reportedSeverity\": \"High\",\r\n \"compromisedEntity\": \"testSite1\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/RSG/providers/Microsoft.Web/sites/testSite1\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"fff23c70-80ef-4a8b-9122-507b0ea8dfff\",\r\n \"extendedProperties\": {\r\n \"sample User Agents\": \"WPScan+v2.9.3+(http://wpscan.org)\",\r\n \"last Event Time\": \"6/23/2018 12:18:58 AM\",\r\n \"sample URIs\": \"/wp-config.php.original, /wp-includes/css/editor.min.css, /wp-includes/js/wp-emoji.js, /wp-config.old, /xmlrpc.php, /wp-admin/css/wp-admin-rtl.css, /#wp-config.php#, /wp-includes/js/tinymce/plugins/wplink/plugin.js, /wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js, /wp-admin/js/post.js\",\r\n \"sample Referer\": \"https://www.stone.com.br/\",\r\n \"resourceType\": \"App Service\",\r\n \"end Time UTC\": \"2018-07-10T11:54:30.5929249Z\"\r\n },\r\n \"state\": \"Dismissed\",\r\n \"reportedTimeUtc\": \"2018-07-10T16:31:52.4195616Z\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/alerts/2518710774894070750_EEE23C70-80EF-4A8B-9122-507B0EA8DFFF\",\r\n \"name\": \"2518710774894070750_EEE23C70-80EF-4A8B-9122-507B0EA8DFFF\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"vendorName\": \"Microsoft\",\r\n \"alertDisplayName\": \"PREVIEW - Spam folder referrer detected\",\r\n \"alertName\": \"APPS_SpamReferrer\",\r\n \"detectedTimeUtc\": \"2018-07-10T11:48:30Z\",\r\n \"description\": \"Azure App Services activity log indicates web activity that was identified as originating from a web site associated with SPAM activity.\\r\\nThis could occur if your web site is compromised and used for spam activity.\",\r\n \"remediationSteps\": \"Review the URIs in the alert details. Check whether the corresponding files contain malicious or suspicious content. \\r\\nIf they do, escalate the alert to the information security team.\",\r\n \"actionTaken\": \"Undefined\",\r\n \"reportedSeverity\": \"High\",\r\n \"compromisedEntity\": \"testSite2\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Web/sites/testSite2\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"eee23c70-80ef-4a8b-9122-507b0ea8dfff\",\r\n \"extendedProperties\": {\r\n \"sample User Agents\": \"Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1)\",\r\n \"last Event Time\": \"6/23/2018 4:53:58 PM\",\r\n \"sample URIs\": \"/acropolis.php, /wp-content/animator.php, /bandpass.php, /wp-content/base.php, /candid.php, /wp-content/uploads/2018/christina.php, /wp-content/climax.php, /wp-content/uploads/conditioning.php, /wp-content/corkscrew.php, /wp-content/uploads/2018/countermeasures.php\",\r\n \"sample Referer\": \"https://google.com/mail/inbox/spam/\",\r\n \"resourceType\": \"App Service\",\r\n \"end Time UTC\": \"2018-07-10T11:53:30.5929249Z\"\r\n },\r\n \"state\": \"Dismissed\",\r\n \"reportedTimeUtc\": \"2018-07-10T16:31:52Z\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700435999999999_2de618c2-4d19-416d-ad99-a6f6c1d9e506\",\r\n \"name\": \"2518700435999999999_2de618c2-4d19-416d-ad99-a6f6c1d9e506\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-22T11:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"2de618c2-4d19-416d-ad99-a6f6c1d9e506\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"186.225.118.6\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-22T12:00:26.3856634Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700435999999999_d7e3ecb2-43e9-4926-9577-e583a3eed68b\",\r\n \"name\": \"2518700435999999999_d7e3ecb2-43e9-4926-9577-e583a3eed68b\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-22T11:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"d7e3ecb2-43e9-4926-9577-e583a3eed68b\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"2\",\r\n \"source IPs\": \"188.243.150.172,37.63.247.5\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-22T12:00:26.8883292Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700471999999999_4883193c-5fb2-4e8a-b751-1398dc277a02\",\r\n \"name\": \"2518700471999999999_4883193c-5fb2-4e8a-b751-1398dc277a02\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-22T10:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"4883193c-5fb2-4e8a-b751-1398dc277a02\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"2\",\r\n \"source IPs\": \"51.38.12.21,200.0.47.204\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-22T11:00:04.4971953Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700471999999999_58a63444-e16b-462d-8927-f68b2e85b625\",\r\n \"name\": \"2518700471999999999_58a63444-e16b-462d-8927-f68b2e85b625\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-22T10:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 5)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"58a63444-e16b-462d-8927-f68b2e85b625\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"196.64.236.5\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-22T11:00:05.2534179Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700471999999999_e4e51f5e-1bb4-41ea-bebc-51c56a48ef9a\",\r\n \"name\": \"2518700471999999999_e4e51f5e-1bb4-41ea-bebc-51c56a48ef9a\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-22T10:00:00Z\",\r\n \"description\": \"Detail:Request Missing a Host Header\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"e4e51f5e-1bb4-41ea-bebc-51c56a48ef9a\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"2\",\r\n \"source IPs\": \"196.64.236.5\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-22T11:00:05.2534179Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700543999999999_2543efd6-dc0b-4849-9b3a-7e94877c2000\",\r\n \"name\": \"2518700543999999999_2543efd6-dc0b-4849-9b3a-7e94877c2000\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-22T08:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"2543efd6-dc0b-4849-9b3a-7e94877c2000\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"190.128.31.67\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-22T09:00:15.597189Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700579999999999_883b42d9-1426-4faa-a929-b31b3fdd9e35\",\r\n \"name\": \"2518700579999999999_883b42d9-1426-4faa-a929-b31b3fdd9e35\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-22T07:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"883b42d9-1426-4faa-a929-b31b3fdd9e35\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"175.184.235.90\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-22T08:00:51.9449931Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700615999999999_43a938d5-2539-46e1-9150-bcd0baf55cfe\",\r\n \"name\": \"2518700615999999999_43a938d5-2539-46e1-9150-bcd0baf55cfe\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-22T06:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 5)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"43a938d5-2539-46e1-9150-bcd0baf55cfe\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"82.55.229.74\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-22T07:00:21.8129293Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700615999999999_f562cc6e-abb5-4eb7-ad4e-4743df2af060\",\r\n \"name\": \"2518700615999999999_f562cc6e-abb5-4eb7-ad4e-4743df2af060\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-22T06:00:00Z\",\r\n \"description\": \"Detail:Request Missing a Host Header\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"f562cc6e-abb5-4eb7-ad4e-4743df2af060\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"3\",\r\n \"source IPs\": \"82.55.229.74,197.245.245.195\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-22T07:00:21.8129293Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700651999999999_76c4718c-0710-4db5-a8fa-20bcb0d54c49\",\r\n \"name\": \"2518700651999999999_76c4718c-0710-4db5-a8fa-20bcb0d54c49\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-22T05:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"76c4718c-0710-4db5-a8fa-20bcb0d54c49\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"2\",\r\n \"source IPs\": \"172.104.108.109\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-22T06:00:08.0833237Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700651999999999_db88aa01-713e-4ec4-b016-21d6db42b865\",\r\n \"name\": \"2518700651999999999_db88aa01-713e-4ec4-b016-21d6db42b865\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-22T05:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 5)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"db88aa01-713e-4ec4-b016-21d6db42b865\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"172.104.108.109\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-22T06:00:06.7205171Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700723999999999_878dac98-f61b-4587-bb81-376e239205c7\",\r\n \"name\": \"2518700723999999999_878dac98-f61b-4587-bb81-376e239205c7\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-22T03:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"878dac98-f61b-4587-bb81-376e239205c7\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"195.154.61.206\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-22T04:00:37.6136685Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700723999999999_e2f15b68-6e1e-448e-a8ce-6035dfdad977\",\r\n \"name\": \"2518700723999999999_e2f15b68-6e1e-448e-a8ce-6035dfdad977\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-22T03:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"e2f15b68-6e1e-448e-a8ce-6035dfdad977\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"4\",\r\n \"source IPs\": \"139.162.119.197,178.79.148.68\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-22T04:00:37.6136685Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700723999999999_e8d49aa6-7770-4c68-acdf-0ba37da0c726\",\r\n \"name\": \"2518700723999999999_e8d49aa6-7770-4c68-acdf-0ba37da0c726\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-22T03:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 5)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"e8d49aa6-7770-4c68-acdf-0ba37da0c726\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"2\",\r\n \"source IPs\": \"139.162.119.197,178.79.148.68\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-22T04:00:37.0521052Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700759999999999_2d8f6c4a-01a5-4af0-9066-288dd59f16e5\",\r\n \"name\": \"2518700759999999999_2d8f6c4a-01a5-4af0-9066-288dd59f16e5\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-22T02:00:00Z\",\r\n \"description\": \"Detail:Request Missing a Host Header\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"2d8f6c4a-01a5-4af0-9066-288dd59f16e5\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"2\",\r\n \"source IPs\": \"182.55.90.82\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-22T03:00:25.4745276Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700759999999999_2e87ce90-38dd-4729-83ee-89ffe05f46f8\",\r\n \"name\": \"2518700759999999999_2e87ce90-38dd-4729-83ee-89ffe05f46f8\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-22T02:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 5)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"2e87ce90-38dd-4729-83ee-89ffe05f46f8\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"182.55.90.82\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-22T03:00:25.4745276Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700759999999999_771bfcc2-4ba2-47b4-9e75-edb288d6a30b\",\r\n \"name\": \"2518700759999999999_771bfcc2-4ba2-47b4-9e75-edb288d6a30b\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-22T02:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 5)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"771bfcc2-4ba2-47b4-9e75-edb288d6a30b\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"222.164.55.171\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-22T03:00:24.7460627Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700759999999999_87953151-05ff-41eb-8417-908bff803ef0\",\r\n \"name\": \"2518700759999999999_87953151-05ff-41eb-8417-908bff803ef0\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-22T02:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"87953151-05ff-41eb-8417-908bff803ef0\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"3\",\r\n \"source IPs\": \"185.141.132.56,222.164.55.171\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-22T03:00:25.4745276Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700795999999999_05efc4cd-3fb7-4517-a3d9-0b8263ed1899\",\r\n \"name\": \"2518700795999999999_05efc4cd-3fb7-4517-a3d9-0b8263ed1899\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-22T01:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 5)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"05efc4cd-3fb7-4517-a3d9-0b8263ed1899\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"109.227.237.134\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-22T02:00:12.5404508Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700795999999999_0a6c6da4-8ed3-4207-ad27-f01a1ad9374c\",\r\n \"name\": \"2518700795999999999_0a6c6da4-8ed3-4207-ad27-f01a1ad9374c\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-22T01:00:00Z\",\r\n \"description\": \"Detail:Request Missing a Host Header\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"0a6c6da4-8ed3-4207-ad27-f01a1ad9374c\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"2\",\r\n \"source IPs\": \"109.227.237.134\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-22T02:00:13.191967Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700831999999999_1a9f09a8-167b-4cfd-9ee5-3d2a70ef89c1\",\r\n \"name\": \"2518700831999999999_1a9f09a8-167b-4cfd-9ee5-3d2a70ef89c1\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-22T00:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 5)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"1a9f09a8-167b-4cfd-9ee5-3d2a70ef89c1\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"89.207.107.54\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-22T01:00:58.3238906Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700831999999999_400b380d-be8f-4911-b1d7-383b8369cefa\",\r\n \"name\": \"2518700831999999999_400b380d-be8f-4911-b1d7-383b8369cefa\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-22T00:00:00Z\",\r\n \"description\": \"Detail:Request Missing a Host Header\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"400b380d-be8f-4911-b1d7-383b8369cefa\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"2\",\r\n \"source IPs\": \"89.207.107.54\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-22T01:00:58.8907467Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700867999999999_8326509d-7170-4e54-982f-5787dede86ec\",\r\n \"name\": \"2518700867999999999_8326509d-7170-4e54-982f-5787dede86ec\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T23:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"8326509d-7170-4e54-982f-5787dede86ec\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"138.201.205.221\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-22T00:00:46.8314264Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700867999999999_8e79a425-1c4b-4968-a946-d342ff1286aa\",\r\n \"name\": \"2518700867999999999_8e79a425-1c4b-4968-a946-d342ff1286aa\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T23:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"8e79a425-1c4b-4968-a946-d342ff1286aa\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"107.170.227.133\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-22T00:00:46.0966483Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700903999999999_0034bdf5-76f6-4a61-902c-2039fffc9634\",\r\n \"name\": \"2518700903999999999_0034bdf5-76f6-4a61-902c-2039fffc9634\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"SCANNER-DETECTION\",\r\n \"alertName\": \"SCANNER-DETECTION\",\r\n \"detectedTimeUtc\": \"2018-07-21T22:00:00Z\",\r\n \"description\": \"Detail:Found User-Agent associated with security scanner Matched Data: nmap scripting engine found within REQUEST_HEADERS:User-Agent: Mozilla/5.0 (compatible; Nmap Scripting Engine; https://nmap.org/book/nse.html)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"bc09060f-3280-4734-a595-310679b63b8f.cloudapp.net\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"0034bdf5-76f6-4a61-902c-2039fffc9634\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"16\",\r\n \"source IPs\": \"52.175.192.251\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T23:00:32.599191Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700903999999999_60b03bdc-46ff-4ebd-af26-4a6adf2b1041\",\r\n \"name\": \"2518700903999999999_60b03bdc-46ff-4ebd-af26-4a6adf2b1041\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-21T22:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 15)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"bc09060f-3280-4734-a595-310679b63b8f.cloudapp.net\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"60b03bdc-46ff-4ebd-af26-4a6adf2b1041\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"16\",\r\n \"source IPs\": \"52.175.192.251\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T23:00:32.599191Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700903999999999_79371451-c6d2-49d3-80ae-c8ec5c2ea7fa\",\r\n \"name\": \"2518700903999999999_79371451-c6d2-49d3-80ae-c8ec5c2ea7fa\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"METHOD-ENFORCEMENT\",\r\n \"alertName\": \"METHOD-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T22:00:00Z\",\r\n \"description\": \"Detail:Method is not allowed by policy PROPFIND\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"bc09060f-3280-4734-a595-310679b63b8f.cloudapp.net\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"79371451-c6d2-49d3-80ae-c8ec5c2ea7fa\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"52.175.192.251\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T23:00:32.599191Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700903999999999_79fb89cc-b486-4276-adbd-521266857196\",\r\n \"name\": \"2518700903999999999_79fb89cc-b486-4276-adbd-521266857196\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-21T22:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 7)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"bc09060f-3280-4734-a595-310679b63b8f.cloudapp.net\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"79fb89cc-b486-4276-adbd-521266857196\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"16\",\r\n \"source IPs\": \"52.175.192.251\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T23:00:32.599191Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700903999999999_81b4186b-efa8-4f61-9d54-6b4e5a33f3f5\",\r\n \"name\": \"2518700903999999999_81b4186b-efa8-4f61-9d54-6b4e5a33f3f5\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"APPLICATION-ATTACK-LFI\",\r\n \"alertName\": \"APPLICATION-ATTACK-LFI\",\r\n \"detectedTimeUtc\": \"2018-07-21T22:00:00Z\",\r\n \"description\": \"Detail:Restricted File Access Attempt Matched Data: /.git/ found within REQUEST_FILENAME: /.git/HEAD\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"bc09060f-3280-4734-a595-310679b63b8f.cloudapp.net\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"81b4186b-efa8-4f61-9d54-6b4e5a33f3f5\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"52.175.192.251\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T23:00:32.599191Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700903999999999_967c516c-c6d2-4b8f-ab3b-0ec9deced54a\",\r\n \"name\": \"2518700903999999999_967c516c-c6d2-4b8f-ab3b-0ec9deced54a\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T22:00:00Z\",\r\n \"description\": \"Detail:Request Missing a Host Header\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"967c516c-c6d2-4b8f-ab3b-0ec9deced54a\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"5\",\r\n \"source IPs\": \"52.175.192.251,81.29.243.149\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T23:00:32.599191Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700903999999999_9bd8a15c-2a6e-4a50-9416-55558beff2a2\",\r\n \"name\": \"2518700903999999999_9bd8a15c-2a6e-4a50-9416-55558beff2a2\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"SCANNER-DETECTION\",\r\n \"alertName\": \"SCANNER-DETECTION\",\r\n \"detectedTimeUtc\": \"2018-07-21T22:00:00Z\",\r\n \"description\": \"Detail:Found User-Agent associated with security scanner Matched Data: nmap scripting engine found within REQUEST_HEADERS:User-Agent: Mozilla/5.0 (compatible; Nmap Scripting Engine; https://nmap.org/book/nse.html)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"bc09060f-3280-4734-a595-310679b63b8f.cloudapp.net\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"9bd8a15c-2a6e-4a50-9416-55558beff2a2\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"16\",\r\n \"source IPs\": \"52.175.192.251\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T23:00:32.599191Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700903999999999_9e53b212-07ba-446e-beb3-326c03baa6e6\",\r\n \"name\": \"2518700903999999999_9e53b212-07ba-446e-beb3-326c03baa6e6\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-21T22:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 5)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"9e53b212-07ba-446e-beb3-326c03baa6e6\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"2\",\r\n \"source IPs\": \"52.175.192.251\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T23:00:32.599191Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700903999999999_a76a76db-2dfe-41c6-bd58-dd4684b1cb47\",\r\n \"name\": \"2518700903999999999_a76a76db-2dfe-41c6-bd58-dd4684b1cb47\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T22:00:00Z\",\r\n \"description\": \"Detail:Request Missing an Accept Header\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"bc09060f-3280-4734-a595-310679b63b8f.cloudapp.net\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"a76a76db-2dfe-41c6-bd58-dd4684b1cb47\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"13\",\r\n \"source IPs\": \"52.175.192.251\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T23:00:32.599191Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700903999999999_c34a988f-03ca-4cbd-b565-3864241df396\",\r\n \"name\": \"2518700903999999999_c34a988f-03ca-4cbd-b565-3864241df396\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T22:00:00Z\",\r\n \"description\": \"Detail:Request Missing an Accept Header\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"bc09060f-3280-4734-a595-310679b63b8f.cloudapp.net\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"c34a988f-03ca-4cbd-b565-3864241df396\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"9\",\r\n \"source IPs\": \"52.175.192.251\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T23:00:32.599191Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700903999999999_cc82e46b-574c-48f8-870b-38634b8aa390\",\r\n \"name\": \"2518700903999999999_cc82e46b-574c-48f8-870b-38634b8aa390\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"APPLICATION-ATTACK-SQLI\",\r\n \"alertName\": \"APPLICATION-ATTACK-SQLI\",\r\n \"detectedTimeUtc\": \"2018-07-21T22:00:00Z\",\r\n \"description\": \"Detail:SQL Injection Attack: SQL Tautology Detected. Matched Data: methodName>system found within ARGS_NAMES: system.listMethods : system.listMethods \",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"bc09060f-3280-4734-a595-310679b63b8f.cloudapp.net\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"cc82e46b-574c-48f8-870b-38634b8aa390\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"2\",\r\n \"source IPs\": \"52.175.192.251\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T23:00:32.599191Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700903999999999_e0518a6d-7f43-44ff-b8ab-6c7fb23bf029\",\r\n \"name\": \"2518700903999999999_e0518a6d-7f43-44ff-b8ab-6c7fb23bf029\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"METHOD-ENFORCEMENT\",\r\n \"alertName\": \"METHOD-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T22:00:00Z\",\r\n \"description\": \"Detail:Method is not allowed by policy PROPFIND\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"bc09060f-3280-4734-a595-310679b63b8f.cloudapp.net\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"e0518a6d-7f43-44ff-b8ab-6c7fb23bf029\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"3\",\r\n \"source IPs\": \"52.175.192.251\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T23:00:31.8584753Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700939999999999_a44d444e-50ea-4c74-a7db-11596fdd484c\",\r\n \"name\": \"2518700939999999999_a44d444e-50ea-4c74-a7db-11596fdd484c\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T21:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"a44d444e-50ea-4c74-a7db-11596fdd484c\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"2\",\r\n \"source IPs\": \"118.193.247.229\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T22:00:19.488755Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518700975999999999_ea683c18-e910-4ea6-b514-96c756b2c468\",\r\n \"name\": \"2518700975999999999_ea683c18-e910-4ea6-b514-96c756b2c468\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T20:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"ea683c18-e910-4ea6-b514-96c756b2c468\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"95.158.80.110\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T21:01:00.0249024Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701011999999999_a79655b5-08cc-4402-9d66-379e3240a9c5\",\r\n \"name\": \"2518701011999999999_a79655b5-08cc-4402-9d66-379e3240a9c5\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T19:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"a79655b5-08cc-4402-9d66-379e3240a9c5\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"103.39.156.156\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T20:00:44.7987088Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701047999999999_29f130d7-09ba-4a81-a76e-cc38f73f3d2c\",\r\n \"name\": \"2518701047999999999_29f130d7-09ba-4a81-a76e-cc38f73f3d2c\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T18:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"29f130d7-09ba-4a81-a76e-cc38f73f3d2c\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"2\",\r\n \"source IPs\": \"45.228.254.164,189.152.72.200\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T19:00:32.9335074Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701047999999999_d0ed12fc-49c4-4acd-bf42-d1dedd7170b3\",\r\n \"name\": \"2518701047999999999_d0ed12fc-49c4-4acd-bf42-d1dedd7170b3\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T18:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"d0ed12fc-49c4-4acd-bf42-d1dedd7170b3\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"2\",\r\n \"source IPs\": \"179.98.15.119,115.178.101.235\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T19:00:32.9335074Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701083999999999_f983cb96-b235-449f-b1e2-761aabe287fe\",\r\n \"name\": \"2518701083999999999_f983cb96-b235-449f-b1e2-761aabe287fe\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T17:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"f983cb96-b235-449f-b1e2-761aabe287fe\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"2\",\r\n \"source IPs\": \"159.192.240.54,102.176.223.153\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T18:00:18.3280963Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701155999999999_0e1291ab-e4c0-4318-b4d3-39411a855c2f\",\r\n \"name\": \"2518701155999999999_0e1291ab-e4c0-4318-b4d3-39411a855c2f\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-21T15:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 20)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"0e1291ab-e4c0-4318-b4d3-39411a855c2f\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"17\",\r\n \"source IPs\": \"54.233.144.66\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T16:00:51.3217994Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701155999999999_3e92cc17-42c7-4e07-a9d8-cd9908d6395b\",\r\n \"name\": \"2518701155999999999_3e92cc17-42c7-4e07-a9d8-cd9908d6395b\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"APPLICATION-ATTACK-SQLI\",\r\n \"alertName\": \"APPLICATION-ATTACK-SQLI\",\r\n \"detectedTimeUtc\": \"2018-07-21T15:00:00Z\",\r\n \"description\": \"Detail:SQL Injection Attack Matched Data: md5 found within ARGS:h: die(md5('PHP'));\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"3e92cc17-42c7-4e07-a9d8-cd9908d6395b\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"51\",\r\n \"source IPs\": \"54.233.144.66\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T16:00:51.9560537Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701155999999999_68b22db1-6cb3-43f5-bfee-b8da396d0ea9\",\r\n \"name\": \"2518701155999999999_68b22db1-6cb3-43f5-bfee-b8da396d0ea9\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-21T15:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 12)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"68b22db1-6cb3-43f5-bfee-b8da396d0ea9\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"25\",\r\n \"source IPs\": \"54.233.144.66\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T16:00:51.9560537Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701155999999999_68f5a622-e75b-4731-aea3-738da0a8e69a\",\r\n \"name\": \"2518701155999999999_68f5a622-e75b-4731-aea3-738da0a8e69a\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"APPLICATION-ATTACK-SQLI\",\r\n \"alertName\": \"APPLICATION-ATTACK-SQLI\",\r\n \"detectedTimeUtc\": \"2018-07-21T15:00:00Z\",\r\n \"description\": \"Detail:SQL Injection Attack Matched Data: md5 found within ARGS:h: die(md5('PHP'));\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"68f5a622-e75b-4731-aea3-738da0a8e69a\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"69\",\r\n \"source IPs\": \"54.233.144.66\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T16:00:51.9560537Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701155999999999_c4c21dd5-ceda-43b2-aab3-6b806234fad0\",\r\n \"name\": \"2518701155999999999_c4c21dd5-ceda-43b2-aab3-6b806234fad0\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T15:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"c4c21dd5-ceda-43b2-aab3-6b806234fad0\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"35\",\r\n \"source IPs\": \"54.233.144.66,189.69.150.216\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T16:00:51.9560537Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701155999999999_e52ab240-d619-4cad-b080-1b39f824f7ef\",\r\n \"name\": \"2518701155999999999_e52ab240-d619-4cad-b080-1b39f824f7ef\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"METHOD-ENFORCEMENT\",\r\n \"alertName\": \"METHOD-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T15:00:00Z\",\r\n \"description\": \"Detail:Method is not allowed by policy PROPFIND\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"e52ab240-d619-4cad-b080-1b39f824f7ef\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"54.233.144.66\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T16:00:51.9560537Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701155999999999_ef17ee35-dd76-4a87-a069-db06bde3d748\",\r\n \"name\": \"2518701155999999999_ef17ee35-dd76-4a87-a069-db06bde3d748\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T15:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"ef17ee35-dd76-4a87-a069-db06bde3d748\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"52\",\r\n \"source IPs\": \"102.141.241.14,54.233.144.66,31.184.194.109\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T16:00:51.9560537Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701191999999999_517d37b2-ac11-49da-92e4-cd3018f7f86d\",\r\n \"name\": \"2518701191999999999_517d37b2-ac11-49da-92e4-cd3018f7f86d\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T14:00:00Z\",\r\n \"description\": \"Detail:Request Missing a Host Header\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"517d37b2-ac11-49da-92e4-cd3018f7f86d\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"6\",\r\n \"source IPs\": \"85.247.30.187,222.136.158.40,185.50.170.145\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T15:00:39.0646696Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701191999999999_64c7add8-d264-4b8e-90f8-ff96dee6d31f\",\r\n \"name\": \"2518701191999999999_64c7add8-d264-4b8e-90f8-ff96dee6d31f\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-21T14:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 5)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"64c7add8-d264-4b8e-90f8-ff96dee6d31f\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"3\",\r\n \"source IPs\": \"85.247.30.187,222.136.158.40,185.50.170.145\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T15:00:38.5620424Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701191999999999_ece6f66b-e548-45e9-b9d7-548ed5af0065\",\r\n \"name\": \"2518701191999999999_ece6f66b-e548-45e9-b9d7-548ed5af0065\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T14:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"ece6f66b-e548-45e9-b9d7-548ed5af0065\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"2\",\r\n \"source IPs\": \"191.17.21.202,5.8.54.27\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T15:00:39.0646696Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701227999999999_6b839d15-42ac-4a3a-9809-a067fb0b676c\",\r\n \"name\": \"2518701227999999999_6b839d15-42ac-4a3a-9809-a067fb0b676c\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T13:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"6b839d15-42ac-4a3a-9809-a067fb0b676c\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"212.174.171.210\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T14:00:27.0435607Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701227999999999_94007475-046f-4ee1-bd9a-42e34ec68bb3\",\r\n \"name\": \"2518701227999999999_94007475-046f-4ee1-bd9a-42e34ec68bb3\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T13:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"94007475-046f-4ee1-bd9a-42e34ec68bb3\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"2\",\r\n \"source IPs\": \"36.79.234.37,185.126.40.102\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T14:00:26.514207Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701299999999999_384d6bc0-84fa-40c4-8588-33505e7203b6\",\r\n \"name\": \"2518701299999999999_384d6bc0-84fa-40c4-8588-33505e7203b6\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-21T11:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 12)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"384d6bc0-84fa-40c4-8588-33505e7203b6\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"21\",\r\n \"source IPs\": \"121.42.144.51\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T12:01:00.7009573Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701299999999999_817aae2b-84f1-4263-962b-71644cec7ba1\",\r\n \"name\": \"2518701299999999999_817aae2b-84f1-4263-962b-71644cec7ba1\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T11:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"817aae2b-84f1-4263-962b-71644cec7ba1\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"52\",\r\n \"source IPs\": \"121.42.144.51\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T12:01:00.7009573Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701299999999999_a0c5a98d-05c5-49cd-92d8-886a50624907\",\r\n \"name\": \"2518701299999999999_a0c5a98d-05c5-49cd-92d8-886a50624907\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-21T11:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 10)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"a0c5a98d-05c5-49cd-92d8-886a50624907\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"26\",\r\n \"source IPs\": \"121.42.144.51\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T12:01:00.7009573Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701299999999999_ab88a9e6-2608-46b4-9737-29a04dfac51a\",\r\n \"name\": \"2518701299999999999_ab88a9e6-2608-46b4-9737-29a04dfac51a\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"APPLICATION-ATTACK-SQLI\",\r\n \"alertName\": \"APPLICATION-ATTACK-SQLI\",\r\n \"detectedTimeUtc\": \"2018-07-21T11:00:00Z\",\r\n \"description\": \"Detail:Detects classic SQL injection probings 2/2 Matched Data: 'Hello, Peppa!'.(string)(111111111*9 found within ARGS:h: die('Hello, Peppa!'.(string)(111111111*9));\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"ab88a9e6-2608-46b4-9737-29a04dfac51a\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"3\",\r\n \"source IPs\": \"121.42.144.51\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T12:01:00.6832735Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701299999999999_c1f4b92c-84d8-453f-8be9-cbf0b352f979\",\r\n \"name\": \"2518701299999999999_c1f4b92c-84d8-453f-8be9-cbf0b352f979\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"APPLICATION-ATTACK-SQLI\",\r\n \"alertName\": \"APPLICATION-ATTACK-SQLI\",\r\n \"detectedTimeUtc\": \"2018-07-21T11:00:00Z\",\r\n \"description\": \"Detail:Detects classic SQL injection probings 2/2 Matched Data: 'Hello, Peppa!'.(string)(111111111*9 found within ARGS:h: die('Hello, Peppa!'.(string)(111111111*9));\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"c1f4b92c-84d8-453f-8be9-cbf0b352f979\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"121.42.144.51\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T12:01:00.7009573Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701299999999999_c79d022c-71b2-4848-b957-292b8b3c044d\",\r\n \"name\": \"2518701299999999999_c79d022c-71b2-4848-b957-292b8b3c044d\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T11:00:00Z\",\r\n \"description\": \"Detail:HTTP header is restricted by policy (/if/) Restricted header detected: /if/\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"c79d022c-71b2-4848-b957-292b8b3c044d\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"43\",\r\n \"source IPs\": \"121.42.144.51,27.50.17.58\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T12:01:00.7009573Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701299999999999_e696b909-9a88-49f6-8701-e39674d8de6c\",\r\n \"name\": \"2518701299999999999_e696b909-9a88-49f6-8701-e39674d8de6c\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"METHOD-ENFORCEMENT\",\r\n \"alertName\": \"METHOD-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T11:00:00Z\",\r\n \"description\": \"Detail:Method is not allowed by policy PROPFIND\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"e696b909-9a88-49f6-8701-e39674d8de6c\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"121.42.144.51\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T12:01:00.7009573Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701335999999999_1bc8adcf-dfb9-45ce-a9d3-c149fb16ddd8\",\r\n \"name\": \"2518701335999999999_1bc8adcf-dfb9-45ce-a9d3-c149fb16ddd8\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T10:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"1bc8adcf-dfb9-45ce-a9d3-c149fb16ddd8\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"2.181.5.78\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T11:00:47.7797168Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701371999999999_0b24e337-7d25-4edc-b37a-a157d3bfa772\",\r\n \"name\": \"2518701371999999999_0b24e337-7d25-4edc-b37a-a157d3bfa772\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T09:00:00Z\",\r\n \"description\": \"Detail:Request Missing a Host Header\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"0b24e337-7d25-4edc-b37a-a157d3bfa772\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"196.52.43.118\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T10:00:35.5407164Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701407999999999_12d37f38-b96d-4b18-850c-42276aae7958\",\r\n \"name\": \"2518701407999999999_12d37f38-b96d-4b18-850c-42276aae7958\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T08:00:00Z\",\r\n \"description\": \"Detail:Request Missing a Host Header\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"12d37f38-b96d-4b18-850c-42276aae7958\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"31.184.194.109\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T09:00:22.8549175Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701407999999999_24071074-fc4c-4fcc-a078-ca9e6aade4e9\",\r\n \"name\": \"2518701407999999999_24071074-fc4c-4fcc-a078-ca9e6aade4e9\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-21T08:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 5)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"24071074-fc4c-4fcc-a078-ca9e6aade4e9\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"139.162.108.53\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T09:00:23.5834339Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701407999999999_40787c98-ef15-46a5-85b8-511aef51a160\",\r\n \"name\": \"2518701407999999999_40787c98-ef15-46a5-85b8-511aef51a160\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T08:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"40787c98-ef15-46a5-85b8-511aef51a160\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"4\",\r\n \"source IPs\": \"139.162.108.53,50.253.82.125,37.63.244.95\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T09:00:23.5834339Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701515999999999_2304fd1f-039c-4502-b410-8b3c4734212c\",\r\n \"name\": \"2518701515999999999_2304fd1f-039c-4502-b410-8b3c4734212c\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T05:00:00Z\",\r\n \"description\": \"Detail:Request Missing a Host Header\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"2304fd1f-039c-4502-b410-8b3c4734212c\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"3\",\r\n \"source IPs\": \"218.212.132.104,60.12.252.18\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T06:00:36.6133095Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701515999999999_690cb961-1bd7-4c77-8c2c-860dea35d4d5\",\r\n \"name\": \"2518701515999999999_690cb961-1bd7-4c77-8c2c-860dea35d4d5\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T05:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"690cb961-1bd7-4c77-8c2c-860dea35d4d5\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"134.236.136.72\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T06:00:36.1101988Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701515999999999_e936f002-033b-451a-8d59-fc65b1d8fc49\",\r\n \"name\": \"2518701515999999999_e936f002-033b-451a-8d59-fc65b1d8fc49\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-21T05:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 5)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"e936f002-033b-451a-8d59-fc65b1d8fc49\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"218.212.132.104\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T06:00:36.6133095Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701587999999999_bcf686a2-7c23-4b39-8875-360d6f3fc481\",\r\n \"name\": \"2518701587999999999_bcf686a2-7c23-4b39-8875-360d6f3fc481\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T03:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"bcf686a2-7c23-4b39-8875-360d6f3fc481\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"2\",\r\n \"source IPs\": \"103.215.202.159,103.84.165.160\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T04:00:03.3277807Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701623999999999_55a22930-e3bd-498d-8ef4-a8ceaed812f9\",\r\n \"name\": \"2518701623999999999_55a22930-e3bd-498d-8ef4-a8ceaed812f9\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T02:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"55a22930-e3bd-498d-8ef4-a8ceaed812f9\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"118.69.37.227\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T03:00:51.205123Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701623999999999_d05e0347-0629-4297-95fd-2e0e954c451e\",\r\n \"name\": \"2518701623999999999_d05e0347-0629-4297-95fd-2e0e954c451e\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T02:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"d05e0347-0629-4297-95fd-2e0e954c451e\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"2\",\r\n \"source IPs\": \"36.67.134.219,46.37.87.82\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T03:00:50.6869343Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701659999999999_fffcccf7-6a83-4d55-aad2-898495fe6f84\",\r\n \"name\": \"2518701659999999999_fffcccf7-6a83-4d55-aad2-898495fe6f84\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T01:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"fffcccf7-6a83-4d55-aad2-898495fe6f84\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"38.99.116.168\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T02:00:38.5866699Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701695999999999_9640cdc3-d150-4df8-bb31-3be8df5770cf\",\r\n \"name\": \"2518701695999999999_9640cdc3-d150-4df8-bb31-3be8df5770cf\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T00:00:00Z\",\r\n \"description\": \"Detail:Request Missing a Host Header\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"9640cdc3-d150-4df8-bb31-3be8df5770cf\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"31.184.194.109\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T01:00:26.7945459Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701695999999999_9a6a9735-9568-41e8-8c2a-83ecad89270a\",\r\n \"name\": \"2518701695999999999_9a6a9735-9568-41e8-8c2a-83ecad89270a\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-21T00:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"9a6a9735-9568-41e8-8c2a-83ecad89270a\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"41.215.247.18\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T01:00:26.1334178Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701731999999999_0c5d9191-9d6b-450b-a6ac-7017be17b363\",\r\n \"name\": \"2518701731999999999_0c5d9191-9d6b-450b-a6ac-7017be17b363\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"APPLICATION-ATTACK-LFI\",\r\n \"alertName\": \"APPLICATION-ATTACK-LFI\",\r\n \"detectedTimeUtc\": \"2018-07-20T23:00:00Z\",\r\n \"description\": \"Detail:Restricted File Access Attempt Matched Data: /.git/ found within REQUEST_FILENAME: /.git/HEAD\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"bc09060f-3280-4734-a595-310679b63b8f.cloudapp.net\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"0c5d9191-9d6b-450b-a6ac-7017be17b363\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"13.77.149.254\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T00:00:13.048378Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701731999999999_0f250fc8-8fbb-4157-a358-f30eb8cf5d99\",\r\n \"name\": \"2518701731999999999_0f250fc8-8fbb-4157-a358-f30eb8cf5d99\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-20T23:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 7)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"bc09060f-3280-4734-a595-310679b63b8f.cloudapp.net\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"0f250fc8-8fbb-4157-a358-f30eb8cf5d99\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"16\",\r\n \"source IPs\": \"13.77.149.254\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T00:00:13.048378Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701731999999999_400450a5-3d6c-4fbd-9fbe-edf68f97350d\",\r\n \"name\": \"2518701731999999999_400450a5-3d6c-4fbd-9fbe-edf68f97350d\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-20T23:00:00Z\",\r\n \"description\": \"Detail:Request Missing a Host Header\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"400450a5-3d6c-4fbd-9fbe-edf68f97350d\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"4\",\r\n \"source IPs\": \"13.77.149.254\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T00:00:13.048378Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701731999999999_54d3c2fb-73d8-46a5-a198-6cd3ae9f8e75\",\r\n \"name\": \"2518701731999999999_54d3c2fb-73d8-46a5-a198-6cd3ae9f8e75\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"APPLICATION-ATTACK-SQLI\",\r\n \"alertName\": \"APPLICATION-ATTACK-SQLI\",\r\n \"detectedTimeUtc\": \"2018-07-20T23:00:00Z\",\r\n \"description\": \"Detail:SQL Injection Attack: SQL Tautology Detected. Matched Data: methodName>system found within ARGS_NAMES: system.listMethods : system.listMethods \",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"bc09060f-3280-4734-a595-310679b63b8f.cloudapp.net\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"54d3c2fb-73d8-46a5-a198-6cd3ae9f8e75\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"2\",\r\n \"source IPs\": \"13.77.149.254\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T00:00:13.048378Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701731999999999_71c861ce-a7d2-494b-b097-312f8cf198aa\",\r\n \"name\": \"2518701731999999999_71c861ce-a7d2-494b-b097-312f8cf198aa\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"METHOD-ENFORCEMENT\",\r\n \"alertName\": \"METHOD-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-20T23:00:00Z\",\r\n \"description\": \"Detail:Method is not allowed by policy PROPFIND\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"bc09060f-3280-4734-a595-310679b63b8f.cloudapp.net\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"71c861ce-a7d2-494b-b097-312f8cf198aa\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"13.77.149.254\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T00:00:13.048378Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701731999999999_7fad5902-eb76-48c0-8c3b-35fef959c674\",\r\n \"name\": \"2518701731999999999_7fad5902-eb76-48c0-8c3b-35fef959c674\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"METHOD-ENFORCEMENT\",\r\n \"alertName\": \"METHOD-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-20T23:00:00Z\",\r\n \"description\": \"Detail:Method is not allowed by policy INVALID\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"bc09060f-3280-4734-a595-310679b63b8f.cloudapp.net\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"7fad5902-eb76-48c0-8c3b-35fef959c674\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"3\",\r\n \"source IPs\": \"13.77.149.254\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T00:00:13.048378Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701731999999999_bce6b1c8-ecfa-4778-99ef-9b2388e29d00\",\r\n \"name\": \"2518701731999999999_bce6b1c8-ecfa-4778-99ef-9b2388e29d00\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"SCANNER-DETECTION\",\r\n \"alertName\": \"SCANNER-DETECTION\",\r\n \"detectedTimeUtc\": \"2018-07-20T23:00:00Z\",\r\n \"description\": \"Detail:Found User-Agent associated with security scanner Matched Data: nmap scripting engine found within REQUEST_HEADERS:User-Agent: Mozilla/5.0 (compatible; Nmap Scripting Engine; https://nmap.org/book/nse.html)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"bc09060f-3280-4734-a595-310679b63b8f.cloudapp.net\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"bce6b1c8-ecfa-4778-99ef-9b2388e29d00\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"16\",\r\n \"source IPs\": \"13.77.149.254\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T00:00:13.048378Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701731999999999_c1f38f4b-923d-41ba-8d68-f6101a79c160\",\r\n \"name\": \"2518701731999999999_c1f38f4b-923d-41ba-8d68-f6101a79c160\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-20T23:00:00Z\",\r\n \"description\": \"Detail:Request Missing an Accept Header\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"bc09060f-3280-4734-a595-310679b63b8f.cloudapp.net\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"c1f38f4b-923d-41ba-8d68-f6101a79c160\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"9\",\r\n \"source IPs\": \"13.77.149.254\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T00:00:13.048378Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701731999999999_d1a82508-5af4-44f0-9199-3963a9da6438\",\r\n \"name\": \"2518701731999999999_d1a82508-5af4-44f0-9199-3963a9da6438\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-20T23:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 5)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"bc09060f-3280-4734-a595-310679b63b8f.cloudapp.net\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"d1a82508-5af4-44f0-9199-3963a9da6438\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"16\",\r\n \"source IPs\": \"13.77.149.254\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T00:00:11.9175688Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701731999999999_e155315a-b2dc-47a6-a1bd-910708b35d3f\",\r\n \"name\": \"2518701731999999999_e155315a-b2dc-47a6-a1bd-910708b35d3f\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"SCANNER-DETECTION\",\r\n \"alertName\": \"SCANNER-DETECTION\",\r\n \"detectedTimeUtc\": \"2018-07-20T23:00:00Z\",\r\n \"description\": \"Detail:Found User-Agent associated with security scanner Matched Data: nmap scripting engine found within REQUEST_HEADERS:User-Agent: Mozilla/5.0 (compatible; Nmap Scripting Engine; https://nmap.org/book/nse.html)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"bc09060f-3280-4734-a595-310679b63b8f.cloudapp.net\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"e155315a-b2dc-47a6-a1bd-910708b35d3f\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"16\",\r\n \"source IPs\": \"13.77.149.254\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T00:00:13.048378Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701731999999999_e3d4f27b-cd47-411c-9d19-b48facc5b727\",\r\n \"name\": \"2518701731999999999_e3d4f27b-cd47-411c-9d19-b48facc5b727\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-20T23:00:00Z\",\r\n \"description\": \"Detail:Request Missing an Accept Header\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"bc09060f-3280-4734-a595-310679b63b8f.cloudapp.net\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"e3d4f27b-cd47-411c-9d19-b48facc5b727\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"13\",\r\n \"source IPs\": \"13.77.149.254\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T00:00:13.048378Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701731999999999_fbcebcd0-be2a-494c-9622-afb3b95953fa\",\r\n \"name\": \"2518701731999999999_fbcebcd0-be2a-494c-9622-afb3b95953fa\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-20T23:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 5)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"fbcebcd0-be2a-494c-9622-afb3b95953fa\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"2\",\r\n \"source IPs\": \"13.77.149.254\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-21T00:00:13.048378Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701803999999999_14d6910e-aa9d-400c-b7b7-84de18536a0b\",\r\n \"name\": \"2518701803999999999_14d6910e-aa9d-400c-b7b7-84de18536a0b\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-20T21:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"14d6910e-aa9d-400c-b7b7-84de18536a0b\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"4\",\r\n \"source IPs\": \"54.198.105.197,54.198.248.84\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-20T22:00:47.4957481Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701803999999999_1bc66ee9-7f73-4a3e-865a-287657eac246\",\r\n \"name\": \"2518701803999999999_1bc66ee9-7f73-4a3e-865a-287657eac246\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-20T21:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 5)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"1bc66ee9-7f73-4a3e-865a-287657eac246\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"2\",\r\n \"source IPs\": \"54.198.105.197,54.198.248.84\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-20T22:00:46.6891774Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701803999999999_dfd2c8af-a7da-43ea-9f57-eb3ed68cf601\",\r\n \"name\": \"2518701803999999999_dfd2c8af-a7da-43ea-9f57-eb3ed68cf601\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-20T21:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"dfd2c8af-a7da-43ea-9f57-eb3ed68cf601\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"3\",\r\n \"source IPs\": \"216.10.138.155,78.85.48.129,131.221.192.165\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-20T22:00:47.4957481Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701839999999999_65c9b5e8-1262-4359-b1ab-600bc391c496\",\r\n \"name\": \"2518701839999999999_65c9b5e8-1262-4359-b1ab-600bc391c496\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-20T20:00:00Z\",\r\n \"description\": \"Detail:Request Missing a Host Header\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"65c9b5e8-1262-4359-b1ab-600bc391c496\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"4\",\r\n \"source IPs\": \"101.235.30.239,78.111.242.68,41.223.227.17\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-20T21:00:34.6548148Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701839999999999_6b7d11c3-ef18-4e33-8c86-3d0aa46dbb9b\",\r\n \"name\": \"2518701839999999999_6b7d11c3-ef18-4e33-8c86-3d0aa46dbb9b\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-20T20:00:00Z\",\r\n \"description\": \"Detail:Request Missing a Host Header\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"6b7d11c3-ef18-4e33-8c86-3d0aa46dbb9b\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"2\",\r\n \"source IPs\": \"77.78.61.127\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-20T21:00:34.6548148Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701839999999999_cb04e114-1307-496c-85da-54d9b9e8eb3a\",\r\n \"name\": \"2518701839999999999_cb04e114-1307-496c-85da-54d9b9e8eb3a\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-20T20:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 5)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"cb04e114-1307-496c-85da-54d9b9e8eb3a\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"77.78.61.127\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-20T21:00:34.1930007Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701839999999999_f28bb306-b53a-4ddb-b791-8d933a37d1e9\",\r\n \"name\": \"2518701839999999999_f28bb306-b53a-4ddb-b791-8d933a37d1e9\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-20T20:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 5)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"f28bb306-b53a-4ddb-b791-8d933a37d1e9\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"101.235.30.239\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-20T21:00:34.6548148Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701875999999999_095afcfe-df36-4adc-b210-7fa9a7608260\",\r\n \"name\": \"2518701875999999999_095afcfe-df36-4adc-b210-7fa9a7608260\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-20T19:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"095afcfe-df36-4adc-b210-7fa9a7608260\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"187.60.43.42\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-20T20:00:24.851972Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701875999999999_a2ecae5e-e510-4f98-91e6-5efa6e73d93e\",\r\n \"name\": \"2518701875999999999_a2ecae5e-e510-4f98-91e6-5efa6e73d93e\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-20T19:00:00Z\",\r\n \"description\": \"Detail:Request Missing a Host Header\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"a2ecae5e-e510-4f98-91e6-5efa6e73d93e\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"45.56.90.98\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-20T20:00:24.851972Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701983999999999_6061c378-5d95-46e7-8622-eb004b363125\",\r\n \"name\": \"2518701983999999999_6061c378-5d95-46e7-8622-eb004b363125\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-20T16:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"6061c378-5d95-46e7-8622-eb004b363125\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"2\",\r\n \"source IPs\": \"159.255.160.226,45.237.156.12\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-20T17:00:33.9371973Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518701983999999999_bc49a067-3bab-4ed4-aae6-c62fb126b89e\",\r\n \"name\": \"2518701983999999999_bc49a067-3bab-4ed4-aae6-c62fb126b89e\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-20T16:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117:80\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"bc49a067-3bab-4ed4-aae6-c62fb126b89e\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"69.85.94.222\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-20T17:00:34.5189337Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518702019999999999_0cfa44a2-ea36-478e-a0b4-8504e4aedc23\",\r\n \"name\": \"2518702019999999999_0cfa44a2-ea36-478e-a0b4-8504e4aedc23\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"BLOCKING-EVALUATION\",\r\n \"alertName\": \"BLOCKING-EVALUATION\",\r\n \"detectedTimeUtc\": \"2018-07-20T15:00:00Z\",\r\n \"description\": \"Detail:Mandatory rule. Cannot be disabled. Inbound Anomaly Score Exceeded (Total Score: 8)\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.5\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"0cfa44a2-ea36-478e-a0b4-8504e4aedc23\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"1\",\r\n \"source IPs\": \"94.102.49.193\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-20T16:00:15.0505023Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/westeurope/alerts/2518702019999999999_461ff686-36da-4875-ae97-490bd3fb07a1\",\r\n \"name\": \"2518702019999999999_461ff686-36da-4875-ae97-490bd3fb07a1\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"systemSource\": \"Azure\",\r\n \"vendorName\": \"Microsoft WAF\",\r\n \"alertDisplayName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"alertName\": \"PROTOCOL-ENFORCEMENT\",\r\n \"detectedTimeUtc\": \"2018-07-20T15:00:00Z\",\r\n \"description\": \"Detail:Host header is a numeric IP address 13.69.131.117\",\r\n \"remediationSteps\": \"\",\r\n \"actionTaken\": \"Detected\",\r\n \"reportedSeverity\": \"Low\",\r\n \"compromisedEntity\": \"10.1.0.4\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"461ff686-36da-4875-ae97-490bd3fb07a1\",\r\n \"extendedProperties\": {\r\n \"hit Count\": \"4\",\r\n \"source IPs\": \"94.102.49.193\",\r\n \"management URL\": \"https://portal.azure.com#resource/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/applicationGateways/ContosoWAF/overview\",\r\n \"resourceType\": \"Networking\"\r\n },\r\n \"state\": \"Active\",\r\n \"reportedTimeUtc\": \"2018-07-20T16:00:15.0505023Z\",\r\n \"workspaceArmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-eus\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n }\r\n ],\r\n \"nextLink\": \"https://management.azure.com/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/alerts?api-version=2015-06-01-preview&%24skiptoken=TY%2fLkqIwAEX%2fhcXskARBxaquqdEKjE4DGpOg7BJIt0FeEhSlq%2f99XMxi1ufWuXW%2bjFo%2b%2bndVX7Sx%2fDISdCCI4niHjKVx7vtWLy2r4jX%2flJWs%2bwkfb52cZE21dJyppW9CZ51qe9XU2nIWcyGchWsKVwDTmUNpehnITQjmcD6D9sdi5llt19xVLjtthSrrGt189JODzG6d6p8WL2XX65%2b8Veb9NXlZ32wAXRPMTADNtpN3JYcf%2bqJa0lxk%2fSaf2zg9ngEN%2fGcelIAn3u1gM3dTNCo8IBCv%2fRgH2ZgkcBsiD7EjTnmZtoSGQ4jcGa4eIQseV0JznCNI9ySKWBA%2bCcN%2fBPVQQqh6X%2f%2f7qLzpf%2b5ppPyIl8whABc5gNf98bxjgYYE4i6iHuUj27HicySXPBbIpem44vvx10DI1pf0Qekx5xhBkDC8ymHphr%2fLmAE6vjiOkHs9jTiSJeo3alCkYk7u4%2fOpepSk8vv0sJmJmmmxHhR7tac2AyTwitMRt8J2VFysPOP7%2by8%3d\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:47 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-original-request-ids": [ + "ff663681-cabe-47a6-8f50-cf2329cb31a0", + "6b299f01-780c-4cd1-b913-0ae1623f74eb" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-request-id": [ + "66000a4a-766e-48af-9660-40b8ed4f50f0" + ], + "x-ms-correlation-request-id": [ + "66000a4a-766e-48af-9660-40b8ed4f50f0" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125247Z:66000a4a-766e-48af-9660-40b8ed4f50f0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityAlertsTests/SecurityAlerts_ListByResourceGroup.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityAlertsTests/SecurityAlerts_ListByResourceGroup.json new file mode 100644 index 000000000000..782d754336b9 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityAlertsTests/SecurityAlerts_ListByResourceGroup.json @@ -0,0 +1,70 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/RSG/providers/Microsoft.Security/alerts?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Jlc291cmNlR3JvdXBzL1JTRy9wcm92aWRlcnMvTWljcm9zb2Z0LlNlY3VyaXR5L2FsZXJ0cz9hcGktdmVyc2lvbj0yMDE1LTA2LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "2976451c-6ae0-4479-a999-b78195701ca3" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/RSG/providers/Microsoft.Security/locations/centralus/alerts/2518710774294070750_FFF23C70-80EF-4A8B-9122-507B0EA8DFFF\",\r\n \"name\": \"2518710774294070750_FFF23C70-80EF-4A8B-9122-507B0EA8DFFF\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"vendorName\": \"Microsoft\",\r\n \"alertDisplayName\": \"PREVIEW - Vulnerability scanner detected\",\r\n \"alertName\": \"APPS_WpScanner\",\r\n \"detectedTimeUtc\": \"2018-07-10T11:49:30.5929249Z\",\r\n \"description\": \"Azure App Services activity log indicates a possible vulnerability scanner usage on your App Service resource.\\r\\nThe suspicious activity detected resembles that of tools targeting WordPress applications.\",\r\n \"remediationSteps\": \"1. If WordPress is installed, make sure that the application is up to date and automatic updates are enabled.\\r\\n2. If only specific IPs should access to the web application, use IP Restrictions (https://docs.microsoft.com/en-us/azure/app-service/app-service-ip-restrictions).\",\r\n \"actionTaken\": \"Undefined\",\r\n \"reportedSeverity\": \"High\",\r\n \"compromisedEntity\": \"testSite1\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/RSG/providers/Microsoft.Web/sites/testSite1\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"fff23c70-80ef-4a8b-9122-507b0ea8dfff\",\r\n \"extendedProperties\": {\r\n \"sample User Agents\": \"WPScan+v2.9.3+(http://wpscan.org)\",\r\n \"last Event Time\": \"6/23/2018 12:18:58 AM\",\r\n \"sample URIs\": \"/wp-config.php.original, /wp-includes/css/editor.min.css, /wp-includes/js/wp-emoji.js, /wp-config.old, /xmlrpc.php, /wp-admin/css/wp-admin-rtl.css, /#wp-config.php#, /wp-includes/js/tinymce/plugins/wplink/plugin.js, /wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js, /wp-admin/js/post.js\",\r\n \"sample Referer\": \"https://www.stone.com.br/\",\r\n \"resourceType\": \"App Service\",\r\n \"end Time UTC\": \"2018-07-10T11:54:30.5929249Z\"\r\n },\r\n \"state\": \"Dismissed\",\r\n \"reportedTimeUtc\": \"2018-07-10T16:31:52.4195616Z\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n }\r\n ],\r\n \"nextLink\": \"https://management.azure.com/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/RSG/providers/Microsoft.Security/alerts?api-version=2015-06-01-preview&%24skiptoken=TY%2fLkqIwAEX%2fhcXskARBxaquqdEKjE4DGpKg7AKk2ygvE%2fBBV%2f%2f7uJjFrO%2bpc%2bp%2bGY149O%2byuWhj%2bWWkKCGI4niHjKVx6vtOLy2r5g3%2fFLVo%2bgkfByUmRVsvHWdq6SHXhZJdL9tGW85inufOwjVzNwemM4fC9ApQmhDM4XwG7Y%2fFzLOU0O2gChGodui0hZPA6lR7k6VQ2gploVrdfvSTRBSDkv3T4pVQvf7JO2neXsgr9GYD6JpgZgJodkrcpLj%2f0BfZkfYimjfx3MbZ4QRo4D%2fLoAI89YbEZu7m3MowQSBe%2bzEOijFN4TZEHmIHnPEq6wgN7yFyZ7h%2bhCx4XAktcYkg3ZMoYkH4JAz%2fyamHUkLl%2b%2fpfo%2fam%2f7mnkfQjXjGHAHwuAbzuD6cdCzQkEKuIepSPbMfOnyO5lHGOXJqNK74ff90J2fqCPig9lBwjCFKGVyWs3PB3FTNAx9eOI%2bRejyOORIX6jbxLUjOn9PHpWD8qUvt9lmxmecN0vr5L9vqe2QyQwDsfD7jLbUfG55VnfH%2f%2fBQ%3d%3d\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:48 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-original-request-ids": [ + "1c86cf74-77c9-483b-bad5-f1435586a477", + "c9a8a2eb-2508-4746-9490-395a142f3db3" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-request-id": [ + "d4deba07-baa2-4fdb-9444-3c357c53b6bc" + ], + "x-ms-correlation-request-id": [ + "d4deba07-baa2-4fdb-9444-3c357c53b6bc" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125249Z:d4deba07-baa2-4fdb-9444-3c357c53b6bc" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityAlertsTests/SecurityAlerts_ListResourceGroupLevelAlertsByRegion.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityAlertsTests/SecurityAlerts_ListResourceGroupLevelAlertsByRegion.json new file mode 100644 index 000000000000..8b3e189ee2dc --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityAlertsTests/SecurityAlerts_ListResourceGroupLevelAlertsByRegion.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/RSG/providers/Microsoft.Security/locations/centralus/alerts?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Jlc291cmNlR3JvdXBzL1JTRy9wcm92aWRlcnMvTWljcm9zb2Z0LlNlY3VyaXR5L2xvY2F0aW9ucy9jZW50cmFsdXMvYWxlcnRzP2FwaS12ZXJzaW9uPTIwMTUtMDYtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "e35ea05d-92a3-4b03-b4f9-d35a932ef0a2" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/RSG/providers/Microsoft.Security/locations/centralus/alerts/2518710774294070750_FFF23C70-80EF-4A8B-9122-507B0EA8DFFF\",\r\n \"name\": \"2518710774294070750_FFF23C70-80EF-4A8B-9122-507B0EA8DFFF\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"vendorName\": \"Microsoft\",\r\n \"alertDisplayName\": \"PREVIEW - Vulnerability scanner detected\",\r\n \"alertName\": \"APPS_WpScanner\",\r\n \"detectedTimeUtc\": \"2018-07-10T11:49:30.5929249Z\",\r\n \"description\": \"Azure App Services activity log indicates a possible vulnerability scanner usage on your App Service resource.\\r\\nThe suspicious activity detected resembles that of tools targeting WordPress applications.\",\r\n \"remediationSteps\": \"1. If WordPress is installed, make sure that the application is up to date and automatic updates are enabled.\\r\\n2. If only specific IPs should access to the web application, use IP Restrictions (https://docs.microsoft.com/en-us/azure/app-service/app-service-ip-restrictions).\",\r\n \"actionTaken\": \"Undefined\",\r\n \"reportedSeverity\": \"High\",\r\n \"compromisedEntity\": \"testSite1\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/RSG/providers/Microsoft.Web/sites/testSite1\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"fff23c70-80ef-4a8b-9122-507b0ea8dfff\",\r\n \"extendedProperties\": {\r\n \"sample User Agents\": \"WPScan+v2.9.3+(http://wpscan.org)\",\r\n \"last Event Time\": \"6/23/2018 12:18:58 AM\",\r\n \"sample URIs\": \"/wp-config.php.original, /wp-includes/css/editor.min.css, /wp-includes/js/wp-emoji.js, /wp-config.old, /xmlrpc.php, /wp-admin/css/wp-admin-rtl.css, /#wp-config.php#, /wp-includes/js/tinymce/plugins/wplink/plugin.js, /wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js, /wp-admin/js/post.js\",\r\n \"sample Referer\": \"https://www.stone.com.br/\",\r\n \"resourceType\": \"App Service\",\r\n \"end Time UTC\": \"2018-07-10T11:54:30.5929249Z\"\r\n },\r\n \"state\": \"Dismissed\",\r\n \"reportedTimeUtc\": \"2018-07-10T16:31:52.4195616Z\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:45 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "bb0e5d6d-64e0-4d85-a86c-7a8dca971d27" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-correlation-request-id": [ + "aae3d8fc-9cbb-41c5-a059-211b28d6d4ac" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125246Z:aae3d8fc-9cbb-41c5-a059-211b28d6d4ac" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityAlertsTests/SecurityAlerts_ListSubscriptionLevelAlertsByRegion.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityAlertsTests/SecurityAlerts_ListSubscriptionLevelAlertsByRegion.json new file mode 100644 index 000000000000..c48a35a667ce --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityAlertsTests/SecurityAlerts_ListSubscriptionLevelAlertsByRegion.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/alerts?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvbG9jYXRpb25zL2NlbnRyYWx1cy9hbGVydHM/YXBpLXZlcnNpb249MjAxNS0wNi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "a9ad0ac4-7efc-40df-b3d6-2d4d225fbcc6" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/RSG/providers/Microsoft.Security/locations/centralus/alerts/2518710774294070750_FFF23C70-80EF-4A8B-9122-507B0EA8DFFF\",\r\n \"name\": \"2518710774294070750_FFF23C70-80EF-4A8B-9122-507B0EA8DFFF\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"vendorName\": \"Microsoft\",\r\n \"alertDisplayName\": \"PREVIEW - Vulnerability scanner detected\",\r\n \"alertName\": \"APPS_WpScanner\",\r\n \"detectedTimeUtc\": \"2018-07-10T11:49:30.5929249Z\",\r\n \"description\": \"Azure App Services activity log indicates a possible vulnerability scanner usage on your App Service resource.\\r\\nThe suspicious activity detected resembles that of tools targeting WordPress applications.\",\r\n \"remediationSteps\": \"1. If WordPress is installed, make sure that the application is up to date and automatic updates are enabled.\\r\\n2. If only specific IPs should access to the web application, use IP Restrictions (https://docs.microsoft.com/en-us/azure/app-service/app-service-ip-restrictions).\",\r\n \"actionTaken\": \"Undefined\",\r\n \"reportedSeverity\": \"High\",\r\n \"compromisedEntity\": \"testSite1\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/RSG/providers/Microsoft.Web/sites/testSite1\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"fff23c70-80ef-4a8b-9122-507b0ea8dfff\",\r\n \"extendedProperties\": {\r\n \"sample User Agents\": \"WPScan+v2.9.3+(http://wpscan.org)\",\r\n \"last Event Time\": \"6/23/2018 12:18:58 AM\",\r\n \"sample URIs\": \"/wp-config.php.original, /wp-includes/css/editor.min.css, /wp-includes/js/wp-emoji.js, /wp-config.old, /xmlrpc.php, /wp-admin/css/wp-admin-rtl.css, /#wp-config.php#, /wp-includes/js/tinymce/plugins/wplink/plugin.js, /wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js, /wp-admin/js/post.js\",\r\n \"sample Referer\": \"https://www.stone.com.br/\",\r\n \"resourceType\": \"App Service\",\r\n \"end Time UTC\": \"2018-07-10T11:54:30.5929249Z\"\r\n },\r\n \"state\": \"Dismissed\",\r\n \"reportedTimeUtc\": \"2018-07-10T16:31:52.4195616Z\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/alerts/2518710774894070750_EEE23C70-80EF-4A8B-9122-507B0EA8DFFF\",\r\n \"name\": \"2518710774894070750_EEE23C70-80EF-4A8B-9122-507B0EA8DFFF\",\r\n \"type\": \"Microsoft.Security/Locations/alerts\",\r\n \"properties\": {\r\n \"vendorName\": \"Microsoft\",\r\n \"alertDisplayName\": \"PREVIEW - Spam folder referrer detected\",\r\n \"alertName\": \"APPS_SpamReferrer\",\r\n \"detectedTimeUtc\": \"2018-07-10T11:48:30Z\",\r\n \"description\": \"Azure App Services activity log indicates web activity that was identified as originating from a web site associated with SPAM activity.\\r\\nThis could occur if your web site is compromised and used for spam activity.\",\r\n \"remediationSteps\": \"Review the URIs in the alert details. Check whether the corresponding files contain malicious or suspicious content. \\r\\nIf they do, escalate the alert to the information security team.\",\r\n \"actionTaken\": \"Undefined\",\r\n \"reportedSeverity\": \"High\",\r\n \"compromisedEntity\": \"testSite2\",\r\n \"associatedResource\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Web/sites/testSite2\",\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"instanceId\": \"eee23c70-80ef-4a8b-9122-507b0ea8dfff\",\r\n \"extendedProperties\": {\r\n \"sample User Agents\": \"Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1)\",\r\n \"last Event Time\": \"6/23/2018 4:53:58 PM\",\r\n \"sample URIs\": \"/acropolis.php, /wp-content/animator.php, /bandpass.php, /wp-content/base.php, /candid.php, /wp-content/uploads/2018/christina.php, /wp-content/climax.php, /wp-content/uploads/conditioning.php, /wp-content/corkscrew.php, /wp-content/uploads/2018/countermeasures.php\",\r\n \"sample Referer\": \"https://google.com/mail/inbox/spam/\",\r\n \"resourceType\": \"App Service\",\r\n \"end Time UTC\": \"2018-07-10T11:53:30.5929249Z\"\r\n },\r\n \"state\": \"Dismissed\",\r\n \"reportedTimeUtc\": \"2018-07-10T16:31:52Z\",\r\n \"confidenceReasons\": [],\r\n \"canBeInvestigated\": true,\r\n \"entities\": []\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:48 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "88494d79-a087-4f5f-8c1f-62287947cded" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-correlation-request-id": [ + "40ca9d62-514b-493c-856c-a505379f0d5a" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125248Z:40ca9d62-514b-493c-856c-a505379f0d5a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityAlertsTests/SecurityAlerts_UpdateResourceGroupLevelAlertState.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityAlertsTests/SecurityAlerts_UpdateResourceGroupLevelAlertState.json new file mode 100644 index 000000000000..085163a1be9a --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityAlertsTests/SecurityAlerts_UpdateResourceGroupLevelAlertState.json @@ -0,0 +1,63 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/RSG/providers/Microsoft.Security/locations/centralus/alerts/2518710774294070750_FFF23C70-80EF-4A8B-9122-507B0EA8DFFF/Dismiss?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Jlc291cmNlR3JvdXBzL1JTRy9wcm92aWRlcnMvTWljcm9zb2Z0LlNlY3VyaXR5L2xvY2F0aW9ucy9jZW50cmFsdXMvYWxlcnRzLzI1MTg3MTA3NzQyOTQwNzA3NTBfRkZGMjNDNzAtODBFRi00QThCLTkxMjItNTA3QjBFQThERkZGL0Rpc21pc3M/YXBpLXZlcnNpb249MjAxNS0wNi0wMS1wcmV2aWV3", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "07964606-6f05-4e81-b9a5-4a4886f71115" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:44 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-request-id": [ + "46f6d7d7-9128-48aa-962b-aabbb4b7e19f" + ], + "x-ms-correlation-request-id": [ + "46f6d7d7-9128-48aa-962b-aabbb4b7e19f" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125244Z:46f6d7d7-9128-48aa-962b-aabbb4b7e19f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 204 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityAlertsTests/SecurityAlerts_UpdateSubscriptionLevelAlertState.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityAlertsTests/SecurityAlerts_UpdateSubscriptionLevelAlertState.json new file mode 100644 index 000000000000..1dce495306e7 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityAlertsTests/SecurityAlerts_UpdateSubscriptionLevelAlertState.json @@ -0,0 +1,63 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/alerts/2518710774894070750_EEE23C70-80EF-4A8B-9122-507B0EA8DFFF/Dismiss?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvbG9jYXRpb25zL2NlbnRyYWx1cy9hbGVydHMvMjUxODcxMDc3NDg5NDA3MDc1MF9FRUUyM0M3MC04MEVGLTRBOEItOTEyMi01MDdCMEVBOERGRkYvRGlzbWlzcz9hcGktdmVyc2lvbj0yMDE1LTA2LTAxLXByZXZpZXc=", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "a71be648-3c75-46cf-9d18-18ecff8d1afc" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:49 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "79aafcf1-e7ac-4d01-bb5b-44b04f77f44b" + ], + "x-ms-correlation-request-id": [ + "79aafcf1-e7ac-4d01-bb5b-44b04f77f44b" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125250Z:79aafcf1-e7ac-4d01-bb5b-44b04f77f44b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 204 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityContactsTests/SecurityContacts_Create.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityContactsTests/SecurityContacts_Create.json new file mode 100644 index 000000000000..c35a14f14611 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityContactsTests/SecurityContacts_Create.json @@ -0,0 +1,78 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/securityContacts/default2?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvc2VjdXJpdHlDb250YWN0cy9kZWZhdWx0Mj9hcGktdmVyc2lvbj0yMDE3LTA4LTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"email\": \"barbra@contoso.com\",\r\n \"phone\": \"\",\r\n \"alertNotifications\": \"Off\",\r\n \"alertsToAdmins\": \"Off\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "145" + ], + "x-ms-client-request-id": [ + "dc9cd1c9-c5b8-4464-8a68-36cf5642d933" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/securityContacts/default2\",\r\n \"name\": \"default2\",\r\n \"type\": \"Microsoft.Security/securityContacts\",\r\n \"properties\": {\r\n \"email\": \"barbra@contoso.com\",\r\n \"alertNotifications\": \"Off\",\r\n \"alertsToAdmins\": \"Off\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:26 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "833f31a7-48bb-4f5e-b7b3-07bb39647121" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "249" + ], + "x-ms-correlation-request-id": [ + "5bd227d6-f2b7-402c-9b42-7944febf67de" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125227Z:5bd227d6-f2b7-402c-9b42-7944febf67de" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityContactsTests/SecurityContacts_Delete.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityContactsTests/SecurityContacts_Delete.json new file mode 100644 index 000000000000..d5008d4b7889 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityContactsTests/SecurityContacts_Delete.json @@ -0,0 +1,63 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/securityContacts/default2?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvc2VjdXJpdHlDb250YWN0cy9kZWZhdWx0Mj9hcGktdmVyc2lvbj0yMDE3LTA4LTAxLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "ae9de5ed-3666-41ff-8c88-3dea275a7c27" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:29 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "96a56f95-1747-4665-b865-49ad7576cc93" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-correlation-request-id": [ + "bdb759bb-9717-4fab-bfa0-41cba41f4486" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125229Z:bdb759bb-9717-4fab-bfa0-41cba41f4486" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 204 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityContactsTests/SecurityContacts_Get.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityContactsTests/SecurityContacts_Get.json new file mode 100644 index 000000000000..c6811f4d6365 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityContactsTests/SecurityContacts_Get.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/securityContacts/default2?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvc2VjdXJpdHlDb250YWN0cy9kZWZhdWx0Mj9hcGktdmVyc2lvbj0yMDE3LTA4LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "479c76f2-ca7b-499e-930c-6647243e8730" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/securityContacts/default2\",\r\n \"name\": \"default2\",\r\n \"type\": \"Microsoft.Security/securityContacts\",\r\n \"properties\": {\r\n \"email\": \"barbra@contoso.com\",\r\n \"alertNotifications\": \"Off\",\r\n \"alertsToAdmins\": \"Off\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:27 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "9c4f831a-c779-4754-a571-68ef938e7577" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-correlation-request-id": [ + "9471bc39-96d3-4661-8adb-9ebe9597944c" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125227Z:9471bc39-96d3-4661-8adb-9ebe9597944c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityContactsTests/SecurityContacts_List.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityContactsTests/SecurityContacts_List.json new file mode 100644 index 000000000000..c5a41631b342 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityContactsTests/SecurityContacts_List.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/securityContacts?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvc2VjdXJpdHlDb250YWN0cz9hcGktdmVyc2lvbj0yMDE3LTA4LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "dfed19f7-aee5-45d5-9f06-1ef58cc1a834" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/securityContacts/default1\",\r\n \"name\": \"default1\",\r\n \"type\": \"Microsoft.Security/securityContacts\",\r\n \"properties\": {\r\n \"email\": \"john@contoso.com\",\r\n \"phone\": \"12312312\",\r\n \"alertNotifications\": \"Off\",\r\n \"alertsToAdmins\": \"Off\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:25 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "17ac5663-8d88-4ca6-86f2-e5ab6b592ecf" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-correlation-request-id": [ + "1158055b-0b7c-4020-9c92-8b86575e9200" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125226Z:1158055b-0b7c-4020-9c92-8b86575e9200" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityContactsTests/SecurityContacts_Update.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityContactsTests/SecurityContacts_Update.json new file mode 100644 index 000000000000..fd328a6c3ea2 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityContactsTests/SecurityContacts_Update.json @@ -0,0 +1,78 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/securityContacts/default2?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvc2VjdXJpdHlDb250YWN0cy9kZWZhdWx0Mj9hcGktdmVyc2lvbj0yMDE3LTA4LTAxLXByZXZpZXc=", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"properties\": {\r\n \"email\": \"barbra@contoso.com\",\r\n \"phone\": \"\",\r\n \"alertNotifications\": \"Off\",\r\n \"alertsToAdmins\": \"Off\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "145" + ], + "x-ms-client-request-id": [ + "f5e459e8-6ab8-4cb0-ae5e-0d7fd701a43e" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/securityContacts/default2\",\r\n \"name\": \"default2\",\r\n \"type\": \"Microsoft.Security/securityContacts\",\r\n \"properties\": {\r\n \"email\": \"barbra@contoso.com\",\r\n \"alertNotifications\": \"Off\",\r\n \"alertsToAdmins\": \"Off\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:27 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "67dae54b-e8f5-4a75-94c0-68d31f11050d" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "249" + ], + "x-ms-correlation-request-id": [ + "96e60fe9-22a6-46d8-823f-6499e374a820" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125228Z:96e60fe9-22a6-46d8-823f-6499e374a820" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityTasksTests/SecurityTaskRecommendations_GetResourceGroupLevelTask.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityTasksTests/SecurityTaskRecommendations_GetResourceGroupLevelTask.json new file mode 100644 index 000000000000..4af658186749 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityTasksTests/SecurityTaskRecommendations_GetResourceGroupLevelTask.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks/dcfb6365-799e-5ed4-f344-d86a0a4c2992?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Jlc291cmNlR3JvdXBzL215U2VydmljZTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TZWN1cml0eS9sb2NhdGlvbnMvY2VudHJhbHVzL3Rhc2tzL2RjZmI2MzY1LTc5OWUtNWVkNC1mMzQ0LWQ4NmEwYTRjMjk5Mj9hcGktdmVyc2lvbj0yMDE1LTA2LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "fc476af3-1be2-4402-84ae-22bfe838219b" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks/dcfb6365-799e-5ed4-f344-d86a0a4c2992\",\r\n \"name\": \"dcfb6365-799e-5ed4-f344-d86a0a4c2992\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Dismissed\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-04T20:23:31.0720338Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-16T11:59:34.5355932Z\",\r\n \"securityTaskParameters\": {\r\n \"inheritServerDefault\": false,\r\n \"serverName\": \"datastore\",\r\n \"databaseName\": \"dataStore\",\r\n \"serverId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore\",\r\n \"databaseId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore/databases/dataStore\",\r\n \"name\": \"Enable auditing for the SQL database\",\r\n \"uniqueKey\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore/databases/dataStore/auditingPolicies/Default\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore/databases/dataStore\"\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:57 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "51a36ab6-5668-4e27-bce7-1a2fba3a3c24" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "99" + ], + "x-ms-correlation-request-id": [ + "9dcd72ca-ae32-4762-a72f-9f076d42b9a5" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125258Z:9dcd72ca-ae32-4762-a72f-9f076d42b9a5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityTasksTests/SecurityTaskRecommendations_GetSubscriptionLevelTask.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityTasksTests/SecurityTaskRecommendations_GetSubscriptionLevelTask.json new file mode 100644 index 000000000000..615e696919a3 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityTasksTests/SecurityTaskRecommendations_GetSubscriptionLevelTask.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/08357a1e-c534-756f-cbb9-7b45e73f3137?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvbG9jYXRpb25zL2NlbnRyYWx1cy90YXNrcy8wODM1N2ExZS1jNTM0LTc1NmYtY2JiOS03YjQ1ZTczZjMxMzc/YXBpLXZlcnNpb249MjAxNS0wNi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "be2b2554-3b1c-4844-b1a5-1ab452691361" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/08357a1e-c534-756f-cbb9-7b45e73f3137\",\r\n \"name\": \"08357a1e-c534-756f-cbb9-7b45e73f3137\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Dismissed\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-09T17:45:42.7431861Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"7e4d9fe1-eb3f-49ac-bb5b-d417df7e6d6c\",\r\n \"baselineName\": \"Ensure 'Audit User Account Management' is set to 'Success and Failure'\",\r\n \"baselineCceId\": \"CCE-37856-2\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"AuditPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_7e4d9fe1-eb3f-49ac-bb5b-d417df7e6d6c\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:58 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "3d257f56-b9d3-4bf5-9841-c9e47cc532ca" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "99" + ], + "x-ms-correlation-request-id": [ + "ecd4dba6-a8bb-4f32-9f5b-df89fe2ffd8d" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125259Z:ecd4dba6-a8bb-4f32-9f5b-df89fe2ffd8d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityTasksTests/SecurityTaskRecommendations_List.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityTasksTests/SecurityTaskRecommendations_List.json new file mode 100644 index 000000000000..41e8430c5fa7 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityTasksTests/SecurityTaskRecommendations_List.json @@ -0,0 +1,71 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/tasks?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvdGFza3M/YXBpLXZlcnNpb249MjAxNS0wNi0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "553b74cd-c1d9-4fb3-acb7-9f25de5f126a" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/08357a1e-c534-756f-cbb9-7b45e73f3137\",\r\n \"name\": \"08357a1e-c534-756f-cbb9-7b45e73f3137\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Dismissed\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-09T17:45:42.7431861Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"7e4d9fe1-eb3f-49ac-bb5b-d417df7e6d6c\",\r\n \"baselineName\": \"Ensure 'Audit User Account Management' is set to 'Success and Failure'\",\r\n \"baselineCceId\": \"CCE-37856-2\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"AuditPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_7e4d9fe1-eb3f-49ac-bb5b-d417df7e6d6c\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/09ea0fa9-ce5a-d703-e17b-08f1d5246e2c\",\r\n \"name\": \"09ea0fa9-ce5a-d703-e17b-08f1d5246e2c\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-10T20:38:37.8557035Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-10T20:38:37.8557035Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"d9ed5e76-2348-4409-94dd-c76352407fe8\",\r\n \"baselineName\": \"Disable support for RDS.\",\r\n \"baselineCceId\": \"CCE-14027-7\",\r\n \"osName\": \"Linux\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"Command\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/myservice1/providers/microsoft.operationalinsights/workspaces/testservicews\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_d9ed5e76-2348-4409-94dd-c76352407fe8\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/11ff8541-820e-cecc-75de-91be7c0d8419\",\r\n \"name\": \"11ff8541-820e-cecc-75de-91be7c0d8419\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"94cc076f-0e88-4398-ac29-d0dc7170303f\",\r\n \"baselineName\": \"Ensure 'Turn off shell protocol protected mode' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-36809-2\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_94cc076f-0e88-4398-ac29-d0dc7170303f\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/12b4f7f5-0fcd-4f54-afc4-adca05e5e4a5\",\r\n \"name\": \"12b4f7f5-0fcd-4f54-afc4-adca05e5e4a5\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"6ed9ad58-c9de-4a8b-9512-8fe5421ac8a7\",\r\n \"baselineName\": \"Ensure 'Network security: Minimum session security for NTLM SSP based servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption'\",\r\n \"baselineCceId\": \"CCE-37835-6\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_6ed9ad58-c9de-4a8b-9512-8fe5421ac8a7\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/1b2830ce-af40-7034-3077-5606feb66657\",\r\n \"name\": \"1b2830ce-af40-7034-3077-5606feb66657\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"ef0eefbb-e845-47f3-af9a-3409296d3264\",\r\n \"baselineName\": \"Ensure 'Shut down the system' is set to 'Administrators'\",\r\n \"baselineCceId\": \"CCE-38328-1\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_ef0eefbb-e845-47f3-af9a-3409296d3264\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/25af609a-d2a1-ef19-c017-7ef94e84c099\",\r\n \"name\": \"25af609a-d2a1-ef19-c017-7ef94e84c099\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"14afe28a-6199-49ff-9789-dabb89ed714e\",\r\n \"baselineName\": \"Ensure 'Allow Telemetry' is set to 'Enabled: 0 - Security [Enterprise Only]'\",\r\n \"baselineCceId\": \"NOT_ASSIGNED\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_14afe28a-6199-49ff-9789-dabb89ed714e\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/29fc999a-ab2b-b777-a952-2a7e3a89e823\",\r\n \"name\": \"29fc999a-ab2b-b777-a952-2a7e3a89e823\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"8ad78d25-6140-4899-9565-e053ce7d9a66\",\r\n \"baselineName\": \"Ensure 'Network Security: Allow PKU2U authentication requests to this computer to use online identities' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-38047-7\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_8ad78d25-6140-4899-9565-e053ce7d9a66\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/2dcadb92-a1f2-7fa5-d61c-40878caf728b\",\r\n \"name\": \"2dcadb92-a1f2-7fa5-d61c-40878caf728b\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"b2538b69-4020-4d50-9f63-581b673a014c\",\r\n \"baselineName\": \"Ensure 'Turn off Data Execution Prevention for Explorer' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-37809-1\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_b2538b69-4020-4d50-9f63-581b673a014c\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/2e047abc-0fc1-84d0-401c-98850d15fae4\",\r\n \"name\": \"2e047abc-0fc1-84d0-401c-98850d15fae4\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"59a97e33-0055-4209-bdee-78e4510625b1\",\r\n \"baselineName\": \"Ensure 'Enumerate local users on domain-joined computers' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-35894-5\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Informational\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_59a97e33-0055-4209-bdee-78e4510625b1\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/2f993d08-ca16-2317-1d3d-399233feb952\",\r\n \"name\": \"2f993d08-ca16-2317-1d3d-399233feb952\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"5046d960-670d-4fef-973a-cf242a97147e\",\r\n \"baselineName\": \"Ensure 'Audit PNP Activity' is set to 'Success'\",\r\n \"baselineCceId\": \"NOT_ASSIGNED\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"AuditPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_5046d960-670d-4fef-973a-cf242a97147e\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/2fb51211-41b2-4571-3127-bce41d8d2662\",\r\n \"name\": \"2fb51211-41b2-4571-3127-bce41d8d2662\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"99cd4fc9-bcf1-4def-8ce6-5a3c4ea8f8c9\",\r\n \"baselineName\": \"Ensure 'Configure registry policy processing: Do not apply during periodic background processing' is set to 'Enabled: FALSE'\",\r\n \"baselineCceId\": \"CCE-36169-1\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_99cd4fc9-bcf1-4def-8ce6-5a3c4ea8f8c9\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/375e3469-3503-b96d-becf-5ba341f3fb75\",\r\n \"name\": \"375e3469-3503-b96d-becf-5ba341f3fb75\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"45bdfbf8-155f-41f8-b9cf-72f1ba26c5be\",\r\n \"baselineName\": \"Ensure 'Minimum password age' is set to '1 or more day'\",\r\n \"baselineCceId\": \"CCE-37073-4\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_45bdfbf8-155f-41f8-b9cf-72f1ba26c5be\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/38a1c205-5ca2-92c7-de4c-90a46ef37899\",\r\n \"name\": \"38a1c205-5ca2-92c7-de4c-90a46ef37899\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"b88b1d85-5f3c-4235-91ab-6d8b5e767311\",\r\n \"baselineName\": \"Ensure 'Audit Removable Storage' is set to 'Success and Failure'\",\r\n \"baselineCceId\": \"CCE-37617-8\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"AuditPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_b88b1d85-5f3c-4235-91ab-6d8b5e767311\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/3d9f4f1c-8e21-5336-525b-100ea0a67509\",\r\n \"name\": \"3d9f4f1c-8e21-5336-525b-100ea0a67509\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"0b2803c7-33ac-4407-80f0-f09940bbe940\",\r\n \"baselineName\": \"Ensure 'Network security: Allow LocalSystem NULL session fallback' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-37035-3\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_0b2803c7-33ac-4407-80f0-f09940bbe940\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/4c7dcaa2-a0ec-c272-8502-91413024fbc5\",\r\n \"name\": \"4c7dcaa2-a0ec-c272-8502-91413024fbc5\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-10T20:38:37.8557035Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-10T20:38:37.8557035Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"627b7494-0e62-4093-9f77-db8d526d036b\",\r\n \"baselineName\": \"Remove unnecesary accounts\",\r\n \"baselineCceId\": \"CCE-XXXXX-7\",\r\n \"osName\": \"Linux\",\r\n \"severity\": \"Informational\",\r\n \"ruleType\": \"Command\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/myservice1/providers/microsoft.operationalinsights/workspaces/testservicews\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_627b7494-0e62-4093-9f77-db8d526d036b\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/53b1863a-be61-5b29-7327-90a867985dab\",\r\n \"name\": \"53b1863a-be61-5b29-7327-90a867985dab\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"e6eab28a-1dc8-4fb5-b88b-4e10f239e67c\",\r\n \"baselineName\": \"Ensure 'Enumerate administrator accounts on elevation' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-36512-2\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_e6eab28a-1dc8-4fb5-b88b-4e10f239e67c\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/5542d6c4-833c-5f11-4508-1bf22e345b5b\",\r\n \"name\": \"5542d6c4-833c-5f11-4508-1bf22e345b5b\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"b625a003-d015-436e-89fb-fb2dfe71ae0f\",\r\n \"baselineName\": \"Ensure 'Microsoft network server: Digitally sign communications (if client agrees)' is set to 'Enabled'\",\r\n \"baselineCceId\": \"CCE-35988-5\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_b625a003-d015-436e-89fb-fb2dfe71ae0f\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/590548c6-afba-302b-a8de-46947eee7172\",\r\n \"name\": \"590548c6-afba-302b-a8de-46947eee7172\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"967531f7-69cd-4a38-a517-3ebf4e5284cd\",\r\n \"baselineName\": \"Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled'\",\r\n \"baselineCceId\": \"CCE-36494-3\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_967531f7-69cd-4a38-a517-3ebf4e5284cd\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/5d54eff5-62f5-303c-025d-de9de8b1bd64\",\r\n \"name\": \"5d54eff5-62f5-303c-025d-de9de8b1bd64\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"11ca2201-2673-4f04-bad3-3265e1a53a5b\",\r\n \"baselineName\": \"Ensure 'Allow Input Personalization' is set to 'Disabled'\",\r\n \"baselineCceId\": \"NOT_ASSIGNED\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_11ca2201-2673-4f04-bad3-3265e1a53a5b\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/6073bd13-8a48-adcc-3cd5-58762309094c\",\r\n \"name\": \"6073bd13-8a48-adcc-3cd5-58762309094c\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"49258884-b2f0-4a4e-b66a-6954bb8473bf\",\r\n \"baselineName\": \"Ensure 'Deny log on as a batch job' to include 'Guests'\",\r\n \"baselineCceId\": \"CCE-36923-1\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_49258884-b2f0-4a4e-b66a-6954bb8473bf\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/64bd710f-15db-2ffe-1e1a-139a3719d69f\",\r\n \"name\": \"64bd710f-15db-2ffe-1e1a-139a3719d69f\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"abb1bcab-f4da-4a9c-be63-7564a0bca7b8\",\r\n \"baselineName\": \"Ensure 'Allow Basic authentication' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-36254-1\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_abb1bcab-f4da-4a9c-be63-7564a0bca7b8\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/70694bc2-c935-9611-77d5-e22b1c3c0c27\",\r\n \"name\": \"70694bc2-c935-9611-77d5-e22b1c3c0c27\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"f3117bf3-e54a-496a-9976-74b1caca3105\",\r\n \"baselineName\": \"Disable 'Configure local setting override for reporting to Microsoft MAPS'\",\r\n \"baselineCceId\": \"NOT_ASSIGNED\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_f3117bf3-e54a-496a-9976-74b1caca3105\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/73c6161a-f009-b061-e8c5-e58dbce5aec3\",\r\n \"name\": \"73c6161a-f009-b061-e8c5-e58dbce5aec3\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"4f8fd732-facf-4184-a29c-61fdd40db89d\",\r\n \"baselineName\": \"Ensure 'Audit Credential Validation' is set to 'Success and Failure'\",\r\n \"baselineCceId\": \"CCE-37741-6\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"AuditPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_4f8fd732-facf-4184-a29c-61fdd40db89d\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/79a9c0d7-b848-cf94-7368-c54ef15fbf69\",\r\n \"name\": \"79a9c0d7-b848-cf94-7368-c54ef15fbf69\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"2eda113a-0fb7-446c-856a-83e010d36671\",\r\n \"baselineName\": \"Ensure 'Always install with elevated privileges' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-37490-0\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_2eda113a-0fb7-446c-856a-83e010d36671\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/7b5e6fa5-c253-802c-dd73-7b90d3f47254\",\r\n \"name\": \"7b5e6fa5-c253-802c-dd73-7b90d3f47254\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"23d0f843-e7bf-40e9-82cb-6299b35e52ab\",\r\n \"baselineName\": \"Increase a process working set\",\r\n \"baselineCceId\": \"NOT_ASSIGNED\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_23d0f843-e7bf-40e9-82cb-6299b35e52ab\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/82a272c3-ceb6-99bc-3158-fe20c2692b46\",\r\n \"name\": \"82a272c3-ceb6-99bc-3158-fe20c2692b46\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"081da702-ce92-480f-aa68-af49bf5b94db\",\r\n \"baselineName\": \"Enable 'Scan removable drives' by setting DisableRemovableDriveScanning to 0\",\r\n \"baselineCceId\": \"NOT_ASSIGNED\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_081da702-ce92-480f-aa68-af49bf5b94db\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/87c73821-7941-15fe-c0fb-7a58c2abb2a6\",\r\n \"name\": \"87c73821-7941-15fe-c0fb-7a58c2abb2a6\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"fc8a4401-ff7a-4a6d-add4-758acce6b76c\",\r\n \"baselineName\": \"Ensure 'User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode' is set to 'Prompt for consent on the secure desktop'\",\r\n \"baselineCceId\": \"CCE-37029-6\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_fc8a4401-ff7a-4a6d-add4-758acce6b76c\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/88bb4f36-6418-d4dd-64e8-6a4a37f52f8a\",\r\n \"name\": \"88bb4f36-6418-d4dd-64e8-6a4a37f52f8a\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"d43b43ec-abd0-4420-ba8c-d4e53b057205\",\r\n \"baselineName\": \"Ensure 'Maximum password age' is set to '70 or fewer days, but not 0'\",\r\n \"baselineCceId\": \"CCE-37167-4\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_d43b43ec-abd0-4420-ba8c-d4e53b057205\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/8a06b49d-7f85-d6ae-80b4-b3b23e62ffc5\",\r\n \"name\": \"8a06b49d-7f85-d6ae-80b4-b3b23e62ffc5\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"87822480-3af9-4cf1-b0d2-93ceb957b129\",\r\n \"baselineName\": \"Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts and shares' is set to 'Enabled'\",\r\n \"baselineCceId\": \"CCE-36077-6\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_87822480-3af9-4cf1-b0d2-93ceb957b129\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/8a9f5439-66c2-a1f0-8df6-ba4e0e23281f\",\r\n \"name\": \"8a9f5439-66c2-a1f0-8df6-ba4e0e23281f\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"b7432fc2-51ba-4ddf-83dd-ca7f92e670c1\",\r\n \"baselineName\": \"Ensure 'Deny log on locally' to include 'Guests'\",\r\n \"baselineCceId\": \"CCE-37146-8\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_b7432fc2-51ba-4ddf-83dd-ca7f92e670c1\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/8ca17bc4-77f6-b806-8765-c14aa6e2a808\",\r\n \"name\": \"8ca17bc4-77f6-b806-8765-c14aa6e2a808\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"fbe348fd-0402-4e31-8482-66ae9ae82ea2\",\r\n \"baselineName\": \"Configure 'Deny access to this computer from the network'\",\r\n \"baselineCceId\": \"CCE-37954-5\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_fbe348fd-0402-4e31-8482-66ae9ae82ea2\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/92a3251f-3021-4e35-31f8-07cb515ce650\",\r\n \"name\": \"92a3251f-3021-4e35-31f8-07cb515ce650\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"a3344272-491e-4846-a1a6-02f63dac669b\",\r\n \"baselineName\": \"Ensure 'Do not enumerate connected users on domain-joined computers' is set to 'Enabled'\",\r\n \"baselineCceId\": \"CCE-37838-0\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Informational\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_a3344272-491e-4846-a1a6-02f63dac669b\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/9c922ca2-0c95-d04b-ba66-e29da28e684a\",\r\n \"name\": \"9c922ca2-0c95-d04b-ba66-e29da28e684a\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"2a074d39-eee4-4bfe-b1e7-4132c033a762\",\r\n \"baselineName\": \"Ensure 'Network security: Minimum session security for NTLM SSP based clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption'\",\r\n \"baselineCceId\": \"CCE-37553-5\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_2a074d39-eee4-4bfe-b1e7-4132c033a762\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/9d0d9014-a916-e6f7-8627-34fca1d8e510\",\r\n \"name\": \"9d0d9014-a916-e6f7-8627-34fca1d8e510\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"5d42c180-4350-49ec-9bb6-e51e1258022c\",\r\n \"baselineName\": \"Ensure 'Allow user control over installs' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-36400-0\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_5d42c180-4350-49ec-9bb6-e51e1258022c\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/a2e78cfe-f307-0a6e-8a4b-338eb5d15f43\",\r\n \"name\": \"a2e78cfe-f307-0a6e-8a4b-338eb5d15f43\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"357272d2-2018-455e-935c-8777473661dd\",\r\n \"baselineName\": \"Ensure 'Prohibit installation and configuration of Network Bridge on your DNS domain network' is set to 'Enabled'\",\r\n \"baselineCceId\": \"CCE-38002-2\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_357272d2-2018-455e-935c-8777473661dd\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/aac8faf5-e831-bbf6-eccb-4c8f8a4d8654\",\r\n \"name\": \"aac8faf5-e831-bbf6-eccb-4c8f8a4d8654\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"e588914e-fbb8-4926-9ccf-8ea781b07610\",\r\n \"baselineName\": \"Ensure 'Continue experiences on this device' is set to 'Disabled'\",\r\n \"baselineCceId\": \"NOT_ASSIGNED\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_e588914e-fbb8-4926-9ccf-8ea781b07610\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/b16ef9c4-ad51-5a6a-1fec-c1e495365634\",\r\n \"name\": \"b16ef9c4-ad51-5a6a-1fec-c1e495365634\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"60e0c2c9-0b14-44fe-83d6-2b7095e06674\",\r\n \"baselineName\": \"Ensure 'Deny log on through Remote Desktop Services' to include 'Guests'\",\r\n \"baselineCceId\": \"CCE-36867-0\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_60e0c2c9-0b14-44fe-83d6-2b7095e06674\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/b5d1496f-0314-c058-37fd-3fedada284d1\",\r\n \"name\": \"b5d1496f-0314-c058-37fd-3fedada284d1\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"484c747f-1418-4c27-a944-c3b1e1690b33\",\r\n \"baselineName\": \"Ensure 'Allow indexing of encrypted files' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-38277-0\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_484c747f-1418-4c27-a944-c3b1e1690b33\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/b6cf9f1d-6ffd-843e-b318-60e34b4cfc87\",\r\n \"name\": \"b6cf9f1d-6ffd-843e-b318-60e34b4cfc87\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"a76d6552-cd22-4a2c-adc1-50f8705cad17\",\r\n \"baselineName\": \"Ensure 'Turn off heap termination on corruption' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-36660-9\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_a76d6552-cd22-4a2c-adc1-50f8705cad17\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/b9ed4a21-a68c-0a18-3525-583a04c46173\",\r\n \"name\": \"b9ed4a21-a68c-0a18-3525-583a04c46173\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"3b993f8f-245d-4f4e-9e8b-f94cbc71c3f6\",\r\n \"baselineName\": \"Ensure 'Deny log on as a service' to include 'Guests'\",\r\n \"baselineCceId\": \"CCE-36877-9\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_3b993f8f-245d-4f4e-9e8b-f94cbc71c3f6\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/bbca15f2-8f14-2e3c-2d94-1a799b16b1d5\",\r\n \"name\": \"bbca15f2-8f14-2e3c-2d94-1a799b16b1d5\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"b2e8d5f9-3d4e-4b8b-b6a1-ddcd60f437b9\",\r\n \"baselineName\": \"Ensure 'Configure registry policy processing: Process even if the Group Policy objects have not changed' is set to 'Enabled: TRUE'\",\r\n \"baselineCceId\": \"CCE-36169-1\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_b2e8d5f9-3d4e-4b8b-b6a1-ddcd60f437b9\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/c16943c5-eaac-8fff-5ae5-7fd318b8ea1e\",\r\n \"name\": \"c16943c5-eaac-8fff-5ae5-7fd318b8ea1e\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"34edb7eb-697c-4be9-8830-5aa5b031372e\",\r\n \"baselineName\": \"Ensure 'Disallow Digest authentication' is set to 'Enabled'\",\r\n \"baselineCceId\": \"CCE-38318-2\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_34edb7eb-697c-4be9-8830-5aa5b031372e\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/c99c5ae8-0ea6-b7d5-2f5a-81f31d4e28c9\",\r\n \"name\": \"c99c5ae8-0ea6-b7d5-2f5a-81f31d4e28c9\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"dad8097d-db46-4df3-9839-a8504e60c878\",\r\n \"baselineName\": \"Ensure 'Enforce password history' is set to '24 or more password'\",\r\n \"baselineCceId\": \"CCE-37166-6\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_dad8097d-db46-4df3-9839-a8504e60c878\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/d27978e1-1198-0dbc-a0b4-215aa96491a1\",\r\n \"name\": \"d27978e1-1198-0dbc-a0b4-215aa96491a1\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"b17eabc0-5d73-4861-acc8-d5b97bc53f12\",\r\n \"baselineName\": \"Ensure 'Configure Solicited Remote Assistance' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-37281-3\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_b17eabc0-5d73-4861-acc8-d5b97bc53f12\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/d640b411-c9f3-0810-bbf4-a66a314b0892\",\r\n \"name\": \"d640b411-c9f3-0810-bbf4-a66a314b0892\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"a002b800-92a4-45cb-bbee-76c91739ddff\",\r\n \"baselineName\": \"Disable SMB v1 server\",\r\n \"baselineCceId\": \"NOT_ASSIGNED\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_a002b800-92a4-45cb-bbee-76c91739ddff\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/d65b4d2f-00ad-2a6c-9c0a-362814d7881c\",\r\n \"name\": \"d65b4d2f-00ad-2a6c-9c0a-362814d7881c\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"9e11215f-9b0b-4ca6-ad5b-d1a0c989af36\",\r\n \"baselineName\": \"Ensure 'Interactive logon: Do not display last user name' is set to 'Enabled'\",\r\n \"baselineCceId\": \"CCE-36056-0\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_9e11215f-9b0b-4ca6-ad5b-d1a0c989af36\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/dac28441-c73e-82dc-a999-577ef0b37421\",\r\n \"name\": \"dac28441-c73e-82dc-a999-577ef0b37421\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"a917e66c-e3e4-4a7b-8f72-e8163994aabc\",\r\n \"baselineName\": \"Enable 'Turn on behavior monitoring'\",\r\n \"baselineCceId\": \"NOT_ASSIGNED\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_a917e66c-e3e4-4a7b-8f72-e8163994aabc\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/dae4bfc6-5a64-8550-7989-d139f992834d\",\r\n \"name\": \"dae4bfc6-5a64-8550-7989-d139f992834d\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"d4477c4c-cee5-445a-9a1f-01cdbe672484\",\r\n \"baselineName\": \"Enable Windows Error Reporting\",\r\n \"baselineCceId\": \"NOT_ASSIGNED\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_d4477c4c-cee5-445a-9a1f-01cdbe672484\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/db52ddb2-4f02-9221-71bd-b01836a84208\",\r\n \"name\": \"db52ddb2-4f02-9221-71bd-b01836a84208\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"ea132d56-9c29-4d2a-bc92-fc81f616e540\",\r\n \"baselineName\": \"Ensure 'User Account Control: Behavior of the elevation prompt for standard users' is set to 'Automatically deny elevation requests'\",\r\n \"baselineCceId\": \"CCE-36864-7\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_ea132d56-9c29-4d2a-bc92-fc81f616e540\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/db7b9b8e-38b3-c6b8-325b-1126b67fab5c\",\r\n \"name\": \"db7b9b8e-38b3-c6b8-325b-1126b67fab5c\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"37e5e1d9-b9d2-454b-bf3f-124682309155\",\r\n \"baselineName\": \"Ensure 'Turn on convenience PIN sign-in' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-37528-7\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_37e5e1d9-b9d2-454b-bf3f-124682309155\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/e0f41866-aa3a-5c3a-b55e-8c445e7aa696\",\r\n \"name\": \"e0f41866-aa3a-5c3a-b55e-8c445e7aa696\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"032b5976-1c4b-4c68-bc5d-0c65e35306b2\",\r\n \"baselineName\": \"Ensure 'Microsoft network server: Digitally sign communications (always)' is set to 'Enabled'\",\r\n \"baselineCceId\": \"CCE-37864-6\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_032b5976-1c4b-4c68-bc5d-0c65e35306b2\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/e14d17f3-f00f-4196-8432-883b62165a1d\",\r\n \"name\": \"e14d17f3-f00f-4196-8432-883b62165a1d\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"7450d70c-391d-4932-be4a-3f3bfecc0eb5\",\r\n \"baselineName\": \"Ensure 'Configure Offer Remote Assistance' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-36388-7\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_7450d70c-391d-4932-be4a-3f3bfecc0eb5\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/e4f88afe-96bb-951e-5269-55f07a1b55a8\",\r\n \"name\": \"e4f88afe-96bb-951e-5269-55f07a1b55a8\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"2785f384-9901-4c9d-8dca-8ff2b5068fde\",\r\n \"baselineName\": \"Ensure 'Allow unencrypted traffic' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-38223-4\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_2785f384-9901-4c9d-8dca-8ff2b5068fde\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/e9b3967d-5059-add3-47fa-17207d08c3b8\",\r\n \"name\": \"e9b3967d-5059-add3-47fa-17207d08c3b8\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"a30f6d7d-f3dc-442c-8a1f-921123c6250c\",\r\n \"baselineName\": \"Bypass traverse checking\",\r\n \"baselineCceId\": \"NOT_ASSIGNED\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_a30f6d7d-f3dc-442c-8a1f-921123c6250c\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/f34c5e60-2c99-fab1-9fc7-c446cb8a01c3\",\r\n \"name\": \"f34c5e60-2c99-fab1-9fc7-c446cb8a01c3\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"3f2d92c2-5850-4f2d-b245-f5089aa975dd\",\r\n \"baselineName\": \"Configure 'Access this computer from the network'\",\r\n \"baselineCceId\": \"CCE-35818-4\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_3f2d92c2-5850-4f2d-b245-f5089aa975dd\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/f5b2824a-92c8-e744-c564-a97d4ffc965f\",\r\n \"name\": \"f5b2824a-92c8-e744-c564-a97d4ffc965f\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"09ed81b2-8dba-4009-84f9-dcfd6009ed0d\",\r\n \"baselineName\": \"Ensure 'Enable insecure guest logons' is set to 'Disabled'\",\r\n \"baselineCceId\": \"NOT_ASSIGNED\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_09ed81b2-8dba-4009-84f9-dcfd6009ed0d\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/fa32b534-37df-59f4-bca0-c178925f9aaf\",\r\n \"name\": \"fa32b534-37df-59f4-bca0-c178925f9aaf\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"41a8be7d-69bd-48f4-ae77-9568cf7b15d1\",\r\n \"baselineName\": \"Ensure 'Microsoft network client: Digitally sign communications (always)' is set to 'Enabled'\",\r\n \"baselineCceId\": \"CCE-36325-9\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_41a8be7d-69bd-48f4-ae77-9568cf7b15d1\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/fa5edbdd-2301-ec4e-3936-55b691cddf9a\",\r\n \"name\": \"fa5edbdd-2301-ec4e-3936-55b691cddf9a\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"bc9d4fef-9e33-48fc-bcbd-b53e60caf4a2\",\r\n \"baselineName\": \"Ensure 'Minimum password length' is set to '14 or more character'\",\r\n \"baselineCceId\": \"CCE-36534-6\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_bc9d4fef-9e33-48fc-bcbd-b53e60caf4a2\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks/22ef553d-f13a-5227-ee4c-7cc861d28c96\",\r\n \"name\": \"22ef553d-f13a-5227-ee4c-7cc861d28c96\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-22T08:23:42.9943448Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-22T08:23:42.9943448Z\",\r\n \"securityTaskParameters\": {\r\n \"resourceType\": \"VirtualNetworkNew\",\r\n \"policyName\": \"Enable DDoS protection standard\",\r\n \"severity\": \"Medium\",\r\n \"name\": \"GenericSecuirtyTask\",\r\n \"uniqueKey\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/virtualNetworks/myService1/protection/myService1_Enable DDoS protection standard\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/virtualNetworks/myService1/protection/myService1\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks/47f736fa-0ec8-a372-de49-8cf18527930c\",\r\n \"name\": \"47f736fa-0ec8-a372-de49-8cf18527930c\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-10T12:43:51.3894814Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-10T12:43:51.3894814Z\",\r\n \"securityTaskParameters\": {\r\n \"resourceGroup\": \"myService1\",\r\n \"provisionTaskAzureResourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/myservice1/providers/microsoft.security/locations/centralus/tasks/bd238b0a-2936-e1a4-fe65-7a52ea8627ad\",\r\n \"solutionName\": \"ContosoWAF\",\r\n \"securityFamily\": \"SaasWaf\",\r\n \"managementUrl\": \"\",\r\n \"name\": \"ConfigureTier2Waf\",\r\n \"uniqueKey\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/publicIPAddresses/SyslogVMPublicIP\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/publicIPAddresses/SyslogVMPublicIP\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks/5696e90f-833d-494c-8833-f3be335fa9cb\",\r\n \"name\": \"5696e90f-833d-494c-8833-f3be335fa9cb\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-10T11:39:28.9783962Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-10T11:39:28.9783962Z\",\r\n \"securityTaskParameters\": {\r\n \"resourceName\": \"syslogmyservice1vm\",\r\n \"resourceType\": \"VirtualMachine\",\r\n \"resourceParent\": \"\",\r\n \"parentIpAddress\": \"\",\r\n \"ipAddress\": \"65.52.66.31\",\r\n \"location\": \"northeurope\",\r\n \"resourceGroup\": \"MYSERVICE1\",\r\n \"subnetIds\": [\r\n \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/virtualNetworks/syslogmyservice1net/subnets/syslogmyservice1net\"\r\n ],\r\n \"resourcesIdsToProtect\": [\r\n \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/networkInterfaces/SyslogVMNic\",\r\n \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/publicIPAddresses/SyslogVMPublicIP\"\r\n ],\r\n \"concreteResourceType\": \"VirtualMachine\",\r\n \"name\": \"NetworkSecurityGroupMissingOnVm\",\r\n \"uniqueKey\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/syslogmyservice1vm\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/syslogmyservice1vm\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Security/locations/centralus/tasks/65193cce-25a1-b30f-f94e-69d52e22923c\",\r\n \"name\": \"65193cce-25a1-b30f-f94e-69d52e22923c\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-04T08:23:39.8258696Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-04T08:23:39.8258696Z\",\r\n \"securityTaskParameters\": {\r\n \"supportedAgents\": [],\r\n \"name\": \"VulnerabilityAssessmentDeployment\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_MYSERVICE1_testService\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Compute/virtualMachines/testService\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks/7e28a40d-e746-4751-8340-5126d6b77ae5\",\r\n \"name\": \"7e28a40d-e746-4751-8340-5126d6b77ae5\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-10T11:39:28.9783962Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-10T11:39:28.9783962Z\",\r\n \"securityTaskParameters\": {\r\n \"resourceName\": \"syslogmyservice1net\",\r\n \"resourceType\": \"Subnet\",\r\n \"resourceParent\": \"syslogmyservice1net\",\r\n \"location\": \"northeurope\",\r\n \"resourceGroup\": \"myService1\",\r\n \"name\": \"NetworkSecurityGroupMissingOnSubnet\",\r\n \"uniqueKey\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/virtualNetworks/syslogmyservice1net/subnets/syslogmyservice1net\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/virtualNetworks/syslogmyservice1net/subnets/syslogmyservice1net\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Security/locations/centralus/tasks/94867597-75e5-cfb6-8b71-e5e5253a24e1\",\r\n \"name\": \"94867597-75e5-cfb6-8b71-e5e5253a24e1\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-04T08:23:39.8258696Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-04T08:23:39.8258696Z\",\r\n \"securityTaskParameters\": {\r\n \"vmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"vmName\": \"testService\",\r\n \"severity\": \"High\",\r\n \"isOsDiskEncrypted\": false,\r\n \"isDataDiskEncrypted\": false,\r\n \"name\": \"EncryptionOnVm\",\r\n \"uniqueKey\": \"EncryptionOnVmTaskParameters_/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Compute/virtualMachines/testService\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Security/locations/centralus/tasks/a02fffd5-1956-a6d7-73da-a87a65ae02f4\",\r\n \"name\": \"a02fffd5-1956-a6d7-73da-a87a65ae02f4\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-10T11:39:28.9783962Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-10T15:03:11.4874871Z\",\r\n \"securityTaskParameters\": {\r\n \"supportedAgents\": [],\r\n \"name\": \"VulnerabilityAssessmentDeployment\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_MYSERVICE1_syslogmyservice1vm\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Compute/virtualMachines/syslogmyservice1vm\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks/bd382d04-b478-ac77-e89f-300789032367\",\r\n \"name\": \"bd382d04-b478-ac77-e89f-300789032367\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-10T11:39:28.9783962Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-10T11:39:28.9783962Z\",\r\n \"securityTaskParameters\": {\r\n \"publicIpName\": \"65.52.66.31\",\r\n \"fullyQualifiedDomainName\": \"SyslogVMPublicIP\",\r\n \"portsToProtect\": [\r\n 0\r\n ],\r\n \"name\": \"ProvisionNgfw\",\r\n \"uniqueKey\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/publicIPAddresses/SyslogVMPublicIP\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/publicIPAddresses/SyslogVMPublicIP\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Security/locations/centralus/tasks/ce43626a-d56b-6a38-49ef-3ad7a731666e\",\r\n \"name\": \"ce43626a-d56b-6a38-49ef-3ad7a731666e\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-10T11:39:28.9627686Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-10T11:39:28.9627686Z\",\r\n \"securityTaskParameters\": {\r\n \"vmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Compute/virtualMachines/syslogmyservice1vm\",\r\n \"vmName\": \"syslogmyservice1vm\",\r\n \"severity\": \"High\",\r\n \"isOsDiskEncrypted\": false,\r\n \"isDataDiskEncrypted\": false,\r\n \"name\": \"EncryptionOnVm\",\r\n \"uniqueKey\": \"EncryptionOnVmTaskParameters_/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Compute/virtualMachines/syslogmyservice1vm\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Compute/virtualMachines/syslogmyservice1vm\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks/dcfb6365-799e-5ed4-f344-d86a0a4c2992\",\r\n \"name\": \"dcfb6365-799e-5ed4-f344-d86a0a4c2992\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Dismissed\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-04T20:23:31.0720338Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-16T11:59:34.5355932Z\",\r\n \"securityTaskParameters\": {\r\n \"inheritServerDefault\": false,\r\n \"serverName\": \"datastore\",\r\n \"databaseName\": \"dataStore\",\r\n \"serverId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore\",\r\n \"databaseId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore/databases/dataStore\",\r\n \"name\": \"Enable auditing for the SQL database\",\r\n \"uniqueKey\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore/databases/dataStore/auditingPolicies/Default\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore/databases/dataStore\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks/ed736ed1-3f42-a95a-0b9e-458c44233937\",\r\n \"name\": \"ed736ed1-3f42-a95a-0b9e-458c44233937\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-04T08:23:39.8258696Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-04T08:23:39.8258696Z\",\r\n \"securityTaskParameters\": {\r\n \"serverName\": \"datastore\",\r\n \"serverId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore\",\r\n \"name\": \"Enable auditing for the SQL server\",\r\n \"uniqueKey\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore/auditingPolicies/Default\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore\"\r\n }\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:57 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-original-request-ids": [ + "36ac1777-5906-4f93-a4c9-a92ca6dc601d", + "", + "" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-request-id": [ + "8f61dfa0-0768-4553-803b-62a70f63dd6a" + ], + "x-ms-correlation-request-id": [ + "8f61dfa0-0768-4553-803b-62a70f63dd6a" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125257Z:8f61dfa0-0768-4553-803b-62a70f63dd6a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityTasksTests/SecurityTaskRecommendations_ListByHomeRegion.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityTasksTests/SecurityTaskRecommendations_ListByHomeRegion.json new file mode 100644 index 000000000000..6be0808ff680 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityTasksTests/SecurityTaskRecommendations_ListByHomeRegion.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvbG9jYXRpb25zL2NlbnRyYWx1cy90YXNrcz9hcGktdmVyc2lvbj0yMDE1LTA2LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "5ac06ef3-7650-407f-9cb2-7c0f0e819531" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/08357a1e-c534-756f-cbb9-7b45e73f3137\",\r\n \"name\": \"08357a1e-c534-756f-cbb9-7b45e73f3137\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"7e4d9fe1-eb3f-49ac-bb5b-d417df7e6d6c\",\r\n \"baselineName\": \"Ensure 'Audit User Account Management' is set to 'Success and Failure'\",\r\n \"baselineCceId\": \"CCE-37856-2\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"AuditPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_7e4d9fe1-eb3f-49ac-bb5b-d417df7e6d6c\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Dismissed\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-09T17:45:42.7431861Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/09ea0fa9-ce5a-d703-e17b-08f1d5246e2c\",\r\n \"name\": \"09ea0fa9-ce5a-d703-e17b-08f1d5246e2c\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"d9ed5e76-2348-4409-94dd-c76352407fe8\",\r\n \"baselineName\": \"Disable support for RDS.\",\r\n \"baselineCceId\": \"CCE-14027-7\",\r\n \"osName\": \"Linux\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"Command\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/myservice1/providers/microsoft.operationalinsights/workspaces/testservicews\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_d9ed5e76-2348-4409-94dd-c76352407fe8\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-10T20:38:37.8557035Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-10T20:38:37.8557035Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/11ff8541-820e-cecc-75de-91be7c0d8419\",\r\n \"name\": \"11ff8541-820e-cecc-75de-91be7c0d8419\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"94cc076f-0e88-4398-ac29-d0dc7170303f\",\r\n \"baselineName\": \"Ensure 'Turn off shell protocol protected mode' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-36809-2\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_94cc076f-0e88-4398-ac29-d0dc7170303f\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/12b4f7f5-0fcd-4f54-afc4-adca05e5e4a5\",\r\n \"name\": \"12b4f7f5-0fcd-4f54-afc4-adca05e5e4a5\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"6ed9ad58-c9de-4a8b-9512-8fe5421ac8a7\",\r\n \"baselineName\": \"Ensure 'Network security: Minimum session security for NTLM SSP based servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption'\",\r\n \"baselineCceId\": \"CCE-37835-6\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_6ed9ad58-c9de-4a8b-9512-8fe5421ac8a7\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/1b2830ce-af40-7034-3077-5606feb66657\",\r\n \"name\": \"1b2830ce-af40-7034-3077-5606feb66657\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"ef0eefbb-e845-47f3-af9a-3409296d3264\",\r\n \"baselineName\": \"Ensure 'Shut down the system' is set to 'Administrators'\",\r\n \"baselineCceId\": \"CCE-38328-1\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_ef0eefbb-e845-47f3-af9a-3409296d3264\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/25af609a-d2a1-ef19-c017-7ef94e84c099\",\r\n \"name\": \"25af609a-d2a1-ef19-c017-7ef94e84c099\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"14afe28a-6199-49ff-9789-dabb89ed714e\",\r\n \"baselineName\": \"Ensure 'Allow Telemetry' is set to 'Enabled: 0 - Security [Enterprise Only]'\",\r\n \"baselineCceId\": \"NOT_ASSIGNED\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_14afe28a-6199-49ff-9789-dabb89ed714e\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/29fc999a-ab2b-b777-a952-2a7e3a89e823\",\r\n \"name\": \"29fc999a-ab2b-b777-a952-2a7e3a89e823\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"8ad78d25-6140-4899-9565-e053ce7d9a66\",\r\n \"baselineName\": \"Ensure 'Network Security: Allow PKU2U authentication requests to this computer to use online identities' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-38047-7\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_8ad78d25-6140-4899-9565-e053ce7d9a66\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/2dcadb92-a1f2-7fa5-d61c-40878caf728b\",\r\n \"name\": \"2dcadb92-a1f2-7fa5-d61c-40878caf728b\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"b2538b69-4020-4d50-9f63-581b673a014c\",\r\n \"baselineName\": \"Ensure 'Turn off Data Execution Prevention for Explorer' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-37809-1\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_b2538b69-4020-4d50-9f63-581b673a014c\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/2e047abc-0fc1-84d0-401c-98850d15fae4\",\r\n \"name\": \"2e047abc-0fc1-84d0-401c-98850d15fae4\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"59a97e33-0055-4209-bdee-78e4510625b1\",\r\n \"baselineName\": \"Ensure 'Enumerate local users on domain-joined computers' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-35894-5\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Informational\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_59a97e33-0055-4209-bdee-78e4510625b1\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/2f993d08-ca16-2317-1d3d-399233feb952\",\r\n \"name\": \"2f993d08-ca16-2317-1d3d-399233feb952\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"5046d960-670d-4fef-973a-cf242a97147e\",\r\n \"baselineName\": \"Ensure 'Audit PNP Activity' is set to 'Success'\",\r\n \"baselineCceId\": \"NOT_ASSIGNED\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"AuditPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_5046d960-670d-4fef-973a-cf242a97147e\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/2fb51211-41b2-4571-3127-bce41d8d2662\",\r\n \"name\": \"2fb51211-41b2-4571-3127-bce41d8d2662\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"99cd4fc9-bcf1-4def-8ce6-5a3c4ea8f8c9\",\r\n \"baselineName\": \"Ensure 'Configure registry policy processing: Do not apply during periodic background processing' is set to 'Enabled: FALSE'\",\r\n \"baselineCceId\": \"CCE-36169-1\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_99cd4fc9-bcf1-4def-8ce6-5a3c4ea8f8c9\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/375e3469-3503-b96d-becf-5ba341f3fb75\",\r\n \"name\": \"375e3469-3503-b96d-becf-5ba341f3fb75\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"45bdfbf8-155f-41f8-b9cf-72f1ba26c5be\",\r\n \"baselineName\": \"Ensure 'Minimum password age' is set to '1 or more day'\",\r\n \"baselineCceId\": \"CCE-37073-4\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_45bdfbf8-155f-41f8-b9cf-72f1ba26c5be\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/38a1c205-5ca2-92c7-de4c-90a46ef37899\",\r\n \"name\": \"38a1c205-5ca2-92c7-de4c-90a46ef37899\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"b88b1d85-5f3c-4235-91ab-6d8b5e767311\",\r\n \"baselineName\": \"Ensure 'Audit Removable Storage' is set to 'Success and Failure'\",\r\n \"baselineCceId\": \"CCE-37617-8\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"AuditPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_b88b1d85-5f3c-4235-91ab-6d8b5e767311\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/3d9f4f1c-8e21-5336-525b-100ea0a67509\",\r\n \"name\": \"3d9f4f1c-8e21-5336-525b-100ea0a67509\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"0b2803c7-33ac-4407-80f0-f09940bbe940\",\r\n \"baselineName\": \"Ensure 'Network security: Allow LocalSystem NULL session fallback' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-37035-3\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_0b2803c7-33ac-4407-80f0-f09940bbe940\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/4c7dcaa2-a0ec-c272-8502-91413024fbc5\",\r\n \"name\": \"4c7dcaa2-a0ec-c272-8502-91413024fbc5\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"627b7494-0e62-4093-9f77-db8d526d036b\",\r\n \"baselineName\": \"Remove unnecesary accounts\",\r\n \"baselineCceId\": \"CCE-XXXXX-7\",\r\n \"osName\": \"Linux\",\r\n \"severity\": \"Informational\",\r\n \"ruleType\": \"Command\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/myservice1/providers/microsoft.operationalinsights/workspaces/testservicews\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_627b7494-0e62-4093-9f77-db8d526d036b\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-10T20:38:37.8557035Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-10T20:38:37.8557035Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/53b1863a-be61-5b29-7327-90a867985dab\",\r\n \"name\": \"53b1863a-be61-5b29-7327-90a867985dab\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"e6eab28a-1dc8-4fb5-b88b-4e10f239e67c\",\r\n \"baselineName\": \"Ensure 'Enumerate administrator accounts on elevation' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-36512-2\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_e6eab28a-1dc8-4fb5-b88b-4e10f239e67c\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/5542d6c4-833c-5f11-4508-1bf22e345b5b\",\r\n \"name\": \"5542d6c4-833c-5f11-4508-1bf22e345b5b\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"b625a003-d015-436e-89fb-fb2dfe71ae0f\",\r\n \"baselineName\": \"Ensure 'Microsoft network server: Digitally sign communications (if client agrees)' is set to 'Enabled'\",\r\n \"baselineCceId\": \"CCE-35988-5\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_b625a003-d015-436e-89fb-fb2dfe71ae0f\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/590548c6-afba-302b-a8de-46947eee7172\",\r\n \"name\": \"590548c6-afba-302b-a8de-46947eee7172\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"967531f7-69cd-4a38-a517-3ebf4e5284cd\",\r\n \"baselineName\": \"Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled'\",\r\n \"baselineCceId\": \"CCE-36494-3\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_967531f7-69cd-4a38-a517-3ebf4e5284cd\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/5d54eff5-62f5-303c-025d-de9de8b1bd64\",\r\n \"name\": \"5d54eff5-62f5-303c-025d-de9de8b1bd64\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"11ca2201-2673-4f04-bad3-3265e1a53a5b\",\r\n \"baselineName\": \"Ensure 'Allow Input Personalization' is set to 'Disabled'\",\r\n \"baselineCceId\": \"NOT_ASSIGNED\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_11ca2201-2673-4f04-bad3-3265e1a53a5b\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/6073bd13-8a48-adcc-3cd5-58762309094c\",\r\n \"name\": \"6073bd13-8a48-adcc-3cd5-58762309094c\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"49258884-b2f0-4a4e-b66a-6954bb8473bf\",\r\n \"baselineName\": \"Ensure 'Deny log on as a batch job' to include 'Guests'\",\r\n \"baselineCceId\": \"CCE-36923-1\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_49258884-b2f0-4a4e-b66a-6954bb8473bf\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/64bd710f-15db-2ffe-1e1a-139a3719d69f\",\r\n \"name\": \"64bd710f-15db-2ffe-1e1a-139a3719d69f\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"abb1bcab-f4da-4a9c-be63-7564a0bca7b8\",\r\n \"baselineName\": \"Ensure 'Allow Basic authentication' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-36254-1\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_abb1bcab-f4da-4a9c-be63-7564a0bca7b8\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/70694bc2-c935-9611-77d5-e22b1c3c0c27\",\r\n \"name\": \"70694bc2-c935-9611-77d5-e22b1c3c0c27\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"f3117bf3-e54a-496a-9976-74b1caca3105\",\r\n \"baselineName\": \"Disable 'Configure local setting override for reporting to Microsoft MAPS'\",\r\n \"baselineCceId\": \"NOT_ASSIGNED\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_f3117bf3-e54a-496a-9976-74b1caca3105\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/73c6161a-f009-b061-e8c5-e58dbce5aec3\",\r\n \"name\": \"73c6161a-f009-b061-e8c5-e58dbce5aec3\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"4f8fd732-facf-4184-a29c-61fdd40db89d\",\r\n \"baselineName\": \"Ensure 'Audit Credential Validation' is set to 'Success and Failure'\",\r\n \"baselineCceId\": \"CCE-37741-6\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"AuditPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_4f8fd732-facf-4184-a29c-61fdd40db89d\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/79a9c0d7-b848-cf94-7368-c54ef15fbf69\",\r\n \"name\": \"79a9c0d7-b848-cf94-7368-c54ef15fbf69\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"2eda113a-0fb7-446c-856a-83e010d36671\",\r\n \"baselineName\": \"Ensure 'Always install with elevated privileges' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-37490-0\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_2eda113a-0fb7-446c-856a-83e010d36671\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/7b5e6fa5-c253-802c-dd73-7b90d3f47254\",\r\n \"name\": \"7b5e6fa5-c253-802c-dd73-7b90d3f47254\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"23d0f843-e7bf-40e9-82cb-6299b35e52ab\",\r\n \"baselineName\": \"Increase a process working set\",\r\n \"baselineCceId\": \"NOT_ASSIGNED\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_23d0f843-e7bf-40e9-82cb-6299b35e52ab\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/82a272c3-ceb6-99bc-3158-fe20c2692b46\",\r\n \"name\": \"82a272c3-ceb6-99bc-3158-fe20c2692b46\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"081da702-ce92-480f-aa68-af49bf5b94db\",\r\n \"baselineName\": \"Enable 'Scan removable drives' by setting DisableRemovableDriveScanning to 0\",\r\n \"baselineCceId\": \"NOT_ASSIGNED\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_081da702-ce92-480f-aa68-af49bf5b94db\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/87c73821-7941-15fe-c0fb-7a58c2abb2a6\",\r\n \"name\": \"87c73821-7941-15fe-c0fb-7a58c2abb2a6\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"fc8a4401-ff7a-4a6d-add4-758acce6b76c\",\r\n \"baselineName\": \"Ensure 'User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode' is set to 'Prompt for consent on the secure desktop'\",\r\n \"baselineCceId\": \"CCE-37029-6\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_fc8a4401-ff7a-4a6d-add4-758acce6b76c\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/88bb4f36-6418-d4dd-64e8-6a4a37f52f8a\",\r\n \"name\": \"88bb4f36-6418-d4dd-64e8-6a4a37f52f8a\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"d43b43ec-abd0-4420-ba8c-d4e53b057205\",\r\n \"baselineName\": \"Ensure 'Maximum password age' is set to '70 or fewer days, but not 0'\",\r\n \"baselineCceId\": \"CCE-37167-4\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_d43b43ec-abd0-4420-ba8c-d4e53b057205\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/8a06b49d-7f85-d6ae-80b4-b3b23e62ffc5\",\r\n \"name\": \"8a06b49d-7f85-d6ae-80b4-b3b23e62ffc5\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"87822480-3af9-4cf1-b0d2-93ceb957b129\",\r\n \"baselineName\": \"Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts and shares' is set to 'Enabled'\",\r\n \"baselineCceId\": \"CCE-36077-6\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_87822480-3af9-4cf1-b0d2-93ceb957b129\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/8a9f5439-66c2-a1f0-8df6-ba4e0e23281f\",\r\n \"name\": \"8a9f5439-66c2-a1f0-8df6-ba4e0e23281f\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"b7432fc2-51ba-4ddf-83dd-ca7f92e670c1\",\r\n \"baselineName\": \"Ensure 'Deny log on locally' to include 'Guests'\",\r\n \"baselineCceId\": \"CCE-37146-8\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_b7432fc2-51ba-4ddf-83dd-ca7f92e670c1\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/8ca17bc4-77f6-b806-8765-c14aa6e2a808\",\r\n \"name\": \"8ca17bc4-77f6-b806-8765-c14aa6e2a808\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"fbe348fd-0402-4e31-8482-66ae9ae82ea2\",\r\n \"baselineName\": \"Configure 'Deny access to this computer from the network'\",\r\n \"baselineCceId\": \"CCE-37954-5\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_fbe348fd-0402-4e31-8482-66ae9ae82ea2\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/92a3251f-3021-4e35-31f8-07cb515ce650\",\r\n \"name\": \"92a3251f-3021-4e35-31f8-07cb515ce650\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"a3344272-491e-4846-a1a6-02f63dac669b\",\r\n \"baselineName\": \"Ensure 'Do not enumerate connected users on domain-joined computers' is set to 'Enabled'\",\r\n \"baselineCceId\": \"CCE-37838-0\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Informational\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_a3344272-491e-4846-a1a6-02f63dac669b\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/9c922ca2-0c95-d04b-ba66-e29da28e684a\",\r\n \"name\": \"9c922ca2-0c95-d04b-ba66-e29da28e684a\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"2a074d39-eee4-4bfe-b1e7-4132c033a762\",\r\n \"baselineName\": \"Ensure 'Network security: Minimum session security for NTLM SSP based clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption'\",\r\n \"baselineCceId\": \"CCE-37553-5\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_2a074d39-eee4-4bfe-b1e7-4132c033a762\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/9d0d9014-a916-e6f7-8627-34fca1d8e510\",\r\n \"name\": \"9d0d9014-a916-e6f7-8627-34fca1d8e510\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"5d42c180-4350-49ec-9bb6-e51e1258022c\",\r\n \"baselineName\": \"Ensure 'Allow user control over installs' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-36400-0\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_5d42c180-4350-49ec-9bb6-e51e1258022c\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/a2e78cfe-f307-0a6e-8a4b-338eb5d15f43\",\r\n \"name\": \"a2e78cfe-f307-0a6e-8a4b-338eb5d15f43\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"357272d2-2018-455e-935c-8777473661dd\",\r\n \"baselineName\": \"Ensure 'Prohibit installation and configuration of Network Bridge on your DNS domain network' is set to 'Enabled'\",\r\n \"baselineCceId\": \"CCE-38002-2\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_357272d2-2018-455e-935c-8777473661dd\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/aac8faf5-e831-bbf6-eccb-4c8f8a4d8654\",\r\n \"name\": \"aac8faf5-e831-bbf6-eccb-4c8f8a4d8654\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"e588914e-fbb8-4926-9ccf-8ea781b07610\",\r\n \"baselineName\": \"Ensure 'Continue experiences on this device' is set to 'Disabled'\",\r\n \"baselineCceId\": \"NOT_ASSIGNED\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_e588914e-fbb8-4926-9ccf-8ea781b07610\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/b16ef9c4-ad51-5a6a-1fec-c1e495365634\",\r\n \"name\": \"b16ef9c4-ad51-5a6a-1fec-c1e495365634\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"60e0c2c9-0b14-44fe-83d6-2b7095e06674\",\r\n \"baselineName\": \"Ensure 'Deny log on through Remote Desktop Services' to include 'Guests'\",\r\n \"baselineCceId\": \"CCE-36867-0\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_60e0c2c9-0b14-44fe-83d6-2b7095e06674\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/b5d1496f-0314-c058-37fd-3fedada284d1\",\r\n \"name\": \"b5d1496f-0314-c058-37fd-3fedada284d1\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"484c747f-1418-4c27-a944-c3b1e1690b33\",\r\n \"baselineName\": \"Ensure 'Allow indexing of encrypted files' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-38277-0\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_484c747f-1418-4c27-a944-c3b1e1690b33\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/b6cf9f1d-6ffd-843e-b318-60e34b4cfc87\",\r\n \"name\": \"b6cf9f1d-6ffd-843e-b318-60e34b4cfc87\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"a76d6552-cd22-4a2c-adc1-50f8705cad17\",\r\n \"baselineName\": \"Ensure 'Turn off heap termination on corruption' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-36660-9\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_a76d6552-cd22-4a2c-adc1-50f8705cad17\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/b9ed4a21-a68c-0a18-3525-583a04c46173\",\r\n \"name\": \"b9ed4a21-a68c-0a18-3525-583a04c46173\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"3b993f8f-245d-4f4e-9e8b-f94cbc71c3f6\",\r\n \"baselineName\": \"Ensure 'Deny log on as a service' to include 'Guests'\",\r\n \"baselineCceId\": \"CCE-36877-9\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_3b993f8f-245d-4f4e-9e8b-f94cbc71c3f6\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/bbca15f2-8f14-2e3c-2d94-1a799b16b1d5\",\r\n \"name\": \"bbca15f2-8f14-2e3c-2d94-1a799b16b1d5\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"b2e8d5f9-3d4e-4b8b-b6a1-ddcd60f437b9\",\r\n \"baselineName\": \"Ensure 'Configure registry policy processing: Process even if the Group Policy objects have not changed' is set to 'Enabled: TRUE'\",\r\n \"baselineCceId\": \"CCE-36169-1\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_b2e8d5f9-3d4e-4b8b-b6a1-ddcd60f437b9\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/c16943c5-eaac-8fff-5ae5-7fd318b8ea1e\",\r\n \"name\": \"c16943c5-eaac-8fff-5ae5-7fd318b8ea1e\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"34edb7eb-697c-4be9-8830-5aa5b031372e\",\r\n \"baselineName\": \"Ensure 'Disallow Digest authentication' is set to 'Enabled'\",\r\n \"baselineCceId\": \"CCE-38318-2\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_34edb7eb-697c-4be9-8830-5aa5b031372e\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/c99c5ae8-0ea6-b7d5-2f5a-81f31d4e28c9\",\r\n \"name\": \"c99c5ae8-0ea6-b7d5-2f5a-81f31d4e28c9\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"dad8097d-db46-4df3-9839-a8504e60c878\",\r\n \"baselineName\": \"Ensure 'Enforce password history' is set to '24 or more password'\",\r\n \"baselineCceId\": \"CCE-37166-6\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_dad8097d-db46-4df3-9839-a8504e60c878\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/d27978e1-1198-0dbc-a0b4-215aa96491a1\",\r\n \"name\": \"d27978e1-1198-0dbc-a0b4-215aa96491a1\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"b17eabc0-5d73-4861-acc8-d5b97bc53f12\",\r\n \"baselineName\": \"Ensure 'Configure Solicited Remote Assistance' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-37281-3\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_b17eabc0-5d73-4861-acc8-d5b97bc53f12\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/d640b411-c9f3-0810-bbf4-a66a314b0892\",\r\n \"name\": \"d640b411-c9f3-0810-bbf4-a66a314b0892\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"a002b800-92a4-45cb-bbee-76c91739ddff\",\r\n \"baselineName\": \"Disable SMB v1 server\",\r\n \"baselineCceId\": \"NOT_ASSIGNED\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_a002b800-92a4-45cb-bbee-76c91739ddff\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/d65b4d2f-00ad-2a6c-9c0a-362814d7881c\",\r\n \"name\": \"d65b4d2f-00ad-2a6c-9c0a-362814d7881c\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"9e11215f-9b0b-4ca6-ad5b-d1a0c989af36\",\r\n \"baselineName\": \"Ensure 'Interactive logon: Do not display last user name' is set to 'Enabled'\",\r\n \"baselineCceId\": \"CCE-36056-0\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_9e11215f-9b0b-4ca6-ad5b-d1a0c989af36\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/dac28441-c73e-82dc-a999-577ef0b37421\",\r\n \"name\": \"dac28441-c73e-82dc-a999-577ef0b37421\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"a917e66c-e3e4-4a7b-8f72-e8163994aabc\",\r\n \"baselineName\": \"Enable 'Turn on behavior monitoring'\",\r\n \"baselineCceId\": \"NOT_ASSIGNED\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_a917e66c-e3e4-4a7b-8f72-e8163994aabc\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/dae4bfc6-5a64-8550-7989-d139f992834d\",\r\n \"name\": \"dae4bfc6-5a64-8550-7989-d139f992834d\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"d4477c4c-cee5-445a-9a1f-01cdbe672484\",\r\n \"baselineName\": \"Enable Windows Error Reporting\",\r\n \"baselineCceId\": \"NOT_ASSIGNED\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_d4477c4c-cee5-445a-9a1f-01cdbe672484\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/db52ddb2-4f02-9221-71bd-b01836a84208\",\r\n \"name\": \"db52ddb2-4f02-9221-71bd-b01836a84208\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"ea132d56-9c29-4d2a-bc92-fc81f616e540\",\r\n \"baselineName\": \"Ensure 'User Account Control: Behavior of the elevation prompt for standard users' is set to 'Automatically deny elevation requests'\",\r\n \"baselineCceId\": \"CCE-36864-7\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_ea132d56-9c29-4d2a-bc92-fc81f616e540\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/db7b9b8e-38b3-c6b8-325b-1126b67fab5c\",\r\n \"name\": \"db7b9b8e-38b3-c6b8-325b-1126b67fab5c\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"37e5e1d9-b9d2-454b-bf3f-124682309155\",\r\n \"baselineName\": \"Ensure 'Turn on convenience PIN sign-in' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-37528-7\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_37e5e1d9-b9d2-454b-bf3f-124682309155\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/e0f41866-aa3a-5c3a-b55e-8c445e7aa696\",\r\n \"name\": \"e0f41866-aa3a-5c3a-b55e-8c445e7aa696\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"032b5976-1c4b-4c68-bc5d-0c65e35306b2\",\r\n \"baselineName\": \"Ensure 'Microsoft network server: Digitally sign communications (always)' is set to 'Enabled'\",\r\n \"baselineCceId\": \"CCE-37864-6\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_032b5976-1c4b-4c68-bc5d-0c65e35306b2\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/e14d17f3-f00f-4196-8432-883b62165a1d\",\r\n \"name\": \"e14d17f3-f00f-4196-8432-883b62165a1d\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"7450d70c-391d-4932-be4a-3f3bfecc0eb5\",\r\n \"baselineName\": \"Ensure 'Configure Offer Remote Assistance' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-36388-7\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Warning\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_7450d70c-391d-4932-be4a-3f3bfecc0eb5\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/e4f88afe-96bb-951e-5269-55f07a1b55a8\",\r\n \"name\": \"e4f88afe-96bb-951e-5269-55f07a1b55a8\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"2785f384-9901-4c9d-8dca-8ff2b5068fde\",\r\n \"baselineName\": \"Ensure 'Allow unencrypted traffic' is set to 'Disabled'\",\r\n \"baselineCceId\": \"CCE-38223-4\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_2785f384-9901-4c9d-8dca-8ff2b5068fde\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/e9b3967d-5059-add3-47fa-17207d08c3b8\",\r\n \"name\": \"e9b3967d-5059-add3-47fa-17207d08c3b8\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"a30f6d7d-f3dc-442c-8a1f-921123c6250c\",\r\n \"baselineName\": \"Bypass traverse checking\",\r\n \"baselineCceId\": \"NOT_ASSIGNED\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_a30f6d7d-f3dc-442c-8a1f-921123c6250c\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/f34c5e60-2c99-fab1-9fc7-c446cb8a01c3\",\r\n \"name\": \"f34c5e60-2c99-fab1-9fc7-c446cb8a01c3\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"3f2d92c2-5850-4f2d-b245-f5089aa975dd\",\r\n \"baselineName\": \"Configure 'Access this computer from the network'\",\r\n \"baselineCceId\": \"CCE-35818-4\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_3f2d92c2-5850-4f2d-b245-f5089aa975dd\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/f5b2824a-92c8-e744-c564-a97d4ffc965f\",\r\n \"name\": \"f5b2824a-92c8-e744-c564-a97d4ffc965f\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"09ed81b2-8dba-4009-84f9-dcfd6009ed0d\",\r\n \"baselineName\": \"Ensure 'Enable insecure guest logons' is set to 'Disabled'\",\r\n \"baselineCceId\": \"NOT_ASSIGNED\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_09ed81b2-8dba-4009-84f9-dcfd6009ed0d\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/fa32b534-37df-59f4-bca0-c178925f9aaf\",\r\n \"name\": \"fa32b534-37df-59f4-bca0-c178925f9aaf\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"41a8be7d-69bd-48f4-ae77-9568cf7b15d1\",\r\n \"baselineName\": \"Ensure 'Microsoft network client: Digitally sign communications (always)' is set to 'Enabled'\",\r\n \"baselineCceId\": \"CCE-36325-9\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"RegistryKey\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_41a8be7d-69bd-48f4-ae77-9568cf7b15d1\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/fa5edbdd-2301-ec4e-3936-55b691cddf9a\",\r\n \"name\": \"fa5edbdd-2301-ec4e-3936-55b691cddf9a\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"subscriptionId\": \"487bb485-b5b0-471e-9c0d-10717612f869\",\r\n \"baselineRuleId\": \"bc9d4fef-9e33-48fc-bcbd-b53e60caf4a2\",\r\n \"baselineName\": \"Ensure 'Minimum password length' is set to '14 or more character'\",\r\n \"baselineCceId\": \"CCE-36534-6\",\r\n \"osName\": \"Windows Server 2016 Datacenter\",\r\n \"severity\": \"Critical\",\r\n \"ruleType\": \"SecurityPolicy\",\r\n \"workspaces\": [\r\n {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/defaultresourcegroup-weu/providers/microsoft.operationalinsights/workspaces/defaultworkspace-487bb485-b5b0-471e-9c0d-10717612f869-weu\",\r\n \"serverCount\": 1\r\n }\r\n ],\r\n \"totalNumberOfDefectedMachines\": 1,\r\n \"name\": \"Subscription has machines with failed baseline rule\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_bc9d4fef-9e33-48fc-bcbd-b53e60caf4a2\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-05T12:08:08.7774195Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-05T12:08:08.7774195Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks/22ef553d-f13a-5227-ee4c-7cc861d28c96\",\r\n \"name\": \"22ef553d-f13a-5227-ee4c-7cc861d28c96\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"resourceType\": \"VirtualNetworkNew\",\r\n \"policyName\": \"Enable DDoS protection standard\",\r\n \"severity\": \"Medium\",\r\n \"name\": \"GenericSecuirtyTask\",\r\n \"uniqueKey\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/virtualNetworks/myService1/protection/myService1_Enable DDoS protection standard\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/virtualNetworks/myService1/protection/myService1\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-22T08:23:42.9943448Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-22T08:23:42.9943448Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks/47f736fa-0ec8-a372-de49-8cf18527930c\",\r\n \"name\": \"47f736fa-0ec8-a372-de49-8cf18527930c\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"resourceGroup\": \"myService1\",\r\n \"provisionTaskAzureResourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/myservice1/providers/microsoft.security/locations/centralus/tasks/bd238b0a-2936-e1a4-fe65-7a52ea8627ad\",\r\n \"solutionName\": \"ContosoWAF\",\r\n \"securityFamily\": \"SaasWaf\",\r\n \"managementUrl\": \"\",\r\n \"name\": \"ConfigureTier2Waf\",\r\n \"uniqueKey\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/publicIPAddresses/SyslogVMPublicIP\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/publicIPAddresses/SyslogVMPublicIP\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-10T12:43:51.3894814Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-10T12:43:51.3894814Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks/5696e90f-833d-494c-8833-f3be335fa9cb\",\r\n \"name\": \"5696e90f-833d-494c-8833-f3be335fa9cb\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"resourceName\": \"syslogmyservice1vm\",\r\n \"resourceType\": \"VirtualMachine\",\r\n \"resourceParent\": \"\",\r\n \"parentIpAddress\": \"\",\r\n \"ipAddress\": \"65.52.66.31\",\r\n \"location\": \"northeurope\",\r\n \"resourceGroup\": \"MYSERVICE1\",\r\n \"subnetIds\": [\r\n \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/virtualNetworks/syslogmyservice1net/subnets/syslogmyservice1net\"\r\n ],\r\n \"resourcesIdsToProtect\": [\r\n \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/networkInterfaces/SyslogVMNic\",\r\n \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/publicIPAddresses/SyslogVMPublicIP\"\r\n ],\r\n \"concreteResourceType\": \"VirtualMachine\",\r\n \"name\": \"NetworkSecurityGroupMissingOnVm\",\r\n \"uniqueKey\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/syslogmyservice1vm\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/syslogmyservice1vm\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-10T11:39:28.9783962Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-10T11:39:28.9783962Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Security/locations/centralus/tasks/65193cce-25a1-b30f-f94e-69d52e22923c\",\r\n \"name\": \"65193cce-25a1-b30f-f94e-69d52e22923c\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"supportedAgents\": [],\r\n \"name\": \"VulnerabilityAssessmentDeployment\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_MYSERVICE1_testService\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Compute/virtualMachines/testService\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-04T08:23:39.8258696Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-04T08:23:39.8258696Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks/7e28a40d-e746-4751-8340-5126d6b77ae5\",\r\n \"name\": \"7e28a40d-e746-4751-8340-5126d6b77ae5\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"resourceName\": \"syslogmyservice1net\",\r\n \"resourceType\": \"Subnet\",\r\n \"resourceParent\": \"syslogmyservice1net\",\r\n \"location\": \"northeurope\",\r\n \"resourceGroup\": \"myService1\",\r\n \"name\": \"NetworkSecurityGroupMissingOnSubnet\",\r\n \"uniqueKey\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/virtualNetworks/syslogmyservice1net/subnets/syslogmyservice1net\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/virtualNetworks/syslogmyservice1net/subnets/syslogmyservice1net\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-10T11:39:28.9783962Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-10T11:39:28.9783962Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Security/locations/centralus/tasks/94867597-75e5-cfb6-8b71-e5e5253a24e1\",\r\n \"name\": \"94867597-75e5-cfb6-8b71-e5e5253a24e1\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"vmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"vmName\": \"testService\",\r\n \"severity\": \"High\",\r\n \"isOsDiskEncrypted\": false,\r\n \"isDataDiskEncrypted\": false,\r\n \"name\": \"EncryptionOnVm\",\r\n \"uniqueKey\": \"EncryptionOnVmTaskParameters_/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Compute/virtualMachines/testService\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-04T08:23:39.8258696Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-04T08:23:39.8258696Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Security/locations/centralus/tasks/a02fffd5-1956-a6d7-73da-a87a65ae02f4\",\r\n \"name\": \"a02fffd5-1956-a6d7-73da-a87a65ae02f4\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"supportedAgents\": [],\r\n \"name\": \"VulnerabilityAssessmentDeployment\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_MYSERVICE1_syslogmyservice1vm\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Compute/virtualMachines/syslogmyservice1vm\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-10T11:39:28.9783962Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-10T15:03:11.4874871Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks/bd382d04-b478-ac77-e89f-300789032367\",\r\n \"name\": \"bd382d04-b478-ac77-e89f-300789032367\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"publicIpName\": \"65.52.66.31\",\r\n \"fullyQualifiedDomainName\": \"SyslogVMPublicIP\",\r\n \"portsToProtect\": [\r\n 0\r\n ],\r\n \"name\": \"ProvisionNgfw\",\r\n \"uniqueKey\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/publicIPAddresses/SyslogVMPublicIP\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/publicIPAddresses/SyslogVMPublicIP\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-10T11:39:28.9783962Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-10T11:39:28.9783962Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Security/locations/centralus/tasks/ce43626a-d56b-6a38-49ef-3ad7a731666e\",\r\n \"name\": \"ce43626a-d56b-6a38-49ef-3ad7a731666e\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"vmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Compute/virtualMachines/syslogmyservice1vm\",\r\n \"vmName\": \"syslogmyservice1vm\",\r\n \"severity\": \"High\",\r\n \"isOsDiskEncrypted\": false,\r\n \"isDataDiskEncrypted\": false,\r\n \"name\": \"EncryptionOnVm\",\r\n \"uniqueKey\": \"EncryptionOnVmTaskParameters_/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Compute/virtualMachines/syslogmyservice1vm\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Compute/virtualMachines/syslogmyservice1vm\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-10T11:39:28.9627686Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-10T11:39:28.9627686Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks/dcfb6365-799e-5ed4-f344-d86a0a4c2992\",\r\n \"name\": \"dcfb6365-799e-5ed4-f344-d86a0a4c2992\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"inheritServerDefault\": false,\r\n \"serverName\": \"datastore\",\r\n \"databaseName\": \"dataStore\",\r\n \"serverId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore\",\r\n \"databaseId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore/databases/dataStore\",\r\n \"name\": \"Enable auditing for the SQL database\",\r\n \"uniqueKey\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore/databases/dataStore/auditingPolicies/Default\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore/databases/dataStore\"\r\n },\r\n \"state\": \"Dismissed\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-04T20:23:31.0720338Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-16T11:59:34.5355932Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks/ed736ed1-3f42-a95a-0b9e-458c44233937\",\r\n \"name\": \"ed736ed1-3f42-a95a-0b9e-458c44233937\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"securityTaskParameters\": {\r\n \"serverName\": \"datastore\",\r\n \"serverId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore\",\r\n \"name\": \"Enable auditing for the SQL server\",\r\n \"uniqueKey\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore/auditingPolicies/Default\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore\"\r\n },\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-04T08:23:39.8258696Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-04T08:23:39.8258696Z\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:54 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "5c8e66a5-f76e-4439-b95e-0b83d0d09813" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "99" + ], + "x-ms-correlation-request-id": [ + "f946d307-87ad-4873-a39b-df719215a440" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125255Z:f946d307-87ad-4873-a39b-df719215a440" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityTasksTests/SecurityTaskRecommendations_ListByResourceGroup.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityTasksTests/SecurityTaskRecommendations_ListByResourceGroup.json new file mode 100644 index 000000000000..a9df7ba48e35 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityTasksTests/SecurityTaskRecommendations_ListByResourceGroup.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Jlc291cmNlR3JvdXBzL215U2VydmljZTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TZWN1cml0eS9sb2NhdGlvbnMvY2VudHJhbHVzL3Rhc2tzP2FwaS12ZXJzaW9uPTIwMTUtMDYtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "24f5758c-e2bf-4876-a21e-99491827bd12" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks/22ef553d-f13a-5227-ee4c-7cc861d28c96\",\r\n \"name\": \"22ef553d-f13a-5227-ee4c-7cc861d28c96\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-22T08:23:42.9943448Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-22T08:23:42.9943448Z\",\r\n \"securityTaskParameters\": {\r\n \"resourceType\": \"VirtualNetworkNew\",\r\n \"policyName\": \"Enable DDoS protection standard\",\r\n \"severity\": \"Medium\",\r\n \"name\": \"GenericSecuirtyTask\",\r\n \"uniqueKey\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/virtualNetworks/myService1/protection/myService1_Enable DDoS protection standard\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/virtualNetworks/myService1/protection/myService1\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks/47f736fa-0ec8-a372-de49-8cf18527930c\",\r\n \"name\": \"47f736fa-0ec8-a372-de49-8cf18527930c\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-10T12:43:51.3894814Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-10T12:43:51.3894814Z\",\r\n \"securityTaskParameters\": {\r\n \"resourceGroup\": \"myService1\",\r\n \"provisionTaskAzureResourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/myservice1/providers/microsoft.security/locations/centralus/tasks/bd238b0a-2936-e1a4-fe65-7a52ea8627ad\",\r\n \"solutionName\": \"ContosoWAF\",\r\n \"securityFamily\": \"SaasWaf\",\r\n \"managementUrl\": \"\",\r\n \"name\": \"ConfigureTier2Waf\",\r\n \"uniqueKey\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/publicIPAddresses/SyslogVMPublicIP\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/publicIPAddresses/SyslogVMPublicIP\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks/5696e90f-833d-494c-8833-f3be335fa9cb\",\r\n \"name\": \"5696e90f-833d-494c-8833-f3be335fa9cb\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-10T11:39:28.9783962Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-10T11:39:28.9783962Z\",\r\n \"securityTaskParameters\": {\r\n \"resourceName\": \"syslogmyservice1vm\",\r\n \"resourceType\": \"VirtualMachine\",\r\n \"resourceParent\": \"\",\r\n \"parentIpAddress\": \"\",\r\n \"ipAddress\": \"65.52.66.31\",\r\n \"location\": \"northeurope\",\r\n \"resourceGroup\": \"MYSERVICE1\",\r\n \"subnetIds\": [\r\n \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/virtualNetworks/syslogmyservice1net/subnets/syslogmyservice1net\"\r\n ],\r\n \"resourcesIdsToProtect\": [\r\n \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/networkInterfaces/SyslogVMNic\",\r\n \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/publicIPAddresses/SyslogVMPublicIP\"\r\n ],\r\n \"concreteResourceType\": \"VirtualMachine\",\r\n \"name\": \"NetworkSecurityGroupMissingOnVm\",\r\n \"uniqueKey\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/syslogmyservice1vm\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/syslogmyservice1vm\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Security/locations/centralus/tasks/65193cce-25a1-b30f-f94e-69d52e22923c\",\r\n \"name\": \"65193cce-25a1-b30f-f94e-69d52e22923c\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-04T08:23:39.8258696Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-04T08:23:39.8258696Z\",\r\n \"securityTaskParameters\": {\r\n \"supportedAgents\": [],\r\n \"name\": \"VulnerabilityAssessmentDeployment\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_MYSERVICE1_testService\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Compute/virtualMachines/testService\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks/7e28a40d-e746-4751-8340-5126d6b77ae5\",\r\n \"name\": \"7e28a40d-e746-4751-8340-5126d6b77ae5\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-10T11:39:28.9783962Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-10T11:39:28.9783962Z\",\r\n \"securityTaskParameters\": {\r\n \"resourceName\": \"syslogmyservice1net\",\r\n \"resourceType\": \"Subnet\",\r\n \"resourceParent\": \"syslogmyservice1net\",\r\n \"location\": \"northeurope\",\r\n \"resourceGroup\": \"myService1\",\r\n \"name\": \"NetworkSecurityGroupMissingOnSubnet\",\r\n \"uniqueKey\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/virtualNetworks/syslogmyservice1net/subnets/syslogmyservice1net\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/virtualNetworks/syslogmyservice1net/subnets/syslogmyservice1net\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Security/locations/centralus/tasks/94867597-75e5-cfb6-8b71-e5e5253a24e1\",\r\n \"name\": \"94867597-75e5-cfb6-8b71-e5e5253a24e1\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-04T08:23:39.8258696Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-04T08:23:39.8258696Z\",\r\n \"securityTaskParameters\": {\r\n \"vmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"vmName\": \"testService\",\r\n \"severity\": \"High\",\r\n \"isOsDiskEncrypted\": false,\r\n \"isDataDiskEncrypted\": false,\r\n \"name\": \"EncryptionOnVm\",\r\n \"uniqueKey\": \"EncryptionOnVmTaskParameters_/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Compute/virtualMachines/testService\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Compute/virtualMachines/testService\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Security/locations/centralus/tasks/a02fffd5-1956-a6d7-73da-a87a65ae02f4\",\r\n \"name\": \"a02fffd5-1956-a6d7-73da-a87a65ae02f4\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-10T11:39:28.9783962Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-10T15:03:11.4874871Z\",\r\n \"securityTaskParameters\": {\r\n \"supportedAgents\": [],\r\n \"name\": \"VulnerabilityAssessmentDeployment\",\r\n \"uniqueKey\": \"487bb485-b5b0-471e-9c0d-10717612f869_MYSERVICE1_syslogmyservice1vm\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Compute/virtualMachines/syslogmyservice1vm\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks/bd382d04-b478-ac77-e89f-300789032367\",\r\n \"name\": \"bd382d04-b478-ac77-e89f-300789032367\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-10T11:39:28.9783962Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-10T11:39:28.9783962Z\",\r\n \"securityTaskParameters\": {\r\n \"publicIpName\": \"65.52.66.31\",\r\n \"fullyQualifiedDomainName\": \"SyslogVMPublicIP\",\r\n \"portsToProtect\": [\r\n 0\r\n ],\r\n \"name\": \"ProvisionNgfw\",\r\n \"uniqueKey\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/publicIPAddresses/SyslogVMPublicIP\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Network/publicIPAddresses/SyslogVMPublicIP\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Security/locations/centralus/tasks/ce43626a-d56b-6a38-49ef-3ad7a731666e\",\r\n \"name\": \"ce43626a-d56b-6a38-49ef-3ad7a731666e\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-10T11:39:28.9627686Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-10T11:39:28.9627686Z\",\r\n \"securityTaskParameters\": {\r\n \"vmId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Compute/virtualMachines/syslogmyservice1vm\",\r\n \"vmName\": \"syslogmyservice1vm\",\r\n \"severity\": \"High\",\r\n \"isOsDiskEncrypted\": false,\r\n \"isDataDiskEncrypted\": false,\r\n \"name\": \"EncryptionOnVm\",\r\n \"uniqueKey\": \"EncryptionOnVmTaskParameters_/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Compute/virtualMachines/syslogmyservice1vm\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/MYSERVICE1/providers/Microsoft.Compute/virtualMachines/syslogmyservice1vm\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks/dcfb6365-799e-5ed4-f344-d86a0a4c2992\",\r\n \"name\": \"dcfb6365-799e-5ed4-f344-d86a0a4c2992\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Dismissed\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-04T20:23:31.0720338Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-16T11:59:34.5355932Z\",\r\n \"securityTaskParameters\": {\r\n \"inheritServerDefault\": false,\r\n \"serverName\": \"datastore\",\r\n \"databaseName\": \"dataStore\",\r\n \"serverId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore\",\r\n \"databaseId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore/databases/dataStore\",\r\n \"name\": \"Enable auditing for the SQL database\",\r\n \"uniqueKey\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore/databases/dataStore/auditingPolicies/Default\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore/databases/dataStore\"\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks/ed736ed1-3f42-a95a-0b9e-458c44233937\",\r\n \"name\": \"ed736ed1-3f42-a95a-0b9e-458c44233937\",\r\n \"type\": \"Microsoft.Security/locations/centralus/tasks\",\r\n \"properties\": {\r\n \"state\": \"Active\",\r\n \"subState\": \"NA\",\r\n \"creationTimeUtc\": \"2018-07-04T08:23:39.8258696Z\",\r\n \"lastStateChangeTimeUtc\": \"2018-07-04T08:23:39.8258696Z\",\r\n \"securityTaskParameters\": {\r\n \"serverName\": \"datastore\",\r\n \"serverId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore\",\r\n \"name\": \"Enable auditing for the SQL server\",\r\n \"uniqueKey\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore/auditingPolicies/Default\",\r\n \"resourceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Sql/servers/datastore\"\r\n }\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:56 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "bddee515-9c13-46bb-963a-07ca03c8a891" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "99" + ], + "x-ms-correlation-request-id": [ + "bba63985-e227-4059-adca-998980077a55" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125256Z:bba63985-e227-4059-adca-998980077a55" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityTasksTests/SecurityTaskRecommendations_UpdateResourceGroupLevelTask.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityTasksTests/SecurityTaskRecommendations_UpdateResourceGroupLevelTask.json new file mode 100644 index 000000000000..9c1bc0578284 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityTasksTests/SecurityTaskRecommendations_UpdateResourceGroupLevelTask.json @@ -0,0 +1,63 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Security/locations/centralus/tasks/dcfb6365-799e-5ed4-f344-d86a0a4c2992/Dismiss?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Jlc291cmNlR3JvdXBzL215U2VydmljZTEvcHJvdmlkZXJzL01pY3Jvc29mdC5TZWN1cml0eS9sb2NhdGlvbnMvY2VudHJhbHVzL3Rhc2tzL2RjZmI2MzY1LTc5OWUtNWVkNC1mMzQ0LWQ4NmEwYTRjMjk5Mi9EaXNtaXNzP2FwaS12ZXJzaW9uPTIwMTUtMDYtMDEtcHJldmlldw==", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "545c511b-3e9d-4e0c-87dd-9245de62a93c" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:53 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "0a545d95-40ac-485d-b44b-7ca9b0b193dc" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "1c006870-60ce-47dc-ba45-f85834176520" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125254Z:1c006870-60ce-47dc-ba45-f85834176520" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 204 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityTasksTests/SecurityTaskRecommendations_UpdateSubscriptionLevelTask.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityTasksTests/SecurityTaskRecommendations_UpdateSubscriptionLevelTask.json new file mode 100644 index 000000000000..241983f6f204 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.SecurityTasksTests/SecurityTaskRecommendations_UpdateSubscriptionLevelTask.json @@ -0,0 +1,63 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/locations/centralus/tasks/08357a1e-c534-756f-cbb9-7b45e73f3137/Dismiss?api-version=2015-06-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvbG9jYXRpb25zL2NlbnRyYWx1cy90YXNrcy8wODM1N2ExZS1jNTM0LTc1NmYtY2JiOS03YjQ1ZTczZjMxMzcvRGlzbWlzcz9hcGktdmVyc2lvbj0yMDE1LTA2LTAxLXByZXZpZXc=", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "1c18d542-c4a1-413a-8b50-afc2022488d4" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:58 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "8a60b7b5-c2f1-4f80-99f5-835f03d435ab" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "fff8be20-0d9c-4865-b142-91336e9e824d" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125258Z:fff8be20-0d9c-4865-b142-91336e9e824d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 204 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.WorkspaceSettingsTests/WorkspaceSettings_Create.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.WorkspaceSettingsTests/WorkspaceSettings_Create.json new file mode 100644 index 000000000000..01ad34bfd3f0 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.WorkspaceSettingsTests/WorkspaceSettings_Create.json @@ -0,0 +1,78 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/workspaceSettings/default?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvd29ya3NwYWNlU2V0dGluZ3MvZGVmYXVsdD9hcGktdmVyc2lvbj0yMDE3LTA4LTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/mainWS/providers/Microsoft.OperationalInsights/workspaces/securityUserWs\",\r\n \"scope\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "259" + ], + "x-ms-client-request-id": [ + "8dca9ad5-d814-40cd-890e-d48b85ffe8e8" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/workspaceSettings/default\",\r\n \"name\": \"default\",\r\n \"type\": \"Microsoft.Security/workspaceSettings\",\r\n \"properties\": {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/mainWS/providers/Microsoft.OperationalInsights/workspaces/securityUserWs\",\r\n \"scope\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:57:53 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "220d3856-a0cd-489d-8334-35ed2ca9ad03" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "249" + ], + "x-ms-correlation-request-id": [ + "7c4c8726-6d48-412d-9fe9-051922d1b23f" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125753Z:7c4c8726-6d48-412d-9fe9-051922d1b23f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.WorkspaceSettingsTests/WorkspaceSettings_Delete.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.WorkspaceSettingsTests/WorkspaceSettings_Delete.json new file mode 100644 index 000000000000..f1d1c6946eb3 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.WorkspaceSettingsTests/WorkspaceSettings_Delete.json @@ -0,0 +1,63 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/workspaceSettings/default?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvd29ya3NwYWNlU2V0dGluZ3MvZGVmYXVsdD9hcGktdmVyc2lvbj0yMDE3LTA4LTAxLXByZXZpZXc=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "0e9770cf-a19f-40d9-886a-93a7092158f2" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:20 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "75d51598-1202-4db8-8aaf-0c5e52b60aef" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-correlation-request-id": [ + "59f8bb9c-1d83-4c22-bd7b-c8e3827b4d68" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125220Z:59f8bb9c-1d83-4c22-bd7b-c8e3827b4d68" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 204 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.WorkspaceSettingsTests/WorkspaceSettings_Get.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.WorkspaceSettingsTests/WorkspaceSettings_Get.json new file mode 100644 index 000000000000..3a5319208af5 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.WorkspaceSettingsTests/WorkspaceSettings_Get.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/workspaceSettings/default?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvd29ya3NwYWNlU2V0dGluZ3MvZGVmYXVsdD9hcGktdmVyc2lvbj0yMDE3LTA4LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "c589599b-8d33-49a8-8283-fd222395a625" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/workspaceSettings/default\",\r\n \"name\": \"default\",\r\n \"type\": \"Microsoft.Security/workspaceSettings\",\r\n \"properties\": {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/mainws/providers/microsoft.operationalinsights/workspaces/securityuserws\",\r\n \"scope\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:58:05 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "1881aa0f-9eec-4a99-b27f-ef4a9c413d51" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-correlation-request-id": [ + "34275857-cf78-40fd-9a22-bbedf7d79efb" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125806Z:34275857-cf78-40fd-9a22-bbedf7d79efb" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.WorkspaceSettingsTests/WorkspaceSettings_List.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.WorkspaceSettingsTests/WorkspaceSettings_List.json new file mode 100644 index 000000000000..9b604a7e4b87 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.WorkspaceSettingsTests/WorkspaceSettings_List.json @@ -0,0 +1,72 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/workspaceSettings?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvd29ya3NwYWNlU2V0dGluZ3M/YXBpLXZlcnNpb249MjAxNy0wOC0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "cbfbcebb-0fd9-471a-8f54-9ba1fca49f92" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/workspaceSettings/default\",\r\n \"name\": \"default\",\r\n \"type\": \"Microsoft.Security/workspaceSettings\",\r\n \"properties\": {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourcegroups/mainws/providers/microsoft.operationalinsights/workspaces/securityuserws\",\r\n \"scope\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:58:07 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "c36543d8-1b06-4bc1-9304-dd3f1a232a58" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "749" + ], + "x-ms-correlation-request-id": [ + "68ec327c-c068-4843-88ca-e7e6ba7447fc" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125807Z:68ec327c-c068-4843-88ca-e7e6ba7447fc" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.WorkspaceSettingsTests/WorkspaceSettings_Update.json b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.WorkspaceSettingsTests/WorkspaceSettings_Update.json new file mode 100644 index 000000000000..0f5cc05ccd2a --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/SessionRecords/SecurityCenter.Tests.WorkspaceSettingsTests/WorkspaceSettings_Update.json @@ -0,0 +1,78 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/workspaceSettings/default?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDg3YmI0ODUtYjViMC00NzFlLTljMGQtMTA3MTc2MTJmODY5L3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VjdXJpdHkvd29ya3NwYWNlU2V0dGluZ3MvZGVmYXVsdD9hcGktdmVyc2lvbj0yMDE3LTA4LTAxLXByZXZpZXc=", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"properties\": {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/mainWS/providers/Microsoft.OperationalInsights/workspaces/securityUserWs\",\r\n \"scope\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "259" + ], + "x-ms-client-request-id": [ + "0562c92f-1802-42e0-80b7-06fc436290b0" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Security.SecurityCenterClient/0.1.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/providers/Microsoft.Security/workspaceSettings/default\",\r\n \"name\": \"default\",\r\n \"type\": \"Microsoft.Security/workspaceSettings\",\r\n \"properties\": {\r\n \"workspaceId\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/mainWS/providers/Microsoft.OperationalInsights/workspaces/securityUserWs\",\r\n \"scope\": \"/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Sun, 22 Jul 2018 12:52:22 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "bda4c725-2831-4935-b1d7-560bb184b13c" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "249" + ], + "x-ms-correlation-request-id": [ + "d8e2c739-0157-426c-9505-01b92e9f9c1b" + ], + "x-ms-routing-request-id": [ + "UKSOUTH:20180722T125223Z:d8e2c739-0157-426c-9505-01b92e9f9c1b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "487bb485-b5b0-471e-9c0d-10717612f869" + } +} \ No newline at end of file diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/Tasks/SecurityTasksTests.cs b/src/SDKs/SecurityCenter/SecurityCenter.Tests/Tasks/SecurityTasksTests.cs new file mode 100644 index 000000000000..f3e0d333b652 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/Tasks/SecurityTasksTests.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Net; +using Microsoft.Azure.Management.Security; +using Microsoft.Azure.Management.Security.Models; +using Microsoft.Azure.Test.HttpRecorder; +using Microsoft.Rest.Azure; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; +using SecurityCenter.Tests.Helpers; +using Xunit; + +namespace SecurityCenter.Tests +{ + public class SecurityTasksTests : TestBase + { + #region Test setup + + public static TestEnvironment TestEnvironment { get; private set; } + + private static SecurityCenterClient GetSecurityCenterClient(MockContext context) + { + if (TestEnvironment == null && HttpMockServer.Mode == HttpRecorderMode.Record) + { + TestEnvironment = TestEnvironmentFactory.GetTestEnvironment(); + } + + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK, IsPassThrough = true }; + + var securityCenterClient = HttpMockServer.Mode == HttpRecorderMode.Record + ? context.GetServiceClient(TestEnvironment, handlers: handler) + : context.GetServiceClient(handlers: handler); + + securityCenterClient.AscLocation = "centralus"; + + return securityCenterClient; + } + + #endregion + + #region Tasks + + [Fact] + public void SecurityTaskRecommendations_List() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var recommendations = securityCenterClient.Tasks.List(); + ValidateTasks(recommendations); + } + } + + [Fact] + public void SecurityTaskRecommendations_GetResourceGroupLevelTask() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var recommendation = securityCenterClient.Tasks.GetResourceGroupLevelTask("myService1", "dcfb6365-799e-5ed4-f344-d86a0a4c2992"); + ValidateTask(recommendation); + } + } + + [Fact] + public void SecurityTaskRecommendations_GetSubscriptionLevelTask() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var recommendation = securityCenterClient.Tasks.GetSubscriptionLevelTask("08357a1e-c534-756f-cbb9-7b45e73f3137"); + ValidateTask(recommendation); + } + } + + [Fact] + public void SecurityTaskRecommendations_ListByHomeRegion() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var recommendations = securityCenterClient.Tasks.ListByHomeRegion(); + ValidateTasks(recommendations); + } + } + + [Fact] + public void SecurityTaskRecommendations_ListByResourceGroup() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var recommendations = securityCenterClient.Tasks.ListByResourceGroup("myService1"); + ValidateTasks(recommendations); + } + } + + [Fact] + public void SecurityTaskRecommendations_UpdateResourceGroupLevelTask() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + securityCenterClient.Tasks.UpdateResourceGroupLevelTaskState("myService1", "dcfb6365-799e-5ed4-f344-d86a0a4c2992", "Dismiss"); + } + } + + [Fact] + public void SecurityTaskRecommendations_UpdateSubscriptionLevelTask() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + securityCenterClient.Tasks.UpdateSubscriptionLevelTaskState("08357a1e-c534-756f-cbb9-7b45e73f3137", "Dismiss"); + } + } + + private void ValidateTasks(IPage recommendationsPage) + { + Assert.True(recommendationsPage.IsAny()); + + recommendationsPage.ForEach(ValidateTask); + } + + private void ValidateTask(SecurityTask recommendation) + { + Assert.NotNull(recommendation); + + Assert.True(recommendation.CreationTimeUtc.HasValue); + Assert.True(recommendation.CreationTimeUtc.Value.ToUniversalTime() < DateTime.UtcNow); + } + + #endregion + } +} diff --git a/src/SDKs/SecurityCenter/SecurityCenter.Tests/WorkspaceSettings/WorkspaceSettingsTests.cs b/src/SDKs/SecurityCenter/SecurityCenter.Tests/WorkspaceSettings/WorkspaceSettingsTests.cs new file mode 100644 index 000000000000..0f029e7a0374 --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.Tests/WorkspaceSettings/WorkspaceSettingsTests.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Net; +using Microsoft.Azure.Management.Security; +using Microsoft.Azure.Management.Security.Models; +using Microsoft.Azure.Test.HttpRecorder; +using Microsoft.Rest.Azure; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; +using SecurityCenter.Tests.Helpers; +using Xunit; + +namespace SecurityCenter.Tests +{ + public class WorkspaceSettingsTests : TestBase + { + #region Test setup + + public static TestEnvironment TestEnvironment { get; private set; } + + private static SecurityCenterClient GetSecurityCenterClient(MockContext context) + { + if (TestEnvironment == null && HttpMockServer.Mode == HttpRecorderMode.Record) + { + TestEnvironment = TestEnvironmentFactory.GetTestEnvironment(); + } + + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK, IsPassThrough = true }; + + var securityCenterClient = HttpMockServer.Mode == HttpRecorderMode.Record + ? context.GetServiceClient(TestEnvironment, handlers: handler) + : context.GetServiceClient(handlers: handler); + + securityCenterClient.AscLocation = "centralus"; + + return securityCenterClient; + } + + #endregion + + #region WorkspaceSettings + + private static string SubscriptionId = "487bb485-b5b0-471e-9c0d-10717612f869"; + + [Fact] + public void WorkspaceSettings_List() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var workspaceSettings = securityCenterClient.WorkspaceSettings.List(); + ValidateWorkspaceSettings(workspaceSettings); + } + } + + [Fact] + public void WorkspaceSettings_Get() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + var workspaceSettings = securityCenterClient.WorkspaceSettings.Get("default"); + ValidateWorkspaceSettings(workspaceSettings); + } + } + + [Fact] + public void WorkspaceSettings_Create() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + + var workspaceId = $"/subscriptions/{SubscriptionId}/resourceGroups/mainWS/providers/Microsoft.OperationalInsights/workspaces/securityUserWs"; + + var workspaceSettings = securityCenterClient.WorkspaceSettings.Create("default", workspaceId, $"/subscriptions/{SubscriptionId}"); + ValidateWorkspaceSettings(workspaceSettings); + } + } + + [Fact] + public void WorkspaceSettings_Update() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + + var workspaceId = $"/subscriptions/{SubscriptionId}/resourceGroups/mainWS/providers/Microsoft.OperationalInsights/workspaces/securityUserWs"; + + var workspaceSettings = securityCenterClient.WorkspaceSettings.Update("default", workspaceId, $"/subscriptions/{SubscriptionId}"); + ValidateWorkspaceSettings(workspaceSettings); + } + } + + [Fact] + public void WorkspaceSettings_Delete() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + var securityCenterClient = GetSecurityCenterClient(context); + securityCenterClient.WorkspaceSettings.Delete("default"); + } + } + + #endregion + + #region Validations + + private void ValidateWorkspaceSettings(IPage workspaceSettingsPage) + { + Assert.True(workspaceSettingsPage.IsAny()); + + workspaceSettingsPage.ForEach(ValidateWorkspaceSettings); + } + + private void ValidateWorkspaceSettings(WorkspaceSetting workspaceSettings) + { + Assert.NotNull(workspaceSettings); + } + + #endregion + } +} diff --git a/src/SDKs/SecurityCenter/SecurityCenter.sln b/src/SDKs/SecurityCenter/SecurityCenter.sln new file mode 100644 index 000000000000..3471469fb26c --- /dev/null +++ b/src/SDKs/SecurityCenter/SecurityCenter.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27428.2011 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Management.SecurityCenter", "Management.SecurityCenter\Microsoft.Azure.Management.SecurityCenter.csproj", "{53CEC855-E510-487A-9C4F-DE99DB0EF552}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SecurityCenter.Tests", "SecurityCenter.Tests\SecurityCenter.Tests.csproj", "{97B79E13-9C1E-4979-B0C4-1690879D258F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {53CEC855-E510-487A-9C4F-DE99DB0EF552}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {53CEC855-E510-487A-9C4F-DE99DB0EF552}.Debug|Any CPU.Build.0 = Debug|Any CPU + {53CEC855-E510-487A-9C4F-DE99DB0EF552}.Release|Any CPU.ActiveCfg = Release|Any CPU + {53CEC855-E510-487A-9C4F-DE99DB0EF552}.Release|Any CPU.Build.0 = Release|Any CPU + {97B79E13-9C1E-4979-B0C4-1690879D258F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {97B79E13-9C1E-4979-B0C4-1690879D258F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {97B79E13-9C1E-4979-B0C4-1690879D258F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {97B79E13-9C1E-4979-B0C4-1690879D258F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {8E5789C2-2EA7-455A-BEAD-82D1581882E7} + EndGlobalSection +EndGlobal diff --git a/src/SDKs/_metadata/security_resource-manager.txt b/src/SDKs/_metadata/security_resource-manager.txt new file mode 100644 index 000000000000..4903dc78a176 --- /dev/null +++ b/src/SDKs/_metadata/security_resource-manager.txt @@ -0,0 +1,20 @@ +Installing AutoRest version: latest +AutoRest installed successfully. +Commencing code generation +Generating CSharp code +Executing AutoRest command +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/security/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\Users\chlahav\Documents\WindowsPowerShell\Modules\CodeGenerationModules\AutoRestCodeGenerationModule +2018-07-24 18:16:36 UTC +1) azure-rest-api-specs repository information +GitHub fork: Azure +Branch: master +Commit: 30d7f17bff767fa03539e749a69bac82e0cd22d8 + +2) AutoRest information +Requested version: latest +Bootstrapper version: autorest@2.0.4282 + + +Latest installed version: + +