HomeMogDBMogDB StackUqbar
v5.0

Documentation:v5.0

Supported Versions:

Other Versions:

ALTER AUDIT POLICY

Function

ALTER AUDIT POLICY modifies the unified audit policy.

Precautions

  • Only users with the poladmin or sysadmin permission, or the initial user can perform this operation.
  • The unified audit policy takes effect only after enable_security_policy is set to on.

Syntax

AlterAuditPolicy ::=
    'ALTER' 'AUDIT' 'POLICY' [ 'IF' 'EXISTS' ] policy_name {DisableClause|CommentClause|DropFilterClause|ModifyFilterClause|AddRemoveClause};
  • AddRemoveClause:

    AddRemoveClause ::=
        { 'ADD' | 'REMOVE' } { AccessAuditClause | PrivilegeAuditClause };
  • PrivilegeAuditClause:

    PrivilegeAuditClause ::= PRIVILEGES '('({CREATE|ALTER|DROP|ANALYZE|COMMENT|GRANT|REVOKE|SET|SHOW|LOGIN_ANY|LOGIN_FAILURE|LOGIN_SUCCESS|LOGOUT | ALL }[ ON LABEL '(' ( resource_label_name [,...] ) ')' ])[,...]')';
  • AccessAuditClause:

    AccessAuditClause ::= ACCESS '('({ SELECT|COPY|DEALLOCATE|DELETE|EXECUTE|INSERT|PREPARE|REINDEX|TRUNCATE|UPDATE | ALL }[ ON LABEL '(' ( resource_label_name [,...] ) ')' ])[,...] ')';
  • ModifyFilterClause:

    ModifyFilterClause ::=
        'MODIFY' '(' FilterGroupClause ')';
  • FilterGroupClause:

    FilterGroupClause ::= FILTER ON { {IP|ROLES |APP} '(' filter_value [, ... ] ')' }[, ... ] ;
  • DropFilterClause:

    DropFilterClause ::=
        'DROP' 'FILTER';
  • CommentClause:

    CommentClause ::=
        'COMMENTS' policy_comments;
  • DisableClause:

    DisableClause ::=
        { 'ENABLE' | 'DISABLE' };

Parameter Description

  • policy_name

    Specifies the audit policy name, which must be unique.

    Value range: a string. It must comply with the identifier naming convention.

  • DDL

    Specifies the operations that are audited in the database: CREATE, ALTER, DROP, ANALYZE, COMMENT, GRANT, REVOKE, SET, SHOW, LOGIN_ANY, LOGIN_FAILURE, LOGIN_SUCCESS, and LOGOUT.

  • ALL

    Specifies all operations supported by the specified DDL statements in the database.

  • DML

    Specifies the operations that are audited in the database: SELECT, COPY, DEALLOCATE, DELETE, EXECUTE, INSERT, PREPARE, REINDEX, TRUNCATE, and UPDATE.

  • FILTER_TYPE

    Specifies the types of information to be filtered by the policy: IP, ROLES, and APP.

  • filter_value

    Specifies the detailed information to be filtered.

  • policy_comments

    Records description information of the audit policy.

  • ENABLE|DISABLE

    Enables or disables the unified audit policy. If ENABLE|DISABLE is not specified, ENABLE is used by default.

Examples

See Examples in CREATE AUDIT POLICY.

CREATE AUDIT POLICY, DROP AUDIT POLICY.

Copyright © 2011-2024 www.enmotech.com All rights reserved.