SCP(Service Control Policy)
SCPとは
SCPは権限を付与するものではなく、組織/OU/アカウント単位で「許可される操作の上限」を設定するガードレール
出典: [Service control policies (SCPs) - AWS Organizations](https://docs.aws.amazon.com/organizations/latest/ userguide/orgs_manage_policies_scps.html)
SCPs do not grant permissions to the IAM users and IAM roles in your organization. No permissions are granted by an SCP. An SCP defines a permission guardrail, or sets limits, on the actions that the IAM users and IAM roles in your organization can perform.
SCPの適用範囲
管理アカウントには影響しない
SCPは管理アカウントのユーザーやロールには影響しない
出典: [Service control policies (SCPs) - AWS Organizations](https://docs.aws.amazon.com/organizations/latest/ userguide/orgs_manage_policies_scps.html)
SCPs don’t affect users or roles in the management account. They affect only the member accounts in your organization.
メンバーアカウント全体に適用される
SCPはアカウント内の全ユーザー・ロール(rootユーザー含む)に一律で適用される。特定のユーザーやグループだけを対象 にすることはできない
出典: [Service control policies (SCPs) - AWS Organizations](https://docs.aws.amazon.com/organizations/latest/ userguide/orgs_manage_policies_scps.html)
SCPs affect all users and roles in attached accounts, including the root user.
SCPでPrincipal/NotPrincipalは使用できない
SCPではPrincipal要素とNotPrincipal要素はサポートされていない。つまり、特定のユーザーやロールを直接指定すること はできない
出典: [SCP syntax - AWS Organizations](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_ policies_scps_syntax.html)
The following elements aren’t supported in SCPs: NotPrincipal, Principal
例
{
"Effect": "Allow",
"Principal": {"AWS": "arn:aws:iam::123456789012:user/tanaka"},
"Action": "s3:*",
"Resource": "*"
}上記をSCPとして作成しようとすると、以下のエラーが発生する:
Invalid Policy Element: ポリシー要素 Principal が有効ではありません。
IAMポリシーとの違い
| 観点 | SCP | IAMポリシー |
|---|---|---|
| 適用対象 | 組織/OU/アカウント | ユーザー/グループ/ロール |
| 権限付与 | しない(上限を設定) | する |
| 役割 | ガードレール | アクセス制御 |
| 管理アカウントへの影響 | なし | あり |
| Principal要素 | 使用不可 | 使用可 |