Files
Triple-C/aws/policies/workspace-user.json
T
shadowdaoandClaude Opus 5.5 1eed994da7 fix(aws): tag access points at create against their file system
EFS authorizes the elasticfilesystem:TagResource that a tagged
CreateAccessPoint needs against the parent file system's ARN, not the new
access point's: a workspace user's first Hybrid start was denied
("not authorized to perform: elasticfilesystem:TagResource on the
specified resource"). Verified live with a probe role: access-point/*
is denied; file-system/* is allowed, as is * with each of
elasticfilesystem:CreateAction, aws:RequestTag and aws:TagKeys.

TagOwnAccessPointsAtCreate now names file-system/* with the same
conditions (CreateAction = CreateAccessPoint, owner request tag, the
three tag keys); its check and owner-scoped test follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 10:46:59 -08:00

405 lines
9.2 KiB
JSON

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "RunOwnTasks",
"Effect": "Allow",
"Action": [
"ecs:RunTask"
],
"Resource": [
"arn:aws:ecs:*:*:task-definition/triple-c-*"
],
"Condition": {
"StringEquals": {
"aws:RequestTag/triple-c:owner": "${aws:userid}",
"aws:ResourceTag/triple-c:owner": "${aws:userid}"
},
"ArnLike": {
"ecs:cluster": "arn:aws:ecs:*:*:cluster/triple-c-*"
},
"ForAllValues:StringEquals": {
"aws:TagKeys": [
"triple-c:owner",
"triple-c:project",
"triple-c:environment"
]
}
}
},
{
"Sid": "TagOwnTasksAtRunTask",
"Effect": "Allow",
"Action": [
"ecs:TagResource"
],
"Resource": [
"arn:aws:ecs:*:*:task/triple-c-*/*"
],
"Condition": {
"StringEquals": {
"ecs:CreateAction": "RunTask",
"aws:RequestTag/triple-c:owner": "${aws:userid}"
},
"ForAllValues:StringEquals": {
"aws:TagKeys": [
"triple-c:owner",
"triple-c:project",
"triple-c:environment"
]
}
}
},
{
"Sid": "PassOwnTaskRoles",
"Effect": "Allow",
"Action": [
"iam:PassRole"
],
"Resource": [
"arn:aws:iam::*:role/triple-c-*"
],
"Condition": {
"StringEquals": {
"iam:ResourceTag/triple-c:owner": "${aws:userid}",
"iam:PassedToService": "ecs-tasks.amazonaws.com"
}
}
},
{
"Sid": "StopAndExecOwnTasks",
"Effect": "Allow",
"Action": [
"ecs:StopTask",
"ecs:ExecuteCommand"
],
"Resource": [
"arn:aws:ecs:*:*:task/triple-c-*/*"
],
"Condition": {
"StringEquals": {
"aws:ResourceTag/triple-c:owner": "${aws:userid}"
}
}
},
{
"Sid": "ExecOnTripleCClusters",
"Effect": "Allow",
"Action": [
"ecs:ExecuteCommand"
],
"Resource": [
"arn:aws:ecs:*:*:cluster/triple-c-*"
]
},
{
"Sid": "StartSessionsToOwnTasks",
"Effect": "Allow",
"Action": [
"ssm:StartSession"
],
"Resource": [
"arn:aws:ecs:*:*:task/triple-c-*/*"
],
"Condition": {
"StringEquals": {
"aws:ResourceTag/triple-c:owner": "${aws:userid}"
}
}
},
{
"Sid": "UsePortForwardingDocument",
"Effect": "Allow",
"Action": [
"ssm:StartSession"
],
"Resource": [
"arn:aws:ssm:*::document/AWS-StartPortForwardingSession"
]
},
{
"Sid": "UseEndOrResumeOwnSessions",
"Effect": "Allow",
"Action": [
"ssm:TerminateSession",
"ssm:ResumeSession",
"ssmmessages:OpenDataChannel"
],
"Resource": [
"arn:aws:ssm:*:*:session/*"
],
"Condition": {
"StringLike": {
"ssm:resourceTag/aws:ssmmessages:session-id": "${aws:userid}"
}
}
},
{
"Sid": "CreateOwnSecrets",
"Effect": "Allow",
"Action": [
"secretsmanager:CreateSecret"
],
"Resource": [
"arn:aws:secretsmanager:*:*:secret:triple-c/*"
],
"Condition": {
"StringEquals": {
"aws:RequestTag/triple-c:owner": "${aws:userid}"
},
"ForAllValues:StringEquals": {
"aws:TagKeys": [
"triple-c:owner",
"triple-c:project",
"triple-c:environment"
]
},
"ArnLike": {
"secretsmanager:KmsKeyId": "arn:aws:kms:*:*:key/*"
}
}
},
{
"Sid": "TagOwnSecrets",
"Effect": "Allow",
"Action": [
"secretsmanager:TagResource"
],
"Resource": [
"arn:aws:secretsmanager:*:*:secret:triple-c/*"
],
"Condition": {
"StringEquals": {
"aws:RequestTag/triple-c:owner": "${aws:userid}"
},
"StringEqualsIfExists": {
"aws:ResourceTag/triple-c:owner": "${aws:userid}"
},
"Null": {
"aws:ResourceTag/triple-c:component": "true"
},
"ForAllValues:StringEquals": {
"aws:TagKeys": [
"triple-c:owner",
"triple-c:project",
"triple-c:environment"
]
}
}
},
{
"Sid": "ManageOwnSecrets",
"Effect": "Allow",
"Action": [
"secretsmanager:PutSecretValue",
"secretsmanager:DeleteSecret"
],
"Resource": [
"arn:aws:secretsmanager:*:*:secret:triple-c/*"
],
"Condition": {
"StringEquals": {
"aws:ResourceTag/triple-c:owner": "${aws:userid}"
}
}
},
{
"Sid": "NeverTouchEnvironmentSecrets",
"Effect": "Deny",
"Action": [
"secretsmanager:TagResource",
"secretsmanager:UntagResource",
"secretsmanager:PutSecretValue",
"secretsmanager:DeleteSecret"
],
"Resource": [
"arn:aws:secretsmanager:*:*:secret:triple-c/*"
],
"Condition": {
"Null": {
"aws:ResourceTag/triple-c:component": "false"
}
}
},
{
"Sid": "CreateOwnAccessPoints",
"Effect": "Allow",
"Action": [
"elasticfilesystem:CreateAccessPoint"
],
"Resource": [
"arn:aws:elasticfilesystem:*:*:file-system/*"
],
"Condition": {
"StringEquals": {
"aws:RequestTag/triple-c:owner": "${aws:userid}",
"aws:ResourceTag/triple-c:owner": "${aws:userid}"
},
"Null": {
"aws:ResourceTag/triple-c:component": "false"
},
"ForAllValues:StringEquals": {
"aws:TagKeys": [
"triple-c:owner",
"triple-c:project",
"triple-c:environment"
]
}
}
},
{
"Sid": "TagOwnAccessPointsAtCreate",
"Effect": "Allow",
"Action": [
"elasticfilesystem:TagResource"
],
"Resource": [
"arn:aws:elasticfilesystem:*:*:file-system/*"
],
"Condition": {
"StringEquals": {
"elasticfilesystem:CreateAction": "CreateAccessPoint",
"aws:RequestTag/triple-c:owner": "${aws:userid}"
},
"ForAllValues:StringEquals": {
"aws:TagKeys": [
"triple-c:owner",
"triple-c:project",
"triple-c:environment"
]
}
}
},
{
"Sid": "DeleteOwnAccessPoints",
"Effect": "Allow",
"Action": [
"elasticfilesystem:DeleteAccessPoint"
],
"Resource": [
"arn:aws:elasticfilesystem:*:*:access-point/*"
],
"Condition": {
"StringEquals": {
"aws:ResourceTag/triple-c:owner": "${aws:userid}"
}
}
},
{
"Sid": "EncryptThroughSecretsManagerWithEnvironmentKeysOnly",
"Effect": "Allow",
"Action": [
"kms:Encrypt",
"kms:GenerateDataKey",
"kms:Decrypt"
],
"Resource": [
"arn:aws:kms:*:*:key/*"
],
"Condition": {
"StringLike": {
"kms:ViaService": "secretsmanager.*.amazonaws.com"
},
"Null": {
"aws:ResourceTag/triple-c:component": "false"
}
}
},
{
"Sid": "NeverEncryptSecretsWithOtherKeys",
"Effect": "Deny",
"Action": [
"kms:Encrypt",
"kms:GenerateDataKey*"
],
"Resource": [
"arn:aws:kms:*:*:key/*"
],
"Condition": {
"StringLike": {
"kms:ViaService": "secretsmanager.*.amazonaws.com"
},
"Null": {
"aws:ResourceTag/triple-c:component": "true"
}
}
},
{
"Sid": "ReadEcs",
"Effect": "Allow",
"Action": [
"ecs:Describe*",
"ecs:List*"
],
"Resource": [
"*"
]
},
{
"Sid": "ReadEnvironmentParameters",
"Effect": "Allow",
"Action": [
"ssm:GetParameter*"
],
"Resource": [
"arn:aws:ssm:*:*:parameter/triple-c/*"
]
},
{
"Sid": "ListSecrets",
"Effect": "Allow",
"Action": [
"secretsmanager:ListSecrets"
],
"Resource": [
"*"
]
},
{
"Sid": "ReadFileSystems",
"Effect": "Allow",
"Action": [
"elasticfilesystem:Describe*"
],
"Resource": [
"*"
]
},
{
"Sid": "ReadLogs",
"Effect": "Allow",
"Action": [
"logs:GetLogEvents",
"logs:FilterLogEvents"
],
"Resource": [
"arn:aws:logs:*:*:log-group:/triple-c/*"
]
},
{
"Sid": "InspectOwnPrincipal",
"Effect": "Allow",
"Action": [
"iam:GetRole",
"iam:SimulatePrincipalPolicy"
],
"Resource": [
"arn:aws:iam::*:role/aws-reserved/sso.amazonaws.com/*",
"arn:aws:iam::*:role/triple-c-*",
"arn:aws:iam::*:user/${aws:username}",
"arn:aws:iam::*:user/*/${aws:username}"
]
},
{
"Sid": "WhoAmI",
"Effect": "Allow",
"Action": [
"sts:GetCallerIdentity"
],
"Resource": [
"*"
]
}
]
}