@@ -230,7 +230,6 @@ def search_for_keys(region_name: str, profile: dict, all_users: list[Threshold],
230
230
aws_access_key_id = profile ["id" ],
231
231
aws_secret_access_key = profile ["secret" ],
232
232
)
233
- print (f"about to check: { account } " )
234
233
iam = session .client ("iam" )
235
234
# Generate credential report for the given profile
236
235
# Generating the report is an async operation, so wait for it by sleeping
@@ -250,8 +249,6 @@ def search_for_keys(region_name: str, profile: dict, all_users: list[Threshold],
250
249
row : dict
251
250
for row in csv_reader :
252
251
user_name = row ["user" ]
253
- if user_name == "ephraim.gross" :
254
- print (f"found ephraim: { row } " )
255
252
# Note: If the user is unknown, we aren't capturing it, but could here
256
253
# in an else below
257
254
aws_user = find_known_user (user_name , all_users )
@@ -331,15 +328,13 @@ def send_key(key_dict: dict, severity: str):
331
328
def check_key (key_num : int , last_rotated_key : str , user : Threshold , row : dict , account : str ):
332
329
days_since_rotation = calc_days_since_rotation (last_rotated_key )
333
330
user_dict = {"user" :row ["user" ], "key_num" : key_num , "user_type" : user .account_type , "account" : account , "days_since_rotation" : days_since_rotation , "last_rotated" :last_rotated_key }
331
+ print (f"user is either being sent or deleted: { user_dict } " )
334
332
if days_since_rotation >= user .violation and user .account_type :
335
- print (f"about to send user: { user_dict ['user' ]} " )
336
333
send_key (user_dict , "violation" )
337
334
elif days_since_rotation >= user .warn :
338
- print (f"about to send user: { user_dict ['user' ]} " )
339
335
send_key (user_dict , "warn" )
340
336
else :
341
- # print(f"about to send rotated for user: {user}")
342
- print (f"about to del user: { user_dict ['user' ]} " )
337
+ print ("it was actually deleted" )
343
338
del_key (user_dict )
344
339
345
340
0 commit comments