本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
亚马逊 AppStream 2.0 跨服务混乱副手防范
混淆代理问题是一个安全性问题,即不具有操作执行权限的实体迫使具有更高权限的实体执行该操作。中AWS,跨服务模拟可能会使账户资源容易受到混淆代理问题的影响。当一项服务时,就会发生跨服务模拟(调用服务) 调用另一个服务(调用的服务)。调用服务可以操纵调用服务以使用其权限对客户的资源进行操作,而调用服务无权自行执行。为了防止这种情况,AWS提供可帮助您保护所有服务的服务委托人数据的工具,这些服务委托人有权限访问账户中的资源。
我们建议使用aws:SourceArn
和aws:SourceAccount
资源策略中的全局条件上下文密钥用于限制访问这些资源时的权限。以下指南详细说明了使用这些密钥保护资源时的建议和要求:
-
使用
aws:SourceArn
如果您只希望将一个资源与跨服务访问相关联, -
使用
aws:SourceAccount
如果您想允许指定账户中的任何与跨服务使用相关的资源, -
如果
aws:SourceArn
密钥不包含账户 ID,您必须使用两个全局条件上下文密钥(aws:SourceArn
和aws:SourceAccount
)来限制权限。 -
如果您使用全局条件上下文键和
aws:SourceArn
值包含账户 ID,aws:SourceAccount
在同一政策声明中使用密钥时,必须使用相同的账户 ID。
防止混淆代理问题最有效的方法是使用您想要允许的 Amazon Resource Name (ARN) 的 Amazon Resource Name (ARN) 的 Amazon Resourc 如果您不知道资源的完整 ARN 的完整 ARN 的完整 ARN,请使用aws:SourceArn
带通配符的全局上下文条件密钥(例如*),用于 ARN 的未知部分。如果您想指定多个资源,您还可以在 ARN 中使用通配符。例如,您可以将 ARN 格式化为arn:aws:
.servicename
::region-name
::your
AWS account ID
:*
示例: AppStream 2.0 服务角色混淆代理问题防范
AppStream 2.0 使用各种资源 ARN 代入服务角色,这会导致复杂的条件语句。我们建议使用通配符资源类型以防止出现意外情况 AppStream 2.0 资源故障。
例 aws:SourceAccount
这是有的:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": [ "appstream.amazonaws.com" ] }, "Action": "sts:AssumeRole", "Condition": { "StringEquals": { "aws:SourceAccount": "
your AWS account ID
" } } } ] }
例 aws:SourceArn
这是有的:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": [ "appstream.amazonaws.com" ] }, "Action": "sts:AssumeRole", "Condition": { "ArnLike": { "aws:SourceArn": "arn:{aws partition}:appstream:{
your region name
}:{your AWS account ID
}:*" } } } ] }
示例: AppStream 2.0 舰队机器角色混淆代理问题防范
例 aws:SourceAccount
这是有的:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": [ "appstream.amazonaws.com" ] }, "Action": "sts:AssumeRole", "Condition": { "StringEquals": { "aws:SourceAccount": "
your AWS account ID
" } } } ] }
例 aws:SourceArn
这是有的:
如果您想为多个队列使用一个 IAM 角色,我们建议使用aws:SourceArn
带通配符的全局上下文条件密钥 (*) 以匹配多个 AppStream 2.0 舰队资源。
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": [ "appstream.amazonaws.com" ] }, "Action": "sts:AssumeRole", "Condition": { "ArnLike": { "aws:SourceArn": "arn:{aws partition}:appstream:{
your region name
}:{your AWS account ID
}:fleet/{your fleet name
}" } } } ] }
示例: AppStream 2.0 弹性队列会话脚本 Amazon S3 存储桶策略跨服务混淆了副手防范
例 aws:SourceAccount
这是有的:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": [ "appstream.amazonaws.com" ] }, "Action": "s3:GetObject", "Resource": "
your session script S3 path
", "Condition": { "StringEquals": { "aws:SourceAccount": "your AWS account ID
" } } } ] }
例 aws:SourceArn
这是有的:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": [ "appstream.amazonaws.com" ] }, "Action": "s3:GetObject", "Resource": "
your session script S3 path
", "Condition": { "ArnLike": { "aws:SourceArn": "arn:{aws partition}:appstream:{your region name
}:{your AWS account ID
}:fleet/{your fleet name
}" } } } ] }
示例: AppStream 2.0 应用程序 Amazon S3 存储桶策略跨服务混淆了副手防范
当您将数据存储在 Amazon S3 存储桶中时,该存储桶可能会出现混乱的副手问题。这会使 Elastic 队列、应用程序块、安装脚本、应用程序图标和会话脚本等数据容易受到恶意攻击者的攻击。
为防止出现混淆副手问题,可以指定aws:SourceAccount
Conditionaws:SourceArn
Amazon S3 存储桶策略中的条件ELASTIC-FLEET-EXAMPLE-BUCKET
.
以下资源策略显示了如何通过以下任一方法防止出现混淆的副手问题:
-
这些区域有:
aws:SourceAccount
用你的AWS账户 ID -
全局条件上下文密钥
aws:SourceArn
AppStream 2.0 目前不支持应用程序图标的混淆副手防护。该服务仅支持 VHD 文件和安装脚本。如果您尝试为应用程序图标添加其他条件,则不会向最终用户显示这些图标。
在以下示例中,存储桶策略仅允许 AppStream 2.0 所有者账户中的弹性队列资源可供访问ELASTIC_FLEET_EXAMPLE_BUCKET
.
{ "Version": "2012-10-17", "Statement": [ { "Sid": "ConfusedDeputyPreventionExamplePolicy", "Effect": "Allow", "Principal": { "Service": "appstream.amazonaws.com" }, "Action": "s3:GetObject", "Resource": [ "arn:aws:s3:::
ELASTIC-FLEET-EXAMPLE-BUCKET
/vhd-folder/*", "arn:aws:s3:::ELASTIC-FLEET-EXAMPLE-BUCKET
/scripts/*" ], "Condition": { "StringEquals": { "aws:SourceAccount": "your AWS account ID
" } } }, { "Sid": "AllowRetrievalPermissionsToS3AppIconsForAppStream", "Effect": "Allow", "Principal": { "Service": "appstream.amazonaws.com" }, "Action": "s3:GetObject", "Resource": "arn:aws:s3:::ELASTIC-FLEET-EXAMPLE-BUCKET
/app-icons/*" } ] }
您还可以使用aws:SourceArn
限制特定资源的资源访问的条件。
如果您不知道资源的完整 ARN,或者想要指定多个资源,请使用aws:SourceArn
带通配符的全局上下文条件密钥 (*),用于 ARN 的未知部分。
{ "Version": "2012-10-17", "Statement": [ { "Sid": "ConfusedDeputyPreventionExamplePolicy", "Effect": "Allow", "Principal": { "Service": "appstream.amazonaws.com" }, "Action": "s3:GetObject", "Resource": [ "arn:aws:s3:::
ELASTIC-FLEET-EXAMPLE-BUCKET
/vhd-folder/*", "arn:aws:s3:::ELASTIC-FLEET-EXAMPLE-BUCKET
/scripts/*" ], "Condition": { "ArnLike": { "aws:SourceArn": "arn:{aws-partition}:appstream:{your region name
}:{your AWS account ID
}:app-block/*" } } }, { "Sid": "AllowRetrievalPermissionsToS3AppIconsForAppStream", "Effect": "Allow", "Principal": { "Service": "appstream.amazonaws.com" }, "Action": "s3:GetObject", "Resource": "arn:aws:s3:::ELASTIC-FLEET-EXAMPLE-BUCKET
/app-icons/*" } ] }
您可以使用aws:SourceArn
和aws:SourceAccount
限制特定资源和账户的资源访问权限的条件。
如果您不知道资源的完整 ARN,或者想要指定多个资源,请使用aws:SourceArn
带通配符的全局上下文条件密钥 (*),用于 ARN 的未知部分。
{ "Version": "2012-10-17", "Statement": [ { "Sid": "ConfusedDeputyPreventionExamplePolicy", "Effect": "Allow", "Principal": { "Service": "appstream.amazonaws.com" }, "Action": "s3:GetObject", "Resource": [ "arn:aws:s3:::
ELASTIC-FLEET-EXAMPLE-BUCKET
/vhd-folder/*", "arn:aws:s3:::ELASTIC-FLEET-EXAMPLE-BUCKET
/scripts/*" ], "Condition": { "ArnLike": { "aws:SourceArn": "arn:{aws partition}:appstream:{your region name
}:{your AWS account ID
}:app-block/*" }, "StringEquals": { "aws:SourceAccount": "your AWS account ID
" } } }, { "Sid": "AllowRetrievalPermissionsToS3AppIconsForAppStream", "Effect": "Allow", "Principal": { "Service": "appstream.amazonaws.com" }, "Action": "s3:GetObject", "Resource": "arn:aws:s3:::ELASTIC-FLEET-EXAMPLE-BUCKET
/app-icons/*" } ] }