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
iam.SimulatePrincipalPolicy returns implicitDeny for actions that should be allowed when the policy condition uses ecs:ResourceTag/* context keys supplied via ContextEntries. The same policies enforce correctly when using LocalStack's IAM enforcement mode (ENFORCE_IAM=1) at runtime.
Environment
LocalStack Pro, latest tag
Triggered via CI using compose.ci.yml (Docker executor)
ENFORCE_IAM=1 is not set for simulation tests (using the simulate_principal_policy API directly)
Reproduction
Case 1: ABAC policy with ${aws:PrincipalTag/username}
When ContextEntries supplies ecs:ResourceTag/<key> values, simulate_principal_policy should evaluate ecs:ResourceTag/* conditions against those values, the same way it handles aws:PrincipalTag/* and other global condition keys. Real AWS IAM Policy Simulator handles this correctly.
Impact
This prevents testing ABAC policies that use ecs:ResourceTag/* conditions — a common pattern for ECS task isolation and timeout enforcement — via simulate_principal_policy. We are forced to skip these simulation-based tests and fall back to structural (policy document) tests only.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
iam.SimulatePrincipalPolicyreturnsimplicitDenyfor actions that should beallowedwhen the policy condition usesecs:ResourceTag/*context keys supplied viaContextEntries. The same policies enforce correctly when using LocalStack's IAM enforcement mode (ENFORCE_IAM=1) at runtime.Environment
compose.ci.yml(Docker executor)ENFORCE_IAM=1is not set for simulation tests (using thesimulate_principal_policyAPI directly)Reproduction
Case 1: ABAC policy with
${aws:PrincipalTag/username}{ "Version": "2012-10-17", "Statement": [{ "Sid": "ExecuteCommandOnOwnedTasks", "Effect": "Allow", "Action": ["ecs:ExecuteCommand"], "Resource": "*", "Condition": { "StringEquals": { "ecs:ResourceTag/username": "${aws:PrincipalTag/username}" } } }] }Case 2: Reaper policy with
ForAnyValue:StringLikeon deadline tag{ "Sid": "StopExpiredTasks", "Effect": "Allow", "Action": "ecs:StopTask", "Resource": "arn:aws:ecs:us-east-1:123456789012:task/test-cluster/*", "Condition": { "ForAnyValue:StringLike": { "ecs:ResourceTag/deadline": "*" } } }Expected Behavior
When
ContextEntriessuppliesecs:ResourceTag/<key>values,simulate_principal_policyshould evaluateecs:ResourceTag/*conditions against those values, the same way it handlesaws:PrincipalTag/*and other global condition keys. Real AWS IAM Policy Simulator handles this correctly.Impact
This prevents testing ABAC policies that use
ecs:ResourceTag/*conditions — a common pattern for ECS task isolation and timeout enforcement — viasimulate_principal_policy. We are forced to skip these simulation-based tests and fall back to structural (policy document) tests only.See: openshift-online/rosa-boundary#27
Related
Beta Was this translation helpful? Give feedback.
All reactions