All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azurenative.sql.ExtendedServerBlobAuditingPolicyArgs Maven / Gradle / Ivy

There is a newer version: 2.72.0
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azurenative.sql;

import com.pulumi.azurenative.sql.enums.BlobAuditingPolicyState;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class ExtendedServerBlobAuditingPolicyArgs extends com.pulumi.resources.ResourceArgs {

    public static final ExtendedServerBlobAuditingPolicyArgs Empty = new ExtendedServerBlobAuditingPolicyArgs();

    /**
     * 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](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#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 <object> 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](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions)
     * 
     */
    @Import(name="auditActionsAndGroups")
    private @Nullable Output> auditActionsAndGroups;

    /**
     * @return 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](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#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 <object> 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](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions)
     * 
     */
    public Optional>> auditActionsAndGroups() {
        return Optional.ofNullable(this.auditActionsAndGroups);
    }

    /**
     * The name of the blob auditing policy.
     * 
     */
    @Import(name="blobAuditingPolicyName")
    private @Nullable Output blobAuditingPolicyName;

    /**
     * @return The name of the blob auditing policy.
     * 
     */
    public Optional> blobAuditingPolicyName() {
        return Optional.ofNullable(this.blobAuditingPolicyName);
    }

    /**
     * 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](https://go.microsoft.com/fwlink/?linkid=2033207)
     * or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
     * 
     */
    @Import(name="isAzureMonitorTargetEnabled")
    private @Nullable Output isAzureMonitorTargetEnabled;

    /**
     * @return 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](https://go.microsoft.com/fwlink/?linkid=2033207)
     * or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
     * 
     */
    public Optional> isAzureMonitorTargetEnabled() {
        return Optional.ofNullable(this.isAzureMonitorTargetEnabled);
    }

    /**
     * Specifies the state of devops audit. If state is Enabled, devops logs will be sent to Azure Monitor.
     * In order to send the events to Azure Monitor, specify 'State' as 'Enabled', 'IsAzureMonitorTargetEnabled' as true and 'IsDevopsAuditEnabled' as true
     * 
     * When using REST API to configure auditing, Diagnostic Settings with 'DevOpsOperationsAudit' diagnostic logs category on the master database should also be created.
     * 
     * Diagnostic Settings URI format:
     * PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
     * 
     * For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
     * or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
     * 
     */
    @Import(name="isDevopsAuditEnabled")
    private @Nullable Output isDevopsAuditEnabled;

    /**
     * @return Specifies the state of devops audit. If state is Enabled, devops logs will be sent to Azure Monitor.
     * In order to send the events to Azure Monitor, specify 'State' as 'Enabled', 'IsAzureMonitorTargetEnabled' as true and 'IsDevopsAuditEnabled' as true
     * 
     * When using REST API to configure auditing, Diagnostic Settings with 'DevOpsOperationsAudit' diagnostic logs category on the master database should also be created.
     * 
     * Diagnostic Settings URI format:
     * PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
     * 
     * For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
     * or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
     * 
     */
    public Optional> isDevopsAuditEnabled() {
        return Optional.ofNullable(this.isDevopsAuditEnabled);
    }

    /**
     * Specifies whether Managed Identity is used to access blob storage
     * 
     */
    @Import(name="isManagedIdentityInUse")
    private @Nullable Output isManagedIdentityInUse;

    /**
     * @return Specifies whether Managed Identity is used to access blob storage
     * 
     */
    public Optional> isManagedIdentityInUse() {
        return Optional.ofNullable(this.isManagedIdentityInUse);
    }

    /**
     * Specifies whether storageAccountAccessKey value is the storage's secondary key.
     * 
     */
    @Import(name="isStorageSecondaryKeyInUse")
    private @Nullable Output isStorageSecondaryKeyInUse;

    /**
     * @return Specifies whether storageAccountAccessKey value is the storage's secondary key.
     * 
     */
    public Optional> isStorageSecondaryKeyInUse() {
        return Optional.ofNullable(this.isStorageSecondaryKeyInUse);
    }

    /**
     * Specifies condition of where clause when creating an audit.
     * 
     */
    @Import(name="predicateExpression")
    private @Nullable Output predicateExpression;

    /**
     * @return Specifies condition of where clause when creating an audit.
     * 
     */
    public Optional> predicateExpression() {
        return Optional.ofNullable(this.predicateExpression);
    }

    /**
     * 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.
     * 
     */
    @Import(name="queueDelayMs")
    private @Nullable Output queueDelayMs;

    /**
     * @return 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.
     * 
     */
    public Optional> queueDelayMs() {
        return Optional.ofNullable(this.queueDelayMs);
    }

    /**
     * The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
     * 
     */
    @Import(name="resourceGroupName", required=true)
    private Output resourceGroupName;

    /**
     * @return The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
     * 
     */
    public Output resourceGroupName() {
        return this.resourceGroupName;
    }

    /**
     * Specifies the number of days to keep in the audit logs in the storage account.
     * 
     */
    @Import(name="retentionDays")
    private @Nullable Output retentionDays;

    /**
     * @return Specifies the number of days to keep in the audit logs in the storage account.
     * 
     */
    public Optional> retentionDays() {
        return Optional.ofNullable(this.retentionDays);
    }

    /**
     * The name of the server.
     * 
     */
    @Import(name="serverName", required=true)
    private Output serverName;

    /**
     * @return The name of the server.
     * 
     */
    public Output serverName() {
        return this.serverName;
    }

    /**
     * Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.
     * 
     */
    @Import(name="state", required=true)
    private Output state;

    /**
     * @return Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.
     * 
     */
    public Output state() {
        return this.state;
    }

    /**
     * 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:
     * 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
     * 2. 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](https://go.microsoft.com/fwlink/?linkid=2114355)
     * 
     */
    @Import(name="storageAccountAccessKey")
    private @Nullable Output storageAccountAccessKey;

    /**
     * @return 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:
     * 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
     * 2. 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](https://go.microsoft.com/fwlink/?linkid=2114355)
     * 
     */
    public Optional> storageAccountAccessKey() {
        return Optional.ofNullable(this.storageAccountAccessKey);
    }

    /**
     * Specifies the blob storage subscription Id.
     * 
     */
    @Import(name="storageAccountSubscriptionId")
    private @Nullable Output storageAccountSubscriptionId;

    /**
     * @return Specifies the blob storage subscription Id.
     * 
     */
    public Optional> storageAccountSubscriptionId() {
        return Optional.ofNullable(this.storageAccountSubscriptionId);
    }

    /**
     * Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
     * 
     */
    @Import(name="storageEndpoint")
    private @Nullable Output storageEndpoint;

    /**
     * @return Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
     * 
     */
    public Optional> storageEndpoint() {
        return Optional.ofNullable(this.storageEndpoint);
    }

    private ExtendedServerBlobAuditingPolicyArgs() {}

    private ExtendedServerBlobAuditingPolicyArgs(ExtendedServerBlobAuditingPolicyArgs $) {
        this.auditActionsAndGroups = $.auditActionsAndGroups;
        this.blobAuditingPolicyName = $.blobAuditingPolicyName;
        this.isAzureMonitorTargetEnabled = $.isAzureMonitorTargetEnabled;
        this.isDevopsAuditEnabled = $.isDevopsAuditEnabled;
        this.isManagedIdentityInUse = $.isManagedIdentityInUse;
        this.isStorageSecondaryKeyInUse = $.isStorageSecondaryKeyInUse;
        this.predicateExpression = $.predicateExpression;
        this.queueDelayMs = $.queueDelayMs;
        this.resourceGroupName = $.resourceGroupName;
        this.retentionDays = $.retentionDays;
        this.serverName = $.serverName;
        this.state = $.state;
        this.storageAccountAccessKey = $.storageAccountAccessKey;
        this.storageAccountSubscriptionId = $.storageAccountSubscriptionId;
        this.storageEndpoint = $.storageEndpoint;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(ExtendedServerBlobAuditingPolicyArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private ExtendedServerBlobAuditingPolicyArgs $;

        public Builder() {
            $ = new ExtendedServerBlobAuditingPolicyArgs();
        }

        public Builder(ExtendedServerBlobAuditingPolicyArgs defaults) {
            $ = new ExtendedServerBlobAuditingPolicyArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param auditActionsAndGroups 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](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#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 <object> 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](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions)
         * 
         * @return builder
         * 
         */
        public Builder auditActionsAndGroups(@Nullable Output> auditActionsAndGroups) {
            $.auditActionsAndGroups = auditActionsAndGroups;
            return this;
        }

        /**
         * @param auditActionsAndGroups 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](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#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 <object> 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](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions)
         * 
         * @return builder
         * 
         */
        public Builder auditActionsAndGroups(List auditActionsAndGroups) {
            return auditActionsAndGroups(Output.of(auditActionsAndGroups));
        }

        /**
         * @param auditActionsAndGroups 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](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#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 <object> 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](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions)
         * 
         * @return builder
         * 
         */
        public Builder auditActionsAndGroups(String... auditActionsAndGroups) {
            return auditActionsAndGroups(List.of(auditActionsAndGroups));
        }

        /**
         * @param blobAuditingPolicyName The name of the blob auditing policy.
         * 
         * @return builder
         * 
         */
        public Builder blobAuditingPolicyName(@Nullable Output blobAuditingPolicyName) {
            $.blobAuditingPolicyName = blobAuditingPolicyName;
            return this;
        }

        /**
         * @param blobAuditingPolicyName The name of the blob auditing policy.
         * 
         * @return builder
         * 
         */
        public Builder blobAuditingPolicyName(String blobAuditingPolicyName) {
            return blobAuditingPolicyName(Output.of(blobAuditingPolicyName));
        }

        /**
         * @param isAzureMonitorTargetEnabled 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](https://go.microsoft.com/fwlink/?linkid=2033207)
         * or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
         * 
         * @return builder
         * 
         */
        public Builder isAzureMonitorTargetEnabled(@Nullable Output isAzureMonitorTargetEnabled) {
            $.isAzureMonitorTargetEnabled = isAzureMonitorTargetEnabled;
            return this;
        }

        /**
         * @param isAzureMonitorTargetEnabled 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](https://go.microsoft.com/fwlink/?linkid=2033207)
         * or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
         * 
         * @return builder
         * 
         */
        public Builder isAzureMonitorTargetEnabled(Boolean isAzureMonitorTargetEnabled) {
            return isAzureMonitorTargetEnabled(Output.of(isAzureMonitorTargetEnabled));
        }

        /**
         * @param isDevopsAuditEnabled Specifies the state of devops audit. If state is Enabled, devops logs will be sent to Azure Monitor.
         * In order to send the events to Azure Monitor, specify 'State' as 'Enabled', 'IsAzureMonitorTargetEnabled' as true and 'IsDevopsAuditEnabled' as true
         * 
         * When using REST API to configure auditing, Diagnostic Settings with 'DevOpsOperationsAudit' diagnostic logs category on the master database should also be created.
         * 
         * Diagnostic Settings URI format:
         * PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
         * 
         * For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
         * or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
         * 
         * @return builder
         * 
         */
        public Builder isDevopsAuditEnabled(@Nullable Output isDevopsAuditEnabled) {
            $.isDevopsAuditEnabled = isDevopsAuditEnabled;
            return this;
        }

        /**
         * @param isDevopsAuditEnabled Specifies the state of devops audit. If state is Enabled, devops logs will be sent to Azure Monitor.
         * In order to send the events to Azure Monitor, specify 'State' as 'Enabled', 'IsAzureMonitorTargetEnabled' as true and 'IsDevopsAuditEnabled' as true
         * 
         * When using REST API to configure auditing, Diagnostic Settings with 'DevOpsOperationsAudit' diagnostic logs category on the master database should also be created.
         * 
         * Diagnostic Settings URI format:
         * PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
         * 
         * For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
         * or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
         * 
         * @return builder
         * 
         */
        public Builder isDevopsAuditEnabled(Boolean isDevopsAuditEnabled) {
            return isDevopsAuditEnabled(Output.of(isDevopsAuditEnabled));
        }

        /**
         * @param isManagedIdentityInUse Specifies whether Managed Identity is used to access blob storage
         * 
         * @return builder
         * 
         */
        public Builder isManagedIdentityInUse(@Nullable Output isManagedIdentityInUse) {
            $.isManagedIdentityInUse = isManagedIdentityInUse;
            return this;
        }

        /**
         * @param isManagedIdentityInUse Specifies whether Managed Identity is used to access blob storage
         * 
         * @return builder
         * 
         */
        public Builder isManagedIdentityInUse(Boolean isManagedIdentityInUse) {
            return isManagedIdentityInUse(Output.of(isManagedIdentityInUse));
        }

        /**
         * @param isStorageSecondaryKeyInUse Specifies whether storageAccountAccessKey value is the storage's secondary key.
         * 
         * @return builder
         * 
         */
        public Builder isStorageSecondaryKeyInUse(@Nullable Output isStorageSecondaryKeyInUse) {
            $.isStorageSecondaryKeyInUse = isStorageSecondaryKeyInUse;
            return this;
        }

        /**
         * @param isStorageSecondaryKeyInUse Specifies whether storageAccountAccessKey value is the storage's secondary key.
         * 
         * @return builder
         * 
         */
        public Builder isStorageSecondaryKeyInUse(Boolean isStorageSecondaryKeyInUse) {
            return isStorageSecondaryKeyInUse(Output.of(isStorageSecondaryKeyInUse));
        }

        /**
         * @param predicateExpression Specifies condition of where clause when creating an audit.
         * 
         * @return builder
         * 
         */
        public Builder predicateExpression(@Nullable Output predicateExpression) {
            $.predicateExpression = predicateExpression;
            return this;
        }

        /**
         * @param predicateExpression Specifies condition of where clause when creating an audit.
         * 
         * @return builder
         * 
         */
        public Builder predicateExpression(String predicateExpression) {
            return predicateExpression(Output.of(predicateExpression));
        }

        /**
         * @param queueDelayMs 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.
         * 
         * @return builder
         * 
         */
        public Builder queueDelayMs(@Nullable Output queueDelayMs) {
            $.queueDelayMs = queueDelayMs;
            return this;
        }

        /**
         * @param queueDelayMs 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.
         * 
         * @return builder
         * 
         */
        public Builder queueDelayMs(Integer queueDelayMs) {
            return queueDelayMs(Output.of(queueDelayMs));
        }

        /**
         * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
         * 
         * @return builder
         * 
         */
        public Builder resourceGroupName(Output resourceGroupName) {
            $.resourceGroupName = resourceGroupName;
            return this;
        }

        /**
         * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
         * 
         * @return builder
         * 
         */
        public Builder resourceGroupName(String resourceGroupName) {
            return resourceGroupName(Output.of(resourceGroupName));
        }

        /**
         * @param retentionDays Specifies the number of days to keep in the audit logs in the storage account.
         * 
         * @return builder
         * 
         */
        public Builder retentionDays(@Nullable Output retentionDays) {
            $.retentionDays = retentionDays;
            return this;
        }

        /**
         * @param retentionDays Specifies the number of days to keep in the audit logs in the storage account.
         * 
         * @return builder
         * 
         */
        public Builder retentionDays(Integer retentionDays) {
            return retentionDays(Output.of(retentionDays));
        }

        /**
         * @param serverName The name of the server.
         * 
         * @return builder
         * 
         */
        public Builder serverName(Output serverName) {
            $.serverName = serverName;
            return this;
        }

        /**
         * @param serverName The name of the server.
         * 
         * @return builder
         * 
         */
        public Builder serverName(String serverName) {
            return serverName(Output.of(serverName));
        }

        /**
         * @param state Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.
         * 
         * @return builder
         * 
         */
        public Builder state(Output state) {
            $.state = state;
            return this;
        }

        /**
         * @param state Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.
         * 
         * @return builder
         * 
         */
        public Builder state(BlobAuditingPolicyState state) {
            return state(Output.of(state));
        }

        /**
         * @param storageAccountAccessKey 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:
         * 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
         * 2. 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](https://go.microsoft.com/fwlink/?linkid=2114355)
         * 
         * @return builder
         * 
         */
        public Builder storageAccountAccessKey(@Nullable Output storageAccountAccessKey) {
            $.storageAccountAccessKey = storageAccountAccessKey;
            return this;
        }

        /**
         * @param storageAccountAccessKey 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:
         * 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
         * 2. 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](https://go.microsoft.com/fwlink/?linkid=2114355)
         * 
         * @return builder
         * 
         */
        public Builder storageAccountAccessKey(String storageAccountAccessKey) {
            return storageAccountAccessKey(Output.of(storageAccountAccessKey));
        }

        /**
         * @param storageAccountSubscriptionId Specifies the blob storage subscription Id.
         * 
         * @return builder
         * 
         */
        public Builder storageAccountSubscriptionId(@Nullable Output storageAccountSubscriptionId) {
            $.storageAccountSubscriptionId = storageAccountSubscriptionId;
            return this;
        }

        /**
         * @param storageAccountSubscriptionId Specifies the blob storage subscription Id.
         * 
         * @return builder
         * 
         */
        public Builder storageAccountSubscriptionId(String storageAccountSubscriptionId) {
            return storageAccountSubscriptionId(Output.of(storageAccountSubscriptionId));
        }

        /**
         * @param storageEndpoint Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
         * 
         * @return builder
         * 
         */
        public Builder storageEndpoint(@Nullable Output storageEndpoint) {
            $.storageEndpoint = storageEndpoint;
            return this;
        }

        /**
         * @param storageEndpoint Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
         * 
         * @return builder
         * 
         */
        public Builder storageEndpoint(String storageEndpoint) {
            return storageEndpoint(Output.of(storageEndpoint));
        }

        public ExtendedServerBlobAuditingPolicyArgs build() {
            if ($.resourceGroupName == null) {
                throw new MissingRequiredPropertyException("ExtendedServerBlobAuditingPolicyArgs", "resourceGroupName");
            }
            if ($.serverName == null) {
                throw new MissingRequiredPropertyException("ExtendedServerBlobAuditingPolicyArgs", "serverName");
            }
            if ($.state == null) {
                throw new MissingRequiredPropertyException("ExtendedServerBlobAuditingPolicyArgs", "state");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy