DataSunrise Achieves AWS DevOps Competency Status in AWS DevSecOps and Monitoring, Logging, Performance

What is YugabyteDB Audit Trail?

Introduction

Maintaining a reliable audit trail is essential for security, compliance, and operational transparency. YugabyteDB, a high-performance distributed SQL database, offers unique audit capabilities tailored for modern distributed architectures. However, tracking database activity across nodes and APIs introduces challenges that require specialized solutions.

Understanding YugabyteDB Audit Trail

An audit trail in YugabyteDB is a comprehensive logging mechanism that captures and records important database activities, including user actions, query executions, schema modifications, and data changes. While the specifics may vary, it typically serves as a detailed log that documents who performed what action, when, and how. For YugabyteDB, this feature provides the following key benefits:

  1. Security Monitoring: Commonly used to track interactions with the database, allowing for the detection of suspicious or unauthorized activity.
  2. Compliance Documentation: Often employed to create a permanent and unalterable record of operations to meet regulatory and audit requirements.
  3. Performance Analysis: Typically captures relevant performance metrics, helping to identify inefficiencies or areas for optimization in query execution.
  4. Forensic Capabilities: Supports detailed investigations into database changes, allowing for a clear, time-based record of events.

In most cases, an audit trail will include:

  • Timestamps for each recorded event
  • The user who performed the action
  • The type of operation (e.g., SELECT, INSERT, UPDATE, DELETE)
  • The database objects affected by the action
  • Details of the queries executed
  • The number of rows impacted by the operation

YugabyteDB’s Native Audit Trail Capabilities

YugabyteDB incorporates PostgreSQL-compatible extensions to support database auditing, enabling monitoring of queries, transactions, and user activities.

1. pgaudit Extension

The pgaudit extension provides detailed session and object audit logging, making it easier to track user activity and DDL/DML operations.

-- Enable the extension
CREATE EXTENSION IF NOT EXISTS pgaudit;

-- Configure audit logging
SET pgaudit.log='DDL,WRITE,READ';
SET pgaudit.log_parameter=ON;
SET pgaudit.log_relation=ON;

2. pg_stat_statements Extension

This YugabyteDB-modified extension records SQL execution statistics, helping administrators analyze database activity and performance.

-- Enable the extension
CREATE EXTENSION pg_stat_statements;

-- Query for statistics
SELECT query, calls, total_time, rows
FROM pg_stat_statements
ORDER BY total_time DESC;

3. yb_pg_metrics Extension

This YugabyteDB-specific extension provides deeper insights into execution statistics across distributed nodes, allowing fine-grained analysis of database performance.

4. yb_ycql_utils Extension

This extension helps capture YCQL-related data from the PostgreSQL interface, though it has limitations due to YugabyteDB’s multi-API structure.

Challenges in YugabyteDB Auditing

While YugabyteDB’s extensions provide essential auditing tools, they also present some challenges:

  • API Isolation: Separate logging for YSQL and YCQL APIs makes unified monitoring difficult.
  • Distributed Architecture: Audit logs are generated per node, requiring aggregation for full visibility.
  • Performance Trade-offs: Extensive logging may impact query performance, necessitating a balanced approach to auditing.

Example Audit Output

Here’s an example of an output audit table:

TimestampUserStatement TypeObjectCommand
2025-02-17 10:15:23 UTCyugabyteDDLpublic.usersCREATE TABLE users (id INT PRIMARY KEY)
2025-02-17 10:15:30 UTCyugabyteWRITEpublic.usersINSERT INTO users VALUES (1)
2025-02-17 10:15:35 UTCadminREADpublic.usersSELECT * FROM users
2025-02-17 10:15:40 UTCyugabyteWRITEpublic.usersUPDATE users SET id = 2 WHERE id = 1

Enhancing YugabyteDB Audit Trails with DataSunrise

DataSunrise provides a powerful, centralized approach to YugabyteDB auditing, overcoming the limitations of native tools and ensuring regulatory compliance.

Unified Cross-API Auditing

DataSunrise enables seamless monitoring across both YSQL and YCQL, delivering a unified view of database activity across all nodes and interfaces. The platform’s architecture ensures complete visibility into database operations while maintaining high performance. Let’s explore its key features and capabilities:

Diagram illustrating the architecture and data flow of YugabyteDB’s audit system with DataSunrise integration.

Comprehensive Audit Rules

DataSunrise enables granular control over database auditing with advanced data activity history tracking and sophisticated rule configuration:

  • Custom audit policies based on users, roles, and objects
  • Detailed session and query tracking
  • Automated audit log management
  • Real-time monitoring and alerting

Screenshot of DataSunrise’s transactional audit trails interface for monitoring YugabyteDB database activity.

Real-Time Monitoring Dashboard

The monitoring interface provides comprehensive visibility into database operations:

  • Live activity tracking and analysis
  • Performance metrics and trends
  • Security event monitoring
  • Resource utilization tracking
  • Query pattern analysis

Real-time performance monitoring dashboard showcasing YugabyteDB query performance and security insights.

Advanced Security Features

The platform provides robust data protection through multiple security layers:

Configuration interface for DataSunrise’s dynamic masking feature, enhancing security for YugabyteDB data.

Conclusion

While YugabyteDB offers essential native auditing tools, the distributed nature and dual-API architecture introduce challenges that can complicate compliance and security monitoring.

DataSunrise solves these issues with a centralized, advanced audit trail solution, ensuring complete visibility, enhanced security, and streamlined compliance management.

Looking to strengthen your YugabyteDB audit trails? Schedule a demo today and experience DataSunrise’s comprehensive database security platform firsthand.

Next

How to Audit YugabyteDB

Learn More

Need Our Support Team Help?

Our experts will be glad to answer your questions.

Countryx
United States
United Kingdom
France
Germany
Australia
Afghanistan
Islands
Albania
Algeria
American Samoa
Andorra
Angola
Anguilla
Antarctica
Antigua and Barbuda
Argentina
Armenia
Aruba
Austria
Azerbaijan
Bahamas
Bahrain
Bangladesh
Barbados
Belarus
Belgium
Belize
Benin
Bermuda
Bhutan
Bolivia
Bosnia and Herzegovina
Botswana
Bouvet
Brazil
British Indian Ocean Territory
Brunei Darussalam
Bulgaria
Burkina Faso
Burundi
Cambodia
Cameroon
Canada
Cape Verde
Cayman Islands
Central African Republic
Chad
Chile
China
Christmas Island
Cocos (Keeling) Islands
Colombia
Comoros
Congo, Republic of the
Congo, The Democratic Republic of the
Cook Islands
Costa Rica
Cote D'Ivoire
Croatia
Cuba
Cyprus
Czech Republic
Denmark
Djibouti
Dominica
Dominican Republic
Ecuador
Egypt
El Salvador
Equatorial Guinea
Eritrea
Estonia
Ethiopia
Falkland Islands (Malvinas)
Faroe Islands
Fiji
Finland
French Guiana
French Polynesia
French Southern Territories
Gabon
Gambia
Georgia
Ghana
Gibraltar
Greece
Greenland
Grenada
Guadeloupe
Guam
Guatemala
Guernsey
Guinea
Guinea-Bissau
Guyana
Haiti
Heard Island and Mcdonald Islands
Holy See (Vatican City State)
Honduras
Hong Kong
Hungary
Iceland
India
Indonesia
Iran, Islamic Republic Of
Iraq
Ireland
Isle of Man
Israel
Italy
Jamaica
Japan
Jersey
Jordan
Kazakhstan
Kenya
Kiribati
Korea, Democratic People's Republic of
Korea, Republic of
Kuwait
Kyrgyzstan
Lao People's Democratic Republic
Latvia
Lebanon
Lesotho
Liberia
Libyan Arab Jamahiriya
Liechtenstein
Lithuania
Luxembourg
Macao
Madagascar
Malawi
Malaysia
Maldives
Mali
Malta
Marshall Islands
Martinique
Mauritania
Mauritius
Mayotte
Mexico
Micronesia, Federated States of
Moldova, Republic of
Monaco
Mongolia
Montserrat
Morocco
Mozambique
Myanmar
Namibia
Nauru
Nepal
Netherlands
Netherlands Antilles
New Caledonia
New Zealand
Nicaragua
Niger
Nigeria
Niue
Norfolk Island
North Macedonia, Republic of
Northern Mariana Islands
Norway
Oman
Pakistan
Palau
Palestinian Territory, Occupied
Panama
Papua New Guinea
Paraguay
Peru
Philippines
Pitcairn
Poland
Portugal
Puerto Rico
Qatar
Reunion
Romania
Russian Federation
Rwanda
Saint Helena
Saint Kitts and Nevis
Saint Lucia
Saint Pierre and Miquelon
Saint Vincent and the Grenadines
Samoa
San Marino
Sao Tome and Principe
Saudi Arabia
Senegal
Serbia and Montenegro
Seychelles
Sierra Leone
Singapore
Slovakia
Slovenia
Solomon Islands
Somalia
South Africa
South Georgia and the South Sandwich Islands
Spain
Sri Lanka
Sudan
Suriname
Svalbard and Jan Mayen
Swaziland
Sweden
Switzerland
Syrian Arab Republic
Taiwan, Province of China
Tajikistan
Tanzania, United Republic of
Thailand
Timor-Leste
Togo
Tokelau
Tonga
Trinidad and Tobago
Tunisia
Turkey
Turkmenistan
Turks and Caicos Islands
Tuvalu
Uganda
Ukraine
United Arab Emirates
United States Minor Outlying Islands
Uruguay
Uzbekistan
Vanuatu
Venezuela
Viet Nam
Virgin Islands, British
Virgin Islands, U.S.
Wallis and Futuna
Western Sahara
Yemen
Zambia
Zimbabwe
Choose a topicx
General Information
Sales
Customer Service and Technical Support
Partnership and Alliance Inquiries
General information:
info@datasunrise.com
Customer Service and Technical Support:
support.datasunrise.com
Partnership and Alliance Inquiries:
partner@datasunrise.com