Security implications of SourceArn (as in AWS::Lambda::Permission)

0

These two doc pages:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html

https://docs.aws.amazon.com/lambda/latest/dg/API_AddPermission.html

have a note:
bq. If you grant permission to a service principal without specifying [SourceArn], other accounts could potentially configure resources in their account to invoke your Lambda function.
I'm unclear on what, exactly, that means.

Let's say I specify a Principal of "s3.amazonaws.com", and I leave SourceArn blank. Does that mean my lambda could be invoked by any random person's S3 bucket, if they managed to find my Lambda's ARN and configure their bucket accordingly?

Edited by: SyntaxColoring on May 27, 2020 9:32 PM

Maxpm
feita há 4 anos555 visualizações
1 Resposta
0
Resposta aceita

Answering my own question.

Yes, if you leave SourceArn blank, other accounts really will be able to execute your Lambda function.

I tested this as described here: https://github.com/terraform-providers/terraform-provider-aws/pull/12794#discussion_r431612010

Maxpm
respondido há 4 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas