หน้านี้ยังไม่พร้อมใช้งานในภาษาท้องถิ่นของคุณ เรากำลังพยายามอย่างหนักเพื่อเพิ่มเวอร์ชันภาษาอื่น ๆ เพิ่มเติม ขอบคุณสำหรับการสนับสนุนเสมอมา

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ GaussDB/ Best Practices/ Suggestions on GaussDB Security Configuration

Suggestions on GaussDB Security Configuration

Updated on 2025-01-22 GMT+08:00

Security is a shared responsibility between Huawei Cloud and you. Huawei Cloud ensures the security of cloud services for a secure cloud. As a tenant, you should utilize the security capabilities provided by cloud services to protect data and use the cloud securely. For details, see Shared Responsibilities.

This section provides actionable guidance for enhancing the overall security of using GaussDB. You can continuously evaluate the security status of your GaussDB and enhance their overall security defense by combining different security capabilities provided by GaussDB. By doing this, data stored in GaussDB can be protected from leakage and tampering both at rest and in transit.

You can make security configurations from the following dimensions to match your workloads.

Maximum Number of Connections

Excessive GaussDB connections can consume excessive server resources, leading to sluggish operation responses. You can adjust the maximum allowed connections using the max_connections parameter. For details, see Connection Settings.

max_connections: maximum number of concurrent connections to the database. This parameter affects the concurrency capability of the cluster.

Security Authentication

To ensure user experience and prevent accounts from being cracked, you can configure the following parameters to set the maximum number of login retries and the automatic unlocking time:

  • failed_login_attempts: maximum number of failed login attempts.
  • password_lock_time: number of days after which a locked account is automatically unlocked.

    Once detecting that an account is stolen or the account is used to access the database without being authorized, administrators can manually lock the account. Administrators can manually unlock the account if the account becomes normal again.

    For example, run the following commands to manually lock and unlock the joe user:

    • Manually lock the account.
      1
      2
      gaussdb=# ALTER USER joe ACCOUNT LOCK;
      ALTER ROLE
      
    • Manually unlock the account.
      1
      2
      gaussdb=# ALTER USER joe ACCOUNT UNLOCK;
      ALTER ROLE
      

User Password Security

GaussDB enhances user account security in the following aspects:

  • User passwords are stored in the system catalog pg_authid. To prevent password leakage, GaussDB encrypts user passwords before storing them. The cryptographic algorithm is determined by the configuration parameter password_encryption_type.
  • All passwords in GaussDB must have a validity period. You can configure the password_effect_time parameter to set a validity period for each database user password.

Permissions Management

  • A VPC provides an isolated virtual network for GaussDB instances. You can configure and manage the network as required. A subnet provides dedicated network resources that are logically isolated from other networks for security. If you need to assign different permissions (also known as privileges) to different employees in your enterprise to access your DB instance resources, IAM is a good choice. For details, see Permissions Management.
  • To ensure database security and reliability, configure security groups before using a DB instance. For details, see Configuring Security Group Rules.
  • Run the following SQL statement to check whether the PUBLIC role has the CREATE privilege in public schema. If so, any user can create and modify tables or database objects in public schema.

    SELECT CAST(has_schema_privilege('public','public','CREATE') AS TEXT);

    • If TRUE is returned, run the following SQL statement to revoke the privilege:

      REVOKE CREATE ON SCHEMA public FROM PUBLIC;

  • All users are attached to the PUBLIC role. If all privileges of an object are granted to the PUBLIC role, any user can inherit all the privileges of the object, which violates the principle of least privilege. For this reason, this role should have the minimal privileges for database security purposes. Run the following SQL statement to check whether all privileges are granted to the PUBLIC role:

    SELECT relname,relacl FROM pg_class WHERE (CAST(relacl AS TEXT) LIKE '%,=arwdDxt/%}' OR CAST(relacl AS TEXT) LIKE '{=arwdDxt/%}') AND (CAST(relacl AS TEXT) LIKE '%,=APmiv/%}' OR CAST(relacl AS TEXT) LIKE '{=APmiv/%}');

    • If the returned value is empty, all privileges have been granted. In this case, run the following SQL statement to revoke the privileges:

      REVOKE ALL ON <OBJECT_NAME> FROM PUBLIC;

  • The pg_authid system catalog in the pg_catalog schema contains information about all roles in a database. To prevent sensitive information from being disclosed or modified, the PUBLIC role is not allowed to have any privilege on this system catalog. Run the following SQL statement to check whether privileges on the pg_authid system catalog have been granted:

    SELECT relname,relacl FROM pg_class WHERE relname = 'pg_authid' AND CAST(relacl AS TEXT) LIKE '%,=%}';

    • If the returned value is not empty, the privileges have been granted. In this case, run the following SQL statement to revoke the privileges:

      REVOKE ALL ON pg_authid FROM PUBLIC;

  • Common users are non-administrator users who perform common service operations. Common users should not have administrative privileges beyond their normal scope of responsibilities, such as the privilege to create roles, create databases, audit, monitor, perform O&M operations, or manage security policies. To ensure the principle of least privilege for common users, unnecessary administrative privileges should be revoked while meeting normal business requirements.
  • The SECURITY DEFINER function is executed with the privileges of the creator. Improper use of SECURITY DEFINER may cause the function executor to perform unauthorized operations with the privileges of the creator. For this reason, ensure that this function is not misused. For security purposes, the PUBLIC role is not allowed to execute functions of the SECURITY DEFINER type. Run the following SQL statement to check whether the PUBLIC role has access to any SECURITY DEFINER functions:

    SELECT a.proname, b.nspname FROM pg_proc a, pg_namespace b where a.pronamespace=b.oid and b.nspname <> 'pg_catalog' and a.prosecdef='t';

    • If the returned value is not empty, run the following SQL statement to check whether it has the EXECUTE privilege:

      SELECT CAST(has_function_privilege('public', 'function_name([arg_type][, ...])', 'EXECUTE') AS TEXT);

      • If TRUE is returned, the role has the privilege. In this case, run the following SQL statement to revoke the privilege:

        REVOKE EXECUTE ON FUNCTION function_name([arg_type][, ...]) FROM PUBLIC;

  • The SECURITY INVOKER function is executed with the privileges of the invoker. Improper use of SECURITY INVOKER may cause the function creator to perform unauthorized operations with the privileges of the executor. Before invoking a function not created by yourself, check the function content to prevent the function creator from performing unauthorized operations with your privileges.

Database Audit

  • GaussDB can record operations you perform on your DB instances. However, only operations supported by Cloud Trace Service (CTS) can be recorded. View the supported operations before performing operations. For details, see Key Operations Supported by CTS.
  • Ensure that auditing is enabled for the creation, deletion, and modification of database objects. For details, see Database Audit.
  • To view audit logs in a visualized manner, enable Upload Audit Logs to LTS. For details, see Interconnecting with LTS and Querying Database Audit Logs.

WAL Archiving

The Write Ahead Log (WAL) is another term for the transaction log, which is also referred to as the Xlog. It records changes made to the database before they are written to the main storage, ensuring data consistency and durability in case of failures. The wal_level parameter specifies the level of information to be written into a WAL. To enable read-only queries on a standby node, you need to set the wal_level parameter to hot_standby on the primary node and set hot_standby to on on the standby node.

Backup Management

GaussDB provides instance backup and restoration to ensure data reliability. Backups are stored in unencrypted form. To prevent data loss caused by misoperations or service exceptions, you can:

  • Configure automated backups and create manual backups. For details, see Working with Backups. When you create a GaussDB instance, the instance-level automated backup policy is enabled by default. After your instance is created, you can modify the automated backup policy as needed.
  • Configure an automated backup policy to periodically back up databases. For details, see Configuring an Automated Backup Policy.
  • Export backup information.

เราใช้คุกกี้เพื่อปรับปรุงไซต์และประสบการณ์การใช้ของคุณ การเรียกดูเว็บไซต์ของเราต่อแสดงว่าคุณยอมรับนโยบายคุกกี้ของเรา เรียนรู้เพิ่มเติม

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback