Ruling R8. ECS authorizes ecs:DeregisterTaskDefinition against * only, with no tag condition (verified live), so the workspace tier's RetireOwnTaskDefinitions could never match, and allowing it on * would let any user deregister any revision in the account. DeleteTaskDefinitions is resource-level but deletes only INACTIVE revisions, so it goes too. Removing an AWS project now stops the task, schedules the secret and (with discard) deletes the access point, and leaves the task definition revisions registered, saying so in the log: they hold no secret values, cost nothing, and RunOwnTasks still needs the owner tag. aws/README.md tells admins how to deregister them. The policy statement, its checks and owner-scoped rows, the RuntimeApi methods, the fakes, the removal UI copy and the live test's final assertion follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
81 lines
1.8 KiB
JSON
81 lines
1.8 KiB
JSON
{
|
|
"Version": "2012-10-17",
|
|
"Statement": [
|
|
{
|
|
"Sid": "RegisterOwnTaskDefinitions",
|
|
"Effect": "Allow",
|
|
"Action": [
|
|
"ecs:RegisterTaskDefinition"
|
|
],
|
|
"Resource": [
|
|
"arn:aws:ecs:*:*:task-definition/triple-c-*"
|
|
],
|
|
"Condition": {
|
|
"StringEquals": {
|
|
"aws:RequestTag/triple-c:owner": "${aws:userid}"
|
|
},
|
|
"ForAllValues:StringEquals": {
|
|
"aws:TagKeys": [
|
|
"triple-c:owner",
|
|
"triple-c:project",
|
|
"triple-c:environment"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"Sid": "TagOwnTaskDefinitionsAtRegister",
|
|
"Effect": "Allow",
|
|
"Action": [
|
|
"ecs:TagResource"
|
|
],
|
|
"Resource": [
|
|
"arn:aws:ecs:*:*:task-definition/triple-c-*"
|
|
],
|
|
"Condition": {
|
|
"StringEquals": {
|
|
"ecs:CreateAction": "RegisterTaskDefinition",
|
|
"aws:RequestTag/triple-c:owner": "${aws:userid}"
|
|
},
|
|
"ForAllValues:StringEquals": {
|
|
"aws:TagKeys": [
|
|
"triple-c:owner",
|
|
"triple-c:project",
|
|
"triple-c:environment"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"Sid": "ReadOwnSecrets",
|
|
"Effect": "Allow",
|
|
"Action": [
|
|
"secretsmanager:GetSecretValue"
|
|
],
|
|
"Resource": [
|
|
"arn:aws:secretsmanager:*:*:secret:triple-c/*"
|
|
],
|
|
"Condition": {
|
|
"StringEquals": {
|
|
"aws:ResourceTag/triple-c:owner": "${aws:userid}"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"Sid": "NeverReadEnvironmentSecrets",
|
|
"Effect": "Deny",
|
|
"Action": [
|
|
"secretsmanager:GetSecretValue"
|
|
],
|
|
"Resource": [
|
|
"arn:aws:secretsmanager:*:*:secret:triple-c/*"
|
|
],
|
|
"Condition": {
|
|
"Null": {
|
|
"aws:ResourceTag/triple-c:component": "false"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|