ServerSecurityAlertPolicyArgs

data class ServerSecurityAlertPolicyArgs(val disabledAlerts: Output<List<String>>? = null, val emailAccountAdmins: Output<Boolean>? = null, val emailAddresses: Output<List<String>>? = null, val resourceGroupName: Output<String>? = null, val retentionDays: Output<Int>? = null, val serverName: Output<String>? = null, val state: Output<String>? = null, val storageAccountAccessKey: Output<String>? = null, val storageEndpoint: Output<String>? = null) : ConvertibleToJava<ServerSecurityAlertPolicyArgs>

Manages a Security Alert Policy for a MSSQL Server.

NOTE Security Alert Policy is currently only available for MS SQL databases.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.sql.SqlServer;
import com.pulumi.azure.sql.SqlServerArgs;
import com.pulumi.azure.storage.Account;
import com.pulumi.azure.storage.AccountArgs;
import com.pulumi.azure.mssql.ServerSecurityAlertPolicy;
import com.pulumi.azure.mssql.ServerSecurityAlertPolicyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-resources")
.location("West Europe")
.build());
var exampleSqlServer = new SqlServer("exampleSqlServer", SqlServerArgs.builder()
.name("mysqlserver")
.resourceGroupName(example.name())
.location(example.location())
.version("12.0")
.administratorLogin("4dm1n157r470r")
.administratorLoginPassword("4-v3ry-53cr37-p455w0rd")
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.name("accteststorageaccount")
.resourceGroupName(example.name())
.location(example.location())
.accountTier("Standard")
.accountReplicationType("GRS")
.build());
var exampleServerSecurityAlertPolicy = new ServerSecurityAlertPolicy("exampleServerSecurityAlertPolicy", ServerSecurityAlertPolicyArgs.builder()
.resourceGroupName(example.name())
.serverName(exampleSqlServer.name())
.state("Enabled")
.storageEndpoint(exampleAccount.primaryBlobEndpoint())
.storageAccountAccessKey(exampleAccount.primaryAccessKey())
.disabledAlerts(
"Sql_Injection",
"Data_Exfiltration")
.retentionDays(20)
.build());
}
}

Import

MS SQL Server Security Alert Policy can be imported using the resource id, e.g.

$ pulumi import azure:mssql/serverSecurityAlertPolicy:ServerSecurityAlertPolicy example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/acceptanceTestResourceGroup1/providers/Microsoft.Sql/servers/mssqlserver/securityAlertPolicies/Default

Constructors

Link copied to clipboard
fun ServerSecurityAlertPolicyArgs(disabledAlerts: Output<List<String>>? = null, emailAccountAdmins: Output<Boolean>? = null, emailAddresses: Output<List<String>>? = null, resourceGroupName: Output<String>? = null, retentionDays: Output<Int>? = null, serverName: Output<String>? = null, state: Output<String>? = null, storageAccountAccessKey: Output<String>? = null, storageEndpoint: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): ServerSecurityAlertPolicyArgs

Properties

Link copied to clipboard
val disabledAlerts: Output<List<String>>? = null

Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action.

Link copied to clipboard
val emailAccountAdmins: Output<Boolean>? = null

Boolean flag which specifies if the alert is sent to the account administrators or not. Defaults to false.

Link copied to clipboard
val emailAddresses: Output<List<String>>? = null

Specifies an array of email addresses to which the alert is sent.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group that contains the MS SQL Server. Changing this forces a new resource to be created.

Link copied to clipboard
val retentionDays: Output<Int>? = null

Specifies the number of days to keep in the Threat Detection audit logs. Defaults to 0.

Link copied to clipboard
val serverName: Output<String>? = null

Specifies the name of the MS SQL Server. Changing this forces a new resource to be created.

Link copied to clipboard
val state: Output<String>? = null

Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific database server. Possible values are Disabled, Enabled and New.

Link copied to clipboard
val storageAccountAccessKey: Output<String>? = null

Specifies the identifier key of the Threat Detection audit storage account. This is mandatory when you use storage_endpoint to specify a storage account blob endpoint.

Link copied to clipboard
val storageEndpoint: Output<String>? = null

Specifies the blob storage endpoint (e.g. https://example.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.