You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Policy variables in condition values: Version 2008-10-17 and the escapes #534
Two policy variable rules in condition values differ from IAM. Both are in expand_policy_variables in crates/auth/src/policy/condition.rs on main.
A condition value in a 2008-10-17 document, or one with no Version, is expanded. IAM treats a variable there as literal text. evaluate_statement_conditions has no access to the document's Version, so the expansion runs for every document.
${*}, ${?} and ${$} in a condition value are left as the four-character text. IAM expands them to *, ? and $.
Measured with aws iam simulate-custom-policy on 2026-10-24, action dynamodb:GetItem, Allow dynamodb:* on * beside the statement under test, resource arn:aws:dynamodb:us-east-1:123456789012:table/blue:
Statement
Context
IAM
ExtendDB
Version2008-10-17, Deny on * if StringEquals aws:ResourceTag/owner: ${aws:username}
aws:username=alice, aws:ResourceTag/owner=alice
allowed
explicitDeny
same with Version2012-10-17
same
explicitDeny
explicitDeny
Version2012-10-17, Deny on * if StringEquals aws:PrincipalTag/team: ${*}
aws:PrincipalTag/team=*
explicitDeny
allowed
Fix: pass whether the document expands policy variables into the condition evaluation, and expand the escapes in condition values. For the escapes, a StringLike or ArnLike value that holds ${*} needs the escaped character to stay literal where a written * is a wildcard, so the comparison has to take the expanded value with its wildcard positions marked rather than a plain string.
Activity
docs(design): describe policy variables in Resource as implemented
fix(auth): expand policy variables in condition values only for 2012-…
test(auth): match #535's tests and docs to the condition-value rules
docs(design): describe policy variables in Resource as implemented
fix(auth): expand policy variables in condition values only for 2012-…
test(auth): match #535's tests and docs to the condition-value rules
fix(auth): read the default form in condition values only where IAM r…
Merge origin/main into fix/condition-policy-variables