Skip to content

Commit 265ad47

Browse files
committed
Remove S3 credentials from debug log
While sorting image locations using store weight, glance logs a debug message which logs secret and access key for s3 backend. Removing the debug log to avoid leaking of the s3 credentials. Closes-Bug: #2095304 SecurityImpact Change-Id: I24073c1b1e5ea92357d9a774e6c9c9cbf0980a44 (cherry picked from commit 33fa959) (cherry picked from commit d1cc917)
1 parent d0be1be commit 265ad47

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

glance/common/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,5 +733,9 @@ def get_store_weight(location):
733733
return store.weight if store is not None else 0
734734

735735
sorted_locations = sorted(locations, key=get_store_weight, reverse=True)
736-
LOG.debug(('Sorted locations: %s'), sorted_locations)
736+
scrubbed = []
737+
for loc in sorted_locations:
738+
scrubbed.append({'store_name': loc["metadata"].get("store")})
739+
740+
LOG.debug(('Sorted locations: %s'), scrubbed)
737741
return sorted_locations

0 commit comments

Comments
 (0)