如何检测 violates/contradicts 违反 AWS SCP 策略的 AWS 资源

How can one detect the AWS resources which violates/contradicts with AWS SCP policy violations

AWS Organizations 是一项账户管理服务,可让您将多个 AWS 账户整合到您创建并集中管理的组织中。 AWS Organizations 包括账户管理和整合账单功能,使您能够更好地满足企业的预算、安全和合规性需求。

服务控制策略(SCP) 指定用户和角色可以在 SCP 影响的帐户中使用的服务和操作的策略。 SCP 类似于 IAM 权限策略,只是它们不授予任何权限。相反,SCP 指定组织、组织单位 (OU) 或帐户的最大权限。当您将 SCP 附加到组织根目录或 OU 时,SCP 会限制成员账户中实体的权限。

问题是“是否有任何机制可以让我们找到与 SCP 强制执行冲突的所有资源(IAM 策略)?”

我没有找到检测这些资源的方法。

但无论如何,如果帐户用户或角色拥有的权限超过 SCP 允许的权限,则 SCP 策略优先,user/role 将无法执行该操作(例如,具有管理员权限的用户和SCP 阻止了某个区域,尽管他具有管理员访问权限,但用户将无法管理该区域的资源。

来自docs

An SCP restricts permissions for IAM users and roles in member accounts, including the member account's root user. Any account has only those permissions permitted by every parent above it. If a permission is blocked at any level above the account, either implicitly (by not being included in an Allow policy statement) or explicitly (by being included in a Deny policy statement), a user or role in the affected account can't use that permission, even if the account administrator attaches the AdministratorAccess IAM policy to the user.