Skip to content

Commit

Permalink
More censoring (move-coop#556)
Browse files Browse the repository at this point in the history
* censor sensitive data in debug log of copy statement

* censoring another logger
  • Loading branch information
ydamit authored Aug 5, 2021
1 parent 88f9c3c commit 85afda1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion parsons/databases/redshift/redshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,14 @@ def copy(self, tbl, table_name, if_exists='fail', max_errors=0, distkey=None,

# Copy from S3 to Redshift
sql = self.copy_statement(table_name, self.s3_temp_bucket, key, **copy_args)
logger.debug(f'Copy SQL command: {sql}')
sql_censored = sql.replace(
aws_access_key_id,
'XXXXXXXXXXXX'
).replace(
aws_secret_access_key,
'YYYYYYYYYYYYY'
)
logger.debug(f'Copy SQL command: {sql_censored}')
self.query_with_connection(sql, connection, commit=False)

logger.info(f'Data copied to {table_name}.')
Expand Down

0 comments on commit 85afda1

Please sign in to comment.