Updated on 2025-05-29 GMT+08:00

User and Permission Audit

audit_login_logout

Parameter description: Specifies whether to audit a user's login (including login success and failure) and logout. This parameter can be set at the PDB level.

Parameter type: integer.

Unit: none

Value range: 0 to 7

  • 0: The function of auditing users' logins and logouts is disabled.
  • 1: Only successful user logins are audited.
  • 2: Only failed user logins are audited.
  • 3: Only successful and failed user logins are audited.
  • 4: Only user logouts are audited.
  • 5: Only successful user logouts and logins are audited.
  • 6: Only failed user logouts and logins are audited.
  • 7: Successful user logins, failed user logins, and logouts are audited.

Default value: 7. In the PDB scenario, if this parameter is not set, the global setting is inherited.

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: A smaller value indicates fewer types of user login and logout behaviors to be audited and higher risks of untraceable user login and logout behaviors. A larger value indicates more types of user login and logout behaviors to be recorded. When a large number of user login and logout behaviors exist, the database performance is affected.

audit_database_process

Parameter description: Specifies whether to audit the database startup, stop, switchover, and recovery.

Parameter type: integer.

Unit: none

Value range: 0 and 1

  • 0: The function of auditing database startup, stop, switchover, and recovery is disabled.
  • 1: The function of auditing database startup, stop, switchover, and recovery is enabled.

Default value: 1

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: If this parameter is set to 0, database startup, stop, switchover, and recovery may fail to be traced.

When the database is started, the standby DN is promoted to primary. Therefore, the DN type in the audit log is system_switch when the DN is started.

audit_user_locked

Parameter description: Specifies whether to audit the users' locking and unlocking.

Parameter type: integer.

Unit: none

Value range: 0 and 1

  • 0: The function of auditing user's locking and unlocking is disabled.
  • 1: The function of auditing user's locking and unlocking is enabled.

Default value: 1. In the PDB scenario, if this parameter is not set, the global setting is inherited.

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1. This parameter can be set at the PDB level.

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: If this parameter is set to 0, user locking and unlocking behaviors may not be traced.

audit_user_violation

Parameter description: Specifies whether to audit the access violation operations of a user.

Parameter type: integer.

Unit: none

Value range: 0 and 1

  • 0: The function of auditing the access violation operations of a user is disabled.
  • 1: The function of auditing the access violation operations of a user is enabled.

Default value: 0. In the PDB scenario, if this parameter is not set, the global setting is inherited.

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1. This parameter can be set at the PDB level.

Setting suggestion: Set this parameter to 1 if unauthorized operations need to be audited.

Risks and impacts of improper settings: If this parameter is set to 0, unauthorized audit operations may fail to be traced. If this parameter is set to 1, a large number of unauthorized operations may affect database performance.

audit_grant_revoke

Parameter description: Specifies whether to audit the granting and revoking of user permissions.

Parameter type: integer.

Unit: none

Value range: 0 and 1

  • 0: The function of auditing user permission granting and revoking operations is disabled.
  • 1: The function of auditing user permission granting and revoking operations is enabled.

Default value: 1. In the PDB scenario, if this parameter is not set, the global setting is inherited.

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1. This parameter can be set at the PDB level.

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: If this parameter is set to 0, user permission granting and revoking behaviors may not be traced. If this parameter is set to 1, the database performance will be affected when a large number of permissions are granted and revoked.

audit_security_label

Parameter description: Specifies whether to audit the creation, deletion, and application of user security labels. This parameter can be set at the PDB level.

Parameter type: integer.

Unit: none

Value range: 0 and 1

  • 0: The creation, deletion, and application of user security labels are not audited.
  • 1: The creation, deletion, and application of user security labels are audited.

Default value: 0. In the PDB scenario, if this parameter is not set, the global setting is inherited.

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: If this parameter is set to 0, the creation, deletion, and application of user security labels cannot be traced. If this parameter is set to 1, the database performance will be affected when a large number of user security labels are created, deleted, and applied.

audit_internal_event

Parameter description: Specifies whether to audit the connections and operations of internal tools CM Agent, gs_clean, and WDRXdb for the initial user.

Parameter type: Boolean.

Unit: none

Value range:

  • on: The login, logout, and operations of internal tools CM Agent, gs_clean, and WDRXdb are audited for the initial user.
  • off: The login, logout, and operations of internal tools CM Agent, gs_clean, and WDRXdb are not audited for the initial user.

Default value: off

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value to save space occupied by audit logs and improve audit log query performance.

Risks and impacts of improper settings: If this parameter is enabled, login and logout operations between internal tools or nodes on the database server will be recorded, causing performance deterioration.

full_audit_users

Parameter description: Specifies the full audit user list. Audit logs are recorded for all auditable operations performed by users in the list. This parameter can be set at the PDB level.

Parameter type: string.

Unit: none

Value range: a string. Use commas (,) to separate multiple usernames.

Default value: "". In the PDB scenario, if this parameter is not set, the global setting is inherited.

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Set this parameter when all behaviors of a specific user need to be recorded and audited.

Risks and impacts of improper settings: If there are too many users in the list, all operations performed by these users are recorded in audit logs, causing performance deterioration.

no_audit_client

Parameter description: Specifies the names and IP addresses of clients that do not need to be audited. The IP addresses can be IPv6 addresses. The parameter format is client name@IP address, which is the same as that of the client_conninfo column in the gs_query_audit function, for example, cm_agent@127.0.0.1 or gs_clean@127.0.0.1. This parameter can be set at the PDB level.

Parameter type: string.

Unit: none

Value range: a string. Use commas (,) to separate multiple configuration items.

Default value: "". In the PDB scenario, if this parameter is not set, the global setting is inherited.

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Audit logs are generated for communication among tools or nodes in the database server. To save space occupied by audit logs and improve the query performance of audit logs, you can configure the no_audit_client parameter not to audit the low-risk scenarios.

Risks and impacts of improper settings: If the settings are incorrect, operations performed on a client may fail to be audited. As a result, risky operations cannot be traced.

  • If the executed SQL statement meets the configuration requirements of full_audit_users and no_audit_client, the no_audit_client is preferentially configured and no audit logs are recorded.