Remediation
Remove Public Permissions from the Functionβ
From Command Lineβ
-
Retrieve the existing resource-based policy to identify the statement ID (
Sid) associated with public access:aws lambda get-policy \
--function-name {{function-name}} \
--output text -
Remove the permission statement that grants access to all principals:
aws lambda remove-permission \
--function-name {{function-name}} \
--statement-id {{sid}}