AWS Redshift Database audit logging

Overview

Amazon Redshift logs information about connections and user activities in your database. These logs help you to monitor the database for security and troubleshooting purposes, which is a process often referred to as database auditing. The logs are stored in Amazon S3 buckets. These provide convenient access with data security features for users who are responsible for monitoring activities in the database.

Amazon Redshift logs

Amazon Redshift logs information in the following log files:

  • Connection log — logs authentication attempts, and connections and disconnections.
  • User log — logs information about changes to database user definitions.
  • User activity log — logs each query before it is run on the database.

Connection log

Logs authentication attempts, and connections and disconnections. The following table describes the information in the connection log.

Column nameDescription
eventConnection or authentication event.
recordtimeTime the event occurred.
remotehostName or IP address of remote host.
remoteportPort number for remote host.
pidProcess ID associated with the statement.
dbnameDatabase name.
usernameUser name.
authmethodAuthentication method.
durationDuration of connection in microseconds.
sslversionSecure Sockets Layer (SSL) version.
sslcipherSSL cipher.
mtuMaximum transmission unit (MTU).
sslcompressionSSL compression type.
sslexpansionSSL expansion type.
iamauthguidThe IAM authentication ID for the CloudTrail request.
application_nameThe initial or updated name of the application for a session.

User log

Records details for the following changes to a database user:

  • Create user
  • Drop user
  • Alter user (rename)
  • Alter user (alter properties)
Column nameDescription
useridID of user affected by the change.
usernameUser name of the user affected by the change.
oldusernameFor a rename action, the original user name. For any other action, this field is empty.
actionAction that occurred. Valid values:AlterCreateDropRename
usecreatedbIf true (1), indicates that the user has create database privileges.
usesuperIf true (1), indicates that the user is a superuser.
usecatupdIf true (1), indicates that the user can update system catalogs.
valuntilPassword expiration date.
pidProcess ID.
xidTransaction ID.
recordtimeTime in UTC that the query started.

User activity log

Logs each query before it is run on the database.

Column nameDescription
recordtimeTime the event occurred.
dbDatabase name.
userUser name.
pidProcess ID associated with the statement.
useridUser ID.
xidTransaction ID.
queryA prefix of LOG: followed by the text of the query, including newlines.

Amazon Redshift enhanced VPC routing

When you use Amazon Redshift enhanced VPC routing, Amazon Redshift forces all COPY and UNLOAD traffic between your cluster and your data repositories through your Amazon VPC. By using enhanced VPC routing, you can use standard VPC features, such as VPC security groups, network access control lists (ACLs), VPC endpoints, VPC endpoint policies, internet gateways, and Domain Name System (DNS) servers, as described in the Amazon VPC User Guide. You use these features to tightly manage the flow of data between your Amazon Redshift cluster and other resources. When you use enhanced VPC routing to route traffic through your VPC, you can also use VPC flow logs to monitor COPY and UNLOAD traffic.

If enhanced VPC routing is not enabled, Amazon Redshift routes traffic through the internet, including traffic to other services within the AWS network.