1 Answer
- Newest
- Most votes
- Most comments
0
Your control results narrow it down to one thing: the simulator treated the key you supplied as absent.
Why your results point there
Null: trueproduced an explicit deny even though you supplied the exact key and value. ANull: truecondition only matches when the key is absent from the evaluated context.- With that in mind, everything else fits.
ArnEqualsgave implicit deny because there was nothing to compare against.stringandstringListbehaved the same. A correct ARN and a wrong ARN gave identical results. - The
aws:SourceArncontrol worked, so your request formatting and context handling aren't the cause. The difference is the key itself.
Your questions
- Is the key supported as a supplied context entry? It looks like it's handled specially. Lambda's documentation says it "injects the source function ARN into the credentials context" for API requests made from inside the execution environment. That means the key comes from the session credentials, not from the request. My guess, which AWS hasn't confirmed, is that the simulator doesn't let
ContextEntriesset credential-derived keys, or that it drops supplied keys whose prefix isn'taws:and isn't the service of the action being simulated. In this case the action iss3:and the key islambda:. - Does the function need to exist? Probably not. The result looks like a missing key, not a mismatched value, so whether the ARN refers to a real function wouldn't change it.
- Why does
Null: truematch whileMissingContextValuesis empty?MissingContextValuesappears to be calculated by comparing the keys your policy references against the keys you supplied in the request. It doesn't reflect what the evaluator actually used. If the evaluator drops the key afterwards, you get exactly this inconsistency. - Is this documented? I couldn't find it documented. The same pattern has been reported for
ec2:SourceInstanceARNwithsqs:SendMessage. EC2 also injects that key from the platform, and it also wasn't evaluated even with matching context. These are two cases with the same shape.
A test to tell the two guesses apart
Keep the same condition and context but change the simulated action to a Lambda action, for example lambda:GetFunction on *.
- If that returns
allowed, the simulator evaluates the key only for its own service. - If it's still denied, the simulator is ignoring credential-injected keys entirely.
Either result is useful to include when you send AWS your request IDs.
Validating the policy without removing the guard
Since the simulator can't test this key, test it live with throwaway resources:
- Positive case: a test function using the role reads the test object, and the read succeeds.
- Negative case, key absent: assume the same role outside Lambda and attempt the same read. It should get AccessDenied, and your
DenyMissingSourcestatement should be what denies it. - Negative case, wrong value: a second function using the same role should also be denied.
Use the unqualified function ARN in the policy. Lambda's documentation says ARNs with a version or alias don't match. Before deploying, IAM Access Analyzer ValidatePolicy can check the policy's syntax and key names.
Sources:

We observed a similar result for dynamodb:GetItem in a completed, bounded SimulateCustomPolicy diagnostic. The unconditional allow returned allowed; adding only ArnEquals on lambda:SourceFunctionArn returned implicitDeny, with MissingContextValues empty. The supplied ContextKeyType was string. Offline checks confirmed that the supplied value exactly matched the policy's unqualified function ARN, with no alias, version, whitespace or non-ASCII characters.
Separate condition-isolation cases for DynamoDB LeadingKeys, Null on LeadingKeys, and DateLessThan each returned allowed. These are existing results, not new tests. No live function invocation was used to establish effective access. We have not performed the Null-on-SourceFunctionArn test described in this thread.
Can AWS confirm whether SimulateCustomPolicy accepts supplied lambda:SourceFunctionArn context when evaluating DynamoDB actions, or whether this credential-derived key has a simulator limitation? Is there a documented validation route that preserves the exact source-function restriction without deploying permissions or invoking a function? We are retaining the restriction and treating effective access as unverified. We can share only anonymized details publicly; no account identifiers or raw captures are included here.