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:
Pepe Fagoaga
2022-06-16 12:20:03 +02:00
committed by GitHub
parent 33c6801501
commit 162852634e
4 changed files with 95 additions and 58 deletions

View File

@@ -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