From 441f435d7aea8e455eb5e12f5b8e812f0a0c3a62 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 17 Jul 2019 09:43:16 +0000 Subject: [PATCH] Generated from 635daecd8672bcf8d06d0d8b6aa54652f198547a Merge branch 'master' into michal-dev-security-Microsoft.Security-2017-08-01-preview --- .../preview/security/mgmt/security/models.go | 269 ++++-- .../mgmt/security/securityapi/models.go | 3 +- .../security/adaptiveapplicationcontrols.go | 296 ++++++ .../mgmt/v1.0/security/assessmentsmetadata.go | 221 ----- .../assessmentsmetadatasubscription.go | 241 ----- .../security/mgmt/v1.0/security/models.go | 731 ++++++++------- .../v1.0/security/securityapi/interfaces.go | 25 +- .../security/adaptiveapplicationcontrols.go | 296 ++++++ .../mgmt/v2.0/security/assessmentsmetadata.go | 221 ----- .../assessmentsmetadatasubscription.go | 241 ----- .../security/mgmt/v2.0/security/models.go | 733 ++++++++------- .../security/mgmt/v2.0/security/pricings.go | 12 +- .../v2.0/security/securityapi/interfaces.go | 25 +- .../security/adaptiveapplicationcontrols.go | 296 ++++++ .../mgmt/v3.0/security/assessmentsmetadata.go | 221 ----- .../assessmentsmetadatasubscription.go | 241 ----- .../security/mgmt/v3.0/security/models.go | 842 ++++++++++-------- .../security/mgmt/v3.0/security/pricings.go | 12 +- .../v3.0/security/securityapi/interfaces.go | 25 +- 19 files changed, 2479 insertions(+), 2472 deletions(-) create mode 100644 services/preview/security/mgmt/v1.0/security/adaptiveapplicationcontrols.go delete mode 100644 services/preview/security/mgmt/v1.0/security/assessmentsmetadata.go delete mode 100644 services/preview/security/mgmt/v1.0/security/assessmentsmetadatasubscription.go create mode 100644 services/preview/security/mgmt/v2.0/security/adaptiveapplicationcontrols.go delete mode 100644 services/preview/security/mgmt/v2.0/security/assessmentsmetadata.go delete mode 100644 services/preview/security/mgmt/v2.0/security/assessmentsmetadatasubscription.go create mode 100644 services/preview/security/mgmt/v3.0/security/adaptiveapplicationcontrols.go delete mode 100644 services/preview/security/mgmt/v3.0/security/assessmentsmetadata.go delete mode 100644 services/preview/security/mgmt/v3.0/security/assessmentsmetadatasubscription.go diff --git a/profiles/preview/preview/security/mgmt/security/models.go b/profiles/preview/preview/security/mgmt/security/models.go index 2af323cf1f84..9798ac9547d7 100644 --- a/profiles/preview/preview/security/mgmt/security/models.go +++ b/profiles/preview/preview/security/mgmt/security/models.go @@ -37,6 +37,14 @@ const ( NotLicensed AadConnectivityState = original.NotLicensed ) +type Action = original.Action + +const ( + Add Action = original.Add + Recommended Action = original.Recommended + Remove Action = original.Remove +) + type AlertNotifications = original.AlertNotifications const ( @@ -51,28 +59,41 @@ const ( AlertsToAdminsOn AlertsToAdmins = original.AlertsToAdminsOn ) -type AssessmentType = original.AssessmentType +type AutoProvision = original.AutoProvision const ( - BuiltIn AssessmentType = original.BuiltIn - Custom AssessmentType = original.Custom + AutoProvisionOff AutoProvision = original.AutoProvisionOff + AutoProvisionOn AutoProvision = original.AutoProvisionOn ) -type AutoProvision = original.AutoProvision +type ConfigurationStatus = original.ConfigurationStatus const ( - AutoProvisionOff AutoProvision = original.AutoProvisionOff - AutoProvisionOn AutoProvision = original.AutoProvisionOn + Configured ConfigurationStatus = original.Configured + Failed ConfigurationStatus = original.Failed + InProgress ConfigurationStatus = original.InProgress + NoStatus ConfigurationStatus = original.NoStatus + NotConfigured ConfigurationStatus = original.NotConfigured ) -type Category = original.Category +type ConfigurationStatus1 = original.ConfigurationStatus1 const ( - Compute Category = original.Compute - Data Category = original.Data - IdentityAndAccess Category = original.IdentityAndAccess - IoT Category = original.IoT - Network Category = original.Network + ConfigurationStatus1Configured ConfigurationStatus1 = original.ConfigurationStatus1Configured + ConfigurationStatus1Failed ConfigurationStatus1 = original.ConfigurationStatus1Failed + ConfigurationStatus1InProgress ConfigurationStatus1 = original.ConfigurationStatus1InProgress + ConfigurationStatus1NoStatus ConfigurationStatus1 = original.ConfigurationStatus1NoStatus + ConfigurationStatus1NotConfigured ConfigurationStatus1 = original.ConfigurationStatus1NotConfigured +) + +type ConfigurationStatus2 = original.ConfigurationStatus2 + +const ( + ConfigurationStatus2Configured ConfigurationStatus2 = original.ConfigurationStatus2Configured + ConfigurationStatus2Failed ConfigurationStatus2 = original.ConfigurationStatus2Failed + ConfigurationStatus2InProgress ConfigurationStatus2 = original.ConfigurationStatus2InProgress + ConfigurationStatus2NoStatus ConfigurationStatus2 = original.ConfigurationStatus2NoStatus + ConfigurationStatus2NotConfigured ConfigurationStatus2 = original.ConfigurationStatus2NotConfigured ) type ConnectionType = original.ConnectionType @@ -88,6 +109,20 @@ const ( TwinData DataSource = original.TwinData ) +type EnforcementMode = original.EnforcementMode + +const ( + Audit EnforcementMode = original.Audit + Enforce EnforcementMode = original.Enforce +) + +type EnforcementMode1 = original.EnforcementMode1 + +const ( + EnforcementMode1Audit EnforcementMode1 = original.EnforcementMode1Audit + EnforcementMode1Enforce EnforcementMode1 = original.EnforcementMode1Enforce +) + type ExportData = original.ExportData const ( @@ -111,6 +146,28 @@ const ( Waf Family = original.Waf ) +type FileType = original.FileType + +const ( + Dll FileType = original.Dll + Exe FileType = original.Exe + Executable FileType = original.Executable + Msi FileType = original.Msi + Script FileType = original.Script + Unknown FileType = original.Unknown +) + +type Issue = original.Issue + +const ( + ExecutableViolationsAudited Issue = original.ExecutableViolationsAudited + MsiAndScriptViolationsAudited Issue = original.MsiAndScriptViolationsAudited + MsiAndScriptViolationsBlocked Issue = original.MsiAndScriptViolationsBlocked + RulesViolatedManually Issue = original.RulesViolatedManually + ViolationsAudited Issue = original.ViolationsAudited + ViolationsBlocked Issue = original.ViolationsBlocked +) + type KindEnum = original.KindEnum const ( @@ -138,35 +195,64 @@ const ( type ProvisioningState = original.ProvisioningState const ( - Canceled ProvisioningState = original.Canceled - Deprovisioning ProvisioningState = original.Deprovisioning - Failed ProvisioningState = original.Failed - Provisioning ProvisioningState = original.Provisioning - Succeeded ProvisioningState = original.Succeeded + ProvisioningStateCanceled ProvisioningState = original.ProvisioningStateCanceled + ProvisioningStateDeprovisioning ProvisioningState = original.ProvisioningStateDeprovisioning + ProvisioningStateFailed ProvisioningState = original.ProvisioningStateFailed + ProvisioningStateProvisioning ProvisioningState = original.ProvisioningStateProvisioning + ProvisioningStateSucceeded ProvisioningState = original.ProvisioningStateSucceeded +) + +type RecommendationAction = original.RecommendationAction + +const ( + RecommendationActionAdd RecommendationAction = original.RecommendationActionAdd + RecommendationActionRecommended RecommendationAction = original.RecommendationActionRecommended + RecommendationActionRemove RecommendationAction = original.RecommendationActionRemove +) + +type RecommendationAction1 = original.RecommendationAction1 + +const ( + RecommendationAction1Add RecommendationAction1 = original.RecommendationAction1Add + RecommendationAction1Recommended RecommendationAction1 = original.RecommendationAction1Recommended + RecommendationAction1Remove RecommendationAction1 = original.RecommendationAction1Remove ) type RecommendationConfigStatus = original.RecommendationConfigStatus const ( - TurnedOff RecommendationConfigStatus = original.TurnedOff - TurnedOn RecommendationConfigStatus = original.TurnedOn + Disabled RecommendationConfigStatus = original.Disabled + Enabled RecommendationConfigStatus = original.Enabled +) + +type RecommendationStatus = original.RecommendationStatus + +const ( + RecommendationStatusNoStatus RecommendationStatus = original.RecommendationStatusNoStatus + RecommendationStatusNotAvailable RecommendationStatus = original.RecommendationStatusNotAvailable + RecommendationStatusNotRecommended RecommendationStatus = original.RecommendationStatusNotRecommended + RecommendationStatusRecommended RecommendationStatus = original.RecommendationStatusRecommended ) type RecommendationType = original.RecommendationType const ( - DenyDefaultIPPolicy RecommendationType = original.DenyDefaultIPPolicy - EnableDiagnosticsLog RecommendationType = original.EnableDiagnosticsLog - IdenticalAuthenticationCredentials RecommendationType = original.IdenticalAuthenticationCredentials - OpenPortsOnDevice RecommendationType = original.OpenPortsOnDevice - OperationSystemNotValid RecommendationType = original.OperationSystemNotValid - PermissiveFirewallPolicy RecommendationType = original.PermissiveFirewallPolicy - PermissiveFirewallRuleInput RecommendationType = original.PermissiveFirewallRuleInput - PermissiveFirewallRuleOut RecommendationType = original.PermissiveFirewallRuleOut - SecurityTwinConfigurationConflict RecommendationType = original.SecurityTwinConfigurationConflict - SecurityTwinConfigurationNotOptimal RecommendationType = original.SecurityTwinConfigurationNotOptimal - TooLargeIPRange RecommendationType = original.TooLargeIPRange - UnutilizedMessagesFromAgent RecommendationType = original.UnutilizedMessagesFromAgent + IoTACRAuthentication RecommendationType = original.IoTACRAuthentication + IoTAgentSendsUnutilizedMessages RecommendationType = original.IoTAgentSendsUnutilizedMessages + IoTBaseline RecommendationType = original.IoTBaseline + IoTEdgeHubMemOptimize RecommendationType = original.IoTEdgeHubMemOptimize + IoTEdgeLoggingOptions RecommendationType = original.IoTEdgeLoggingOptions + IoTInconsistentModuleSettings RecommendationType = original.IoTInconsistentModuleSettings + IoTInstallAgent RecommendationType = original.IoTInstallAgent + IoTIPFilterDenyAll RecommendationType = original.IoTIPFilterDenyAll + IoTIPFilterPermissiveRule RecommendationType = original.IoTIPFilterPermissiveRule + IoTOpenPorts RecommendationType = original.IoTOpenPorts + IoTPermissiveFirewallPolicy RecommendationType = original.IoTPermissiveFirewallPolicy + IoTPermissiveInputFirewallRules RecommendationType = original.IoTPermissiveInputFirewallRules + IoTPermissiveOutputFirewallRules RecommendationType = original.IoTPermissiveOutputFirewallRules + IoTPrivilegedDockerOptions RecommendationType = original.IoTPrivilegedDockerOptions + IoTSharedCredentials RecommendationType = original.IoTSharedCredentials + IoTVulnerableTLSCipherSuite RecommendationType = original.IoTVulnerableTLSCipherSuite ) type ReportedSeverity = original.ReportedSeverity @@ -178,15 +264,6 @@ const ( Medium ReportedSeverity = original.Medium ) -type RequiredPricingBundle = original.RequiredPricingBundle - -const ( - AppServices RequiredPricingBundle = original.AppServices - SQLServers RequiredPricingBundle = original.SQLServers - StorageAccounts RequiredPricingBundle = original.StorageAccounts - VirtualMachines RequiredPricingBundle = original.VirtualMachines -) - type ResourceStatus = original.ResourceStatus const ( @@ -206,8 +283,18 @@ const ( type SolutionStatus = original.SolutionStatus const ( - Disabled SolutionStatus = original.Disabled - Enabled SolutionStatus = original.Enabled + SolutionStatusDisabled SolutionStatus = original.SolutionStatusDisabled + SolutionStatusEnabled SolutionStatus = original.SolutionStatusEnabled +) + +type SourceSystem = original.SourceSystem + +const ( + AzureAppLocker SourceSystem = original.AzureAppLocker + AzureAuditD SourceSystem = original.AzureAuditD + NonAzureAppLocker SourceSystem = original.NonAzureAppLocker + NonAzureAuditD SourceSystem = original.NonAzureAuditD + None SourceSystem = original.None ) type State = original.State @@ -234,9 +321,21 @@ const ( UserRequested StatusReason = original.UserRequested ) +type Type = original.Type + +const ( + BinarySignature Type = original.BinarySignature + File Type = original.File + FileHash Type = original.FileHash + ProductSignature Type = original.ProductSignature + PublisherSignature Type = original.PublisherSignature + VersionAndAboveSignature Type = original.VersionAndAboveSignature +) + type AadConnectivityState1 = original.AadConnectivityState1 type AadExternalSecuritySolution = original.AadExternalSecuritySolution type AadSolutionProperties = original.AadSolutionProperties +type AdaptiveApplicationControlsClient = original.AdaptiveApplicationControlsClient type AdvancedThreatProtectionClient = original.AdvancedThreatProtectionClient type AdvancedThreatProtectionProperties = original.AdvancedThreatProtectionProperties type AdvancedThreatProtectionSetting = original.AdvancedThreatProtectionSetting @@ -254,17 +353,15 @@ type AllowedConnectionsListIterator = original.AllowedConnectionsListIterator type AllowedConnectionsListPage = original.AllowedConnectionsListPage type AllowedConnectionsResource = original.AllowedConnectionsResource type AllowedConnectionsResourceProperties = original.AllowedConnectionsResourceProperties +type AppWhitelistingGroup = original.AppWhitelistingGroup +type AppWhitelistingGroupData = original.AppWhitelistingGroupData +type AppWhitelistingGroups = original.AppWhitelistingGroups +type AppWhitelistingIssueSummary = original.AppWhitelistingIssueSummary +type AppWhitelistingPutGroupData = original.AppWhitelistingPutGroupData type AscLocation = original.AscLocation type AscLocationList = original.AscLocationList type AscLocationListIterator = original.AscLocationListIterator type AscLocationListPage = original.AscLocationListPage -type AssessmentMetadata = original.AssessmentMetadata -type AssessmentMetadataList = original.AssessmentMetadataList -type AssessmentMetadataListIterator = original.AssessmentMetadataListIterator -type AssessmentMetadataListPage = original.AssessmentMetadataListPage -type AssessmentMetadataProperties = original.AssessmentMetadataProperties -type AssessmentsMetadataClient = original.AssessmentsMetadataClient -type AssessmentsMetadataSubscriptionClient = original.AssessmentsMetadataSubscriptionClient type AtaExternalSecuritySolution = original.AtaExternalSecuritySolution type AtaSolutionProperties = original.AtaSolutionProperties type AutoProvisioningSetting = original.AutoProvisioningSetting @@ -382,10 +479,12 @@ type OperationList = original.OperationList type OperationListIterator = original.OperationListIterator type OperationListPage = original.OperationListPage type OperationsClient = original.OperationsClient +type PathRecommendation = original.PathRecommendation type Pricing = original.Pricing type PricingList = original.PricingList type PricingProperties = original.PricingProperties type PricingsClient = original.PricingsClient +type PublisherInfo = original.PublisherInfo type RecommendationConfigurationProperties = original.RecommendationConfigurationProperties type RegulatoryComplianceAssessment = original.RegulatoryComplianceAssessment type RegulatoryComplianceAssessmentList = original.RegulatoryComplianceAssessmentList @@ -436,6 +535,8 @@ type TopologySingleResourceChild = original.TopologySingleResourceChild type TopologySingleResourceParent = original.TopologySingleResourceParent type UpdateIotSecuritySolutionData = original.UpdateIotSecuritySolutionData type UserDefinedResourcesProperties = original.UserDefinedResourcesProperties +type UserRecommendation = original.UserRecommendation +type VMRecommendation = original.VMRecommendation type WorkspaceSetting = original.WorkspaceSetting type WorkspaceSettingList = original.WorkspaceSettingList type WorkspaceSettingListIterator = original.WorkspaceSettingListIterator @@ -446,6 +547,12 @@ type WorkspaceSettingsClient = original.WorkspaceSettingsClient func New(subscriptionID string, ascLocation string) BaseClient { return original.New(subscriptionID, ascLocation) } +func NewAdaptiveApplicationControlsClient(subscriptionID string, ascLocation string) AdaptiveApplicationControlsClient { + return original.NewAdaptiveApplicationControlsClient(subscriptionID, ascLocation) +} +func NewAdaptiveApplicationControlsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AdaptiveApplicationControlsClient { + return original.NewAdaptiveApplicationControlsClientWithBaseURI(baseURI, subscriptionID, ascLocation) +} func NewAdvancedThreatProtectionClient(subscriptionID string, ascLocation string) AdvancedThreatProtectionClient { return original.NewAdvancedThreatProtectionClient(subscriptionID, ascLocation) } @@ -482,24 +589,6 @@ func NewAscLocationListIterator(page AscLocationListPage) AscLocationListIterato func NewAscLocationListPage(getNextPage func(context.Context, AscLocationList) (AscLocationList, error)) AscLocationListPage { return original.NewAscLocationListPage(getNextPage) } -func NewAssessmentMetadataListIterator(page AssessmentMetadataListPage) AssessmentMetadataListIterator { - return original.NewAssessmentMetadataListIterator(page) -} -func NewAssessmentMetadataListPage(getNextPage func(context.Context, AssessmentMetadataList) (AssessmentMetadataList, error)) AssessmentMetadataListPage { - return original.NewAssessmentMetadataListPage(getNextPage) -} -func NewAssessmentsMetadataClient(subscriptionID string, ascLocation string) AssessmentsMetadataClient { - return original.NewAssessmentsMetadataClient(subscriptionID, ascLocation) -} -func NewAssessmentsMetadataClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AssessmentsMetadataClient { - return original.NewAssessmentsMetadataClientWithBaseURI(baseURI, subscriptionID, ascLocation) -} -func NewAssessmentsMetadataSubscriptionClient(subscriptionID string, ascLocation string) AssessmentsMetadataSubscriptionClient { - return original.NewAssessmentsMetadataSubscriptionClient(subscriptionID, ascLocation) -} -func NewAssessmentsMetadataSubscriptionClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AssessmentsMetadataSubscriptionClient { - return original.NewAssessmentsMetadataSubscriptionClientWithBaseURI(baseURI, subscriptionID, ascLocation) -} func NewAutoProvisioningSettingListIterator(page AutoProvisioningSettingListPage) AutoProvisioningSettingListIterator { return original.NewAutoProvisioningSettingListIterator(page) } @@ -782,20 +871,26 @@ func NewWorkspaceSettingsClientWithBaseURI(baseURI string, subscriptionID string func PossibleAadConnectivityStateValues() []AadConnectivityState { return original.PossibleAadConnectivityStateValues() } +func PossibleActionValues() []Action { + return original.PossibleActionValues() +} func PossibleAlertNotificationsValues() []AlertNotifications { return original.PossibleAlertNotificationsValues() } func PossibleAlertsToAdminsValues() []AlertsToAdmins { return original.PossibleAlertsToAdminsValues() } -func PossibleAssessmentTypeValues() []AssessmentType { - return original.PossibleAssessmentTypeValues() -} func PossibleAutoProvisionValues() []AutoProvision { return original.PossibleAutoProvisionValues() } -func PossibleCategoryValues() []Category { - return original.PossibleCategoryValues() +func PossibleConfigurationStatus1Values() []ConfigurationStatus1 { + return original.PossibleConfigurationStatus1Values() +} +func PossibleConfigurationStatus2Values() []ConfigurationStatus2 { + return original.PossibleConfigurationStatus2Values() +} +func PossibleConfigurationStatusValues() []ConfigurationStatus { + return original.PossibleConfigurationStatusValues() } func PossibleConnectionTypeValues() []ConnectionType { return original.PossibleConnectionTypeValues() @@ -803,6 +898,12 @@ func PossibleConnectionTypeValues() []ConnectionType { func PossibleDataSourceValues() []DataSource { return original.PossibleDataSourceValues() } +func PossibleEnforcementMode1Values() []EnforcementMode1 { + return original.PossibleEnforcementMode1Values() +} +func PossibleEnforcementModeValues() []EnforcementMode { + return original.PossibleEnforcementModeValues() +} func PossibleExportDataValues() []ExportData { return original.PossibleExportDataValues() } @@ -812,6 +913,12 @@ func PossibleExternalSecuritySolutionKindValues() []ExternalSecuritySolutionKind func PossibleFamilyValues() []Family { return original.PossibleFamilyValues() } +func PossibleFileTypeValues() []FileType { + return original.PossibleFileTypeValues() +} +func PossibleIssueValues() []Issue { + return original.PossibleIssueValues() +} func PossibleKindEnumValues() []KindEnum { return original.PossibleKindEnumValues() } @@ -824,18 +931,24 @@ func PossibleProtocolValues() []Protocol { func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } +func PossibleRecommendationAction1Values() []RecommendationAction1 { + return original.PossibleRecommendationAction1Values() +} +func PossibleRecommendationActionValues() []RecommendationAction { + return original.PossibleRecommendationActionValues() +} func PossibleRecommendationConfigStatusValues() []RecommendationConfigStatus { return original.PossibleRecommendationConfigStatusValues() } +func PossibleRecommendationStatusValues() []RecommendationStatus { + return original.PossibleRecommendationStatusValues() +} func PossibleRecommendationTypeValues() []RecommendationType { return original.PossibleRecommendationTypeValues() } func PossibleReportedSeverityValues() []ReportedSeverity { return original.PossibleReportedSeverityValues() } -func PossibleRequiredPricingBundleValues() []RequiredPricingBundle { - return original.PossibleRequiredPricingBundleValues() -} func PossibleResourceStatusValues() []ResourceStatus { return original.PossibleResourceStatusValues() } @@ -845,6 +958,9 @@ func PossibleSettingKindValues() []SettingKind { func PossibleSolutionStatusValues() []SolutionStatus { return original.PossibleSolutionStatusValues() } +func PossibleSourceSystemValues() []SourceSystem { + return original.PossibleSourceSystemValues() +} func PossibleStateValues() []State { return original.PossibleStateValues() } @@ -854,6 +970,9 @@ func PossibleStatusReasonValues() []StatusReason { func PossibleStatusValues() []Status { return original.PossibleStatusValues() } +func PossibleTypeValues() []Type { + return original.PossibleTypeValues() +} func UserAgent() string { return original.UserAgent() + " profiles/preview" } diff --git a/profiles/preview/preview/security/mgmt/security/securityapi/models.go b/profiles/preview/preview/security/mgmt/security/securityapi/models.go index 45611f5942d9..f3f1649c0b39 100644 --- a/profiles/preview/preview/security/mgmt/security/securityapi/models.go +++ b/profiles/preview/preview/security/mgmt/security/securityapi/models.go @@ -21,11 +21,10 @@ package securityapi import original "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security/securityapi" +type AdaptiveApplicationControlsClientAPI = original.AdaptiveApplicationControlsClientAPI type AdvancedThreatProtectionClientAPI = original.AdvancedThreatProtectionClientAPI type AlertsClientAPI = original.AlertsClientAPI type AllowedConnectionsClientAPI = original.AllowedConnectionsClientAPI -type AssessmentsMetadataClientAPI = original.AssessmentsMetadataClientAPI -type AssessmentsMetadataSubscriptionClientAPI = original.AssessmentsMetadataSubscriptionClientAPI type AutoProvisioningSettingsClientAPI = original.AutoProvisioningSettingsClientAPI type ComplianceResultsClientAPI = original.ComplianceResultsClientAPI type CompliancesClientAPI = original.CompliancesClientAPI diff --git a/services/preview/security/mgmt/v1.0/security/adaptiveapplicationcontrols.go b/services/preview/security/mgmt/v1.0/security/adaptiveapplicationcontrols.go new file mode 100644 index 000000000000..8fe79f24b6d0 --- /dev/null +++ b/services/preview/security/mgmt/v1.0/security/adaptiveapplicationcontrols.go @@ -0,0 +1,296 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// AdaptiveApplicationControlsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type AdaptiveApplicationControlsClient struct { + BaseClient +} + +// NewAdaptiveApplicationControlsClient creates an instance of the AdaptiveApplicationControlsClient client. +func NewAdaptiveApplicationControlsClient(subscriptionID string, ascLocation string) AdaptiveApplicationControlsClient { + return NewAdaptiveApplicationControlsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewAdaptiveApplicationControlsClientWithBaseURI creates an instance of the AdaptiveApplicationControlsClient client. +func NewAdaptiveApplicationControlsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AdaptiveApplicationControlsClient { + return AdaptiveApplicationControlsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// Get gets an application control VM/server group. +// Parameters: +// groupName - name of an application control VM/server group +func (client AdaptiveApplicationControlsClient) Get(ctx context.Context, groupName string) (result AppWhitelistingGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveApplicationControlsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AdaptiveApplicationControlsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, groupName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AdaptiveApplicationControlsClient) GetPreparer(ctx context.Context, groupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "ascLocation": autorest.Encode("path", client.AscLocation), + "groupName": autorest.Encode("path", groupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AdaptiveApplicationControlsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AdaptiveApplicationControlsClient) GetResponder(resp *http.Response) (result AppWhitelistingGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of application control VM/server groups for the subscription. +// Parameters: +// includePathRecommendations - include the policy rules +// summary - return output in a summarized form +func (client AdaptiveApplicationControlsClient) List(ctx context.Context, includePathRecommendations *bool, summary *bool) (result AppWhitelistingGroups, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveApplicationControlsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AdaptiveApplicationControlsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, includePathRecommendations, summary) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AdaptiveApplicationControlsClient) ListPreparer(ctx context.Context, includePathRecommendations *bool, summary *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if includePathRecommendations != nil { + queryParameters["includePathRecommendations"] = autorest.Encode("query", *includePathRecommendations) + } + if summary != nil { + queryParameters["summary"] = autorest.Encode("query", *summary) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/applicationWhitelistings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AdaptiveApplicationControlsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client AdaptiveApplicationControlsClient) ListResponder(resp *http.Response) (result AppWhitelistingGroups, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Put update an application control VM/server group +// Parameters: +// groupName - name of an application control VM/server group +// body - the updated VM/server group data +func (client AdaptiveApplicationControlsClient) Put(ctx context.Context, groupName string, body AppWhitelistingPutGroupData) (result AppWhitelistingGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveApplicationControlsClient.Put") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AdaptiveApplicationControlsClient", "Put", err.Error()) + } + + req, err := client.PutPreparer(ctx, groupName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Put", nil, "Failure preparing request") + return + } + + resp, err := client.PutSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Put", resp, "Failure sending request") + return + } + + result, err = client.PutResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Put", resp, "Failure responding to request") + } + + return +} + +// PutPreparer prepares the Put request. +func (client AdaptiveApplicationControlsClient) PutPreparer(ctx context.Context, groupName string, body AppWhitelistingPutGroupData) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "ascLocation": autorest.Encode("path", client.AscLocation), + "groupName": autorest.Encode("path", groupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PutSender sends the Put request. The method will close the +// http.Response Body if it receives an error. +func (client AdaptiveApplicationControlsClient) PutSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// PutResponder handles the response to the Put request. The method always +// closes the http.Response Body. +func (client AdaptiveApplicationControlsClient) PutResponder(resp *http.Response) (result AppWhitelistingGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/security/mgmt/v1.0/security/assessmentsmetadata.go b/services/preview/security/mgmt/v1.0/security/assessmentsmetadata.go deleted file mode 100644 index 1fc3026a4c73..000000000000 --- a/services/preview/security/mgmt/v1.0/security/assessmentsmetadata.go +++ /dev/null @@ -1,221 +0,0 @@ -package security - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AssessmentsMetadataClient is the API spec for Microsoft.Security (Azure Security Center) resource provider -type AssessmentsMetadataClient struct { - BaseClient -} - -// NewAssessmentsMetadataClient creates an instance of the AssessmentsMetadataClient client. -func NewAssessmentsMetadataClient(subscriptionID string, ascLocation string) AssessmentsMetadataClient { - return NewAssessmentsMetadataClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) -} - -// NewAssessmentsMetadataClientWithBaseURI creates an instance of the AssessmentsMetadataClient client. -func NewAssessmentsMetadataClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AssessmentsMetadataClient { - return AssessmentsMetadataClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} -} - -// Get get metadata information on an assessment type -// Parameters: -// assessmentsMetadataName - the Assessment Key - Unique key for the assessment type -func (client AssessmentsMetadataClient) Get(ctx context.Context, assessmentsMetadataName string) (result AssessmentMetadata, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, assessmentsMetadataName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client AssessmentsMetadataClient) GetPreparer(ctx context.Context, assessmentsMetadataName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "assessmentsMetadataName": autorest.Encode("path", assessmentsMetadataName), - } - - const APIVersion = "2019-01-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/providers/Microsoft.Security/assessmentsMetadata/{assessmentsMetadataName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client AssessmentsMetadataClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AssessmentsMetadataClient) GetResponder(resp *http.Response) (result AssessmentMetadata, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List get metadata information on all assessment types -func (client AssessmentsMetadataClient) List(ctx context.Context) (result AssessmentMetadataListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataClient.List") - defer func() { - sc := -1 - if result.aml.Response.Response != nil { - sc = result.aml.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.aml.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "List", resp, "Failure sending request") - return - } - - result.aml, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client AssessmentsMetadataClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2019-01-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.Security/assessmentsMetadata"), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AssessmentsMetadataClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AssessmentsMetadataClient) ListResponder(resp *http.Response) (result AssessmentMetadataList, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client AssessmentsMetadataClient) listNextResults(ctx context.Context, lastResults AssessmentMetadataList) (result AssessmentMetadataList, err error) { - req, err := lastResults.assessmentMetadataListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AssessmentsMetadataClient) ListComplete(ctx context.Context) (result AssessmentMetadataListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} diff --git a/services/preview/security/mgmt/v1.0/security/assessmentsmetadatasubscription.go b/services/preview/security/mgmt/v1.0/security/assessmentsmetadatasubscription.go deleted file mode 100644 index e88c4591d691..000000000000 --- a/services/preview/security/mgmt/v1.0/security/assessmentsmetadatasubscription.go +++ /dev/null @@ -1,241 +0,0 @@ -package security - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AssessmentsMetadataSubscriptionClient is the API spec for Microsoft.Security (Azure Security Center) resource -// provider -type AssessmentsMetadataSubscriptionClient struct { - BaseClient -} - -// NewAssessmentsMetadataSubscriptionClient creates an instance of the AssessmentsMetadataSubscriptionClient client. -func NewAssessmentsMetadataSubscriptionClient(subscriptionID string, ascLocation string) AssessmentsMetadataSubscriptionClient { - return NewAssessmentsMetadataSubscriptionClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) -} - -// NewAssessmentsMetadataSubscriptionClientWithBaseURI creates an instance of the AssessmentsMetadataSubscriptionClient -// client. -func NewAssessmentsMetadataSubscriptionClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AssessmentsMetadataSubscriptionClient { - return AssessmentsMetadataSubscriptionClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} -} - -// Get get metadata information on an assessment type in a specific subscription -// Parameters: -// assessmentsMetadataName - the Assessment Key - Unique key for the assessment type -func (client AssessmentsMetadataSubscriptionClient) Get(ctx context.Context, assessmentsMetadataName string) (result AssessmentMetadata, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataSubscriptionClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AssessmentsMetadataSubscriptionClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, assessmentsMetadataName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client AssessmentsMetadataSubscriptionClient) GetPreparer(ctx context.Context, assessmentsMetadataName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "assessmentsMetadataName": autorest.Encode("path", assessmentsMetadataName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-01-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentsMetadata/{assessmentsMetadataName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client AssessmentsMetadataSubscriptionClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AssessmentsMetadataSubscriptionClient) GetResponder(resp *http.Response) (result AssessmentMetadata, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List get metadata information on all assessment types in a specific subscription -func (client AssessmentsMetadataSubscriptionClient) List(ctx context.Context) (result AssessmentMetadataListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataSubscriptionClient.List") - defer func() { - sc := -1 - if result.aml.Response.Response != nil { - sc = result.aml.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AssessmentsMetadataSubscriptionClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.aml.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "List", resp, "Failure sending request") - return - } - - result.aml, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client AssessmentsMetadataSubscriptionClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-01-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentsMetadata", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AssessmentsMetadataSubscriptionClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AssessmentsMetadataSubscriptionClient) ListResponder(resp *http.Response) (result AssessmentMetadataList, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client AssessmentsMetadataSubscriptionClient) listNextResults(ctx context.Context, lastResults AssessmentMetadataList) (result AssessmentMetadataList, err error) { - req, err := lastResults.assessmentMetadataListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AssessmentsMetadataSubscriptionClient) ListComplete(ctx context.Context) (result AssessmentMetadataListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataSubscriptionClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} diff --git a/services/preview/security/mgmt/v1.0/security/models.go b/services/preview/security/mgmt/v1.0/security/models.go index 76c2fdd625cd..6b41a0671d75 100644 --- a/services/preview/security/mgmt/v1.0/security/models.go +++ b/services/preview/security/mgmt/v1.0/security/models.go @@ -49,6 +49,23 @@ func PossibleAadConnectivityStateValues() []AadConnectivityState { return []AadConnectivityState{Connected, Discovered, NotLicensed} } +// Action enumerates the values for action. +type Action string + +const ( + // Add ... + Add Action = "Add" + // Recommended ... + Recommended Action = "Recommended" + // Remove ... + Remove Action = "Remove" +) + +// PossibleActionValues returns an array of possible values for the Action const type. +func PossibleActionValues() []Action { + return []Action{Add, Recommended, Remove} +} + // AlertNotifications enumerates the values for alert notifications. type AlertNotifications string @@ -79,21 +96,6 @@ func PossibleAlertsToAdminsValues() []AlertsToAdmins { return []AlertsToAdmins{AlertsToAdminsOff, AlertsToAdminsOn} } -// AssessmentType enumerates the values for assessment type. -type AssessmentType string - -const ( - // BuiltIn ... - BuiltIn AssessmentType = "BuiltIn" - // Custom ... - Custom AssessmentType = "Custom" -) - -// PossibleAssessmentTypeValues returns an array of possible values for the AssessmentType const type. -func PossibleAssessmentTypeValues() []AssessmentType { - return []AssessmentType{BuiltIn, Custom} -} - // AutoProvision enumerates the values for auto provision. type AutoProvision string @@ -109,25 +111,67 @@ func PossibleAutoProvisionValues() []AutoProvision { return []AutoProvision{AutoProvisionOff, AutoProvisionOn} } -// Category enumerates the values for category. -type Category string +// ConfigurationStatus enumerates the values for configuration status. +type ConfigurationStatus string + +const ( + // Configured ... + Configured ConfigurationStatus = "Configured" + // Failed ... + Failed ConfigurationStatus = "Failed" + // InProgress ... + InProgress ConfigurationStatus = "InProgress" + // NoStatus ... + NoStatus ConfigurationStatus = "NoStatus" + // NotConfigured ... + NotConfigured ConfigurationStatus = "NotConfigured" +) + +// PossibleConfigurationStatusValues returns an array of possible values for the ConfigurationStatus const type. +func PossibleConfigurationStatusValues() []ConfigurationStatus { + return []ConfigurationStatus{Configured, Failed, InProgress, NoStatus, NotConfigured} +} + +// ConfigurationStatus1 enumerates the values for configuration status 1. +type ConfigurationStatus1 string + +const ( + // ConfigurationStatus1Configured ... + ConfigurationStatus1Configured ConfigurationStatus1 = "Configured" + // ConfigurationStatus1Failed ... + ConfigurationStatus1Failed ConfigurationStatus1 = "Failed" + // ConfigurationStatus1InProgress ... + ConfigurationStatus1InProgress ConfigurationStatus1 = "InProgress" + // ConfigurationStatus1NoStatus ... + ConfigurationStatus1NoStatus ConfigurationStatus1 = "NoStatus" + // ConfigurationStatus1NotConfigured ... + ConfigurationStatus1NotConfigured ConfigurationStatus1 = "NotConfigured" +) + +// PossibleConfigurationStatus1Values returns an array of possible values for the ConfigurationStatus1 const type. +func PossibleConfigurationStatus1Values() []ConfigurationStatus1 { + return []ConfigurationStatus1{ConfigurationStatus1Configured, ConfigurationStatus1Failed, ConfigurationStatus1InProgress, ConfigurationStatus1NoStatus, ConfigurationStatus1NotConfigured} +} + +// ConfigurationStatus2 enumerates the values for configuration status 2. +type ConfigurationStatus2 string const ( - // Compute ... - Compute Category = "Compute" - // Data ... - Data Category = "Data" - // IdentityAndAccess ... - IdentityAndAccess Category = "IdentityAndAccess" - // IoT ... - IoT Category = "IoT" - // Network ... - Network Category = "Network" + // ConfigurationStatus2Configured ... + ConfigurationStatus2Configured ConfigurationStatus2 = "Configured" + // ConfigurationStatus2Failed ... + ConfigurationStatus2Failed ConfigurationStatus2 = "Failed" + // ConfigurationStatus2InProgress ... + ConfigurationStatus2InProgress ConfigurationStatus2 = "InProgress" + // ConfigurationStatus2NoStatus ... + ConfigurationStatus2NoStatus ConfigurationStatus2 = "NoStatus" + // ConfigurationStatus2NotConfigured ... + ConfigurationStatus2NotConfigured ConfigurationStatus2 = "NotConfigured" ) -// PossibleCategoryValues returns an array of possible values for the Category const type. -func PossibleCategoryValues() []Category { - return []Category{Compute, Data, IdentityAndAccess, IoT, Network} +// PossibleConfigurationStatus2Values returns an array of possible values for the ConfigurationStatus2 const type. +func PossibleConfigurationStatus2Values() []ConfigurationStatus2 { + return []ConfigurationStatus2{ConfigurationStatus2Configured, ConfigurationStatus2Failed, ConfigurationStatus2InProgress, ConfigurationStatus2NoStatus, ConfigurationStatus2NotConfigured} } // ConnectionType enumerates the values for connection type. @@ -160,6 +204,36 @@ func PossibleDirectionValues() []Direction { return []Direction{Inbound, Outbound} } +// EnforcementMode enumerates the values for enforcement mode. +type EnforcementMode string + +const ( + // Audit ... + Audit EnforcementMode = "Audit" + // Enforce ... + Enforce EnforcementMode = "Enforce" +) + +// PossibleEnforcementModeValues returns an array of possible values for the EnforcementMode const type. +func PossibleEnforcementModeValues() []EnforcementMode { + return []EnforcementMode{Audit, Enforce} +} + +// EnforcementMode1 enumerates the values for enforcement mode 1. +type EnforcementMode1 string + +const ( + // EnforcementMode1Audit ... + EnforcementMode1Audit EnforcementMode1 = "Audit" + // EnforcementMode1Enforce ... + EnforcementMode1Enforce EnforcementMode1 = "Enforce" +) + +// PossibleEnforcementMode1Values returns an array of possible values for the EnforcementMode1 const type. +func PossibleEnforcementMode1Values() []EnforcementMode1 { + return []EnforcementMode1{EnforcementMode1Audit, EnforcementMode1Enforce} +} + // ExternalSecuritySolutionKind enumerates the values for external security solution kind. type ExternalSecuritySolutionKind string @@ -196,6 +270,52 @@ func PossibleFamilyValues() []Family { return []Family{Ngfw, SaasWaf, Va, Waf} } +// FileType enumerates the values for file type. +type FileType string + +const ( + // Dll ... + Dll FileType = "Dll" + // Exe ... + Exe FileType = "Exe" + // Executable ... + Executable FileType = "Executable" + // Msi ... + Msi FileType = "Msi" + // Script ... + Script FileType = "Script" + // Unknown ... + Unknown FileType = "Unknown" +) + +// PossibleFileTypeValues returns an array of possible values for the FileType const type. +func PossibleFileTypeValues() []FileType { + return []FileType{Dll, Exe, Executable, Msi, Script, Unknown} +} + +// Issue enumerates the values for issue. +type Issue string + +const ( + // ExecutableViolationsAudited ... + ExecutableViolationsAudited Issue = "ExecutableViolationsAudited" + // MsiAndScriptViolationsAudited ... + MsiAndScriptViolationsAudited Issue = "MsiAndScriptViolationsAudited" + // MsiAndScriptViolationsBlocked ... + MsiAndScriptViolationsBlocked Issue = "MsiAndScriptViolationsBlocked" + // RulesViolatedManually ... + RulesViolatedManually Issue = "RulesViolatedManually" + // ViolationsAudited ... + ViolationsAudited Issue = "ViolationsAudited" + // ViolationsBlocked ... + ViolationsBlocked Issue = "ViolationsBlocked" +) + +// PossibleIssueValues returns an array of possible values for the Issue const type. +func PossibleIssueValues() []Issue { + return []Issue{ExecutableViolationsAudited, MsiAndScriptViolationsAudited, MsiAndScriptViolationsBlocked, RulesViolatedManually, ViolationsAudited, ViolationsBlocked} +} + // KindEnum enumerates the values for kind enum. type KindEnum string @@ -247,6 +367,59 @@ func PossibleProtocolValues() []Protocol { return []Protocol{All, TCP, UDP} } +// RecommendationAction enumerates the values for recommendation action. +type RecommendationAction string + +const ( + // RecommendationActionAdd ... + RecommendationActionAdd RecommendationAction = "Add" + // RecommendationActionRecommended ... + RecommendationActionRecommended RecommendationAction = "Recommended" + // RecommendationActionRemove ... + RecommendationActionRemove RecommendationAction = "Remove" +) + +// PossibleRecommendationActionValues returns an array of possible values for the RecommendationAction const type. +func PossibleRecommendationActionValues() []RecommendationAction { + return []RecommendationAction{RecommendationActionAdd, RecommendationActionRecommended, RecommendationActionRemove} +} + +// RecommendationAction1 enumerates the values for recommendation action 1. +type RecommendationAction1 string + +const ( + // RecommendationAction1Add ... + RecommendationAction1Add RecommendationAction1 = "Add" + // RecommendationAction1Recommended ... + RecommendationAction1Recommended RecommendationAction1 = "Recommended" + // RecommendationAction1Remove ... + RecommendationAction1Remove RecommendationAction1 = "Remove" +) + +// PossibleRecommendationAction1Values returns an array of possible values for the RecommendationAction1 const type. +func PossibleRecommendationAction1Values() []RecommendationAction1 { + return []RecommendationAction1{RecommendationAction1Add, RecommendationAction1Recommended, RecommendationAction1Remove} +} + +// RecommendationStatus enumerates the values for recommendation status. +type RecommendationStatus string + +const ( + // RecommendationStatusNoStatus ... + RecommendationStatusNoStatus RecommendationStatus = "NoStatus" + // RecommendationStatusNotAvailable ... + RecommendationStatusNotAvailable RecommendationStatus = "NotAvailable" + // RecommendationStatusNotRecommended ... + RecommendationStatusNotRecommended RecommendationStatus = "NotRecommended" + // RecommendationStatusRecommended ... + RecommendationStatusRecommended RecommendationStatus = "Recommended" +) + +// PossibleRecommendationStatusValues returns an array of possible values for the RecommendationStatus const type. +func PossibleRecommendationStatusValues() []RecommendationStatus { + return []RecommendationStatus{RecommendationStatusNoStatus, RecommendationStatusNotAvailable, RecommendationStatusNotRecommended, RecommendationStatusRecommended} +} + // ReportedSeverity enumerates the values for reported severity. type ReportedSeverity string @@ -266,25 +439,6 @@ func PossibleReportedSeverityValues() []ReportedSeverity { return []ReportedSeverity{High, Information, Low, Silent} } -// RequiredPricingBundle enumerates the values for required pricing bundle. -type RequiredPricingBundle string - -const ( - // AppServices ... - AppServices RequiredPricingBundle = "AppServices" - // SQLServers ... - SQLServers RequiredPricingBundle = "SqlServers" - // StorageAccounts ... - StorageAccounts RequiredPricingBundle = "StorageAccounts" - // VirtualMachines ... - VirtualMachines RequiredPricingBundle = "VirtualMachines" -) - -// PossibleRequiredPricingBundleValues returns an array of possible values for the RequiredPricingBundle const type. -func PossibleRequiredPricingBundleValues() []RequiredPricingBundle { - return []RequiredPricingBundle{AppServices, SQLServers, StorageAccounts, VirtualMachines} -} - // SettingKind enumerates the values for setting kind. type SettingKind string @@ -300,23 +454,45 @@ func PossibleSettingKindValues() []SettingKind { return []SettingKind{SettingKindAlertSuppressionSetting, SettingKindDataExportSetting} } +// SourceSystem enumerates the values for source system. +type SourceSystem string + +const ( + // AzureAppLocker ... + AzureAppLocker SourceSystem = "Azure_AppLocker" + // AzureAuditD ... + AzureAuditD SourceSystem = "Azure_AuditD" + // NonAzureAppLocker ... + NonAzureAppLocker SourceSystem = "NonAzure_AppLocker" + // NonAzureAuditD ... + NonAzureAuditD SourceSystem = "NonAzure_AuditD" + // None ... + None SourceSystem = "None" +) + +// PossibleSourceSystemValues returns an array of possible values for the SourceSystem const type. +func PossibleSourceSystemValues() []SourceSystem { + return []SourceSystem{AzureAppLocker, AzureAuditD, NonAzureAppLocker, NonAzureAuditD, None} +} + // State enumerates the values for state. type State string const ( - // Failed At least one supported regulatory compliance control in the given standard has a state of failed - Failed State = "Failed" - // Passed All supported regulatory compliance controls in the given standard have a passed state - Passed State = "Passed" - // Skipped All supported regulatory compliance controls in the given standard have a state of skipped - Skipped State = "Skipped" - // Unsupported No supported regulatory compliance data for the given standard - Unsupported State = "Unsupported" + // StateFailed At least one supported regulatory compliance control in the given standard has a state of + // failed + StateFailed State = "Failed" + // StatePassed All supported regulatory compliance controls in the given standard have a passed state + StatePassed State = "Passed" + // StateSkipped All supported regulatory compliance controls in the given standard have a state of skipped + StateSkipped State = "Skipped" + // StateUnsupported No supported regulatory compliance data for the given standard + StateUnsupported State = "Unsupported" ) // PossibleStateValues returns an array of possible values for the State const type. func PossibleStateValues() []State { - return []State{Failed, Passed, Skipped, Unsupported} + return []State{StateFailed, StatePassed, StateSkipped, StateUnsupported} } // Status enumerates the values for status. @@ -366,6 +542,29 @@ func PossibleTransportProtocolValues() []TransportProtocol { return []TransportProtocol{TransportProtocolTCP, TransportProtocolUDP} } +// Type enumerates the values for type. +type Type string + +const ( + // BinarySignature ... + BinarySignature Type = "BinarySignature" + // File ... + File Type = "File" + // FileHash ... + FileHash Type = "FileHash" + // ProductSignature ... + ProductSignature Type = "ProductSignature" + // PublisherSignature ... + PublisherSignature Type = "PublisherSignature" + // VersionAndAboveSignature ... + VersionAndAboveSignature Type = "VersionAndAboveSignature" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{BinarySignature, File, FileHash, ProductSignature, PublisherSignature, VersionAndAboveSignature} +} + // ValueType enumerates the values for value type. type ValueType string @@ -1386,6 +1585,128 @@ type AllowlistCustomAlertRule struct { RuleType *string `json:"ruleType,omitempty"` } +// AppWhitelistingGroup ... +type AppWhitelistingGroup struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - READ-ONLY; Location where the resource is stored + Location *string `json:"location,omitempty"` + *AppWhitelistingGroupData `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppWhitelistingGroup. +func (awg AppWhitelistingGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if awg.AppWhitelistingGroupData != nil { + objectMap["properties"] = awg.AppWhitelistingGroupData + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AppWhitelistingGroup struct. +func (awg *AppWhitelistingGroup) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + awg.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + awg.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + awg.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + awg.Location = &location + } + case "properties": + if v != nil { + var appWhitelistingGroupData AppWhitelistingGroupData + err = json.Unmarshal(*v, &appWhitelistingGroupData) + if err != nil { + return err + } + awg.AppWhitelistingGroupData = &appWhitelistingGroupData + } + } + } + + return nil +} + +// AppWhitelistingGroupData represents a VM/server group and set of rules that are Recommended by Azure +// Security Center to be allowed +type AppWhitelistingGroupData struct { + // EnforcementMode - Possible values include: 'Audit', 'Enforce' + EnforcementMode EnforcementMode `json:"enforcementMode,omitempty"` + // ConfigurationStatus - Possible values include: 'ConfigurationStatus2Configured', 'ConfigurationStatus2NotConfigured', 'ConfigurationStatus2InProgress', 'ConfigurationStatus2Failed', 'ConfigurationStatus2NoStatus' + ConfigurationStatus ConfigurationStatus2 `json:"configurationStatus,omitempty"` + // RecommendationStatus - Possible values include: 'RecommendationStatusRecommended', 'RecommendationStatusNotRecommended', 'RecommendationStatusNotAvailable', 'RecommendationStatusNoStatus' + RecommendationStatus RecommendationStatus `json:"recommendationStatus,omitempty"` + Issues *[]AppWhitelistingIssueSummary `json:"issues,omitempty"` + // SourceSystem - Possible values include: 'AzureAppLocker', 'AzureAuditD', 'NonAzureAppLocker', 'NonAzureAuditD', 'None' + SourceSystem SourceSystem `json:"sourceSystem,omitempty"` + VMRecommendations *[]VMRecommendation `json:"vmRecommendations,omitempty"` + PathRecommendations *[]PathRecommendation `json:"pathRecommendations,omitempty"` +} + +// AppWhitelistingGroups represents a list of VM/server groups and set of rules that are Recommended by +// Azure Security Center to be allowed +type AppWhitelistingGroups struct { + autorest.Response `json:"-"` + Value *[]AppWhitelistingGroup `json:"value,omitempty"` +} + +// AppWhitelistingIssueSummary represents a summary of the alerts of the VM/server group +type AppWhitelistingIssueSummary struct { + // Issue - Possible values include: 'ViolationsAudited', 'ViolationsBlocked', 'MsiAndScriptViolationsAudited', 'MsiAndScriptViolationsBlocked', 'ExecutableViolationsAudited', 'RulesViolatedManually' + Issue Issue `json:"issue,omitempty"` + // NumberOfVms - The number of machines in the VM/server group that have this alert + NumberOfVms *float64 `json:"numberOfVms,omitempty"` +} + +// AppWhitelistingPutGroupData the altered data of the recommended VM/server group policy +type AppWhitelistingPutGroupData struct { + // EnforcementMode - Possible values include: 'EnforcementMode1Audit', 'EnforcementMode1Enforce' + EnforcementMode EnforcementMode1 `json:"enforcementMode,omitempty"` + VMRecommendations *[]VMRecommendation `json:"vmRecommendations,omitempty"` + PathRecommendations *[]PathRecommendation `json:"pathRecommendations,omitempty"` +} + // AscLocation the ASC location of the subscription is in the "name" field type AscLocation struct { autorest.Response `json:"-"` @@ -1544,246 +1865,6 @@ func NewAscLocationListPage(getNextPage func(context.Context, AscLocationList) ( return AscLocationListPage{fn: getNextPage} } -// AssessmentMetadata security assessment metadata -type AssessmentMetadata struct { - autorest.Response `json:"-"` - *AssessmentMetadataProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for AssessmentMetadata. -func (am AssessmentMetadata) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if am.AssessmentMetadataProperties != nil { - objectMap["properties"] = am.AssessmentMetadataProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AssessmentMetadata struct. -func (am *AssessmentMetadata) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var assessmentMetadataProperties AssessmentMetadataProperties - err = json.Unmarshal(*v, &assessmentMetadataProperties) - if err != nil { - return err - } - am.AssessmentMetadataProperties = &assessmentMetadataProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - am.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - am.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - am.Type = &typeVar - } - } - } - - return nil -} - -// AssessmentMetadataList list of security assessment metadata -type AssessmentMetadataList struct { - autorest.Response `json:"-"` - // Value - READ-ONLY - Value *[]AssessmentMetadata `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` -} - -// AssessmentMetadataListIterator provides access to a complete listing of AssessmentMetadata values. -type AssessmentMetadataListIterator struct { - i int - page AssessmentMetadataListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AssessmentMetadataListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentMetadataListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AssessmentMetadataListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AssessmentMetadataListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AssessmentMetadataListIterator) Response() AssessmentMetadataList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AssessmentMetadataListIterator) Value() AssessmentMetadata { - if !iter.page.NotDone() { - return AssessmentMetadata{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AssessmentMetadataListIterator type. -func NewAssessmentMetadataListIterator(page AssessmentMetadataListPage) AssessmentMetadataListIterator { - return AssessmentMetadataListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (aml AssessmentMetadataList) IsEmpty() bool { - return aml.Value == nil || len(*aml.Value) == 0 -} - -// assessmentMetadataListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (aml AssessmentMetadataList) assessmentMetadataListPreparer(ctx context.Context) (*http.Request, error) { - if aml.NextLink == nil || len(to.String(aml.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(aml.NextLink))) -} - -// AssessmentMetadataListPage contains a page of AssessmentMetadata values. -type AssessmentMetadataListPage struct { - fn func(context.Context, AssessmentMetadataList) (AssessmentMetadataList, error) - aml AssessmentMetadataList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AssessmentMetadataListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentMetadataListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - next, err := page.fn(ctx, page.aml) - if err != nil { - return err - } - page.aml = next - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AssessmentMetadataListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AssessmentMetadataListPage) NotDone() bool { - return !page.aml.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AssessmentMetadataListPage) Response() AssessmentMetadataList { - return page.aml -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AssessmentMetadataListPage) Values() []AssessmentMetadata { - if page.aml.IsEmpty() { - return nil - } - return *page.aml.Value -} - -// Creates a new instance of the AssessmentMetadataListPage type. -func NewAssessmentMetadataListPage(getNextPage func(context.Context, AssessmentMetadataList) (AssessmentMetadataList, error)) AssessmentMetadataListPage { - return AssessmentMetadataListPage{fn: getNextPage} -} - -// AssessmentMetadataProperties describes properties of an assessment metadata. -type AssessmentMetadataProperties struct { - // DisplayName - READ-ONLY; User friendly display name of the assessment - DisplayName *string `json:"displayName,omitempty"` - // PolicyDefinitionID - READ-ONLY; Azure resource ID of the policy definition that turns this assessment calculation on - PolicyDefinitionID *string `json:"policyDefinitionId,omitempty"` - // Description - READ-ONLY; Human readable description of the assessment - Description *string `json:"description,omitempty"` - // RemediationDescription - READ-ONLY; Human readable description of what you should do to mitigate this security issue - RemediationDescription *string `json:"remediationDescription,omitempty"` - // Category - READ-ONLY - Category *[]Category `json:"category,omitempty"` - // SecureScoreWeight - READ-ONLY; Weight for the security score calculation. the higher this number, this severity of this assessment is higher - SecureScoreWeight *int32 `json:"secureScoreWeight,omitempty"` - // RequiredPricingBundle - READ-ONLY - RequiredPricingBundle *[]RequiredPricingBundle `json:"requiredPricingBundle,omitempty"` - // Preview - READ-ONLY; True if this assessment is in preview release status - Preview *bool `json:"preview,omitempty"` - // AssessmentType - READ-ONLY; BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure Policy definition. Possible values include: 'BuiltIn', 'Custom' - AssessmentType AssessmentType `json:"assessmentType,omitempty"` -} - // AtaExternalSecuritySolution represents an ATA security solution which sends logs to an OMS workspace type AtaExternalSecuritySolution struct { Properties *AtaSolutionProperties `json:"properties,omitempty"` @@ -4657,6 +4738,25 @@ func NewOperationListPage(getNextPage func(context.Context, OperationList) (Oper return OperationListPage{fn: getNextPage} } +// PathRecommendation represents a path that is recommended to be allowed and its properties +type PathRecommendation struct { + // Path - The full path to whitelist + Path *string `json:"path,omitempty"` + // Action - Possible values include: 'Recommended', 'Add', 'Remove' + Action Action `json:"action,omitempty"` + // Type - Possible values include: 'File', 'FileHash', 'PublisherSignature', 'ProductSignature', 'BinarySignature', 'VersionAndAboveSignature' + Type Type `json:"type,omitempty"` + PublisherInfo *PublisherInfo `json:"publisherInfo,omitempty"` + // Common - Whether the path is commonly run on the machine + Common *bool `json:"common,omitempty"` + UserSids *[]string `json:"userSids,omitempty"` + Usernames *[]UserRecommendation `json:"usernames,omitempty"` + // FileType - Possible values include: 'Exe', 'Dll', 'Msi', 'Script', 'Executable', 'Unknown' + FileType FileType `json:"fileType,omitempty"` + // ConfigurationStatus - Possible values include: 'ConfigurationStatus1Configured', 'ConfigurationStatus1NotConfigured', 'ConfigurationStatus1InProgress', 'ConfigurationStatus1Failed', 'ConfigurationStatus1NoStatus' + ConfigurationStatus ConfigurationStatus1 `json:"configurationStatus,omitempty"` +} + // Pricing pricing tier will be applied for the scope based on the resource ID type Pricing struct { autorest.Response `json:"-"` @@ -4882,6 +4982,18 @@ type PricingProperties struct { PricingTier PricingTier `json:"pricingTier,omitempty"` } +// PublisherInfo represents the publisher information of a process/rule +type PublisherInfo struct { + // PublisherName - The Subject field of the x.509 certificate used to sign the code, using the following fields - O = Organization, L = Locality, S = State or Province, and C = Country + PublisherName *string `json:"publisherName,omitempty"` + // ProductName - The product name taken from the file's version resource + ProductName *string `json:"productName,omitempty"` + // BinaryName - The "OriginalName" field taken from the file's version resource + BinaryName *string `json:"binaryName,omitempty"` + // Version - The binary file version taken from the file's version resource + Version *string `json:"version,omitempty"` +} + // RegulatoryComplianceAssessment regulatory compliance assessment details and state type RegulatoryComplianceAssessment struct { autorest.Response `json:"-"` @@ -5109,7 +5221,7 @@ type RegulatoryComplianceAssessmentProperties struct { AssessmentType *string `json:"assessmentType,omitempty"` // AssessmentDetailsLink - READ-ONLY; Link to more detailed assessment results data. The response type will be according to the assessmentType field AssessmentDetailsLink *string `json:"assessmentDetailsLink,omitempty"` - // State - Aggregative state based on the assessment's scanned resources states. Possible values include: 'Passed', 'Failed', 'Skipped', 'Unsupported' + // State - Aggregative state based on the assessment's scanned resources states. Possible values include: 'StatePassed', 'StateFailed', 'StateSkipped', 'StateUnsupported' State State `json:"state,omitempty"` // PassedResources - READ-ONLY; The given assessment's related resources count with passed state. PassedResources *int32 `json:"passedResources,omitempty"` @@ -5345,7 +5457,7 @@ func NewRegulatoryComplianceControlListPage(getNextPage func(context.Context, Re type RegulatoryComplianceControlProperties struct { // Description - READ-ONLY; The description of the regulatory compliance control Description *string `json:"description,omitempty"` - // State - Aggregative state based on the control's supported assessments states. Possible values include: 'Passed', 'Failed', 'Skipped', 'Unsupported' + // State - Aggregative state based on the control's supported assessments states. Possible values include: 'StatePassed', 'StateFailed', 'StateSkipped', 'StateUnsupported' State State `json:"state,omitempty"` // PassedAssessments - READ-ONLY; The number of supported regulatory compliance assessments of the given control with a passed state PassedAssessments *int32 `json:"passedAssessments,omitempty"` @@ -5576,7 +5688,7 @@ func NewRegulatoryComplianceStandardListPage(getNextPage func(context.Context, R // RegulatoryComplianceStandardProperties regulatory compliance standard data type RegulatoryComplianceStandardProperties struct { - // State - Aggregative state based on the standard's supported controls states. Possible values include: 'Passed', 'Failed', 'Skipped', 'Unsupported' + // State - Aggregative state based on the standard's supported controls states. Possible values include: 'StatePassed', 'StateFailed', 'StateSkipped', 'StateUnsupported' State State `json:"state,omitempty"` // PassedControls - READ-ONLY; The number of supported regulatory compliance controls of the given standard with a passed state PassedControls *int32 `json:"passedControls,omitempty"` @@ -6382,6 +6494,23 @@ type TopologySingleResourceParent struct { ResourceID *string `json:"resourceId,omitempty"` } +// UserRecommendation represents a user that is recommended to be allowed for a certain rule +type UserRecommendation struct { + // Username - Represents a user that is recommended to be allowed for a certain rule + Username *string `json:"username,omitempty"` + // RecommendationAction - Possible values include: 'RecommendationAction1Recommended', 'RecommendationAction1Add', 'RecommendationAction1Remove' + RecommendationAction RecommendationAction1 `json:"recommendationAction,omitempty"` +} + +// VMRecommendation represents a machine that is part of a VM/server group +type VMRecommendation struct { + // ConfigurationStatus - Possible values include: 'Configured', 'NotConfigured', 'InProgress', 'Failed', 'NoStatus' + ConfigurationStatus ConfigurationStatus `json:"configurationStatus,omitempty"` + // RecommendationAction - Possible values include: 'RecommendationActionRecommended', 'RecommendationActionAdd', 'RecommendationActionRemove' + RecommendationAction RecommendationAction `json:"recommendationAction,omitempty"` + ResourceID *string `json:"resourceId,omitempty"` +} + // WorkspaceSetting configures where to store the OMS agent data for workspaces under a scope type WorkspaceSetting struct { autorest.Response `json:"-"` diff --git a/services/preview/security/mgmt/v1.0/security/securityapi/interfaces.go b/services/preview/security/mgmt/v1.0/security/securityapi/interfaces.go index 98583e0919a6..06c5df144765 100644 --- a/services/preview/security/mgmt/v1.0/security/securityapi/interfaces.go +++ b/services/preview/security/mgmt/v1.0/security/securityapi/interfaces.go @@ -47,22 +47,6 @@ type RegulatoryComplianceAssessmentsClientAPI interface { var _ RegulatoryComplianceAssessmentsClientAPI = (*security.RegulatoryComplianceAssessmentsClient)(nil) -// AssessmentsMetadataClientAPI contains the set of methods on the AssessmentsMetadataClient type. -type AssessmentsMetadataClientAPI interface { - Get(ctx context.Context, assessmentsMetadataName string) (result security.AssessmentMetadata, err error) - List(ctx context.Context) (result security.AssessmentMetadataListPage, err error) -} - -var _ AssessmentsMetadataClientAPI = (*security.AssessmentsMetadataClient)(nil) - -// AssessmentsMetadataSubscriptionClientAPI contains the set of methods on the AssessmentsMetadataSubscriptionClient type. -type AssessmentsMetadataSubscriptionClientAPI interface { - Get(ctx context.Context, assessmentsMetadataName string) (result security.AssessmentMetadata, err error) - List(ctx context.Context) (result security.AssessmentMetadataListPage, err error) -} - -var _ AssessmentsMetadataSubscriptionClientAPI = (*security.AssessmentsMetadataSubscriptionClient)(nil) - // PricingsClientAPI contains the set of methods on the PricingsClient type. type PricingsClientAPI interface { CreateOrUpdateResourceGroupPricing(ctx context.Context, resourceGroupName string, pricingName string, pricing security.Pricing) (result security.Pricing, err error) @@ -215,6 +199,15 @@ type JitNetworkAccessPoliciesClientAPI interface { var _ JitNetworkAccessPoliciesClientAPI = (*security.JitNetworkAccessPoliciesClient)(nil) +// AdaptiveApplicationControlsClientAPI contains the set of methods on the AdaptiveApplicationControlsClient type. +type AdaptiveApplicationControlsClientAPI interface { + Get(ctx context.Context, groupName string) (result security.AppWhitelistingGroup, err error) + List(ctx context.Context, includePathRecommendations *bool, summary *bool) (result security.AppWhitelistingGroups, err error) + Put(ctx context.Context, groupName string, body security.AppWhitelistingPutGroupData) (result security.AppWhitelistingGroup, err error) +} + +var _ AdaptiveApplicationControlsClientAPI = (*security.AdaptiveApplicationControlsClient)(nil) + // ExternalSecuritySolutionsClientAPI contains the set of methods on the ExternalSecuritySolutionsClient type. type ExternalSecuritySolutionsClientAPI interface { Get(ctx context.Context, resourceGroupName string, externalSecuritySolutionsName string) (result security.ExternalSecuritySolutionModel, err error) diff --git a/services/preview/security/mgmt/v2.0/security/adaptiveapplicationcontrols.go b/services/preview/security/mgmt/v2.0/security/adaptiveapplicationcontrols.go new file mode 100644 index 000000000000..8fe79f24b6d0 --- /dev/null +++ b/services/preview/security/mgmt/v2.0/security/adaptiveapplicationcontrols.go @@ -0,0 +1,296 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// AdaptiveApplicationControlsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type AdaptiveApplicationControlsClient struct { + BaseClient +} + +// NewAdaptiveApplicationControlsClient creates an instance of the AdaptiveApplicationControlsClient client. +func NewAdaptiveApplicationControlsClient(subscriptionID string, ascLocation string) AdaptiveApplicationControlsClient { + return NewAdaptiveApplicationControlsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewAdaptiveApplicationControlsClientWithBaseURI creates an instance of the AdaptiveApplicationControlsClient client. +func NewAdaptiveApplicationControlsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AdaptiveApplicationControlsClient { + return AdaptiveApplicationControlsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// Get gets an application control VM/server group. +// Parameters: +// groupName - name of an application control VM/server group +func (client AdaptiveApplicationControlsClient) Get(ctx context.Context, groupName string) (result AppWhitelistingGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveApplicationControlsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AdaptiveApplicationControlsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, groupName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AdaptiveApplicationControlsClient) GetPreparer(ctx context.Context, groupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "ascLocation": autorest.Encode("path", client.AscLocation), + "groupName": autorest.Encode("path", groupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AdaptiveApplicationControlsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AdaptiveApplicationControlsClient) GetResponder(resp *http.Response) (result AppWhitelistingGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of application control VM/server groups for the subscription. +// Parameters: +// includePathRecommendations - include the policy rules +// summary - return output in a summarized form +func (client AdaptiveApplicationControlsClient) List(ctx context.Context, includePathRecommendations *bool, summary *bool) (result AppWhitelistingGroups, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveApplicationControlsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AdaptiveApplicationControlsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, includePathRecommendations, summary) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AdaptiveApplicationControlsClient) ListPreparer(ctx context.Context, includePathRecommendations *bool, summary *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if includePathRecommendations != nil { + queryParameters["includePathRecommendations"] = autorest.Encode("query", *includePathRecommendations) + } + if summary != nil { + queryParameters["summary"] = autorest.Encode("query", *summary) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/applicationWhitelistings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AdaptiveApplicationControlsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client AdaptiveApplicationControlsClient) ListResponder(resp *http.Response) (result AppWhitelistingGroups, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Put update an application control VM/server group +// Parameters: +// groupName - name of an application control VM/server group +// body - the updated VM/server group data +func (client AdaptiveApplicationControlsClient) Put(ctx context.Context, groupName string, body AppWhitelistingPutGroupData) (result AppWhitelistingGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveApplicationControlsClient.Put") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AdaptiveApplicationControlsClient", "Put", err.Error()) + } + + req, err := client.PutPreparer(ctx, groupName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Put", nil, "Failure preparing request") + return + } + + resp, err := client.PutSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Put", resp, "Failure sending request") + return + } + + result, err = client.PutResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Put", resp, "Failure responding to request") + } + + return +} + +// PutPreparer prepares the Put request. +func (client AdaptiveApplicationControlsClient) PutPreparer(ctx context.Context, groupName string, body AppWhitelistingPutGroupData) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "ascLocation": autorest.Encode("path", client.AscLocation), + "groupName": autorest.Encode("path", groupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PutSender sends the Put request. The method will close the +// http.Response Body if it receives an error. +func (client AdaptiveApplicationControlsClient) PutSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// PutResponder handles the response to the Put request. The method always +// closes the http.Response Body. +func (client AdaptiveApplicationControlsClient) PutResponder(resp *http.Response) (result AppWhitelistingGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/security/mgmt/v2.0/security/assessmentsmetadata.go b/services/preview/security/mgmt/v2.0/security/assessmentsmetadata.go deleted file mode 100644 index 1fc3026a4c73..000000000000 --- a/services/preview/security/mgmt/v2.0/security/assessmentsmetadata.go +++ /dev/null @@ -1,221 +0,0 @@ -package security - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AssessmentsMetadataClient is the API spec for Microsoft.Security (Azure Security Center) resource provider -type AssessmentsMetadataClient struct { - BaseClient -} - -// NewAssessmentsMetadataClient creates an instance of the AssessmentsMetadataClient client. -func NewAssessmentsMetadataClient(subscriptionID string, ascLocation string) AssessmentsMetadataClient { - return NewAssessmentsMetadataClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) -} - -// NewAssessmentsMetadataClientWithBaseURI creates an instance of the AssessmentsMetadataClient client. -func NewAssessmentsMetadataClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AssessmentsMetadataClient { - return AssessmentsMetadataClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} -} - -// Get get metadata information on an assessment type -// Parameters: -// assessmentsMetadataName - the Assessment Key - Unique key for the assessment type -func (client AssessmentsMetadataClient) Get(ctx context.Context, assessmentsMetadataName string) (result AssessmentMetadata, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, assessmentsMetadataName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client AssessmentsMetadataClient) GetPreparer(ctx context.Context, assessmentsMetadataName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "assessmentsMetadataName": autorest.Encode("path", assessmentsMetadataName), - } - - const APIVersion = "2019-01-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/providers/Microsoft.Security/assessmentsMetadata/{assessmentsMetadataName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client AssessmentsMetadataClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AssessmentsMetadataClient) GetResponder(resp *http.Response) (result AssessmentMetadata, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List get metadata information on all assessment types -func (client AssessmentsMetadataClient) List(ctx context.Context) (result AssessmentMetadataListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataClient.List") - defer func() { - sc := -1 - if result.aml.Response.Response != nil { - sc = result.aml.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.aml.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "List", resp, "Failure sending request") - return - } - - result.aml, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client AssessmentsMetadataClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2019-01-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.Security/assessmentsMetadata"), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AssessmentsMetadataClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AssessmentsMetadataClient) ListResponder(resp *http.Response) (result AssessmentMetadataList, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client AssessmentsMetadataClient) listNextResults(ctx context.Context, lastResults AssessmentMetadataList) (result AssessmentMetadataList, err error) { - req, err := lastResults.assessmentMetadataListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AssessmentsMetadataClient) ListComplete(ctx context.Context) (result AssessmentMetadataListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} diff --git a/services/preview/security/mgmt/v2.0/security/assessmentsmetadatasubscription.go b/services/preview/security/mgmt/v2.0/security/assessmentsmetadatasubscription.go deleted file mode 100644 index e88c4591d691..000000000000 --- a/services/preview/security/mgmt/v2.0/security/assessmentsmetadatasubscription.go +++ /dev/null @@ -1,241 +0,0 @@ -package security - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AssessmentsMetadataSubscriptionClient is the API spec for Microsoft.Security (Azure Security Center) resource -// provider -type AssessmentsMetadataSubscriptionClient struct { - BaseClient -} - -// NewAssessmentsMetadataSubscriptionClient creates an instance of the AssessmentsMetadataSubscriptionClient client. -func NewAssessmentsMetadataSubscriptionClient(subscriptionID string, ascLocation string) AssessmentsMetadataSubscriptionClient { - return NewAssessmentsMetadataSubscriptionClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) -} - -// NewAssessmentsMetadataSubscriptionClientWithBaseURI creates an instance of the AssessmentsMetadataSubscriptionClient -// client. -func NewAssessmentsMetadataSubscriptionClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AssessmentsMetadataSubscriptionClient { - return AssessmentsMetadataSubscriptionClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} -} - -// Get get metadata information on an assessment type in a specific subscription -// Parameters: -// assessmentsMetadataName - the Assessment Key - Unique key for the assessment type -func (client AssessmentsMetadataSubscriptionClient) Get(ctx context.Context, assessmentsMetadataName string) (result AssessmentMetadata, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataSubscriptionClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AssessmentsMetadataSubscriptionClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, assessmentsMetadataName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client AssessmentsMetadataSubscriptionClient) GetPreparer(ctx context.Context, assessmentsMetadataName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "assessmentsMetadataName": autorest.Encode("path", assessmentsMetadataName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-01-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentsMetadata/{assessmentsMetadataName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client AssessmentsMetadataSubscriptionClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AssessmentsMetadataSubscriptionClient) GetResponder(resp *http.Response) (result AssessmentMetadata, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List get metadata information on all assessment types in a specific subscription -func (client AssessmentsMetadataSubscriptionClient) List(ctx context.Context) (result AssessmentMetadataListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataSubscriptionClient.List") - defer func() { - sc := -1 - if result.aml.Response.Response != nil { - sc = result.aml.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AssessmentsMetadataSubscriptionClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.aml.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "List", resp, "Failure sending request") - return - } - - result.aml, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client AssessmentsMetadataSubscriptionClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-01-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentsMetadata", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AssessmentsMetadataSubscriptionClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AssessmentsMetadataSubscriptionClient) ListResponder(resp *http.Response) (result AssessmentMetadataList, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client AssessmentsMetadataSubscriptionClient) listNextResults(ctx context.Context, lastResults AssessmentMetadataList) (result AssessmentMetadataList, err error) { - req, err := lastResults.assessmentMetadataListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AssessmentsMetadataSubscriptionClient) ListComplete(ctx context.Context) (result AssessmentMetadataListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataSubscriptionClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} diff --git a/services/preview/security/mgmt/v2.0/security/models.go b/services/preview/security/mgmt/v2.0/security/models.go index bfd9fde122c0..d2369e5e53bb 100644 --- a/services/preview/security/mgmt/v2.0/security/models.go +++ b/services/preview/security/mgmt/v2.0/security/models.go @@ -49,6 +49,23 @@ func PossibleAadConnectivityStateValues() []AadConnectivityState { return []AadConnectivityState{Connected, Discovered, NotLicensed} } +// Action enumerates the values for action. +type Action string + +const ( + // Add ... + Add Action = "Add" + // Recommended ... + Recommended Action = "Recommended" + // Remove ... + Remove Action = "Remove" +) + +// PossibleActionValues returns an array of possible values for the Action const type. +func PossibleActionValues() []Action { + return []Action{Add, Recommended, Remove} +} + // AlertNotifications enumerates the values for alert notifications. type AlertNotifications string @@ -79,21 +96,6 @@ func PossibleAlertsToAdminsValues() []AlertsToAdmins { return []AlertsToAdmins{AlertsToAdminsOff, AlertsToAdminsOn} } -// AssessmentType enumerates the values for assessment type. -type AssessmentType string - -const ( - // BuiltIn ... - BuiltIn AssessmentType = "BuiltIn" - // Custom ... - Custom AssessmentType = "Custom" -) - -// PossibleAssessmentTypeValues returns an array of possible values for the AssessmentType const type. -func PossibleAssessmentTypeValues() []AssessmentType { - return []AssessmentType{BuiltIn, Custom} -} - // AutoProvision enumerates the values for auto provision. type AutoProvision string @@ -109,25 +111,67 @@ func PossibleAutoProvisionValues() []AutoProvision { return []AutoProvision{AutoProvisionOff, AutoProvisionOn} } -// Category enumerates the values for category. -type Category string +// ConfigurationStatus enumerates the values for configuration status. +type ConfigurationStatus string + +const ( + // Configured ... + Configured ConfigurationStatus = "Configured" + // Failed ... + Failed ConfigurationStatus = "Failed" + // InProgress ... + InProgress ConfigurationStatus = "InProgress" + // NoStatus ... + NoStatus ConfigurationStatus = "NoStatus" + // NotConfigured ... + NotConfigured ConfigurationStatus = "NotConfigured" +) + +// PossibleConfigurationStatusValues returns an array of possible values for the ConfigurationStatus const type. +func PossibleConfigurationStatusValues() []ConfigurationStatus { + return []ConfigurationStatus{Configured, Failed, InProgress, NoStatus, NotConfigured} +} + +// ConfigurationStatus1 enumerates the values for configuration status 1. +type ConfigurationStatus1 string + +const ( + // ConfigurationStatus1Configured ... + ConfigurationStatus1Configured ConfigurationStatus1 = "Configured" + // ConfigurationStatus1Failed ... + ConfigurationStatus1Failed ConfigurationStatus1 = "Failed" + // ConfigurationStatus1InProgress ... + ConfigurationStatus1InProgress ConfigurationStatus1 = "InProgress" + // ConfigurationStatus1NoStatus ... + ConfigurationStatus1NoStatus ConfigurationStatus1 = "NoStatus" + // ConfigurationStatus1NotConfigured ... + ConfigurationStatus1NotConfigured ConfigurationStatus1 = "NotConfigured" +) + +// PossibleConfigurationStatus1Values returns an array of possible values for the ConfigurationStatus1 const type. +func PossibleConfigurationStatus1Values() []ConfigurationStatus1 { + return []ConfigurationStatus1{ConfigurationStatus1Configured, ConfigurationStatus1Failed, ConfigurationStatus1InProgress, ConfigurationStatus1NoStatus, ConfigurationStatus1NotConfigured} +} + +// ConfigurationStatus2 enumerates the values for configuration status 2. +type ConfigurationStatus2 string const ( - // Compute ... - Compute Category = "Compute" - // Data ... - Data Category = "Data" - // IdentityAndAccess ... - IdentityAndAccess Category = "IdentityAndAccess" - // IoT ... - IoT Category = "IoT" - // Network ... - Network Category = "Network" + // ConfigurationStatus2Configured ... + ConfigurationStatus2Configured ConfigurationStatus2 = "Configured" + // ConfigurationStatus2Failed ... + ConfigurationStatus2Failed ConfigurationStatus2 = "Failed" + // ConfigurationStatus2InProgress ... + ConfigurationStatus2InProgress ConfigurationStatus2 = "InProgress" + // ConfigurationStatus2NoStatus ... + ConfigurationStatus2NoStatus ConfigurationStatus2 = "NoStatus" + // ConfigurationStatus2NotConfigured ... + ConfigurationStatus2NotConfigured ConfigurationStatus2 = "NotConfigured" ) -// PossibleCategoryValues returns an array of possible values for the Category const type. -func PossibleCategoryValues() []Category { - return []Category{Compute, Data, IdentityAndAccess, IoT, Network} +// PossibleConfigurationStatus2Values returns an array of possible values for the ConfigurationStatus2 const type. +func PossibleConfigurationStatus2Values() []ConfigurationStatus2 { + return []ConfigurationStatus2{ConfigurationStatus2Configured, ConfigurationStatus2Failed, ConfigurationStatus2InProgress, ConfigurationStatus2NoStatus, ConfigurationStatus2NotConfigured} } // ConnectionType enumerates the values for connection type. @@ -160,6 +204,36 @@ func PossibleDirectionValues() []Direction { return []Direction{Inbound, Outbound} } +// EnforcementMode enumerates the values for enforcement mode. +type EnforcementMode string + +const ( + // Audit ... + Audit EnforcementMode = "Audit" + // Enforce ... + Enforce EnforcementMode = "Enforce" +) + +// PossibleEnforcementModeValues returns an array of possible values for the EnforcementMode const type. +func PossibleEnforcementModeValues() []EnforcementMode { + return []EnforcementMode{Audit, Enforce} +} + +// EnforcementMode1 enumerates the values for enforcement mode 1. +type EnforcementMode1 string + +const ( + // EnforcementMode1Audit ... + EnforcementMode1Audit EnforcementMode1 = "Audit" + // EnforcementMode1Enforce ... + EnforcementMode1Enforce EnforcementMode1 = "Enforce" +) + +// PossibleEnforcementMode1Values returns an array of possible values for the EnforcementMode1 const type. +func PossibleEnforcementMode1Values() []EnforcementMode1 { + return []EnforcementMode1{EnforcementMode1Audit, EnforcementMode1Enforce} +} + // ExternalSecuritySolutionKind enumerates the values for external security solution kind. type ExternalSecuritySolutionKind string @@ -196,6 +270,52 @@ func PossibleFamilyValues() []Family { return []Family{Ngfw, SaasWaf, Va, Waf} } +// FileType enumerates the values for file type. +type FileType string + +const ( + // Dll ... + Dll FileType = "Dll" + // Exe ... + Exe FileType = "Exe" + // Executable ... + Executable FileType = "Executable" + // Msi ... + Msi FileType = "Msi" + // Script ... + Script FileType = "Script" + // Unknown ... + Unknown FileType = "Unknown" +) + +// PossibleFileTypeValues returns an array of possible values for the FileType const type. +func PossibleFileTypeValues() []FileType { + return []FileType{Dll, Exe, Executable, Msi, Script, Unknown} +} + +// Issue enumerates the values for issue. +type Issue string + +const ( + // ExecutableViolationsAudited ... + ExecutableViolationsAudited Issue = "ExecutableViolationsAudited" + // MsiAndScriptViolationsAudited ... + MsiAndScriptViolationsAudited Issue = "MsiAndScriptViolationsAudited" + // MsiAndScriptViolationsBlocked ... + MsiAndScriptViolationsBlocked Issue = "MsiAndScriptViolationsBlocked" + // RulesViolatedManually ... + RulesViolatedManually Issue = "RulesViolatedManually" + // ViolationsAudited ... + ViolationsAudited Issue = "ViolationsAudited" + // ViolationsBlocked ... + ViolationsBlocked Issue = "ViolationsBlocked" +) + +// PossibleIssueValues returns an array of possible values for the Issue const type. +func PossibleIssueValues() []Issue { + return []Issue{ExecutableViolationsAudited, MsiAndScriptViolationsAudited, MsiAndScriptViolationsBlocked, RulesViolatedManually, ViolationsAudited, ViolationsBlocked} +} + // KindEnum enumerates the values for kind enum. type KindEnum string @@ -247,6 +367,59 @@ func PossibleProtocolValues() []Protocol { return []Protocol{All, TCP, UDP} } +// RecommendationAction enumerates the values for recommendation action. +type RecommendationAction string + +const ( + // RecommendationActionAdd ... + RecommendationActionAdd RecommendationAction = "Add" + // RecommendationActionRecommended ... + RecommendationActionRecommended RecommendationAction = "Recommended" + // RecommendationActionRemove ... + RecommendationActionRemove RecommendationAction = "Remove" +) + +// PossibleRecommendationActionValues returns an array of possible values for the RecommendationAction const type. +func PossibleRecommendationActionValues() []RecommendationAction { + return []RecommendationAction{RecommendationActionAdd, RecommendationActionRecommended, RecommendationActionRemove} +} + +// RecommendationAction1 enumerates the values for recommendation action 1. +type RecommendationAction1 string + +const ( + // RecommendationAction1Add ... + RecommendationAction1Add RecommendationAction1 = "Add" + // RecommendationAction1Recommended ... + RecommendationAction1Recommended RecommendationAction1 = "Recommended" + // RecommendationAction1Remove ... + RecommendationAction1Remove RecommendationAction1 = "Remove" +) + +// PossibleRecommendationAction1Values returns an array of possible values for the RecommendationAction1 const type. +func PossibleRecommendationAction1Values() []RecommendationAction1 { + return []RecommendationAction1{RecommendationAction1Add, RecommendationAction1Recommended, RecommendationAction1Remove} +} + +// RecommendationStatus enumerates the values for recommendation status. +type RecommendationStatus string + +const ( + // RecommendationStatusNoStatus ... + RecommendationStatusNoStatus RecommendationStatus = "NoStatus" + // RecommendationStatusNotAvailable ... + RecommendationStatusNotAvailable RecommendationStatus = "NotAvailable" + // RecommendationStatusNotRecommended ... + RecommendationStatusNotRecommended RecommendationStatus = "NotRecommended" + // RecommendationStatusRecommended ... + RecommendationStatusRecommended RecommendationStatus = "Recommended" +) + +// PossibleRecommendationStatusValues returns an array of possible values for the RecommendationStatus const type. +func PossibleRecommendationStatusValues() []RecommendationStatus { + return []RecommendationStatus{RecommendationStatusNoStatus, RecommendationStatusNotAvailable, RecommendationStatusNotRecommended, RecommendationStatusRecommended} +} + // ReportedSeverity enumerates the values for reported severity. type ReportedSeverity string @@ -266,25 +439,6 @@ func PossibleReportedSeverityValues() []ReportedSeverity { return []ReportedSeverity{High, Informational, Low, Medium} } -// RequiredPricingBundle enumerates the values for required pricing bundle. -type RequiredPricingBundle string - -const ( - // AppServices ... - AppServices RequiredPricingBundle = "AppServices" - // SQLServers ... - SQLServers RequiredPricingBundle = "SqlServers" - // StorageAccounts ... - StorageAccounts RequiredPricingBundle = "StorageAccounts" - // VirtualMachines ... - VirtualMachines RequiredPricingBundle = "VirtualMachines" -) - -// PossibleRequiredPricingBundleValues returns an array of possible values for the RequiredPricingBundle const type. -func PossibleRequiredPricingBundleValues() []RequiredPricingBundle { - return []RequiredPricingBundle{AppServices, SQLServers, StorageAccounts, VirtualMachines} -} - // SettingKind enumerates the values for setting kind. type SettingKind string @@ -300,23 +454,45 @@ func PossibleSettingKindValues() []SettingKind { return []SettingKind{SettingKindAlertSuppressionSetting, SettingKindDataExportSetting} } +// SourceSystem enumerates the values for source system. +type SourceSystem string + +const ( + // AzureAppLocker ... + AzureAppLocker SourceSystem = "Azure_AppLocker" + // AzureAuditD ... + AzureAuditD SourceSystem = "Azure_AuditD" + // NonAzureAppLocker ... + NonAzureAppLocker SourceSystem = "NonAzure_AppLocker" + // NonAzureAuditD ... + NonAzureAuditD SourceSystem = "NonAzure_AuditD" + // None ... + None SourceSystem = "None" +) + +// PossibleSourceSystemValues returns an array of possible values for the SourceSystem const type. +func PossibleSourceSystemValues() []SourceSystem { + return []SourceSystem{AzureAppLocker, AzureAuditD, NonAzureAppLocker, NonAzureAuditD, None} +} + // State enumerates the values for state. type State string const ( - // Failed At least one supported regulatory compliance control in the given standard has a state of failed - Failed State = "Failed" - // Passed All supported regulatory compliance controls in the given standard have a passed state - Passed State = "Passed" - // Skipped All supported regulatory compliance controls in the given standard have a state of skipped - Skipped State = "Skipped" - // Unsupported No supported regulatory compliance data for the given standard - Unsupported State = "Unsupported" + // StateFailed At least one supported regulatory compliance control in the given standard has a state of + // failed + StateFailed State = "Failed" + // StatePassed All supported regulatory compliance controls in the given standard have a passed state + StatePassed State = "Passed" + // StateSkipped All supported regulatory compliance controls in the given standard have a state of skipped + StateSkipped State = "Skipped" + // StateUnsupported No supported regulatory compliance data for the given standard + StateUnsupported State = "Unsupported" ) // PossibleStateValues returns an array of possible values for the State const type. func PossibleStateValues() []State { - return []State{Failed, Passed, Skipped, Unsupported} + return []State{StateFailed, StatePassed, StateSkipped, StateUnsupported} } // Status enumerates the values for status. @@ -366,6 +542,29 @@ func PossibleTransportProtocolValues() []TransportProtocol { return []TransportProtocol{TransportProtocolTCP, TransportProtocolUDP} } +// Type enumerates the values for type. +type Type string + +const ( + // BinarySignature ... + BinarySignature Type = "BinarySignature" + // File ... + File Type = "File" + // FileHash ... + FileHash Type = "FileHash" + // ProductSignature ... + ProductSignature Type = "ProductSignature" + // PublisherSignature ... + PublisherSignature Type = "PublisherSignature" + // VersionAndAboveSignature ... + VersionAndAboveSignature Type = "VersionAndAboveSignature" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{BinarySignature, File, FileHash, ProductSignature, PublisherSignature, VersionAndAboveSignature} +} + // ValueType enumerates the values for value type. type ValueType string @@ -1386,6 +1585,128 @@ type AllowlistCustomAlertRule struct { RuleType *string `json:"ruleType,omitempty"` } +// AppWhitelistingGroup ... +type AppWhitelistingGroup struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - READ-ONLY; Location where the resource is stored + Location *string `json:"location,omitempty"` + *AppWhitelistingGroupData `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppWhitelistingGroup. +func (awg AppWhitelistingGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if awg.AppWhitelistingGroupData != nil { + objectMap["properties"] = awg.AppWhitelistingGroupData + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AppWhitelistingGroup struct. +func (awg *AppWhitelistingGroup) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + awg.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + awg.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + awg.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + awg.Location = &location + } + case "properties": + if v != nil { + var appWhitelistingGroupData AppWhitelistingGroupData + err = json.Unmarshal(*v, &appWhitelistingGroupData) + if err != nil { + return err + } + awg.AppWhitelistingGroupData = &appWhitelistingGroupData + } + } + } + + return nil +} + +// AppWhitelistingGroupData represents a VM/server group and set of rules that are Recommended by Azure +// Security Center to be allowed +type AppWhitelistingGroupData struct { + // EnforcementMode - Possible values include: 'Audit', 'Enforce' + EnforcementMode EnforcementMode `json:"enforcementMode,omitempty"` + // ConfigurationStatus - Possible values include: 'ConfigurationStatus2Configured', 'ConfigurationStatus2NotConfigured', 'ConfigurationStatus2InProgress', 'ConfigurationStatus2Failed', 'ConfigurationStatus2NoStatus' + ConfigurationStatus ConfigurationStatus2 `json:"configurationStatus,omitempty"` + // RecommendationStatus - Possible values include: 'RecommendationStatusRecommended', 'RecommendationStatusNotRecommended', 'RecommendationStatusNotAvailable', 'RecommendationStatusNoStatus' + RecommendationStatus RecommendationStatus `json:"recommendationStatus,omitempty"` + Issues *[]AppWhitelistingIssueSummary `json:"issues,omitempty"` + // SourceSystem - Possible values include: 'AzureAppLocker', 'AzureAuditD', 'NonAzureAppLocker', 'NonAzureAuditD', 'None' + SourceSystem SourceSystem `json:"sourceSystem,omitempty"` + VMRecommendations *[]VMRecommendation `json:"vmRecommendations,omitempty"` + PathRecommendations *[]PathRecommendation `json:"pathRecommendations,omitempty"` +} + +// AppWhitelistingGroups represents a list of VM/server groups and set of rules that are Recommended by +// Azure Security Center to be allowed +type AppWhitelistingGroups struct { + autorest.Response `json:"-"` + Value *[]AppWhitelistingGroup `json:"value,omitempty"` +} + +// AppWhitelistingIssueSummary represents a summary of the alerts of the VM/server group +type AppWhitelistingIssueSummary struct { + // Issue - Possible values include: 'ViolationsAudited', 'ViolationsBlocked', 'MsiAndScriptViolationsAudited', 'MsiAndScriptViolationsBlocked', 'ExecutableViolationsAudited', 'RulesViolatedManually' + Issue Issue `json:"issue,omitempty"` + // NumberOfVms - The number of machines in the VM/server group that have this alert + NumberOfVms *float64 `json:"numberOfVms,omitempty"` +} + +// AppWhitelistingPutGroupData the altered data of the recommended VM/server group policy +type AppWhitelistingPutGroupData struct { + // EnforcementMode - Possible values include: 'EnforcementMode1Audit', 'EnforcementMode1Enforce' + EnforcementMode EnforcementMode1 `json:"enforcementMode,omitempty"` + VMRecommendations *[]VMRecommendation `json:"vmRecommendations,omitempty"` + PathRecommendations *[]PathRecommendation `json:"pathRecommendations,omitempty"` +} + // AscLocation the ASC location of the subscription is in the "name" field type AscLocation struct { autorest.Response `json:"-"` @@ -1544,246 +1865,6 @@ func NewAscLocationListPage(getNextPage func(context.Context, AscLocationList) ( return AscLocationListPage{fn: getNextPage} } -// AssessmentMetadata security assessment metadata -type AssessmentMetadata struct { - autorest.Response `json:"-"` - *AssessmentMetadataProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for AssessmentMetadata. -func (am AssessmentMetadata) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if am.AssessmentMetadataProperties != nil { - objectMap["properties"] = am.AssessmentMetadataProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AssessmentMetadata struct. -func (am *AssessmentMetadata) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var assessmentMetadataProperties AssessmentMetadataProperties - err = json.Unmarshal(*v, &assessmentMetadataProperties) - if err != nil { - return err - } - am.AssessmentMetadataProperties = &assessmentMetadataProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - am.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - am.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - am.Type = &typeVar - } - } - } - - return nil -} - -// AssessmentMetadataList list of security assessment metadata -type AssessmentMetadataList struct { - autorest.Response `json:"-"` - // Value - READ-ONLY - Value *[]AssessmentMetadata `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` -} - -// AssessmentMetadataListIterator provides access to a complete listing of AssessmentMetadata values. -type AssessmentMetadataListIterator struct { - i int - page AssessmentMetadataListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AssessmentMetadataListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentMetadataListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AssessmentMetadataListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AssessmentMetadataListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AssessmentMetadataListIterator) Response() AssessmentMetadataList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AssessmentMetadataListIterator) Value() AssessmentMetadata { - if !iter.page.NotDone() { - return AssessmentMetadata{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AssessmentMetadataListIterator type. -func NewAssessmentMetadataListIterator(page AssessmentMetadataListPage) AssessmentMetadataListIterator { - return AssessmentMetadataListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (aml AssessmentMetadataList) IsEmpty() bool { - return aml.Value == nil || len(*aml.Value) == 0 -} - -// assessmentMetadataListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (aml AssessmentMetadataList) assessmentMetadataListPreparer(ctx context.Context) (*http.Request, error) { - if aml.NextLink == nil || len(to.String(aml.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(aml.NextLink))) -} - -// AssessmentMetadataListPage contains a page of AssessmentMetadata values. -type AssessmentMetadataListPage struct { - fn func(context.Context, AssessmentMetadataList) (AssessmentMetadataList, error) - aml AssessmentMetadataList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AssessmentMetadataListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentMetadataListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - next, err := page.fn(ctx, page.aml) - if err != nil { - return err - } - page.aml = next - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AssessmentMetadataListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AssessmentMetadataListPage) NotDone() bool { - return !page.aml.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AssessmentMetadataListPage) Response() AssessmentMetadataList { - return page.aml -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AssessmentMetadataListPage) Values() []AssessmentMetadata { - if page.aml.IsEmpty() { - return nil - } - return *page.aml.Value -} - -// Creates a new instance of the AssessmentMetadataListPage type. -func NewAssessmentMetadataListPage(getNextPage func(context.Context, AssessmentMetadataList) (AssessmentMetadataList, error)) AssessmentMetadataListPage { - return AssessmentMetadataListPage{fn: getNextPage} -} - -// AssessmentMetadataProperties describes properties of an assessment metadata. -type AssessmentMetadataProperties struct { - // DisplayName - READ-ONLY; User friendly display name of the assessment - DisplayName *string `json:"displayName,omitempty"` - // PolicyDefinitionID - READ-ONLY; Azure resource ID of the policy definition that turns this assessment calculation on - PolicyDefinitionID *string `json:"policyDefinitionId,omitempty"` - // Description - READ-ONLY; Human readable description of the assessment - Description *string `json:"description,omitempty"` - // RemediationDescription - READ-ONLY; Human readable description of what you should do to mitigate this security issue - RemediationDescription *string `json:"remediationDescription,omitempty"` - // Category - READ-ONLY - Category *[]Category `json:"category,omitempty"` - // SecureScoreWeight - READ-ONLY; Weight for the security score calculation. the higher this number, this severity of this assessment is higher - SecureScoreWeight *int32 `json:"secureScoreWeight,omitempty"` - // RequiredPricingBundle - READ-ONLY - RequiredPricingBundle *[]RequiredPricingBundle `json:"requiredPricingBundle,omitempty"` - // Preview - READ-ONLY; True if this assessment is in preview release status - Preview *bool `json:"preview,omitempty"` - // AssessmentType - READ-ONLY; BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure Policy definition. Possible values include: 'BuiltIn', 'Custom' - AssessmentType AssessmentType `json:"assessmentType,omitempty"` -} - // AtaExternalSecuritySolution represents an ATA security solution which sends logs to an OMS workspace type AtaExternalSecuritySolution struct { Properties *AtaSolutionProperties `json:"properties,omitempty"` @@ -4657,6 +4738,25 @@ func NewOperationListPage(getNextPage func(context.Context, OperationList) (Oper return OperationListPage{fn: getNextPage} } +// PathRecommendation represents a path that is recommended to be allowed and its properties +type PathRecommendation struct { + // Path - The full path to whitelist + Path *string `json:"path,omitempty"` + // Action - Possible values include: 'Recommended', 'Add', 'Remove' + Action Action `json:"action,omitempty"` + // Type - Possible values include: 'File', 'FileHash', 'PublisherSignature', 'ProductSignature', 'BinarySignature', 'VersionAndAboveSignature' + Type Type `json:"type,omitempty"` + PublisherInfo *PublisherInfo `json:"publisherInfo,omitempty"` + // Common - Whether the path is commonly run on the machine + Common *bool `json:"common,omitempty"` + UserSids *[]string `json:"userSids,omitempty"` + Usernames *[]UserRecommendation `json:"usernames,omitempty"` + // FileType - Possible values include: 'Exe', 'Dll', 'Msi', 'Script', 'Executable', 'Unknown' + FileType FileType `json:"fileType,omitempty"` + // ConfigurationStatus - Possible values include: 'ConfigurationStatus1Configured', 'ConfigurationStatus1NotConfigured', 'ConfigurationStatus1InProgress', 'ConfigurationStatus1Failed', 'ConfigurationStatus1NoStatus' + ConfigurationStatus ConfigurationStatus1 `json:"configurationStatus,omitempty"` +} + // Pricing pricing tier will be applied for the scope based on the resource ID type Pricing struct { autorest.Response `json:"-"` @@ -4739,12 +4839,24 @@ type PricingList struct { // PricingProperties pricing properties for the relevant scope type PricingProperties struct { - // PricingTier - The pricing tier value. Possible values include: 'Free', 'Standard' + // PricingTier - The pricing tier value. Azure Security Center is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features. Possible values include: 'Free', 'Standard' PricingTier PricingTier `json:"pricingTier,omitempty"` // FreeTrialRemainingTime - READ-ONLY; The duration left for the subscriptions free trial period - in ISO 8601 format (e.g. P3Y6M4DT12H30M5S). FreeTrialRemainingTime *string `json:"freeTrialRemainingTime,omitempty"` } +// PublisherInfo represents the publisher information of a process/rule +type PublisherInfo struct { + // PublisherName - The Subject field of the x.509 certificate used to sign the code, using the following fields - O = Organization, L = Locality, S = State or Province, and C = Country + PublisherName *string `json:"publisherName,omitempty"` + // ProductName - The product name taken from the file's version resource + ProductName *string `json:"productName,omitempty"` + // BinaryName - The "OriginalName" field taken from the file's version resource + BinaryName *string `json:"binaryName,omitempty"` + // Version - The binary file version taken from the file's version resource + Version *string `json:"version,omitempty"` +} + // RegulatoryComplianceAssessment regulatory compliance assessment details and state type RegulatoryComplianceAssessment struct { autorest.Response `json:"-"` @@ -4972,7 +5084,7 @@ type RegulatoryComplianceAssessmentProperties struct { AssessmentType *string `json:"assessmentType,omitempty"` // AssessmentDetailsLink - READ-ONLY; Link to more detailed assessment results data. The response type will be according to the assessmentType field AssessmentDetailsLink *string `json:"assessmentDetailsLink,omitempty"` - // State - Aggregative state based on the assessment's scanned resources states. Possible values include: 'Passed', 'Failed', 'Skipped', 'Unsupported' + // State - Aggregative state based on the assessment's scanned resources states. Possible values include: 'StatePassed', 'StateFailed', 'StateSkipped', 'StateUnsupported' State State `json:"state,omitempty"` // PassedResources - READ-ONLY; The given assessment's related resources count with passed state. PassedResources *int32 `json:"passedResources,omitempty"` @@ -5208,7 +5320,7 @@ func NewRegulatoryComplianceControlListPage(getNextPage func(context.Context, Re type RegulatoryComplianceControlProperties struct { // Description - READ-ONLY; The description of the regulatory compliance control Description *string `json:"description,omitempty"` - // State - Aggregative state based on the control's supported assessments states. Possible values include: 'Passed', 'Failed', 'Skipped', 'Unsupported' + // State - Aggregative state based on the control's supported assessments states. Possible values include: 'StatePassed', 'StateFailed', 'StateSkipped', 'StateUnsupported' State State `json:"state,omitempty"` // PassedAssessments - READ-ONLY; The number of supported regulatory compliance assessments of the given control with a passed state PassedAssessments *int32 `json:"passedAssessments,omitempty"` @@ -5439,7 +5551,7 @@ func NewRegulatoryComplianceStandardListPage(getNextPage func(context.Context, R // RegulatoryComplianceStandardProperties regulatory compliance standard data type RegulatoryComplianceStandardProperties struct { - // State - Aggregative state based on the standard's supported controls states. Possible values include: 'Passed', 'Failed', 'Skipped', 'Unsupported' + // State - Aggregative state based on the standard's supported controls states. Possible values include: 'StatePassed', 'StateFailed', 'StateSkipped', 'StateUnsupported' State State `json:"state,omitempty"` // PassedControls - READ-ONLY; The number of supported regulatory compliance controls of the given standard with a passed state PassedControls *int32 `json:"passedControls,omitempty"` @@ -6245,6 +6357,23 @@ type TopologySingleResourceParent struct { ResourceID *string `json:"resourceId,omitempty"` } +// UserRecommendation represents a user that is recommended to be allowed for a certain rule +type UserRecommendation struct { + // Username - Represents a user that is recommended to be allowed for a certain rule + Username *string `json:"username,omitempty"` + // RecommendationAction - Possible values include: 'RecommendationAction1Recommended', 'RecommendationAction1Add', 'RecommendationAction1Remove' + RecommendationAction RecommendationAction1 `json:"recommendationAction,omitempty"` +} + +// VMRecommendation represents a machine that is part of a VM/server group +type VMRecommendation struct { + // ConfigurationStatus - Possible values include: 'Configured', 'NotConfigured', 'InProgress', 'Failed', 'NoStatus' + ConfigurationStatus ConfigurationStatus `json:"configurationStatus,omitempty"` + // RecommendationAction - Possible values include: 'RecommendationActionRecommended', 'RecommendationActionAdd', 'RecommendationActionRemove' + RecommendationAction RecommendationAction `json:"recommendationAction,omitempty"` + ResourceID *string `json:"resourceId,omitempty"` +} + // WorkspaceSetting configures where to store the OMS agent data for workspaces under a scope type WorkspaceSetting struct { autorest.Response `json:"-"` diff --git a/services/preview/security/mgmt/v2.0/security/pricings.go b/services/preview/security/mgmt/v2.0/security/pricings.go index ceb3b3291c14..f73100cc775f 100644 --- a/services/preview/security/mgmt/v2.0/security/pricings.go +++ b/services/preview/security/mgmt/v2.0/security/pricings.go @@ -41,7 +41,9 @@ func NewPricingsClientWithBaseURI(baseURI string, subscriptionID string, ascLoca return PricingsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} } -// Get security pricing configuration in the subscription +// Get a given security pricing configuration in the subscription. Azure Security Center is available in two pricing +// tiers: Free and Standard, on multiple resource types, including Virtual machines, SQL Servers, App service plans and +// Storage accounts. // Parameters: // pricingName - name of the pricing configuration func (client PricingsClient) Get(ctx context.Context, pricingName string) (result Pricing, err error) { @@ -122,7 +124,9 @@ func (client PricingsClient) GetResponder(resp *http.Response) (result Pricing, return } -// List security pricing configurations in the subscription +// List a given security pricing configuration in the subscription. Azure Security Center is available in two pricing +// tiers: Free and Standard, on multiple resource types, including Virtual machines, SQL Servers, App service plans and +// Storage accounts. func (client PricingsClient) List(ctx context.Context) (result PricingList, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PricingsClient.List") @@ -200,7 +204,9 @@ func (client PricingsClient) ListResponder(resp *http.Response) (result PricingL return } -// Update security pricing configuration in the subscription +// Update a given security pricing configuration in the subscription. Azure Security Center is available in two pricing +// tiers: Free and Standard, on multiple resource types, including Virtual machines, SQL Servers, App service plans and +// Storage accounts. // Parameters: // pricingName - name of the pricing configuration // pricing - pricing object diff --git a/services/preview/security/mgmt/v2.0/security/securityapi/interfaces.go b/services/preview/security/mgmt/v2.0/security/securityapi/interfaces.go index f739050b209c..357335dd3a70 100644 --- a/services/preview/security/mgmt/v2.0/security/securityapi/interfaces.go +++ b/services/preview/security/mgmt/v2.0/security/securityapi/interfaces.go @@ -47,22 +47,6 @@ type RegulatoryComplianceAssessmentsClientAPI interface { var _ RegulatoryComplianceAssessmentsClientAPI = (*security.RegulatoryComplianceAssessmentsClient)(nil) -// AssessmentsMetadataClientAPI contains the set of methods on the AssessmentsMetadataClient type. -type AssessmentsMetadataClientAPI interface { - Get(ctx context.Context, assessmentsMetadataName string) (result security.AssessmentMetadata, err error) - List(ctx context.Context) (result security.AssessmentMetadataListPage, err error) -} - -var _ AssessmentsMetadataClientAPI = (*security.AssessmentsMetadataClient)(nil) - -// AssessmentsMetadataSubscriptionClientAPI contains the set of methods on the AssessmentsMetadataSubscriptionClient type. -type AssessmentsMetadataSubscriptionClientAPI interface { - Get(ctx context.Context, assessmentsMetadataName string) (result security.AssessmentMetadata, err error) - List(ctx context.Context) (result security.AssessmentMetadataListPage, err error) -} - -var _ AssessmentsMetadataSubscriptionClientAPI = (*security.AssessmentsMetadataSubscriptionClient)(nil) - // PricingsClientAPI contains the set of methods on the PricingsClient type. type PricingsClientAPI interface { Get(ctx context.Context, pricingName string) (result security.Pricing, err error) @@ -212,6 +196,15 @@ type JitNetworkAccessPoliciesClientAPI interface { var _ JitNetworkAccessPoliciesClientAPI = (*security.JitNetworkAccessPoliciesClient)(nil) +// AdaptiveApplicationControlsClientAPI contains the set of methods on the AdaptiveApplicationControlsClient type. +type AdaptiveApplicationControlsClientAPI interface { + Get(ctx context.Context, groupName string) (result security.AppWhitelistingGroup, err error) + List(ctx context.Context, includePathRecommendations *bool, summary *bool) (result security.AppWhitelistingGroups, err error) + Put(ctx context.Context, groupName string, body security.AppWhitelistingPutGroupData) (result security.AppWhitelistingGroup, err error) +} + +var _ AdaptiveApplicationControlsClientAPI = (*security.AdaptiveApplicationControlsClient)(nil) + // ExternalSecuritySolutionsClientAPI contains the set of methods on the ExternalSecuritySolutionsClient type. type ExternalSecuritySolutionsClientAPI interface { Get(ctx context.Context, resourceGroupName string, externalSecuritySolutionsName string) (result security.ExternalSecuritySolutionModel, err error) diff --git a/services/preview/security/mgmt/v3.0/security/adaptiveapplicationcontrols.go b/services/preview/security/mgmt/v3.0/security/adaptiveapplicationcontrols.go new file mode 100644 index 000000000000..8fe79f24b6d0 --- /dev/null +++ b/services/preview/security/mgmt/v3.0/security/adaptiveapplicationcontrols.go @@ -0,0 +1,296 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// AdaptiveApplicationControlsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type AdaptiveApplicationControlsClient struct { + BaseClient +} + +// NewAdaptiveApplicationControlsClient creates an instance of the AdaptiveApplicationControlsClient client. +func NewAdaptiveApplicationControlsClient(subscriptionID string, ascLocation string) AdaptiveApplicationControlsClient { + return NewAdaptiveApplicationControlsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewAdaptiveApplicationControlsClientWithBaseURI creates an instance of the AdaptiveApplicationControlsClient client. +func NewAdaptiveApplicationControlsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AdaptiveApplicationControlsClient { + return AdaptiveApplicationControlsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// Get gets an application control VM/server group. +// Parameters: +// groupName - name of an application control VM/server group +func (client AdaptiveApplicationControlsClient) Get(ctx context.Context, groupName string) (result AppWhitelistingGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveApplicationControlsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AdaptiveApplicationControlsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, groupName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AdaptiveApplicationControlsClient) GetPreparer(ctx context.Context, groupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "ascLocation": autorest.Encode("path", client.AscLocation), + "groupName": autorest.Encode("path", groupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AdaptiveApplicationControlsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AdaptiveApplicationControlsClient) GetResponder(resp *http.Response) (result AppWhitelistingGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of application control VM/server groups for the subscription. +// Parameters: +// includePathRecommendations - include the policy rules +// summary - return output in a summarized form +func (client AdaptiveApplicationControlsClient) List(ctx context.Context, includePathRecommendations *bool, summary *bool) (result AppWhitelistingGroups, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveApplicationControlsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AdaptiveApplicationControlsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, includePathRecommendations, summary) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AdaptiveApplicationControlsClient) ListPreparer(ctx context.Context, includePathRecommendations *bool, summary *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if includePathRecommendations != nil { + queryParameters["includePathRecommendations"] = autorest.Encode("query", *includePathRecommendations) + } + if summary != nil { + queryParameters["summary"] = autorest.Encode("query", *summary) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/applicationWhitelistings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AdaptiveApplicationControlsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client AdaptiveApplicationControlsClient) ListResponder(resp *http.Response) (result AppWhitelistingGroups, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Put update an application control VM/server group +// Parameters: +// groupName - name of an application control VM/server group +// body - the updated VM/server group data +func (client AdaptiveApplicationControlsClient) Put(ctx context.Context, groupName string, body AppWhitelistingPutGroupData) (result AppWhitelistingGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveApplicationControlsClient.Put") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AdaptiveApplicationControlsClient", "Put", err.Error()) + } + + req, err := client.PutPreparer(ctx, groupName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Put", nil, "Failure preparing request") + return + } + + resp, err := client.PutSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Put", resp, "Failure sending request") + return + } + + result, err = client.PutResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Put", resp, "Failure responding to request") + } + + return +} + +// PutPreparer prepares the Put request. +func (client AdaptiveApplicationControlsClient) PutPreparer(ctx context.Context, groupName string, body AppWhitelistingPutGroupData) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "ascLocation": autorest.Encode("path", client.AscLocation), + "groupName": autorest.Encode("path", groupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PutSender sends the Put request. The method will close the +// http.Response Body if it receives an error. +func (client AdaptiveApplicationControlsClient) PutSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// PutResponder handles the response to the Put request. The method always +// closes the http.Response Body. +func (client AdaptiveApplicationControlsClient) PutResponder(resp *http.Response) (result AppWhitelistingGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/security/mgmt/v3.0/security/assessmentsmetadata.go b/services/preview/security/mgmt/v3.0/security/assessmentsmetadata.go deleted file mode 100644 index 1fc3026a4c73..000000000000 --- a/services/preview/security/mgmt/v3.0/security/assessmentsmetadata.go +++ /dev/null @@ -1,221 +0,0 @@ -package security - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AssessmentsMetadataClient is the API spec for Microsoft.Security (Azure Security Center) resource provider -type AssessmentsMetadataClient struct { - BaseClient -} - -// NewAssessmentsMetadataClient creates an instance of the AssessmentsMetadataClient client. -func NewAssessmentsMetadataClient(subscriptionID string, ascLocation string) AssessmentsMetadataClient { - return NewAssessmentsMetadataClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) -} - -// NewAssessmentsMetadataClientWithBaseURI creates an instance of the AssessmentsMetadataClient client. -func NewAssessmentsMetadataClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AssessmentsMetadataClient { - return AssessmentsMetadataClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} -} - -// Get get metadata information on an assessment type -// Parameters: -// assessmentsMetadataName - the Assessment Key - Unique key for the assessment type -func (client AssessmentsMetadataClient) Get(ctx context.Context, assessmentsMetadataName string) (result AssessmentMetadata, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, assessmentsMetadataName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client AssessmentsMetadataClient) GetPreparer(ctx context.Context, assessmentsMetadataName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "assessmentsMetadataName": autorest.Encode("path", assessmentsMetadataName), - } - - const APIVersion = "2019-01-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/providers/Microsoft.Security/assessmentsMetadata/{assessmentsMetadataName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client AssessmentsMetadataClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AssessmentsMetadataClient) GetResponder(resp *http.Response) (result AssessmentMetadata, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List get metadata information on all assessment types -func (client AssessmentsMetadataClient) List(ctx context.Context) (result AssessmentMetadataListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataClient.List") - defer func() { - sc := -1 - if result.aml.Response.Response != nil { - sc = result.aml.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.aml.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "List", resp, "Failure sending request") - return - } - - result.aml, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client AssessmentsMetadataClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2019-01-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.Security/assessmentsMetadata"), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AssessmentsMetadataClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AssessmentsMetadataClient) ListResponder(resp *http.Response) (result AssessmentMetadataList, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client AssessmentsMetadataClient) listNextResults(ctx context.Context, lastResults AssessmentMetadataList) (result AssessmentMetadataList, err error) { - req, err := lastResults.assessmentMetadataListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AssessmentsMetadataClient) ListComplete(ctx context.Context) (result AssessmentMetadataListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} diff --git a/services/preview/security/mgmt/v3.0/security/assessmentsmetadatasubscription.go b/services/preview/security/mgmt/v3.0/security/assessmentsmetadatasubscription.go deleted file mode 100644 index e88c4591d691..000000000000 --- a/services/preview/security/mgmt/v3.0/security/assessmentsmetadatasubscription.go +++ /dev/null @@ -1,241 +0,0 @@ -package security - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AssessmentsMetadataSubscriptionClient is the API spec for Microsoft.Security (Azure Security Center) resource -// provider -type AssessmentsMetadataSubscriptionClient struct { - BaseClient -} - -// NewAssessmentsMetadataSubscriptionClient creates an instance of the AssessmentsMetadataSubscriptionClient client. -func NewAssessmentsMetadataSubscriptionClient(subscriptionID string, ascLocation string) AssessmentsMetadataSubscriptionClient { - return NewAssessmentsMetadataSubscriptionClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) -} - -// NewAssessmentsMetadataSubscriptionClientWithBaseURI creates an instance of the AssessmentsMetadataSubscriptionClient -// client. -func NewAssessmentsMetadataSubscriptionClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AssessmentsMetadataSubscriptionClient { - return AssessmentsMetadataSubscriptionClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} -} - -// Get get metadata information on an assessment type in a specific subscription -// Parameters: -// assessmentsMetadataName - the Assessment Key - Unique key for the assessment type -func (client AssessmentsMetadataSubscriptionClient) Get(ctx context.Context, assessmentsMetadataName string) (result AssessmentMetadata, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataSubscriptionClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AssessmentsMetadataSubscriptionClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, assessmentsMetadataName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client AssessmentsMetadataSubscriptionClient) GetPreparer(ctx context.Context, assessmentsMetadataName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "assessmentsMetadataName": autorest.Encode("path", assessmentsMetadataName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-01-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentsMetadata/{assessmentsMetadataName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client AssessmentsMetadataSubscriptionClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AssessmentsMetadataSubscriptionClient) GetResponder(resp *http.Response) (result AssessmentMetadata, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List get metadata information on all assessment types in a specific subscription -func (client AssessmentsMetadataSubscriptionClient) List(ctx context.Context) (result AssessmentMetadataListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataSubscriptionClient.List") - defer func() { - sc := -1 - if result.aml.Response.Response != nil { - sc = result.aml.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AssessmentsMetadataSubscriptionClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.aml.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "List", resp, "Failure sending request") - return - } - - result.aml, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client AssessmentsMetadataSubscriptionClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-01-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentsMetadata", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AssessmentsMetadataSubscriptionClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AssessmentsMetadataSubscriptionClient) ListResponder(resp *http.Response) (result AssessmentMetadataList, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client AssessmentsMetadataSubscriptionClient) listNextResults(ctx context.Context, lastResults AssessmentMetadataList) (result AssessmentMetadataList, err error) { - req, err := lastResults.assessmentMetadataListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AssessmentsMetadataSubscriptionClient) ListComplete(ctx context.Context) (result AssessmentMetadataListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataSubscriptionClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} diff --git a/services/preview/security/mgmt/v3.0/security/models.go b/services/preview/security/mgmt/v3.0/security/models.go index 2939d09b507d..d9aa8af052a7 100644 --- a/services/preview/security/mgmt/v3.0/security/models.go +++ b/services/preview/security/mgmt/v3.0/security/models.go @@ -48,6 +48,23 @@ func PossibleAadConnectivityStateValues() []AadConnectivityState { return []AadConnectivityState{Connected, Discovered, NotLicensed} } +// Action enumerates the values for action. +type Action string + +const ( + // Add ... + Add Action = "Add" + // Recommended ... + Recommended Action = "Recommended" + // Remove ... + Remove Action = "Remove" +) + +// PossibleActionValues returns an array of possible values for the Action const type. +func PossibleActionValues() []Action { + return []Action{Add, Recommended, Remove} +} + // AlertNotifications enumerates the values for alert notifications. type AlertNotifications string @@ -78,21 +95,6 @@ func PossibleAlertsToAdminsValues() []AlertsToAdmins { return []AlertsToAdmins{AlertsToAdminsOff, AlertsToAdminsOn} } -// AssessmentType enumerates the values for assessment type. -type AssessmentType string - -const ( - // BuiltIn ... - BuiltIn AssessmentType = "BuiltIn" - // Custom ... - Custom AssessmentType = "Custom" -) - -// PossibleAssessmentTypeValues returns an array of possible values for the AssessmentType const type. -func PossibleAssessmentTypeValues() []AssessmentType { - return []AssessmentType{BuiltIn, Custom} -} - // AutoProvision enumerates the values for auto provision. type AutoProvision string @@ -108,25 +110,67 @@ func PossibleAutoProvisionValues() []AutoProvision { return []AutoProvision{AutoProvisionOff, AutoProvisionOn} } -// Category enumerates the values for category. -type Category string +// ConfigurationStatus enumerates the values for configuration status. +type ConfigurationStatus string const ( - // Compute ... - Compute Category = "Compute" - // Data ... - Data Category = "Data" - // IdentityAndAccess ... - IdentityAndAccess Category = "IdentityAndAccess" - // IoT ... - IoT Category = "IoT" - // Network ... - Network Category = "Network" + // Configured ... + Configured ConfigurationStatus = "Configured" + // Failed ... + Failed ConfigurationStatus = "Failed" + // InProgress ... + InProgress ConfigurationStatus = "InProgress" + // NoStatus ... + NoStatus ConfigurationStatus = "NoStatus" + // NotConfigured ... + NotConfigured ConfigurationStatus = "NotConfigured" ) -// PossibleCategoryValues returns an array of possible values for the Category const type. -func PossibleCategoryValues() []Category { - return []Category{Compute, Data, IdentityAndAccess, IoT, Network} +// PossibleConfigurationStatusValues returns an array of possible values for the ConfigurationStatus const type. +func PossibleConfigurationStatusValues() []ConfigurationStatus { + return []ConfigurationStatus{Configured, Failed, InProgress, NoStatus, NotConfigured} +} + +// ConfigurationStatus1 enumerates the values for configuration status 1. +type ConfigurationStatus1 string + +const ( + // ConfigurationStatus1Configured ... + ConfigurationStatus1Configured ConfigurationStatus1 = "Configured" + // ConfigurationStatus1Failed ... + ConfigurationStatus1Failed ConfigurationStatus1 = "Failed" + // ConfigurationStatus1InProgress ... + ConfigurationStatus1InProgress ConfigurationStatus1 = "InProgress" + // ConfigurationStatus1NoStatus ... + ConfigurationStatus1NoStatus ConfigurationStatus1 = "NoStatus" + // ConfigurationStatus1NotConfigured ... + ConfigurationStatus1NotConfigured ConfigurationStatus1 = "NotConfigured" +) + +// PossibleConfigurationStatus1Values returns an array of possible values for the ConfigurationStatus1 const type. +func PossibleConfigurationStatus1Values() []ConfigurationStatus1 { + return []ConfigurationStatus1{ConfigurationStatus1Configured, ConfigurationStatus1Failed, ConfigurationStatus1InProgress, ConfigurationStatus1NoStatus, ConfigurationStatus1NotConfigured} +} + +// ConfigurationStatus2 enumerates the values for configuration status 2. +type ConfigurationStatus2 string + +const ( + // ConfigurationStatus2Configured ... + ConfigurationStatus2Configured ConfigurationStatus2 = "Configured" + // ConfigurationStatus2Failed ... + ConfigurationStatus2Failed ConfigurationStatus2 = "Failed" + // ConfigurationStatus2InProgress ... + ConfigurationStatus2InProgress ConfigurationStatus2 = "InProgress" + // ConfigurationStatus2NoStatus ... + ConfigurationStatus2NoStatus ConfigurationStatus2 = "NoStatus" + // ConfigurationStatus2NotConfigured ... + ConfigurationStatus2NotConfigured ConfigurationStatus2 = "NotConfigured" +) + +// PossibleConfigurationStatus2Values returns an array of possible values for the ConfigurationStatus2 const type. +func PossibleConfigurationStatus2Values() []ConfigurationStatus2 { + return []ConfigurationStatus2{ConfigurationStatus2Configured, ConfigurationStatus2Failed, ConfigurationStatus2InProgress, ConfigurationStatus2NoStatus, ConfigurationStatus2NotConfigured} } // ConnectionType enumerates the values for connection type. @@ -157,6 +201,36 @@ func PossibleDataSourceValues() []DataSource { return []DataSource{TwinData} } +// EnforcementMode enumerates the values for enforcement mode. +type EnforcementMode string + +const ( + // Audit ... + Audit EnforcementMode = "Audit" + // Enforce ... + Enforce EnforcementMode = "Enforce" +) + +// PossibleEnforcementModeValues returns an array of possible values for the EnforcementMode const type. +func PossibleEnforcementModeValues() []EnforcementMode { + return []EnforcementMode{Audit, Enforce} +} + +// EnforcementMode1 enumerates the values for enforcement mode 1. +type EnforcementMode1 string + +const ( + // EnforcementMode1Audit ... + EnforcementMode1Audit EnforcementMode1 = "Audit" + // EnforcementMode1Enforce ... + EnforcementMode1Enforce EnforcementMode1 = "Enforce" +) + +// PossibleEnforcementMode1Values returns an array of possible values for the EnforcementMode1 const type. +func PossibleEnforcementMode1Values() []EnforcementMode1 { + return []EnforcementMode1{EnforcementMode1Audit, EnforcementMode1Enforce} +} + // ExportData enumerates the values for export data. type ExportData string @@ -206,6 +280,52 @@ func PossibleFamilyValues() []Family { return []Family{Ngfw, SaasWaf, Va, Waf} } +// FileType enumerates the values for file type. +type FileType string + +const ( + // Dll ... + Dll FileType = "Dll" + // Exe ... + Exe FileType = "Exe" + // Executable ... + Executable FileType = "Executable" + // Msi ... + Msi FileType = "Msi" + // Script ... + Script FileType = "Script" + // Unknown ... + Unknown FileType = "Unknown" +) + +// PossibleFileTypeValues returns an array of possible values for the FileType const type. +func PossibleFileTypeValues() []FileType { + return []FileType{Dll, Exe, Executable, Msi, Script, Unknown} +} + +// Issue enumerates the values for issue. +type Issue string + +const ( + // ExecutableViolationsAudited ... + ExecutableViolationsAudited Issue = "ExecutableViolationsAudited" + // MsiAndScriptViolationsAudited ... + MsiAndScriptViolationsAudited Issue = "MsiAndScriptViolationsAudited" + // MsiAndScriptViolationsBlocked ... + MsiAndScriptViolationsBlocked Issue = "MsiAndScriptViolationsBlocked" + // RulesViolatedManually ... + RulesViolatedManually Issue = "RulesViolatedManually" + // ViolationsAudited ... + ViolationsAudited Issue = "ViolationsAudited" + // ViolationsBlocked ... + ViolationsBlocked Issue = "ViolationsBlocked" +) + +// PossibleIssueValues returns an array of possible values for the Issue const type. +func PossibleIssueValues() []Issue { + return []Issue{ExecutableViolationsAudited, MsiAndScriptViolationsAudited, MsiAndScriptViolationsBlocked, RulesViolatedManually, ViolationsAudited, ViolationsBlocked} +} + // KindEnum enumerates the values for kind enum. type KindEnum string @@ -261,81 +381,144 @@ func PossibleProtocolValues() []Protocol { type ProvisioningState string const ( - // Canceled ... - Canceled ProvisioningState = "Canceled" - // Deprovisioning ... - Deprovisioning ProvisioningState = "Deprovisioning" - // Failed ... - Failed ProvisioningState = "Failed" - // Provisioning ... - Provisioning ProvisioningState = "Provisioning" - // Succeeded ... - Succeeded ProvisioningState = "Succeeded" + // ProvisioningStateCanceled ... + ProvisioningStateCanceled ProvisioningState = "Canceled" + // ProvisioningStateDeprovisioning ... + ProvisioningStateDeprovisioning ProvisioningState = "Deprovisioning" + // ProvisioningStateFailed ... + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateProvisioning ... + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + // ProvisioningStateSucceeded ... + ProvisioningStateSucceeded ProvisioningState = "Succeeded" ) // PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{Canceled, Deprovisioning, Failed, Provisioning, Succeeded} + return []ProvisioningState{ProvisioningStateCanceled, ProvisioningStateDeprovisioning, ProvisioningStateFailed, ProvisioningStateProvisioning, ProvisioningStateSucceeded} +} + +// RecommendationAction enumerates the values for recommendation action. +type RecommendationAction string + +const ( + // RecommendationActionAdd ... + RecommendationActionAdd RecommendationAction = "Add" + // RecommendationActionRecommended ... + RecommendationActionRecommended RecommendationAction = "Recommended" + // RecommendationActionRemove ... + RecommendationActionRemove RecommendationAction = "Remove" +) + +// PossibleRecommendationActionValues returns an array of possible values for the RecommendationAction const type. +func PossibleRecommendationActionValues() []RecommendationAction { + return []RecommendationAction{RecommendationActionAdd, RecommendationActionRecommended, RecommendationActionRemove} +} + +// RecommendationAction1 enumerates the values for recommendation action 1. +type RecommendationAction1 string + +const ( + // RecommendationAction1Add ... + RecommendationAction1Add RecommendationAction1 = "Add" + // RecommendationAction1Recommended ... + RecommendationAction1Recommended RecommendationAction1 = "Recommended" + // RecommendationAction1Remove ... + RecommendationAction1Remove RecommendationAction1 = "Remove" +) + +// PossibleRecommendationAction1Values returns an array of possible values for the RecommendationAction1 const type. +func PossibleRecommendationAction1Values() []RecommendationAction1 { + return []RecommendationAction1{RecommendationAction1Add, RecommendationAction1Recommended, RecommendationAction1Remove} } // RecommendationConfigStatus enumerates the values for recommendation config status. type RecommendationConfigStatus string const ( - // TurnedOff ... - TurnedOff RecommendationConfigStatus = "TurnedOff" - // TurnedOn ... - TurnedOn RecommendationConfigStatus = "TurnedOn" + // Disabled ... + Disabled RecommendationConfigStatus = "Disabled" + // Enabled ... + Enabled RecommendationConfigStatus = "Enabled" ) // PossibleRecommendationConfigStatusValues returns an array of possible values for the RecommendationConfigStatus const type. func PossibleRecommendationConfigStatusValues() []RecommendationConfigStatus { - return []RecommendationConfigStatus{TurnedOff, TurnedOn} + return []RecommendationConfigStatus{Disabled, Enabled} +} + +// RecommendationStatus enumerates the values for recommendation status. +type RecommendationStatus string + +const ( + // RecommendationStatusNoStatus ... + RecommendationStatusNoStatus RecommendationStatus = "NoStatus" + // RecommendationStatusNotAvailable ... + RecommendationStatusNotAvailable RecommendationStatus = "NotAvailable" + // RecommendationStatusNotRecommended ... + RecommendationStatusNotRecommended RecommendationStatus = "NotRecommended" + // RecommendationStatusRecommended ... + RecommendationStatusRecommended RecommendationStatus = "Recommended" +) + +// PossibleRecommendationStatusValues returns an array of possible values for the RecommendationStatus const type. +func PossibleRecommendationStatusValues() []RecommendationStatus { + return []RecommendationStatus{RecommendationStatusNoStatus, RecommendationStatusNotAvailable, RecommendationStatusNotRecommended, RecommendationStatusRecommended} } // RecommendationType enumerates the values for recommendation type. type RecommendationType string const ( - // DenyDefaultIPPolicy IP filter configuration should have rules defined for allowed traffic, and should by - // default, deny all other traffic by default. - DenyDefaultIPPolicy RecommendationType = "DenyDefaultIpPolicy" - // EnableDiagnosticsLog Enable logs and retain them for up to a year. Retaining logs enables you to - // recreate activity trails for investigation purposes when a security incident occurs or your network is - // compromised. - EnableDiagnosticsLog RecommendationType = "EnableDiagnosticsLog" - // IdenticalAuthenticationCredentials IoT Hub authentication credentials are used by multiple devices. This - // may indicate an illegitimate device impersonating a legitimate device. Duplicate credential use - // increases the risk of device impersonation by a malicious actor. - IdenticalAuthenticationCredentials RecommendationType = "IdenticalAuthenticationCredentials" - // OpenPortsOnDevice A listening endpoint was found on the device. - OpenPortsOnDevice RecommendationType = "OpenPortsOnDevice" - // OperationSystemNotValid Device doesn't comply with CIS Linux benchmarks. - OperationSystemNotValid RecommendationType = "OperationSystemNotValid" - // PermissiveFirewallPolicy Allowed firewall policy found (INPUT/OUTPUT). Firewall policy should deny all - // traffic by default, and define rules to allow necessary communication to/from the device. - PermissiveFirewallPolicy RecommendationType = "PermissiveFirewallPolicy" - // PermissiveFirewallRuleInput A rule in the firewall in the input chain has been found that contains a - // permissive pattern for a wide range of IP addresses or ports. - PermissiveFirewallRuleInput RecommendationType = "PermissiveFirewallRuleInput" - // PermissiveFirewallRuleOut A rule in the firewall in the output chain has been found that contains a - // permissive pattern for a wide range of IP addresses or ports. - PermissiveFirewallRuleOut RecommendationType = "PermissiveFirewallRuleOut" - // SecurityTwinConfigurationConflict Conflicts were identified in the security twin configuration. - SecurityTwinConfigurationConflict RecommendationType = "SecurityTwinConfigurationConflict" - // SecurityTwinConfigurationNotOptimal Security twin configuration is not optimal. - SecurityTwinConfigurationNotOptimal RecommendationType = "SecurityTwinConfigurationNotOptimal" - // TooLargeIPRange An allow IP filter rule source IP range is too large. Overly permissive rules can expose - // your IoT hub to malicious actors. - TooLargeIPRange RecommendationType = "TooLargeIPRange" - // UnutilizedMessagesFromAgent 10% or more of security messages were smaller than 4kb during the last 24 - // hours. - UnutilizedMessagesFromAgent RecommendationType = "UnutilizedMessagesFromAgent" + // IoTACRAuthentication Authentication schema used for pull an edge module from an ACR repository does not + // use Service Principal Authentication. + IoTACRAuthentication RecommendationType = "IoT_ACRAuthentication" + // IoTAgentSendsUnutilizedMessages IoT agent message size capacity is currently underutilized, causing an + // increase in the number of sent messages. Adjust message intervals for better utilization. + IoTAgentSendsUnutilizedMessages RecommendationType = "IoT_AgentSendsUnutilizedMessages" + // IoTBaseline Identified security related system configuration issues. + IoTBaseline RecommendationType = "IoT_Baseline" + // IoTEdgeHubMemOptimize You can optimize Edge Hub memory usage by turning off protocol heads for any + // protocols not used by Edge modules in your solution. + IoTEdgeHubMemOptimize RecommendationType = "IoT_EdgeHubMemOptimize" + // IoTEdgeLoggingOptions Logging is disabled for this edge module. + IoTEdgeLoggingOptions RecommendationType = "IoT_EdgeLoggingOptions" + // IoTInconsistentModuleSettings A minority within a device security group has inconsistent Edge Module + // settings with the rest of their group. + IoTInconsistentModuleSettings RecommendationType = "IoT_InconsistentModuleSettings" + // IoTInstallAgent Install the Azure Security of Things Agent. + IoTInstallAgent RecommendationType = "IoT_InstallAgent" + // IoTIPFilterDenyAll IP Filter Configuration should have rules defined for allowed traffic and should deny + // all other traffic by default. + IoTIPFilterDenyAll RecommendationType = "IoT_IPFilter_DenyAll" + // IoTIPFilterPermissiveRule An Allow IP Filter rules source IP range is too large. Overly permissive rules + // might expose your IoT hub to malicious intenders. + IoTIPFilterPermissiveRule RecommendationType = "IoT_IPFilter_PermissiveRule" + // IoTOpenPorts A listening endpoint was found on the device. + IoTOpenPorts RecommendationType = "IoT_OpenPorts" + // IoTPermissiveFirewallPolicy An Allowed firewall policy was found (INPUT/OUTPUT). The policy should Deny + // all traffic by default and define rules to allow necessary communication to/from the device. + IoTPermissiveFirewallPolicy RecommendationType = "IoT_PermissiveFirewallPolicy" + // IoTPermissiveInputFirewallRules A rule in the firewall has been found that contains a permissive pattern + // for a wide range of IP addresses or Ports. + IoTPermissiveInputFirewallRules RecommendationType = "IoT_PermissiveInputFirewallRules" + // IoTPermissiveOutputFirewallRules A rule in the firewall has been found that contains a permissive + // pattern for a wide range of IP addresses or Ports. + IoTPermissiveOutputFirewallRules RecommendationType = "IoT_PermissiveOutputFirewallRules" + // IoTPrivilegedDockerOptions Edge module is configured to run in privileged mode, with extensive Linux + // capabilities or with host-level network access (send/receive data to host machine). + IoTPrivilegedDockerOptions RecommendationType = "IoT_PrivilegedDockerOptions" + // IoTSharedCredentials Same authentication credentials to the IoT Hub used by multiple devices. This could + // indicate an illegitimate device impersonating a legitimate device. It also exposes the risk of device + // impersonation by an attacker. + IoTSharedCredentials RecommendationType = "IoT_SharedCredentials" + // IoTVulnerableTLSCipherSuite Insecure TLS configurations detected. Immediate upgrade recommended. + IoTVulnerableTLSCipherSuite RecommendationType = "IoT_VulnerableTLSCipherSuite" ) // PossibleRecommendationTypeValues returns an array of possible values for the RecommendationType const type. func PossibleRecommendationTypeValues() []RecommendationType { - return []RecommendationType{DenyDefaultIPPolicy, EnableDiagnosticsLog, IdenticalAuthenticationCredentials, OpenPortsOnDevice, OperationSystemNotValid, PermissiveFirewallPolicy, PermissiveFirewallRuleInput, PermissiveFirewallRuleOut, SecurityTwinConfigurationConflict, SecurityTwinConfigurationNotOptimal, TooLargeIPRange, UnutilizedMessagesFromAgent} + return []RecommendationType{IoTACRAuthentication, IoTAgentSendsUnutilizedMessages, IoTBaseline, IoTEdgeHubMemOptimize, IoTEdgeLoggingOptions, IoTInconsistentModuleSettings, IoTInstallAgent, IoTIPFilterDenyAll, IoTIPFilterPermissiveRule, IoTOpenPorts, IoTPermissiveFirewallPolicy, IoTPermissiveInputFirewallRules, IoTPermissiveOutputFirewallRules, IoTPrivilegedDockerOptions, IoTSharedCredentials, IoTVulnerableTLSCipherSuite} } // ReportedSeverity enumerates the values for reported severity. @@ -357,25 +540,6 @@ func PossibleReportedSeverityValues() []ReportedSeverity { return []ReportedSeverity{High, Informational, Low, Medium} } -// RequiredPricingBundle enumerates the values for required pricing bundle. -type RequiredPricingBundle string - -const ( - // AppServices ... - AppServices RequiredPricingBundle = "AppServices" - // SQLServers ... - SQLServers RequiredPricingBundle = "SqlServers" - // StorageAccounts ... - StorageAccounts RequiredPricingBundle = "StorageAccounts" - // VirtualMachines ... - VirtualMachines RequiredPricingBundle = "VirtualMachines" -) - -// PossibleRequiredPricingBundleValues returns an array of possible values for the RequiredPricingBundle const type. -func PossibleRequiredPricingBundleValues() []RequiredPricingBundle { - return []RequiredPricingBundle{AppServices, SQLServers, StorageAccounts, VirtualMachines} -} - // ResourceStatus enumerates the values for resource status. type ResourceStatus string @@ -414,15 +578,36 @@ func PossibleSettingKindValues() []SettingKind { type SolutionStatus string const ( - // Disabled ... - Disabled SolutionStatus = "Disabled" - // Enabled ... - Enabled SolutionStatus = "Enabled" + // SolutionStatusDisabled ... + SolutionStatusDisabled SolutionStatus = "Disabled" + // SolutionStatusEnabled ... + SolutionStatusEnabled SolutionStatus = "Enabled" ) // PossibleSolutionStatusValues returns an array of possible values for the SolutionStatus const type. func PossibleSolutionStatusValues() []SolutionStatus { - return []SolutionStatus{Disabled, Enabled} + return []SolutionStatus{SolutionStatusDisabled, SolutionStatusEnabled} +} + +// SourceSystem enumerates the values for source system. +type SourceSystem string + +const ( + // AzureAppLocker ... + AzureAppLocker SourceSystem = "Azure_AppLocker" + // AzureAuditD ... + AzureAuditD SourceSystem = "Azure_AuditD" + // NonAzureAppLocker ... + NonAzureAppLocker SourceSystem = "NonAzure_AppLocker" + // NonAzureAuditD ... + NonAzureAuditD SourceSystem = "NonAzure_AuditD" + // None ... + None SourceSystem = "None" +) + +// PossibleSourceSystemValues returns an array of possible values for the SourceSystem const type. +func PossibleSourceSystemValues() []SourceSystem { + return []SourceSystem{AzureAppLocker, AzureAuditD, NonAzureAppLocker, NonAzureAuditD, None} } // State enumerates the values for state. @@ -477,6 +662,29 @@ func PossibleStatusReasonValues() []StatusReason { return []StatusReason{Expired, NewerRequestInitiated, UserRequested} } +// Type enumerates the values for type. +type Type string + +const ( + // BinarySignature ... + BinarySignature Type = "BinarySignature" + // File ... + File Type = "File" + // FileHash ... + FileHash Type = "FileHash" + // ProductSignature ... + ProductSignature Type = "ProductSignature" + // PublisherSignature ... + PublisherSignature Type = "PublisherSignature" + // VersionAndAboveSignature ... + VersionAndAboveSignature Type = "VersionAndAboveSignature" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{BinarySignature, File, FileHash, ProductSignature, PublisherSignature, VersionAndAboveSignature} +} + // AadConnectivityState1 describes an Azure resource with kind type AadConnectivityState1 struct { // ConnectivityState - Possible values include: 'Discovered', 'NotLicensed', 'Connected' @@ -1203,6 +1411,128 @@ type AllowedConnectionsResourceProperties struct { ConnectableResources *[]ConnectableResource `json:"connectableResources,omitempty"` } +// AppWhitelistingGroup ... +type AppWhitelistingGroup struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - READ-ONLY; Location where the resource is stored + Location *string `json:"location,omitempty"` + *AppWhitelistingGroupData `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppWhitelistingGroup. +func (awg AppWhitelistingGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if awg.AppWhitelistingGroupData != nil { + objectMap["properties"] = awg.AppWhitelistingGroupData + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AppWhitelistingGroup struct. +func (awg *AppWhitelistingGroup) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + awg.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + awg.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + awg.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + awg.Location = &location + } + case "properties": + if v != nil { + var appWhitelistingGroupData AppWhitelistingGroupData + err = json.Unmarshal(*v, &appWhitelistingGroupData) + if err != nil { + return err + } + awg.AppWhitelistingGroupData = &appWhitelistingGroupData + } + } + } + + return nil +} + +// AppWhitelistingGroupData represents a VM/server group and set of rules that are Recommended by Azure +// Security Center to be allowed +type AppWhitelistingGroupData struct { + // EnforcementMode - Possible values include: 'Audit', 'Enforce' + EnforcementMode EnforcementMode `json:"enforcementMode,omitempty"` + // ConfigurationStatus - Possible values include: 'ConfigurationStatus2Configured', 'ConfigurationStatus2NotConfigured', 'ConfigurationStatus2InProgress', 'ConfigurationStatus2Failed', 'ConfigurationStatus2NoStatus' + ConfigurationStatus ConfigurationStatus2 `json:"configurationStatus,omitempty"` + // RecommendationStatus - Possible values include: 'RecommendationStatusRecommended', 'RecommendationStatusNotRecommended', 'RecommendationStatusNotAvailable', 'RecommendationStatusNoStatus' + RecommendationStatus RecommendationStatus `json:"recommendationStatus,omitempty"` + Issues *[]AppWhitelistingIssueSummary `json:"issues,omitempty"` + // SourceSystem - Possible values include: 'AzureAppLocker', 'AzureAuditD', 'NonAzureAppLocker', 'NonAzureAuditD', 'None' + SourceSystem SourceSystem `json:"sourceSystem,omitempty"` + VMRecommendations *[]VMRecommendation `json:"vmRecommendations,omitempty"` + PathRecommendations *[]PathRecommendation `json:"pathRecommendations,omitempty"` +} + +// AppWhitelistingGroups represents a list of VM/server groups and set of rules that are Recommended by +// Azure Security Center to be allowed +type AppWhitelistingGroups struct { + autorest.Response `json:"-"` + Value *[]AppWhitelistingGroup `json:"value,omitempty"` +} + +// AppWhitelistingIssueSummary represents a summary of the alerts of the VM/server group +type AppWhitelistingIssueSummary struct { + // Issue - Possible values include: 'ViolationsAudited', 'ViolationsBlocked', 'MsiAndScriptViolationsAudited', 'MsiAndScriptViolationsBlocked', 'ExecutableViolationsAudited', 'RulesViolatedManually' + Issue Issue `json:"issue,omitempty"` + // NumberOfVms - The number of machines in the VM/server group that have this alert + NumberOfVms *float64 `json:"numberOfVms,omitempty"` +} + +// AppWhitelistingPutGroupData the altered data of the recommended VM/server group policy +type AppWhitelistingPutGroupData struct { + // EnforcementMode - Possible values include: 'EnforcementMode1Audit', 'EnforcementMode1Enforce' + EnforcementMode EnforcementMode1 `json:"enforcementMode,omitempty"` + VMRecommendations *[]VMRecommendation `json:"vmRecommendations,omitempty"` + PathRecommendations *[]PathRecommendation `json:"pathRecommendations,omitempty"` +} + // AscLocation the ASC location of the subscription is in the "name" field type AscLocation struct { autorest.Response `json:"-"` @@ -1361,246 +1691,6 @@ func NewAscLocationListPage(getNextPage func(context.Context, AscLocationList) ( return AscLocationListPage{fn: getNextPage} } -// AssessmentMetadata security assessment metadata -type AssessmentMetadata struct { - autorest.Response `json:"-"` - *AssessmentMetadataProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for AssessmentMetadata. -func (am AssessmentMetadata) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if am.AssessmentMetadataProperties != nil { - objectMap["properties"] = am.AssessmentMetadataProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AssessmentMetadata struct. -func (am *AssessmentMetadata) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var assessmentMetadataProperties AssessmentMetadataProperties - err = json.Unmarshal(*v, &assessmentMetadataProperties) - if err != nil { - return err - } - am.AssessmentMetadataProperties = &assessmentMetadataProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - am.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - am.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - am.Type = &typeVar - } - } - } - - return nil -} - -// AssessmentMetadataList list of security assessment metadata -type AssessmentMetadataList struct { - autorest.Response `json:"-"` - // Value - READ-ONLY - Value *[]AssessmentMetadata `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` -} - -// AssessmentMetadataListIterator provides access to a complete listing of AssessmentMetadata values. -type AssessmentMetadataListIterator struct { - i int - page AssessmentMetadataListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AssessmentMetadataListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentMetadataListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AssessmentMetadataListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AssessmentMetadataListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AssessmentMetadataListIterator) Response() AssessmentMetadataList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AssessmentMetadataListIterator) Value() AssessmentMetadata { - if !iter.page.NotDone() { - return AssessmentMetadata{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AssessmentMetadataListIterator type. -func NewAssessmentMetadataListIterator(page AssessmentMetadataListPage) AssessmentMetadataListIterator { - return AssessmentMetadataListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (aml AssessmentMetadataList) IsEmpty() bool { - return aml.Value == nil || len(*aml.Value) == 0 -} - -// assessmentMetadataListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (aml AssessmentMetadataList) assessmentMetadataListPreparer(ctx context.Context) (*http.Request, error) { - if aml.NextLink == nil || len(to.String(aml.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(aml.NextLink))) -} - -// AssessmentMetadataListPage contains a page of AssessmentMetadata values. -type AssessmentMetadataListPage struct { - fn func(context.Context, AssessmentMetadataList) (AssessmentMetadataList, error) - aml AssessmentMetadataList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AssessmentMetadataListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentMetadataListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - next, err := page.fn(ctx, page.aml) - if err != nil { - return err - } - page.aml = next - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AssessmentMetadataListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AssessmentMetadataListPage) NotDone() bool { - return !page.aml.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AssessmentMetadataListPage) Response() AssessmentMetadataList { - return page.aml -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AssessmentMetadataListPage) Values() []AssessmentMetadata { - if page.aml.IsEmpty() { - return nil - } - return *page.aml.Value -} - -// Creates a new instance of the AssessmentMetadataListPage type. -func NewAssessmentMetadataListPage(getNextPage func(context.Context, AssessmentMetadataList) (AssessmentMetadataList, error)) AssessmentMetadataListPage { - return AssessmentMetadataListPage{fn: getNextPage} -} - -// AssessmentMetadataProperties describes properties of an assessment metadata. -type AssessmentMetadataProperties struct { - // DisplayName - READ-ONLY; User friendly display name of the assessment - DisplayName *string `json:"displayName,omitempty"` - // PolicyDefinitionID - READ-ONLY; Azure resource ID of the policy definition that turns this assessment calculation on - PolicyDefinitionID *string `json:"policyDefinitionId,omitempty"` - // Description - READ-ONLY; Human readable description of the assessment - Description *string `json:"description,omitempty"` - // RemediationDescription - READ-ONLY; Human readable description of what you should do to mitigate this security issue - RemediationDescription *string `json:"remediationDescription,omitempty"` - // Category - READ-ONLY - Category *[]Category `json:"category,omitempty"` - // SecureScoreWeight - READ-ONLY; Weight for the security score calculation. the higher this number, this severity of this assessment is higher - SecureScoreWeight *int32 `json:"secureScoreWeight,omitempty"` - // RequiredPricingBundle - READ-ONLY - RequiredPricingBundle *[]RequiredPricingBundle `json:"requiredPricingBundle,omitempty"` - // Preview - READ-ONLY; True if this assessment is in preview release status - Preview *bool `json:"preview,omitempty"` - // AssessmentType - READ-ONLY; BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure Policy definition. Possible values include: 'BuiltIn', 'Custom' - AssessmentType AssessmentType `json:"assessmentType,omitempty"` -} - // AtaExternalSecuritySolution represents an ATA security solution which sends logs to an OMS workspace type AtaExternalSecuritySolution struct { Properties *AtaSolutionProperties `json:"properties,omitempty"` @@ -4694,7 +4784,7 @@ type IoTSecuritySolutionProperties struct { Workspace *string `json:"workspace,omitempty"` // DisplayName - Resource display name. DisplayName *string `json:"displayName,omitempty"` - // Status - Security solution status. Possible values include: 'Enabled', 'Disabled' + // Status - Security solution status. Possible values include: 'SolutionStatusEnabled', 'SolutionStatusDisabled' Status SolutionStatus `json:"status,omitempty"` // Export - List of additional export to workspace data options Export *[]ExportData `json:"export,omitempty"` @@ -5377,6 +5467,25 @@ func NewOperationListPage(getNextPage func(context.Context, OperationList) (Oper return OperationListPage{fn: getNextPage} } +// PathRecommendation represents a path that is recommended to be allowed and its properties +type PathRecommendation struct { + // Path - The full path to whitelist + Path *string `json:"path,omitempty"` + // Action - Possible values include: 'Recommended', 'Add', 'Remove' + Action Action `json:"action,omitempty"` + // Type - Possible values include: 'File', 'FileHash', 'PublisherSignature', 'ProductSignature', 'BinarySignature', 'VersionAndAboveSignature' + Type Type `json:"type,omitempty"` + PublisherInfo *PublisherInfo `json:"publisherInfo,omitempty"` + // Common - Whether the path is commonly run on the machine + Common *bool `json:"common,omitempty"` + UserSids *[]string `json:"userSids,omitempty"` + Usernames *[]UserRecommendation `json:"usernames,omitempty"` + // FileType - Possible values include: 'Exe', 'Dll', 'Msi', 'Script', 'Executable', 'Unknown' + FileType FileType `json:"fileType,omitempty"` + // ConfigurationStatus - Possible values include: 'ConfigurationStatus1Configured', 'ConfigurationStatus1NotConfigured', 'ConfigurationStatus1InProgress', 'ConfigurationStatus1Failed', 'ConfigurationStatus1NoStatus' + ConfigurationStatus ConfigurationStatus1 `json:"configurationStatus,omitempty"` +} + // Pricing pricing tier will be applied for the scope based on the resource ID type Pricing struct { autorest.Response `json:"-"` @@ -5459,19 +5568,31 @@ type PricingList struct { // PricingProperties pricing properties for the relevant scope type PricingProperties struct { - // PricingTier - The pricing tier value. Possible values include: 'Free', 'Standard' + // PricingTier - The pricing tier value. Azure Security Center is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features. Possible values include: 'Free', 'Standard' PricingTier PricingTier `json:"pricingTier,omitempty"` // FreeTrialRemainingTime - READ-ONLY; The duration left for the subscriptions free trial period - in ISO 8601 format (e.g. P3Y6M4DT12H30M5S). FreeTrialRemainingTime *string `json:"freeTrialRemainingTime,omitempty"` } +// PublisherInfo represents the publisher information of a process/rule +type PublisherInfo struct { + // PublisherName - The Subject field of the x.509 certificate used to sign the code, using the following fields - O = Organization, L = Locality, S = State or Province, and C = Country + PublisherName *string `json:"publisherName,omitempty"` + // ProductName - The product name taken from the file's version resource + ProductName *string `json:"productName,omitempty"` + // BinaryName - The "OriginalName" field taken from the file's version resource + BinaryName *string `json:"binaryName,omitempty"` + // Version - The binary file version taken from the file's version resource + Version *string `json:"version,omitempty"` +} + // RecommendationConfigurationProperties recommendation configuration type RecommendationConfigurationProperties struct { - // RecommendationType - The recommendation type. Possible values include: 'OpenPortsOnDevice', 'PermissiveFirewallPolicy', 'PermissiveFirewallRuleInput', 'PermissiveFirewallRuleOut', 'OperationSystemNotValid', 'UnutilizedMessagesFromAgent', 'SecurityTwinConfigurationNotOptimal', 'SecurityTwinConfigurationConflict', 'IdenticalAuthenticationCredentials', 'DenyDefaultIPPolicy', 'TooLargeIPRange', 'EnableDiagnosticsLog' + // RecommendationType - The recommendation type. Possible values include: 'IoTACRAuthentication', 'IoTAgentSendsUnutilizedMessages', 'IoTBaseline', 'IoTEdgeHubMemOptimize', 'IoTEdgeLoggingOptions', 'IoTInconsistentModuleSettings', 'IoTInstallAgent', 'IoTIPFilterDenyAll', 'IoTIPFilterPermissiveRule', 'IoTOpenPorts', 'IoTPermissiveFirewallPolicy', 'IoTPermissiveInputFirewallRules', 'IoTPermissiveOutputFirewallRules', 'IoTPrivilegedDockerOptions', 'IoTSharedCredentials', 'IoTVulnerableTLSCipherSuite' RecommendationType RecommendationType `json:"recommendationType,omitempty"` - // Description - READ-ONLY - Description *string `json:"description,omitempty"` - // Status - Recommendation status. The recommendation is not generated when the status is turned off. Possible values include: 'TurnedOff', 'TurnedOn' + // Name - READ-ONLY + Name *string `json:"name,omitempty"` + // Status - Recommendation status. The recommendation is not generated when the status is disabled. Possible values include: 'Disabled', 'Enabled' Status RecommendationConfigStatus `json:"status,omitempty"` } @@ -6275,7 +6396,7 @@ func (sva *ServerVulnerabilityAssessment) UnmarshalJSON(body []byte) error { // ServerVulnerabilityAssessmentProperties describes ServerVulnerabilityAssessment properties. type ServerVulnerabilityAssessmentProperties struct { - // ProvisioningState - READ-ONLY; The provisioningState of the vulnerability assessment capability on the VM. Possible values include: 'Succeeded', 'Failed', 'Canceled', 'Provisioning', 'Deprovisioning' + // ProvisioningState - READ-ONLY; The provisioningState of the vulnerability assessment capability on the VM. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateProvisioning', 'ProvisioningStateDeprovisioning' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -7054,6 +7175,23 @@ type UserDefinedResourcesProperties struct { QuerySubscriptions *[]string `json:"querySubscriptions,omitempty"` } +// UserRecommendation represents a user that is recommended to be allowed for a certain rule +type UserRecommendation struct { + // Username - Represents a user that is recommended to be allowed for a certain rule + Username *string `json:"username,omitempty"` + // RecommendationAction - Possible values include: 'RecommendationAction1Recommended', 'RecommendationAction1Add', 'RecommendationAction1Remove' + RecommendationAction RecommendationAction1 `json:"recommendationAction,omitempty"` +} + +// VMRecommendation represents a machine that is part of a VM/server group +type VMRecommendation struct { + // ConfigurationStatus - Possible values include: 'Configured', 'NotConfigured', 'InProgress', 'Failed', 'NoStatus' + ConfigurationStatus ConfigurationStatus `json:"configurationStatus,omitempty"` + // RecommendationAction - Possible values include: 'RecommendationActionRecommended', 'RecommendationActionAdd', 'RecommendationActionRemove' + RecommendationAction RecommendationAction `json:"recommendationAction,omitempty"` + ResourceID *string `json:"resourceId,omitempty"` +} + // WorkspaceSetting configures where to store the OMS agent data for workspaces under a scope type WorkspaceSetting struct { autorest.Response `json:"-"` diff --git a/services/preview/security/mgmt/v3.0/security/pricings.go b/services/preview/security/mgmt/v3.0/security/pricings.go index ceb3b3291c14..f73100cc775f 100644 --- a/services/preview/security/mgmt/v3.0/security/pricings.go +++ b/services/preview/security/mgmt/v3.0/security/pricings.go @@ -41,7 +41,9 @@ func NewPricingsClientWithBaseURI(baseURI string, subscriptionID string, ascLoca return PricingsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} } -// Get security pricing configuration in the subscription +// Get a given security pricing configuration in the subscription. Azure Security Center is available in two pricing +// tiers: Free and Standard, on multiple resource types, including Virtual machines, SQL Servers, App service plans and +// Storage accounts. // Parameters: // pricingName - name of the pricing configuration func (client PricingsClient) Get(ctx context.Context, pricingName string) (result Pricing, err error) { @@ -122,7 +124,9 @@ func (client PricingsClient) GetResponder(resp *http.Response) (result Pricing, return } -// List security pricing configurations in the subscription +// List a given security pricing configuration in the subscription. Azure Security Center is available in two pricing +// tiers: Free and Standard, on multiple resource types, including Virtual machines, SQL Servers, App service plans and +// Storage accounts. func (client PricingsClient) List(ctx context.Context) (result PricingList, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PricingsClient.List") @@ -200,7 +204,9 @@ func (client PricingsClient) ListResponder(resp *http.Response) (result PricingL return } -// Update security pricing configuration in the subscription +// Update a given security pricing configuration in the subscription. Azure Security Center is available in two pricing +// tiers: Free and Standard, on multiple resource types, including Virtual machines, SQL Servers, App service plans and +// Storage accounts. // Parameters: // pricingName - name of the pricing configuration // pricing - pricing object diff --git a/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go b/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go index 003ce80937e5..573a51be7f5f 100644 --- a/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go +++ b/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go @@ -104,6 +104,15 @@ type JitNetworkAccessPoliciesClientAPI interface { var _ JitNetworkAccessPoliciesClientAPI = (*security.JitNetworkAccessPoliciesClient)(nil) +// AdaptiveApplicationControlsClientAPI contains the set of methods on the AdaptiveApplicationControlsClient type. +type AdaptiveApplicationControlsClientAPI interface { + Get(ctx context.Context, groupName string) (result security.AppWhitelistingGroup, err error) + List(ctx context.Context, includePathRecommendations *bool, summary *bool) (result security.AppWhitelistingGroups, err error) + Put(ctx context.Context, groupName string, body security.AppWhitelistingPutGroupData) (result security.AppWhitelistingGroup, err error) +} + +var _ AdaptiveApplicationControlsClientAPI = (*security.AdaptiveApplicationControlsClient)(nil) + // LocationsClientAPI contains the set of methods on the LocationsClient type. type LocationsClientAPI interface { Get(ctx context.Context) (result security.AscLocation, err error) @@ -282,22 +291,6 @@ type RegulatoryComplianceAssessmentsClientAPI interface { var _ RegulatoryComplianceAssessmentsClientAPI = (*security.RegulatoryComplianceAssessmentsClient)(nil) -// AssessmentsMetadataClientAPI contains the set of methods on the AssessmentsMetadataClient type. -type AssessmentsMetadataClientAPI interface { - Get(ctx context.Context, assessmentsMetadataName string) (result security.AssessmentMetadata, err error) - List(ctx context.Context) (result security.AssessmentMetadataListPage, err error) -} - -var _ AssessmentsMetadataClientAPI = (*security.AssessmentsMetadataClient)(nil) - -// AssessmentsMetadataSubscriptionClientAPI contains the set of methods on the AssessmentsMetadataSubscriptionClient type. -type AssessmentsMetadataSubscriptionClientAPI interface { - Get(ctx context.Context, assessmentsMetadataName string) (result security.AssessmentMetadata, err error) - List(ctx context.Context) (result security.AssessmentMetadataListPage, err error) -} - -var _ AssessmentsMetadataSubscriptionClientAPI = (*security.AssessmentsMetadataSubscriptionClient)(nil) - // ServerVulnerabilityAssessmentClientAPI contains the set of methods on the ServerVulnerabilityAssessmentClient type. type ServerVulnerabilityAssessmentClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (result security.ServerVulnerabilityAssessment, err error)