Files
floci/docs/services
Priamo Germosen 6563e6a315 fix(iam): check each layer a Lambda function adds as lambda:GetLayerVersion (#9769)
The Service Reference lists lambda:GetLayerVersion among the actions CreateFunction and UpdateFunctionConfiguration
are authorized by, and the Lambda Developer Guide says what it is checked on: "Make sure that you have permission to
call the GetLayerVersion API on the layer version". Floci checked neither operation as it, so a caller allowed to
create or update functions added any layer version of its account, whatever its policies said about reading it.

tools/aws/fetch_lambda_layer_permissions.py vendors that sentence from the adding-layers page, with the action and
the resource it names, and refuses a page asking for permission to call an API in any other wording. The
request-resources generator reads it (api_permission_resources): an operation the Service Reference lists as
authorized by that action is also checked as it on each value of the request's member holding botocore's ARN shape
for the type the words name (`<Type>Arn`, as minted_types reads it; `Layers`, a list of `LayerVersionArn`, for a
`layerVersion`). CreateFunction and UpdateFunctionConfiguration now check lambda:GetLayerVersion on each layer
version their Layers give, and a request giving none is not checked as it; no other operation changes.
--verify reports an operation checked so whose action the Service Reference stops listing (verify_api_actions).

CreateFunction is the first operation checked by parts that also tags what it creates, so IamEnforcementFilter now
checks an operation's own action, where it is one of the parts, as it would be alone: with the request's tags
(aws:RequestTag, aws:TagKeys) and carried values, not the bare part context. The checks made after it, the tagging
action a create also needs, a companion and a forwarded action, are made on the resources that action was checked on,
not on *, so lambda:TagResource is again checked on the function a tagged create makes.

Another account's layer version is checked on its ARN alone: LambdaStoredResourceArns answers reachedInItsAccount
for it, as Lambda reads such a layer in its owner's account through the owner's policy and never as the caller's layer
of that name, where IAM also checked the caller's same-named layer before (GetLayerVersionByArn too).

The table is regenerated against today's Service Reference too, which the online gate this change runs requires: AWS
added SageMaker's leaderboard and model-monitor-config types (their ARN formats and tag keys, and the types of
AddTags, DeleteTags and ListTags) and lists a backup-external namespace the table does not read.

The docs and two comments in LambdaService and LambdaLayerService no longer say Floci implements no layer
permissions.
2026-11-29 16:49:45 -04:00
..