mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 06:45:08 +00:00
feat(validate-metadata): Validate Check's metadata and list checks (#1215)
This commit is contained in:
@@ -4,9 +4,9 @@
|
||||
"cat2"
|
||||
],
|
||||
"CheckAlias": "extra764",
|
||||
"CheckID": "iam-check-credentials-expiration-30-days",
|
||||
"CheckName": "iam-check-credentials-expiration-30-days",
|
||||
"CheckTitle": "IAM Access Analyzer Enabled",
|
||||
"CheckID": "iam_disable_30_days_credentials",
|
||||
"CheckName": "iam_disable_30_days_credentials",
|
||||
"CheckTitle": "Ensure credentials unused for 30 days or greater are disabled",
|
||||
"CheckType": "Software and Configuration Checks",
|
||||
"Compliance": [
|
||||
{
|
||||
@@ -25,7 +25,7 @@
|
||||
"othercheck1",
|
||||
"othercheck2"
|
||||
],
|
||||
"Description": "If Security groups are not properly configured the attack surface is increased.",
|
||||
"Description": "Ensure credentials unused for 30 days or greater are disabled",
|
||||
"Notes": "additional information",
|
||||
"Provider": "aws",
|
||||
"RelatedTo": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from datetime import datetime
|
||||
|
||||
from lib.check.check import Check, Check_Report
|
||||
from lib.check.models import Check, Check_Report
|
||||
from providers.aws.services.iam.iam_service import iam_client
|
||||
|
||||
maximum_expiration_days = 30
|
||||
@@ -32,9 +32,7 @@ class iam_disable_30_days_credentials(Check):
|
||||
pass
|
||||
else:
|
||||
report.status = "PASS"
|
||||
report.result_extended = (
|
||||
f"User {user['UserName']} has not a console password or is unused."
|
||||
)
|
||||
report.result_extended = f"User {user['UserName']} has not a console password or is unused."
|
||||
report.region = "us-east-1"
|
||||
|
||||
# Append report
|
||||
@@ -46,4 +44,4 @@ class iam_disable_30_days_credentials(Check):
|
||||
report.region = "us-east-1"
|
||||
findings.append(report)
|
||||
|
||||
return findings
|
||||
return findings
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
"cat2"
|
||||
],
|
||||
"CheckAlias": "extra764",
|
||||
"CheckID": "iam-check-credentials-expiration-90-days",
|
||||
"CheckName": "iam-check-credentials-expiration-90-days",
|
||||
"CheckTitle": "IAM Access Analyzer Enabled",
|
||||
"CheckID": "iam_disable_90_days_credentials",
|
||||
"CheckName": "iam_disable_90_days_credentials",
|
||||
"CheckTitle": "Ensure credentials unused for 90 days or greater are disabled",
|
||||
"CheckType": "Software and Configuration Checks",
|
||||
"Compliance": [
|
||||
{
|
||||
@@ -25,7 +25,7 @@
|
||||
"othercheck1",
|
||||
"othercheck2"
|
||||
],
|
||||
"Description": "If Security groups are not properly configured the attack surface is increased.",
|
||||
"Description": "Ensure credentials unused for 90 days or greater are disabled",
|
||||
"Notes": "additional information",
|
||||
"Provider": "aws",
|
||||
"RelatedTo": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from datetime import datetime
|
||||
|
||||
from lib.check.check import Check, Check_Report
|
||||
from lib.check.models import Check, Check_Report
|
||||
from providers.aws.services.iam.iam_service import iam_client
|
||||
|
||||
maximum_expiration_days = 90
|
||||
@@ -32,9 +32,7 @@ class iam_disable_90_days_credentials(Check):
|
||||
pass
|
||||
else:
|
||||
report.status = "PASS"
|
||||
report.result_extended = (
|
||||
f"User {user['UserName']} has not a console password or is unused."
|
||||
)
|
||||
report.result_extended = f"User {user['UserName']} has not a console password or is unused."
|
||||
report.region = "us-east-1"
|
||||
|
||||
# Append report
|
||||
@@ -45,4 +43,4 @@ class iam_disable_90_days_credentials(Check):
|
||||
report.result_extended = "There is no IAM users"
|
||||
report.region = "us-east-1"
|
||||
|
||||
return findings
|
||||
return findings
|
||||
|
||||
Reference in New Issue
Block a user