Enable Audit Logging on This PostgreSQL Instance

30 minutes
  • 3 Learning Objectives

About this Hands-on Lab

In this hands-on lab, students will enable audit logging using the `pgaudit` extension. They will then review the audit log created.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Install the `pgaudit` Extension.
  1. Install the pgaudit extension. This extension enables detailed session, and object audit logging, via the standard logging facility.
Configure the Extension
  1. Configure the pgaudit extension, to log all DDL, ROLE, READ and WRITE statements.
Test the Extension
  1. Generate some WRITE activity on the server and confirm the log is generated as expected.

Additional Resources

There are 3 steps required to complete this hands-on lab:

  • Install the pgaudit extension
  • Configure the pgaudit extension. The config file pgaudit.conf will be downloaded into the cloud_user home directory. You can also find it here.
  • Generate traffic and review the logs.

Database Info

  • User: postgres
  • Database name: demo
  • Database table: users

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?