Skip to content

Commit

Permalink
fix(aws) wording of report.status_extended in awslambda_function_not_…
Browse files Browse the repository at this point in the history
…publicly_accessible
  • Loading branch information
kagahd committed Feb 5, 2025
1 parent f3b1219 commit a2d225e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ def execute(self):
report = Check_Report_AWS(metadata=self.metadata(), resource=function)

report.status = "PASS"
report.status_extended = f"Lambda function {function.name} has a policy resource-based policy not public."
report.status_extended = f"Lambda function {function.name} has a resource-based policy without public access."
if is_policy_public(
function.policy,
awslambda_client.audited_account,
is_cross_account_allowed=True,
):
report.status = "FAIL"
report.status_extended = f"Lambda function {function.name} has a policy resource-based policy with public access."
report.status_extended = f"Lambda function {function.name} has a resource-based policy with public access."

findings.append(report)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def test_function_public(self):
assert result[0].status == "FAIL"
assert (
result[0].status_extended
== f"Lambda function {function_name} has a policy resource-based policy with public access."
== f"Lambda function {function_name} has a resource-based policy with public access."
)
assert result[0].resource_tags == [{"tag1": "value1", "tag2": "value2"}]

Expand Down Expand Up @@ -184,7 +184,7 @@ def test_function_public_with_source_account(self):
assert result[0].status == "PASS"
assert (
result[0].status_extended
== f"Lambda function {function_name} has a policy resource-based policy not public."
== f"Lambda function {function_name} has a resource-based policy without public access."
)
assert result[0].resource_tags == [{"tag1": "value1", "tag2": "value2"}]

Expand Down Expand Up @@ -260,7 +260,7 @@ def test_function_not_public(self):
assert result[0].status == "PASS"
assert (
result[0].status_extended
== f"Lambda function {function_name} has a policy resource-based policy not public."
== f"Lambda function {function_name} has a resource-based policy without public access."
)
assert result[0].resource_tags == [{"tag1": "value1", "tag2": "value2"}]

Expand Down Expand Up @@ -319,7 +319,7 @@ def test_function_public_with_canonical(self):
assert result[0].status == "FAIL"
assert (
result[0].status_extended
== f"Lambda function {function_name} has a policy resource-based policy with public access."
== f"Lambda function {function_name} has a resource-based policy with public access."
)
assert result[0].resource_tags == []

Expand Down Expand Up @@ -492,7 +492,7 @@ def test_function_public_with_alb(self):
assert result[0].status == "FAIL"
assert (
result[0].status_extended
== "Lambda function test-public-lambda has a policy resource-based policy with public access."
== "Lambda function test-public-lambda has a resource-based policy with public access."
)
assert result[0].resource_tags == [{"tag1": "value1", "tag2": "value2"}]

Expand Down Expand Up @@ -552,7 +552,7 @@ def test_function_could_be_invoked_by_specific_aws_account(self):
assert result[0].status == "PASS"
assert (
result[0].status_extended
== f"Lambda function {function_name} has a policy resource-based policy not public."
== f"Lambda function {function_name} has a resource-based policy without public access."
)
assert result[0].resource_tags == []

Expand Down Expand Up @@ -612,7 +612,7 @@ def test_function_could_be_invoked_by_specific_other_aws_account(self):
assert result[0].status == "PASS"
assert (
result[0].status_extended
== f"Lambda function {function_name} has a policy resource-based policy not public."
== f"Lambda function {function_name} has a resource-based policy without public access."
)
assert result[0].resource_tags == []

Expand Down Expand Up @@ -681,7 +681,7 @@ def test_function_public_policy_with_several_statements(self):
assert result[0].status == "FAIL"
assert (
result[0].status_extended
== f"Lambda function {function_name} has a policy resource-based policy with public access."
== f"Lambda function {function_name} has a resource-based policy with public access."
)
assert result[0].resource_id == function_name
assert result[0].resource_arn == function_arn
Expand Down

0 comments on commit a2d225e

Please sign in to comment.