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

Database Audit for Google Cloud SQL

Database Audit for Google Cloud SQL

Introduction

In today’s data-driven world, having a reliable database management solution is essential for maintaining competitiveness. As businesses adopt advanced techniques for database audit and database security, hackers continually evolve their methods to breach systems. This article explores how Google Cloud SQL provides a robust platform for conducting database audit while ensuring high-level compliance and security. Additionally, we’ll cover best practices to enhance the security of your SQL database.

What is Google Cloud SQL?

Google Cloud SQL is a unified platform for managing relational databases, including MySQL, PostgreSQL, and SQL Server (MSSQL). Its user-friendly, web-based interface makes executing SQL queries and managing databases seamless. The platform offers tools for reliable database auditing, connecting storage buckets, and configuring secure environments, making it a flexible solution for secure data management.

Let’s explore how to configure a database audit using Google Cloud SQL.

Setting Up a Database Audit in Google Cloud SQL

To set up a database audit in Google Cloud SQL, start by ensuring you have a functional database instance. This guide uses an SQL Server Express 19 instance. A crucial step involves configuring a storage bucket for your audit logs:

Once storage is configured, you can proceed with the audit setup.

Types of Database Audits in SQL Server

In SQL Server, audits are categorized into three levels:

  1. Server-level Audit: Tracks high-level events like authentication attempts and management changes.
  2. Database-level Audit: Monitors DML (Data Manipulation Language) and DDL (Data Definition Language) operations.
  3. Audit-level Actions: Logs activities related to the auditing process.

Here’s how to create a Server-level Audit in SQL Server:

CREATE SERVER AUDIT testAudit TO FILE (FILEPATH = '/var/opt/mssql/audit', MAXSIZE = 10 MB);
ALTER SERVER AUDIT testAudit WITH (STATE = ON);

Creating an Audit Specification

Specify the events to monitor using an Audit Specification. For instance, the following captures all failed login attempts:

CREATE SERVER AUDIT SPECIFICATION testAuditSpec  
FOR SERVER AUDIT testAudit  
    ADD (FAILED_LOGIN_GROUP)  
    WITH (STATE=ON); 
ALTER SERVER AUDIT SPECIFICATION testAuditSpec WITH (STATE=ON);

View the audit results using this stored procedure:

SELECT * FROM msdb.dbo.gcloudsql_fn_get_audit_file('/var/opt/mssql/audit/*', NULL, NULL);

Expanding to Database-Level Audits

For more granular monitoring, configure Database-level Audits. For example, to log all queries on the MOCK_DATA database by a specific user:

CREATE DATABASE AUDIT SPECIFICATION dbSpec 
FOR SERVER AUDIT testAudit  
    ADD (SELECT ON dbo.MOCK_DATA BY testuser) 
WITH (STATE = ON);

Logs for queries executed under the testuser account will be stored in the configured bucket. You can retrieve and analyze these logs as follows:

SELECT * FROM msdb.dbo.gcloudsql_fn_get_audit_file('/var/opt/mssql/audit/*', NULL, NULL);

Granular Rule-Based Database Audit: DataSunrise + Google Cloud SQL

While Google Cloud SQL provides foundational auditing tools, integrating third-party solutions like DataSunrise elevates your database audit and security capabilities. DataSunrise offers comprehensive tools for database security, real-time threat assistance, and data compliance.

Here’s how to use DataSunrise to set up granular audit rules:

  • Add the database to the list of managed databases:
  • Create an audit rule by clicking “Add New Rule.”:
  • Configure general settings:
  • Configure filter sessions so only sessions from testuser are audited:
  • Set up a statement filter to monitor only the MOCK_DATA database:

Save your settings and view audit logs in the Transactional Trails tab:

These logs are interactive and you can create separate rules auditing a certain types of queries:

Best Practices for Database Audit in Google Cloud SQL

To maximize performance and security when auditing Google Cloud SQL, consider these best practices:
  1. Place both DataSunrise and MSSQL instances within Google’s Virtual Private Cloud (VPC).
  2. Allow external connections only through the DataSunrise proxy for enhanced security.

Conveniently, DataSunrise is available on the Google Cloud Marketplace for ease of configuration of such setup.

Conclusion

Conducting a database audit is a complex yet critical task to ensure compliance with regulatory standards and protect against security threats. Use a combination of built-in tools from MSSQL and advanced third-party solutions like DataSunrise to achieve comprehensive audit coverage and enhanced database security. Leveraging Google Cloud SQL as your platform simplifies setup and management while ensuring robust data protection.

Next

Database Audit for CosmosDB for NoSQL

Database Audit for CosmosDB for NoSQL

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