mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 14:55:00 +00:00
feat(checks): Select checks to run from provider using -c/--checks (#1197)
* feat(checks): Select checks to run * Update providers/aws/services/iam/iam_disable_30_days_credentials/iam_disable_30_days_credentials.py Co-authored-by: Sergio Garcia <38561120+sergargar@users.noreply.github.com>
This commit is contained in:
@@ -9,13 +9,11 @@ maximum_expiration_days = 30
|
||||
class iam_disable_30_days_credentials(Check):
|
||||
def execute(self) -> Check_Report:
|
||||
findings = []
|
||||
report = Check_Report
|
||||
|
||||
response = iam_client.users
|
||||
|
||||
if response:
|
||||
for user in response:
|
||||
report = Check_Report
|
||||
report = Check_Report()
|
||||
if "PasswordLastUsed" in user and user["PasswordLastUsed"] != "":
|
||||
try:
|
||||
time_since_insertion = (
|
||||
@@ -42,8 +40,10 @@ class iam_disable_30_days_credentials(Check):
|
||||
# Append report
|
||||
findings.append(report)
|
||||
else:
|
||||
report = Check_Report()
|
||||
report.status = "PASS"
|
||||
report.result_extended = "There is no IAM users"
|
||||
report.region = "us-east-1"
|
||||
findings.append(report)
|
||||
|
||||
return findings
|
||||
|
||||
Reference in New Issue
Block a user