azure-native.sql.ExtendedDatabaseBlobAuditingPolicy
Explore with Pulumi AI
An extended database blob auditing policy. Azure REST API version: 2021-11-01. Prior API version in Azure Native 1.x: 2020-11-01-preview.
Other available API versions: 2022-11-01-preview, 2023-02-01-preview, 2023-05-01-preview, 2023-08-01-preview.
Example Usage
Create or update an extended database's azure monitor auditing policy with minimal parameters
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var extendedDatabaseBlobAuditingPolicy = new AzureNative.Sql.ExtendedDatabaseBlobAuditingPolicy("extendedDatabaseBlobAuditingPolicy", new()
{
BlobAuditingPolicyName = "default",
DatabaseName = "testdb",
IsAzureMonitorTargetEnabled = true,
ResourceGroupName = "blobauditingtest-4799",
ServerName = "blobauditingtest-6440",
State = AzureNative.Sql.BlobAuditingPolicyState.Enabled,
});
});
package main
import (
sql "github.com/pulumi/pulumi-azure-native-sdk/sql/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := sql.NewExtendedDatabaseBlobAuditingPolicy(ctx, "extendedDatabaseBlobAuditingPolicy", &sql.ExtendedDatabaseBlobAuditingPolicyArgs{
BlobAuditingPolicyName: pulumi.String("default"),
DatabaseName: pulumi.String("testdb"),
IsAzureMonitorTargetEnabled: pulumi.Bool(true),
ResourceGroupName: pulumi.String("blobauditingtest-4799"),
ServerName: pulumi.String("blobauditingtest-6440"),
State: sql.BlobAuditingPolicyStateEnabled,
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.sql.ExtendedDatabaseBlobAuditingPolicy;
import com.pulumi.azurenative.sql.ExtendedDatabaseBlobAuditingPolicyArgs;
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 extendedDatabaseBlobAuditingPolicy = new ExtendedDatabaseBlobAuditingPolicy("extendedDatabaseBlobAuditingPolicy", ExtendedDatabaseBlobAuditingPolicyArgs.builder()
.blobAuditingPolicyName("default")
.databaseName("testdb")
.isAzureMonitorTargetEnabled(true)
.resourceGroupName("blobauditingtest-4799")
.serverName("blobauditingtest-6440")
.state("Enabled")
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
extended_database_blob_auditing_policy = azure_native.sql.ExtendedDatabaseBlobAuditingPolicy("extendedDatabaseBlobAuditingPolicy",
blob_auditing_policy_name="default",
database_name="testdb",
is_azure_monitor_target_enabled=True,
resource_group_name="blobauditingtest-4799",
server_name="blobauditingtest-6440",
state=azure_native.sql.BlobAuditingPolicyState.ENABLED)
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const extendedDatabaseBlobAuditingPolicy = new azure_native.sql.ExtendedDatabaseBlobAuditingPolicy("extendedDatabaseBlobAuditingPolicy", {
blobAuditingPolicyName: "default",
databaseName: "testdb",
isAzureMonitorTargetEnabled: true,
resourceGroupName: "blobauditingtest-4799",
serverName: "blobauditingtest-6440",
state: azure_native.sql.BlobAuditingPolicyState.Enabled,
});
resources:
extendedDatabaseBlobAuditingPolicy:
type: azure-native:sql:ExtendedDatabaseBlobAuditingPolicy
properties:
blobAuditingPolicyName: default
databaseName: testdb
isAzureMonitorTargetEnabled: true
resourceGroupName: blobauditingtest-4799
serverName: blobauditingtest-6440
state: Enabled
Create or update an extended database's blob auditing policy with all parameters
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var extendedDatabaseBlobAuditingPolicy = new AzureNative.Sql.ExtendedDatabaseBlobAuditingPolicy("extendedDatabaseBlobAuditingPolicy", new()
{
AuditActionsAndGroups = new[]
{
"DATABASE_LOGOUT_GROUP",
"DATABASE_ROLE_MEMBER_CHANGE_GROUP",
"UPDATE on database::TestDatabaseName by public",
},
BlobAuditingPolicyName = "default",
DatabaseName = "testdb",
IsAzureMonitorTargetEnabled = true,
IsStorageSecondaryKeyInUse = false,
PredicateExpression = "statement = 'select 1'",
QueueDelayMs = 4000,
ResourceGroupName = "blobauditingtest-4799",
RetentionDays = 6,
ServerName = "blobauditingtest-6440",
State = AzureNative.Sql.BlobAuditingPolicyState.Enabled,
StorageAccountAccessKey = "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==",
StorageAccountSubscriptionId = "00000000-1234-0000-5678-000000000000",
StorageEndpoint = "https://mystorage.blob.core.windows.net",
});
});
package main
import (
sql "github.com/pulumi/pulumi-azure-native-sdk/sql/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := sql.NewExtendedDatabaseBlobAuditingPolicy(ctx, "extendedDatabaseBlobAuditingPolicy", &sql.ExtendedDatabaseBlobAuditingPolicyArgs{
AuditActionsAndGroups: pulumi.StringArray{
pulumi.String("DATABASE_LOGOUT_GROUP"),
pulumi.String("DATABASE_ROLE_MEMBER_CHANGE_GROUP"),
pulumi.String("UPDATE on database::TestDatabaseName by public"),
},
BlobAuditingPolicyName: pulumi.String("default"),
DatabaseName: pulumi.String("testdb"),
IsAzureMonitorTargetEnabled: pulumi.Bool(true),
IsStorageSecondaryKeyInUse: pulumi.Bool(false),
PredicateExpression: pulumi.String("statement = 'select 1'"),
QueueDelayMs: pulumi.Int(4000),
ResourceGroupName: pulumi.String("blobauditingtest-4799"),
RetentionDays: pulumi.Int(6),
ServerName: pulumi.String("blobauditingtest-6440"),
State: sql.BlobAuditingPolicyStateEnabled,
StorageAccountAccessKey: pulumi.String("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="),
StorageAccountSubscriptionId: pulumi.String("00000000-1234-0000-5678-000000000000"),
StorageEndpoint: pulumi.String("https://mystorage.blob.core.windows.net"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.sql.ExtendedDatabaseBlobAuditingPolicy;
import com.pulumi.azurenative.sql.ExtendedDatabaseBlobAuditingPolicyArgs;
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 extendedDatabaseBlobAuditingPolicy = new ExtendedDatabaseBlobAuditingPolicy("extendedDatabaseBlobAuditingPolicy", ExtendedDatabaseBlobAuditingPolicyArgs.builder()
.auditActionsAndGroups(
"DATABASE_LOGOUT_GROUP",
"DATABASE_ROLE_MEMBER_CHANGE_GROUP",
"UPDATE on database::TestDatabaseName by public")
.blobAuditingPolicyName("default")
.databaseName("testdb")
.isAzureMonitorTargetEnabled(true)
.isStorageSecondaryKeyInUse(false)
.predicateExpression("statement = 'select 1'")
.queueDelayMs(4000)
.resourceGroupName("blobauditingtest-4799")
.retentionDays(6)
.serverName("blobauditingtest-6440")
.state("Enabled")
.storageAccountAccessKey("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==")
.storageAccountSubscriptionId("00000000-1234-0000-5678-000000000000")
.storageEndpoint("https://mystorage.blob.core.windows.net")
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
extended_database_blob_auditing_policy = azure_native.sql.ExtendedDatabaseBlobAuditingPolicy("extendedDatabaseBlobAuditingPolicy",
audit_actions_and_groups=[
"DATABASE_LOGOUT_GROUP",
"DATABASE_ROLE_MEMBER_CHANGE_GROUP",
"UPDATE on database::TestDatabaseName by public",
],
blob_auditing_policy_name="default",
database_name="testdb",
is_azure_monitor_target_enabled=True,
is_storage_secondary_key_in_use=False,
predicate_expression="statement = 'select 1'",
queue_delay_ms=4000,
resource_group_name="blobauditingtest-4799",
retention_days=6,
server_name="blobauditingtest-6440",
state=azure_native.sql.BlobAuditingPolicyState.ENABLED,
storage_account_access_key="sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==",
storage_account_subscription_id="00000000-1234-0000-5678-000000000000",
storage_endpoint="https://mystorage.blob.core.windows.net")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const extendedDatabaseBlobAuditingPolicy = new azure_native.sql.ExtendedDatabaseBlobAuditingPolicy("extendedDatabaseBlobAuditingPolicy", {
auditActionsAndGroups: [
"DATABASE_LOGOUT_GROUP",
"DATABASE_ROLE_MEMBER_CHANGE_GROUP",
"UPDATE on database::TestDatabaseName by public",
],
blobAuditingPolicyName: "default",
databaseName: "testdb",
isAzureMonitorTargetEnabled: true,
isStorageSecondaryKeyInUse: false,
predicateExpression: "statement = 'select 1'",
queueDelayMs: 4000,
resourceGroupName: "blobauditingtest-4799",
retentionDays: 6,
serverName: "blobauditingtest-6440",
state: azure_native.sql.BlobAuditingPolicyState.Enabled,
storageAccountAccessKey: "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==",
storageAccountSubscriptionId: "00000000-1234-0000-5678-000000000000",
storageEndpoint: "https://mystorage.blob.core.windows.net",
});
resources:
extendedDatabaseBlobAuditingPolicy:
type: azure-native:sql:ExtendedDatabaseBlobAuditingPolicy
properties:
auditActionsAndGroups:
- DATABASE_LOGOUT_GROUP
- DATABASE_ROLE_MEMBER_CHANGE_GROUP
- UPDATE on database::TestDatabaseName by public
blobAuditingPolicyName: default
databaseName: testdb
isAzureMonitorTargetEnabled: true
isStorageSecondaryKeyInUse: false
predicateExpression: statement = 'select 1'
queueDelayMs: 4000
resourceGroupName: blobauditingtest-4799
retentionDays: 6
serverName: blobauditingtest-6440
state: Enabled
storageAccountAccessKey: sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==
storageAccountSubscriptionId: 00000000-1234-0000-5678-000000000000
storageEndpoint: https://mystorage.blob.core.windows.net
Create or update an extended database's blob auditing policy with minimal parameters
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var extendedDatabaseBlobAuditingPolicy = new AzureNative.Sql.ExtendedDatabaseBlobAuditingPolicy("extendedDatabaseBlobAuditingPolicy", new()
{
BlobAuditingPolicyName = "default",
DatabaseName = "testdb",
ResourceGroupName = "blobauditingtest-4799",
ServerName = "blobauditingtest-6440",
State = AzureNative.Sql.BlobAuditingPolicyState.Enabled,
StorageAccountAccessKey = "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==",
StorageEndpoint = "https://mystorage.blob.core.windows.net",
});
});
package main
import (
sql "github.com/pulumi/pulumi-azure-native-sdk/sql/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := sql.NewExtendedDatabaseBlobAuditingPolicy(ctx, "extendedDatabaseBlobAuditingPolicy", &sql.ExtendedDatabaseBlobAuditingPolicyArgs{
BlobAuditingPolicyName: pulumi.String("default"),
DatabaseName: pulumi.String("testdb"),
ResourceGroupName: pulumi.String("blobauditingtest-4799"),
ServerName: pulumi.String("blobauditingtest-6440"),
State: sql.BlobAuditingPolicyStateEnabled,
StorageAccountAccessKey: pulumi.String("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="),
StorageEndpoint: pulumi.String("https://mystorage.blob.core.windows.net"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.sql.ExtendedDatabaseBlobAuditingPolicy;
import com.pulumi.azurenative.sql.ExtendedDatabaseBlobAuditingPolicyArgs;
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 extendedDatabaseBlobAuditingPolicy = new ExtendedDatabaseBlobAuditingPolicy("extendedDatabaseBlobAuditingPolicy", ExtendedDatabaseBlobAuditingPolicyArgs.builder()
.blobAuditingPolicyName("default")
.databaseName("testdb")
.resourceGroupName("blobauditingtest-4799")
.serverName("blobauditingtest-6440")
.state("Enabled")
.storageAccountAccessKey("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==")
.storageEndpoint("https://mystorage.blob.core.windows.net")
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
extended_database_blob_auditing_policy = azure_native.sql.ExtendedDatabaseBlobAuditingPolicy("extendedDatabaseBlobAuditingPolicy",
blob_auditing_policy_name="default",
database_name="testdb",
resource_group_name="blobauditingtest-4799",
server_name="blobauditingtest-6440",
state=azure_native.sql.BlobAuditingPolicyState.ENABLED,
storage_account_access_key="sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==",
storage_endpoint="https://mystorage.blob.core.windows.net")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const extendedDatabaseBlobAuditingPolicy = new azure_native.sql.ExtendedDatabaseBlobAuditingPolicy("extendedDatabaseBlobAuditingPolicy", {
blobAuditingPolicyName: "default",
databaseName: "testdb",
resourceGroupName: "blobauditingtest-4799",
serverName: "blobauditingtest-6440",
state: azure_native.sql.BlobAuditingPolicyState.Enabled,
storageAccountAccessKey: "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==",
storageEndpoint: "https://mystorage.blob.core.windows.net",
});
resources:
extendedDatabaseBlobAuditingPolicy:
type: azure-native:sql:ExtendedDatabaseBlobAuditingPolicy
properties:
blobAuditingPolicyName: default
databaseName: testdb
resourceGroupName: blobauditingtest-4799
serverName: blobauditingtest-6440
state: Enabled
storageAccountAccessKey: sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==
storageEndpoint: https://mystorage.blob.core.windows.net
Create ExtendedDatabaseBlobAuditingPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ExtendedDatabaseBlobAuditingPolicy(name: string, args: ExtendedDatabaseBlobAuditingPolicyArgs, opts?: CustomResourceOptions);
@overload
def ExtendedDatabaseBlobAuditingPolicy(resource_name: str,
args: ExtendedDatabaseBlobAuditingPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ExtendedDatabaseBlobAuditingPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
resource_group_name: Optional[str] = None,
state: Optional[BlobAuditingPolicyState] = None,
database_name: Optional[str] = None,
server_name: Optional[str] = None,
predicate_expression: Optional[str] = None,
is_storage_secondary_key_in_use: Optional[bool] = None,
audit_actions_and_groups: Optional[Sequence[str]] = None,
queue_delay_ms: Optional[int] = None,
is_managed_identity_in_use: Optional[bool] = None,
retention_days: Optional[int] = None,
is_azure_monitor_target_enabled: Optional[bool] = None,
blob_auditing_policy_name: Optional[str] = None,
storage_account_access_key: Optional[str] = None,
storage_account_subscription_id: Optional[str] = None,
storage_endpoint: Optional[str] = None)
func NewExtendedDatabaseBlobAuditingPolicy(ctx *Context, name string, args ExtendedDatabaseBlobAuditingPolicyArgs, opts ...ResourceOption) (*ExtendedDatabaseBlobAuditingPolicy, error)
public ExtendedDatabaseBlobAuditingPolicy(string name, ExtendedDatabaseBlobAuditingPolicyArgs args, CustomResourceOptions? opts = null)
public ExtendedDatabaseBlobAuditingPolicy(String name, ExtendedDatabaseBlobAuditingPolicyArgs args)
public ExtendedDatabaseBlobAuditingPolicy(String name, ExtendedDatabaseBlobAuditingPolicyArgs args, CustomResourceOptions options)
type: azure-native:sql:ExtendedDatabaseBlobAuditingPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ExtendedDatabaseBlobAuditingPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ExtendedDatabaseBlobAuditingPolicyArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ExtendedDatabaseBlobAuditingPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ExtendedDatabaseBlobAuditingPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ExtendedDatabaseBlobAuditingPolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var extendedDatabaseBlobAuditingPolicyResource = new AzureNative.Sql.ExtendedDatabaseBlobAuditingPolicy("extendedDatabaseBlobAuditingPolicyResource", new()
{
ResourceGroupName = "string",
State = AzureNative.Sql.BlobAuditingPolicyState.Enabled,
DatabaseName = "string",
ServerName = "string",
PredicateExpression = "string",
IsStorageSecondaryKeyInUse = false,
AuditActionsAndGroups = new[]
{
"string",
},
QueueDelayMs = 0,
IsManagedIdentityInUse = false,
RetentionDays = 0,
IsAzureMonitorTargetEnabled = false,
BlobAuditingPolicyName = "string",
StorageAccountAccessKey = "string",
StorageAccountSubscriptionId = "string",
StorageEndpoint = "string",
});
example, err := sql.NewExtendedDatabaseBlobAuditingPolicy(ctx, "extendedDatabaseBlobAuditingPolicyResource", &sql.ExtendedDatabaseBlobAuditingPolicyArgs{
ResourceGroupName: pulumi.String("string"),
State: sql.BlobAuditingPolicyStateEnabled,
DatabaseName: pulumi.String("string"),
ServerName: pulumi.String("string"),
PredicateExpression: pulumi.String("string"),
IsStorageSecondaryKeyInUse: pulumi.Bool(false),
AuditActionsAndGroups: pulumi.StringArray{
pulumi.String("string"),
},
QueueDelayMs: pulumi.Int(0),
IsManagedIdentityInUse: pulumi.Bool(false),
RetentionDays: pulumi.Int(0),
IsAzureMonitorTargetEnabled: pulumi.Bool(false),
BlobAuditingPolicyName: pulumi.String("string"),
StorageAccountAccessKey: pulumi.String("string"),
StorageAccountSubscriptionId: pulumi.String("string"),
StorageEndpoint: pulumi.String("string"),
})
var extendedDatabaseBlobAuditingPolicyResource = new ExtendedDatabaseBlobAuditingPolicy("extendedDatabaseBlobAuditingPolicyResource", ExtendedDatabaseBlobAuditingPolicyArgs.builder()
.resourceGroupName("string")
.state("Enabled")
.databaseName("string")
.serverName("string")
.predicateExpression("string")
.isStorageSecondaryKeyInUse(false)
.auditActionsAndGroups("string")
.queueDelayMs(0)
.isManagedIdentityInUse(false)
.retentionDays(0)
.isAzureMonitorTargetEnabled(false)
.blobAuditingPolicyName("string")
.storageAccountAccessKey("string")
.storageAccountSubscriptionId("string")
.storageEndpoint("string")
.build());
extended_database_blob_auditing_policy_resource = azure_native.sql.ExtendedDatabaseBlobAuditingPolicy("extendedDatabaseBlobAuditingPolicyResource",
resource_group_name="string",
state=azure_native.sql.BlobAuditingPolicyState.ENABLED,
database_name="string",
server_name="string",
predicate_expression="string",
is_storage_secondary_key_in_use=False,
audit_actions_and_groups=["string"],
queue_delay_ms=0,
is_managed_identity_in_use=False,
retention_days=0,
is_azure_monitor_target_enabled=False,
blob_auditing_policy_name="string",
storage_account_access_key="string",
storage_account_subscription_id="string",
storage_endpoint="string")
const extendedDatabaseBlobAuditingPolicyResource = new azure_native.sql.ExtendedDatabaseBlobAuditingPolicy("extendedDatabaseBlobAuditingPolicyResource", {
resourceGroupName: "string",
state: azure_native.sql.BlobAuditingPolicyState.Enabled,
databaseName: "string",
serverName: "string",
predicateExpression: "string",
isStorageSecondaryKeyInUse: false,
auditActionsAndGroups: ["string"],
queueDelayMs: 0,
isManagedIdentityInUse: false,
retentionDays: 0,
isAzureMonitorTargetEnabled: false,
blobAuditingPolicyName: "string",
storageAccountAccessKey: "string",
storageAccountSubscriptionId: "string",
storageEndpoint: "string",
});
type: azure-native:sql:ExtendedDatabaseBlobAuditingPolicy
properties:
auditActionsAndGroups:
- string
blobAuditingPolicyName: string
databaseName: string
isAzureMonitorTargetEnabled: false
isManagedIdentityInUse: false
isStorageSecondaryKeyInUse: false
predicateExpression: string
queueDelayMs: 0
resourceGroupName: string
retentionDays: 0
serverName: string
state: Enabled
storageAccountAccessKey: string
storageAccountSubscriptionId: string
storageEndpoint: string
ExtendedDatabaseBlobAuditingPolicy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The ExtendedDatabaseBlobAuditingPolicy resource accepts the following input properties:
- Database
Name string - The name of the database.
- Resource
Group stringName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
- Server
Name string - The name of the server.
- State
Pulumi.
Azure Native. Sql. Blob Auditing Policy State - Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.
- Audit
Actions List<string>And Groups Specifies the Actions-Groups and Actions to audit.
The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins:
BATCH_COMPLETED_GROUP, SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, FAILED_DATABASE_AUTHENTICATION_GROUP.
This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records):
APPLICATION_ROLE_CHANGE_PASSWORD_GROUP BACKUP_RESTORE_GROUP DATABASE_LOGOUT_GROUP DATABASE_OBJECT_CHANGE_GROUP DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP DATABASE_OBJECT_PERMISSION_CHANGE_GROUP DATABASE_OPERATION_GROUP DATABASE_PERMISSION_CHANGE_GROUP DATABASE_PRINCIPAL_CHANGE_GROUP DATABASE_PRINCIPAL_IMPERSONATION_GROUP DATABASE_ROLE_MEMBER_CHANGE_GROUP FAILED_DATABASE_AUTHENTICATION_GROUP SCHEMA_OBJECT_ACCESS_GROUP SCHEMA_OBJECT_CHANGE_GROUP SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP USER_CHANGE_PASSWORD_GROUP BATCH_STARTED_GROUP BATCH_COMPLETED_GROUP DBCC_GROUP DATABASE_OWNERSHIP_CHANGE_GROUP DATABASE_CHANGE_GROUP LEDGER_OPERATION_GROUP
These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs.
For more information, see Database-Level Audit Action Groups.
For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are: SELECT UPDATE INSERT DELETE EXECUTE RECEIVE REFERENCES
The general form for defining an action to be audited is: {action} ON {object} BY {principal}
Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively.
For example: SELECT on dbo.myTable by public SELECT on DATABASE::myDatabase by public SELECT on SCHEMA::mySchema by public
For more information, see Database-Level Audit Actions
- Blob
Auditing stringPolicy Name - The name of the blob auditing policy.
- Is
Azure boolMonitor Target Enabled Specifies whether audit events are sent to Azure Monitor. In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true.
When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. Note that for server level audit you should use the 'master' database as {databaseName}.
Diagnostic Settings URI format: PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
For more information, see Diagnostic Settings REST API or Diagnostic Settings PowerShell
- Is
Managed boolIdentity In Use - Specifies whether Managed Identity is used to access blob storage
- Is
Storage boolSecondary Key In Use - Specifies whether storageAccountAccessKey value is the storage's secondary key.
- Predicate
Expression string - Specifies condition of where clause when creating an audit.
- Queue
Delay intMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed. The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.
- Retention
Days int - Specifies the number of days to keep in the audit logs in the storage account.
- Storage
Account stringAccess Key - Specifies the identifier key of the auditing storage account.
If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
Prerequisites for using managed identity authentication:
- Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
- Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity. For more information, see Auditing to storage using Managed Identity authentication
- Storage
Account stringSubscription Id - Specifies the blob storage subscription Id.
- Storage
Endpoint string - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
- Database
Name string - The name of the database.
- Resource
Group stringName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
- Server
Name string - The name of the server.
- State
Blob
Auditing Policy State - Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.
- Audit
Actions []stringAnd Groups Specifies the Actions-Groups and Actions to audit.
The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins:
BATCH_COMPLETED_GROUP, SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, FAILED_DATABASE_AUTHENTICATION_GROUP.
This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records):
APPLICATION_ROLE_CHANGE_PASSWORD_GROUP BACKUP_RESTORE_GROUP DATABASE_LOGOUT_GROUP DATABASE_OBJECT_CHANGE_GROUP DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP DATABASE_OBJECT_PERMISSION_CHANGE_GROUP DATABASE_OPERATION_GROUP DATABASE_PERMISSION_CHANGE_GROUP DATABASE_PRINCIPAL_CHANGE_GROUP DATABASE_PRINCIPAL_IMPERSONATION_GROUP DATABASE_ROLE_MEMBER_CHANGE_GROUP FAILED_DATABASE_AUTHENTICATION_GROUP SCHEMA_OBJECT_ACCESS_GROUP SCHEMA_OBJECT_CHANGE_GROUP SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP USER_CHANGE_PASSWORD_GROUP BATCH_STARTED_GROUP BATCH_COMPLETED_GROUP DBCC_GROUP DATABASE_OWNERSHIP_CHANGE_GROUP DATABASE_CHANGE_GROUP LEDGER_OPERATION_GROUP
These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs.
For more information, see Database-Level Audit Action Groups.
For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are: SELECT UPDATE INSERT DELETE EXECUTE RECEIVE REFERENCES
The general form for defining an action to be audited is: {action} ON {object} BY {principal}
Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively.
For example: SELECT on dbo.myTable by public SELECT on DATABASE::myDatabase by public SELECT on SCHEMA::mySchema by public
For more information, see Database-Level Audit Actions
- Blob
Auditing stringPolicy Name - The name of the blob auditing policy.
- Is
Azure boolMonitor Target Enabled Specifies whether audit events are sent to Azure Monitor. In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true.
When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. Note that for server level audit you should use the 'master' database as {databaseName}.
Diagnostic Settings URI format: PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
For more information, see Diagnostic Settings REST API or Diagnostic Settings PowerShell
- Is
Managed boolIdentity In Use - Specifies whether Managed Identity is used to access blob storage
- Is
Storage boolSecondary Key In Use - Specifies whether storageAccountAccessKey value is the storage's secondary key.
- Predicate
Expression string - Specifies condition of where clause when creating an audit.
- Queue
Delay intMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed. The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.
- Retention
Days int - Specifies the number of days to keep in the audit logs in the storage account.
- Storage
Account stringAccess Key - Specifies the identifier key of the auditing storage account.
If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
Prerequisites for using managed identity authentication:
- Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
- Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity. For more information, see Auditing to storage using Managed Identity authentication
- Storage
Account stringSubscription Id - Specifies the blob storage subscription Id.
- Storage
Endpoint string - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
- database
Name String - The name of the database.
- resource
Group StringName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
- server
Name String - The name of the server.
- state
Blob
Auditing Policy State - Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.
- audit
Actions List<String>And Groups Specifies the Actions-Groups and Actions to audit.
The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins:
BATCH_COMPLETED_GROUP, SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, FAILED_DATABASE_AUTHENTICATION_GROUP.
This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records):
APPLICATION_ROLE_CHANGE_PASSWORD_GROUP BACKUP_RESTORE_GROUP DATABASE_LOGOUT_GROUP DATABASE_OBJECT_CHANGE_GROUP DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP DATABASE_OBJECT_PERMISSION_CHANGE_GROUP DATABASE_OPERATION_GROUP DATABASE_PERMISSION_CHANGE_GROUP DATABASE_PRINCIPAL_CHANGE_GROUP DATABASE_PRINCIPAL_IMPERSONATION_GROUP DATABASE_ROLE_MEMBER_CHANGE_GROUP FAILED_DATABASE_AUTHENTICATION_GROUP SCHEMA_OBJECT_ACCESS_GROUP SCHEMA_OBJECT_CHANGE_GROUP SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP USER_CHANGE_PASSWORD_GROUP BATCH_STARTED_GROUP BATCH_COMPLETED_GROUP DBCC_GROUP DATABASE_OWNERSHIP_CHANGE_GROUP DATABASE_CHANGE_GROUP LEDGER_OPERATION_GROUP
These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs.
For more information, see Database-Level Audit Action Groups.
For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are: SELECT UPDATE INSERT DELETE EXECUTE RECEIVE REFERENCES
The general form for defining an action to be audited is: {action} ON {object} BY {principal}
Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively.
For example: SELECT on dbo.myTable by public SELECT on DATABASE::myDatabase by public SELECT on SCHEMA::mySchema by public
For more information, see Database-Level Audit Actions
- blob
Auditing StringPolicy Name - The name of the blob auditing policy.
- is
Azure BooleanMonitor Target Enabled Specifies whether audit events are sent to Azure Monitor. In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true.
When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. Note that for server level audit you should use the 'master' database as {databaseName}.
Diagnostic Settings URI format: PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
For more information, see Diagnostic Settings REST API or Diagnostic Settings PowerShell
- is
Managed BooleanIdentity In Use - Specifies whether Managed Identity is used to access blob storage
- is
Storage BooleanSecondary Key In Use - Specifies whether storageAccountAccessKey value is the storage's secondary key.
- predicate
Expression String - Specifies condition of where clause when creating an audit.
- queue
Delay IntegerMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed. The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.
- retention
Days Integer - Specifies the number of days to keep in the audit logs in the storage account.
- storage
Account StringAccess Key - Specifies the identifier key of the auditing storage account.
If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
Prerequisites for using managed identity authentication:
- Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
- Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity. For more information, see Auditing to storage using Managed Identity authentication
- storage
Account StringSubscription Id - Specifies the blob storage subscription Id.
- storage
Endpoint String - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
- database
Name string - The name of the database.
- resource
Group stringName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
- server
Name string - The name of the server.
- state
Blob
Auditing Policy State - Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.
- audit
Actions string[]And Groups Specifies the Actions-Groups and Actions to audit.
The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins:
BATCH_COMPLETED_GROUP, SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, FAILED_DATABASE_AUTHENTICATION_GROUP.
This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records):
APPLICATION_ROLE_CHANGE_PASSWORD_GROUP BACKUP_RESTORE_GROUP DATABASE_LOGOUT_GROUP DATABASE_OBJECT_CHANGE_GROUP DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP DATABASE_OBJECT_PERMISSION_CHANGE_GROUP DATABASE_OPERATION_GROUP DATABASE_PERMISSION_CHANGE_GROUP DATABASE_PRINCIPAL_CHANGE_GROUP DATABASE_PRINCIPAL_IMPERSONATION_GROUP DATABASE_ROLE_MEMBER_CHANGE_GROUP FAILED_DATABASE_AUTHENTICATION_GROUP SCHEMA_OBJECT_ACCESS_GROUP SCHEMA_OBJECT_CHANGE_GROUP SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP USER_CHANGE_PASSWORD_GROUP BATCH_STARTED_GROUP BATCH_COMPLETED_GROUP DBCC_GROUP DATABASE_OWNERSHIP_CHANGE_GROUP DATABASE_CHANGE_GROUP LEDGER_OPERATION_GROUP
These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs.
For more information, see Database-Level Audit Action Groups.
For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are: SELECT UPDATE INSERT DELETE EXECUTE RECEIVE REFERENCES
The general form for defining an action to be audited is: {action} ON {object} BY {principal}
Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively.
For example: SELECT on dbo.myTable by public SELECT on DATABASE::myDatabase by public SELECT on SCHEMA::mySchema by public
For more information, see Database-Level Audit Actions
- blob
Auditing stringPolicy Name - The name of the blob auditing policy.
- is
Azure booleanMonitor Target Enabled Specifies whether audit events are sent to Azure Monitor. In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true.
When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. Note that for server level audit you should use the 'master' database as {databaseName}.
Diagnostic Settings URI format: PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
For more information, see Diagnostic Settings REST API or Diagnostic Settings PowerShell
- is
Managed booleanIdentity In Use - Specifies whether Managed Identity is used to access blob storage
- is
Storage booleanSecondary Key In Use - Specifies whether storageAccountAccessKey value is the storage's secondary key.
- predicate
Expression string - Specifies condition of where clause when creating an audit.
- queue
Delay numberMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed. The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.
- retention
Days number - Specifies the number of days to keep in the audit logs in the storage account.
- storage
Account stringAccess Key - Specifies the identifier key of the auditing storage account.
If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
Prerequisites for using managed identity authentication:
- Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
- Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity. For more information, see Auditing to storage using Managed Identity authentication
- storage
Account stringSubscription Id - Specifies the blob storage subscription Id.
- storage
Endpoint string - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
- database_
name str - The name of the database.
- resource_
group_ strname - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
- server_
name str - The name of the server.
- state
Blob
Auditing Policy State - Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.
- audit_
actions_ Sequence[str]and_ groups Specifies the Actions-Groups and Actions to audit.
The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins:
BATCH_COMPLETED_GROUP, SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, FAILED_DATABASE_AUTHENTICATION_GROUP.
This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records):
APPLICATION_ROLE_CHANGE_PASSWORD_GROUP BACKUP_RESTORE_GROUP DATABASE_LOGOUT_GROUP DATABASE_OBJECT_CHANGE_GROUP DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP DATABASE_OBJECT_PERMISSION_CHANGE_GROUP DATABASE_OPERATION_GROUP DATABASE_PERMISSION_CHANGE_GROUP DATABASE_PRINCIPAL_CHANGE_GROUP DATABASE_PRINCIPAL_IMPERSONATION_GROUP DATABASE_ROLE_MEMBER_CHANGE_GROUP FAILED_DATABASE_AUTHENTICATION_GROUP SCHEMA_OBJECT_ACCESS_GROUP SCHEMA_OBJECT_CHANGE_GROUP SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP USER_CHANGE_PASSWORD_GROUP BATCH_STARTED_GROUP BATCH_COMPLETED_GROUP DBCC_GROUP DATABASE_OWNERSHIP_CHANGE_GROUP DATABASE_CHANGE_GROUP LEDGER_OPERATION_GROUP
These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs.
For more information, see Database-Level Audit Action Groups.
For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are: SELECT UPDATE INSERT DELETE EXECUTE RECEIVE REFERENCES
The general form for defining an action to be audited is: {action} ON {object} BY {principal}
Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively.
For example: SELECT on dbo.myTable by public SELECT on DATABASE::myDatabase by public SELECT on SCHEMA::mySchema by public
For more information, see Database-Level Audit Actions
- blob_
auditing_ strpolicy_ name - The name of the blob auditing policy.
- is_
azure_ boolmonitor_ target_ enabled Specifies whether audit events are sent to Azure Monitor. In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true.
When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. Note that for server level audit you should use the 'master' database as {databaseName}.
Diagnostic Settings URI format: PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
For more information, see Diagnostic Settings REST API or Diagnostic Settings PowerShell
- is_
managed_ boolidentity_ in_ use - Specifies whether Managed Identity is used to access blob storage
- is_
storage_ boolsecondary_ key_ in_ use - Specifies whether storageAccountAccessKey value is the storage's secondary key.
- predicate_
expression str - Specifies condition of where clause when creating an audit.
- queue_
delay_ intms - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed. The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.
- retention_
days int - Specifies the number of days to keep in the audit logs in the storage account.
- storage_
account_ straccess_ key - Specifies the identifier key of the auditing storage account.
If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
Prerequisites for using managed identity authentication:
- Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
- Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity. For more information, see Auditing to storage using Managed Identity authentication
- storage_
account_ strsubscription_ id - Specifies the blob storage subscription Id.
- storage_
endpoint str - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
- database
Name String - The name of the database.
- resource
Group StringName - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
- server
Name String - The name of the server.
- state "Enabled" | "Disabled"
- Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.
- audit
Actions List<String>And Groups Specifies the Actions-Groups and Actions to audit.
The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins:
BATCH_COMPLETED_GROUP, SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, FAILED_DATABASE_AUTHENTICATION_GROUP.
This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records):
APPLICATION_ROLE_CHANGE_PASSWORD_GROUP BACKUP_RESTORE_GROUP DATABASE_LOGOUT_GROUP DATABASE_OBJECT_CHANGE_GROUP DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP DATABASE_OBJECT_PERMISSION_CHANGE_GROUP DATABASE_OPERATION_GROUP DATABASE_PERMISSION_CHANGE_GROUP DATABASE_PRINCIPAL_CHANGE_GROUP DATABASE_PRINCIPAL_IMPERSONATION_GROUP DATABASE_ROLE_MEMBER_CHANGE_GROUP FAILED_DATABASE_AUTHENTICATION_GROUP SCHEMA_OBJECT_ACCESS_GROUP SCHEMA_OBJECT_CHANGE_GROUP SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP USER_CHANGE_PASSWORD_GROUP BATCH_STARTED_GROUP BATCH_COMPLETED_GROUP DBCC_GROUP DATABASE_OWNERSHIP_CHANGE_GROUP DATABASE_CHANGE_GROUP LEDGER_OPERATION_GROUP
These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs.
For more information, see Database-Level Audit Action Groups.
For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are: SELECT UPDATE INSERT DELETE EXECUTE RECEIVE REFERENCES
The general form for defining an action to be audited is: {action} ON {object} BY {principal}
Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively.
For example: SELECT on dbo.myTable by public SELECT on DATABASE::myDatabase by public SELECT on SCHEMA::mySchema by public
For more information, see Database-Level Audit Actions
- blob
Auditing StringPolicy Name - The name of the blob auditing policy.
- is
Azure BooleanMonitor Target Enabled Specifies whether audit events are sent to Azure Monitor. In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true.
When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. Note that for server level audit you should use the 'master' database as {databaseName}.
Diagnostic Settings URI format: PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
For more information, see Diagnostic Settings REST API or Diagnostic Settings PowerShell
- is
Managed BooleanIdentity In Use - Specifies whether Managed Identity is used to access blob storage
- is
Storage BooleanSecondary Key In Use - Specifies whether storageAccountAccessKey value is the storage's secondary key.
- predicate
Expression String - Specifies condition of where clause when creating an audit.
- queue
Delay NumberMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed. The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.
- retention
Days Number - Specifies the number of days to keep in the audit logs in the storage account.
- storage
Account StringAccess Key - Specifies the identifier key of the auditing storage account.
If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
Prerequisites for using managed identity authentication:
- Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
- Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity. For more information, see Auditing to storage using Managed Identity authentication
- storage
Account StringSubscription Id - Specifies the blob storage subscription Id.
- storage
Endpoint String - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
Outputs
All input properties are implicitly available as output properties. Additionally, the ExtendedDatabaseBlobAuditingPolicy resource produces the following output properties:
Supporting Types
BlobAuditingPolicyState, BlobAuditingPolicyStateArgs
- Enabled
- Enabled
- Disabled
- Disabled
- Blob
Auditing Policy State Enabled - Enabled
- Blob
Auditing Policy State Disabled - Disabled
- Enabled
- Enabled
- Disabled
- Disabled
- Enabled
- Enabled
- Disabled
- Disabled
- ENABLED
- Enabled
- DISABLED
- Disabled
- "Enabled"
- Enabled
- "Disabled"
- Disabled
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:sql:ExtendedDatabaseBlobAuditingPolicy default /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0