Lambda function should not be accessible over the public internet

이 페이지는 아직 한국어로 제공되지 않으며 번역 작업 중입니다. 번역에 관한 질문이나 의견이 있으시면 언제든지 저희에게 연락해 주십시오.

Description

Identify when a Lambda function can be invoked by anyone, either directly or through a Lambda function URL.

Rationale

Giving anonymous users the ability to invoke Amazon Lambda functions can lead to data loss, data exposure, and unexpected AWS billing charges.

Remediation

From the console

Follow the Using resource-based policies for AWS lambda docs to update your AWS lambda function permissions.

From the command line

  1. Run remove-permission with your function name and statement ID.

remove-permission.sh

  aws lambda remove-permission
    --function-name your-function-name
    --statement-id ab-12ab34c5-6a78-9b0c-123d-a123b456c789
  
  1. Run add-permission with your function name, statement ID, principal for the trusted account, and action.

add-permission.sh

  aws lambda add-permission
    --function-name your-function-name
    --statement-id ab-12ab34c5-6a78-9b0c-123d-a123b456c789
    --principal 0123456780123
    --action lambda:InvokeFunction