Framework/Core/FixControl/Services/SubscriptionCoreFix.ps1
Set-StrictMode -Version Latest class SubscriptionCoreFix: FixSubscriptionBase { SubscriptionCoreFix([string] $subscriptionId, [ArrayWrapper] $controls): Base($subscriptionId, $controls) { } [MessageData[]] AddRequiredCentralAccounts([PSObject] $parameters) { [MessageData[]] $detailedLogs = @(); $detailedLogs += [MessageData]::new("Adding required central accounts to the subscription using AzSDK command..."); Set-AzSDKSubscriptionRBAC ` -SubscriptionId $this.SubscriptionContext.SubscriptionId ` -Tags ([String]::Join(",", $parameters.Tags)) ` -DoNotOpenOutputFolder $detailedLogs += [MessageData]::new("All required central accounts have been added to the subscription", [MessageType]::Update); return $detailedLogs; } [MessageData[]] RemoveDeprecatedAccounts([PSObject] $parameters) { [MessageData[]] $detailedLogs = @(); $detailedLogs += [MessageData]::new("Removing deprecated accounts from the subscription using AzSDK command..."); Remove-AzSDKSubscriptionRBAC -SubscriptionId $this.SubscriptionContext.SubscriptionId -DoNotOpenOutputFolder $detailedLogs += [MessageData]::new("All deprecated accounts have been removed from the subscription", [MessageType]::Update); return $detailedLogs; } [MessageData[]] ConfigureSecurityCenter([PSObject] $parameters) { [MessageData[]] $detailedLogs = @(); $detailedLogs += [MessageData]::new("Configuring Security Center using AzSDK command..."); Set-AzSDKAzureSecurityCenterPolicies ` -SubscriptionId $this.SubscriptionContext.SubscriptionId ` -SecurityContactEmails $parameters.SecurityContactEmails ` -SecurityPhoneNumber $parameters.SecurityPhoneNumber ` -DoNotOpenOutputFolder $detailedLogs += [MessageData]::new("Security Center has been configured", [MessageType]::Update); return $detailedLogs; } [MessageData[]] ConfigureARMPolicies([PSObject] $parameters) { [MessageData[]] $detailedLogs = @(); $detailedLogs += [MessageData]::new("Configuring ARM policies using AzSDK command..."); Set-AzSDKARMPolicies ` -SubscriptionId $this.SubscriptionContext.SubscriptionId ` -Tags ([String]::Join(",", $parameters.Tags)) ` -DoNotOpenOutputFolder $detailedLogs += [MessageData]::new("ARM policies have been configured", [MessageType]::Update); return $detailedLogs; } [MessageData[]] ConfigureAlerts([PSObject] $parameters) { [MessageData[]] $detailedLogs = @(); $detailedLogs += [MessageData]::new("Configuring alerts using AzSDK command..."); Set-AzSDKAlerts ` -SubscriptionId $this.SubscriptionContext.SubscriptionId ` -SecurityContactEmails $parameters.SecurityContactEmails ` -Tags ([String]::Join(",", $parameters.Tags)) ` -DoNotOpenOutputFolder $detailedLogs += [MessageData]::new("Alerts have been configured", [MessageType]::Update); return $detailedLogs; } } |