Skip to content

Accessing Unredacted Secure Logging Records in Amazon Redshift with the DEBUG Permission

3 minute read
Content level: Intermediate
0

Amazon Redshift secure logging redacts sensitive values in system table records when a query accesses data protected by federated permissions with fine-grained access control (FGAC). Redaction protects the data producer, but it also blocks auditors and administrators who need these records to troubleshoot queries and meet compliance requirements. This article shows database administrators and auditors how to use the DEBUG permission to give specific identities unredacted records.

Accessing Unredacted Secure Logging Records in Amazon Redshift with the DEBUG Permission

Content level: Intermediate

Amazon Redshift secure logging redacts sensitive values in system table records when a query accesses data protected by federated permissions with fine-grained access control (FGAC). Redaction protects the data producer, but it also blocks auditors and administrators who need these records to troubleshoot queries and meet compliance requirements. This article shows database administrators and auditors how to use the DEBUG permission to give specific identities unredacted records while secure logging stays on.

Introduction

With Amazon Redshift federated permissions, you define data permissions once. Redshift enforces them across every Redshift warehouse in your AWS account. When a query accesses FGAC-protected data, secure logging redacts sensitive values in system table records, such as rewritten query text, error messages, and object names.

On September 30, 2026, Amazon Redshift added the DEBUG permission. A superuser or database owner grants DEBUG to choose which identities see these records without redaction. You don't need to turn off secure logging.

Prerequisites

To grant DEBUG, you must be a superuser or the database owner. The grantee is typically an IAM user, IAM role, or IAM Identity Center user or group.

Identify Redacted Records

Secure logging masks text with asterisks and numbers with -1. A masked string shows one asterisk per character, up to six. Strings longer than six characters show six asterisks.

Masking applies to many system tables and views. The following are five examples, with their masked columns:

  • SYS_QUERY_HISTORY: returned_rows, returned_bytes
  • SYS_QUERY_DETAIL: step_id, step_name, table_id, table_name, input_bytes, input_rows, output_bytes, output_rows, blocks_read, blocks_write, local_read_IO, remote_read_IO, spilled_block_local_disk, spilled_block_remote_disk, step_attribute
  • STL_QUERY: querytxt
  • STL_QUERYTEXT: text
  • STL_ERROR: file, linenum, context, error

For the full list of tables, views, and columns, see Secure logging in the Amazon Redshift Management Guide.

Grant the DEBUG Permission

Grant DEBUG with the standard Amazon Redshift GRANT command. The grantee then sees unredacted records for its own queries.

Grant DEBUG to Consumer Account Administrators

You can grant DEBUG to the administrators of a consumer account. These administrators then have full log visibility for troubleshooting and audit.

Export Unredacted Records to Amazon S3 Tables

When you export Redshift system table data to Amazon S3 Tables, records authorized for account administrators stay unredacted. Use this export to keep audit records outside the warehouse.

Availability

The DEBUG permission is available in all AWS Regions where Amazon Redshift is supported.

Conclusion

The DEBUG permission gives auditors and administrators the system table records they need to troubleshoot and audit queries on FGAC-protected data. Secure logging stays on for every identity that does not hold DEBUG.

References

AWS
EXPERT

published a month ago268 views