fix(lambda): discover permissions on published versions and aliases - #182
Merged
JeroenSoeters merged 1 commit intoAug 22, 2026
Merged
Conversation
A Lambda function keeps a separate resource policy per qualifier: statements added against the bare function name live on the unqualified policy, while statements added against a version's or alias's ARN live on that qualifier's policy. The CloudControl list handler only returns the unqualified policy's statements, so a permission granted against a qualified ARN, the shape API Gateway and Lambda@Edge wiring uses, was invisible to discovery. List now goes through a custom provisioner that walks every policy scope via the Lambda control plane (GetPolicy on the function, each published version, and each alias) and emits the same statement-ARN|Sid composite id the CloudControl CRUD path produces. The client carries the discovery-grade retry budget registry dispatch bypasses.
Contributor
Author
|
Conformance evidence: lambda-version-ref and lambda-permission, CRUD and discovery suites, all phases passing. The version-ref discovery phase, structurally unable to pass before this change, completes in 2m12s with the qualified permission found; the unqualified case stays green. |
JeroenSoeters
deleted the
jeroensoeters/lambda-permission-qualified-discovery
branch
August 22, 2026 17:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AWS::Lambda::Permissiondiscovery only found statements on the bare function's resource policy. Lambda keeps a separate policy per qualifier, and the CloudControl list handler returns just the unqualified one, so a permission granted against a published version's or alias's ARN (the shape API Gateway and Lambda@Edge wiring uses) was invisible to discovery. This surfaced as soon as discovery for the type was enabled: the conformance suite that attaches a permission to a published version's qualified ARN fails its discovery phase because the awaited id can never appear in the list.GetPolicyon the function, on each published version (ListVersionsByFunction, paginated,$LATESTskipped since it shares the unqualified policy), and on each alias (ListAliases). Each statement emits the sameARN|Sidcomposite id the CloudControl CRUD path produces, so discovered and managed permissions resolve to identical ids. A deleted function yields an empty list, a scope with no policy is skipped, and the client carries the discovery-grade retry budget that registry dispatch bypasses.Verification
make test-unit,make lint,make verify-schema,make buildall pass.lambda-version-ref(the failing qualified case) andlambda-permission(unqualified regression guard) dispatched from this branch; results will be linked in a comment.