Skip to content

Commit bbeb062

Browse files
authored
Merge pull request #6 from aws-containers/can-executecommand-should-check-for-task-resource
"Can I ExecuteCommand" check should test on task resource not cluster
2 parents 27ac726 + 9e80eba commit bbeb062

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

check-ecs-exec.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ ecsExecuteCommand="ecs:ExecuteCommand"
235235
ecsExecEvalResult=$(${AWS_CLI_BIN} iam simulate-principal-policy \
236236
--policy-source-arn "${MY_IAM_ARN}" \
237237
--action-names "${ecsExecuteCommand}" \
238-
--resource-arns "arn:aws:ecs:${AWS_REGION}:${ACCOUNT_ID}:cluster/${CLUSTER_NAME}" \
238+
--resource-arns "arn:aws:ecs:${AWS_REGION}:${ACCOUNT_ID}:task/${CLUSTER_NAME}/${TASK_ID}" \
239239
--output json \
240240
| jq -r ".EvaluationResults[0].EvalDecision")
241241
showEvalResult "${ecsExecEvalResult}" "${ecsExecuteCommand}"

0 commit comments

Comments
 (0)