mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 14:55:00 +00:00
feat(lambda_cloudtrail check): improved logic and status extended (#2092)
This commit is contained in:
3008
poetry.lock
generated
3008
poetry.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -38,8 +38,7 @@ class awslambda_function_invoke_api_operations_cloudtrail_logging_enabled(Check)
|
||||
]:
|
||||
if (
|
||||
field_selector["Field"] == "resources.type"
|
||||
and field_selector["Equals"][0]
|
||||
== "AWS::Lambda::Function"
|
||||
and "AWS::Lambda::Function" in field_selector["Equals"]
|
||||
):
|
||||
lambda_recorded_cloudtrail = True
|
||||
break
|
||||
@@ -47,7 +46,7 @@ class awslambda_function_invoke_api_operations_cloudtrail_logging_enabled(Check)
|
||||
break
|
||||
if lambda_recorded_cloudtrail:
|
||||
report.status = "PASS"
|
||||
report.status_extended = f"Lambda function {function.name} is recorded by CloudTrail {trail.name}"
|
||||
report.status_extended = f"Lambda function {function.name} is recorded by CloudTrail trail {trail.name}"
|
||||
break
|
||||
findings.append(report)
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ class Test_awslambda_function_invoke_api_operations_cloudtrail_logging_enabled:
|
||||
assert result[0].status == "PASS"
|
||||
assert (
|
||||
result[0].status_extended
|
||||
== f"Lambda function {function_name} is recorded by CloudTrail {trail_name}"
|
||||
== f"Lambda function {function_name} is recorded by CloudTrail trail {trail_name}"
|
||||
)
|
||||
|
||||
@mock_cloudtrail
|
||||
@@ -291,7 +291,7 @@ class Test_awslambda_function_invoke_api_operations_cloudtrail_logging_enabled:
|
||||
assert result[0].status == "PASS"
|
||||
assert (
|
||||
result[0].status_extended
|
||||
== f"Lambda function {function_name} is recorded by CloudTrail {trail_name}"
|
||||
== f"Lambda function {function_name} is recorded by CloudTrail trail {trail_name}"
|
||||
)
|
||||
|
||||
@mock_cloudtrail
|
||||
@@ -364,5 +364,5 @@ class Test_awslambda_function_invoke_api_operations_cloudtrail_logging_enabled:
|
||||
assert result[0].status == "PASS"
|
||||
assert (
|
||||
result[0].status_extended
|
||||
== f"Lambda function {function_name} is recorded by CloudTrail {trail_name}"
|
||||
== f"Lambda function {function_name} is recorded by CloudTrail trail {trail_name}"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user