mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 14:55:00 +00:00
fix(key_error): remove KeyError. (#1326)
This commit is contained in:
@@ -17,7 +17,6 @@ class iam_disable_30_days_credentials(Check):
|
||||
report.resource_arn = user.arn
|
||||
report.region = iam_client.region
|
||||
if user.password_last_used and user.password_last_used != "":
|
||||
try:
|
||||
time_since_insertion = (
|
||||
datetime.datetime.now()
|
||||
- datetime.datetime.strptime(
|
||||
@@ -30,9 +29,6 @@ class iam_disable_30_days_credentials(Check):
|
||||
else:
|
||||
report.status = "PASS"
|
||||
report.status_extended = f"User {user.name} has logged into the console in the past 30 days."
|
||||
|
||||
except KeyError:
|
||||
pass
|
||||
else:
|
||||
report.status = "PASS"
|
||||
report.status_extended = (
|
||||
|
||||
@@ -17,7 +17,6 @@ class iam_disable_90_days_credentials(Check):
|
||||
report.resource_id = user.name
|
||||
report.resource_arn = user.arn
|
||||
if user.password_last_used and user.password_last_used != "":
|
||||
try:
|
||||
time_since_insertion = (
|
||||
datetime.datetime.now()
|
||||
- datetime.datetime.strptime(
|
||||
@@ -30,9 +29,6 @@ class iam_disable_90_days_credentials(Check):
|
||||
else:
|
||||
report.status = "PASS"
|
||||
report.status_extended = f"User {user.name} has logged into the console in the past 90 days."
|
||||
|
||||
except KeyError:
|
||||
pass
|
||||
else:
|
||||
report.status = "PASS"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user