Skip to content

Commit

Permalink
s3: Do not log access keys
Browse files Browse the repository at this point in the history
The previous attempt a5ba027 was
incomplete and there are still a few more logs where access keys are
logged. This fixes these to avoid leaking access keys to log.

Related-Bug: #2047688
Change-Id: I8dc564bed33d6fc71965f4f573ae9109b410b1d4
  • Loading branch information
kajinamit committed Jan 20, 2024
1 parent e823a3c commit d6e531a
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions glance_store/_drivers/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,10 +539,8 @@ def get(self, location, offset=0, chunk_size=None, context=None):
key = s3_client.get_object(Bucket=bucket, Key=key)

LOG.debug("Retrieved image object from S3 using s3_host=%(s3_host)s, "
"access_key=%(accesskey)s, bucket=%(bucket)s, "
"key=%(key)s)",
{'s3_host': loc.s3serviceurl, 'accesskey': loc.accesskey,
'bucket': bucket, 'key': key})
"bucket=%(bucket)s key=%(key)s)",
{'s3_host': loc.s3serviceurl, 'bucket': bucket, 'key': key})

cs = self.READ_CHUNKSIZE

Expand Down Expand Up @@ -828,9 +826,8 @@ def delete(self, location, context=None):
raise exceptions.NotFound(image=key)

LOG.debug("Deleting image object from S3 using s3_host=%(s3_host)s, "
"accesskey=%(accesskey)s, bucket=%(bucket)s, key=%(key)s)",
{'s3_host': loc.s3serviceurl, 'accesskey': loc.accesskey,
'bucket': bucket, 'key': key})
"bucket=%(bucket)s, key=%(key)s)",
{'s3_host': loc.s3serviceurl, 'bucket': bucket, 'key': key})

return s3_client.delete_object(Bucket=bucket, Key=key)

Expand Down

0 comments on commit d6e531a

Please sign in to comment.