AWS OrganizationsのSecurity Hubポリシーを有効化してみた
Security Hubポリシーの概要
Security HubポリシーとはAWS Organizationsの管理ポリシーの一種で、組織内のAWSアカウントの(AWS Security Hub CSPMではなく[1])AWS Security Hubをどのリージョンで有効化または無効化するか制御するポリシーです。
2025年6月にAWS公式ドキュメントに追加された比較的新しいポリシータイプです。
Security Hubポリシーを有効化してみた(誤設定編)
今回検証するAWS Organizationsの組織は以下のような構造です。

また、OU直下のメンバーアカウントのAWS Security Hubは大阪リージョンのみ有効化しています。

この状態でSecurity Hubポリシーを利用し、OU直下のメンバーアカウントのAWS Security Hubを東京リージョンのみ有効化(東京リージョン以外は無効化)することを目標とします。
まず、管理アカウントにてSecurity Hubの信頼されたアクセスを有効にします。

AWS Security Hubの画面から信頼されたアクセスを有効にすることが推奨されていますが、今回は管理アカウントのAWS Security Hubを有効化したくないので、このままAWS Organizationsの画面から有効化します。

次に、Security Hubポリシーを有効化します。

そして、ルートに以下のSecurity Hubポリシーをアタッチします。
{
"securityhub": {
"enable_in_regions": {
"@@assign": [],
"@@operators_allowed_for_child_policies": ["@@append"]
},
"disable_in_regions": {
"@@assign": ["ALL_SUPPORTED"],
"@@operators_allowed_for_child_policies": ["@@remove"]
}
}
}
Security Hubポリシーではenable_in_regionsフィールドとdisable_in_regionsフィールドが必須です。
enable_in_regionsフィールドではSecurity Hubを有効化したいリージョンを、disable_in_regionsフィールドでは無効化したいリージョンを指定します。
全てのリージョンを指定する場合はALL_SUPPORTED、1つも指定しない場合は空とします。
上記のSecurity Hubポリシーは
- 子OU・子AWSアカウントにアタッチされたSecurity Hubポリシーによる有効化リージョンの追加のみ許可する
- 全てのリージョンでAWS Security Hubを無効化する
- 子OU・子AWSアカウントにアタッチされたSecurity Hubポリシーによる無効化リージョンの削除のみ許可する
という意味です。
なぜこのように書いたのかは後ほど説明します。
OUに以下のSecurity Hubポリシーをアタッチします。
{
"securityhub": {
"enable_in_regions": {
"@@append": ["ap-northeast-1"],
"@@operators_allowed_for_child_policies": ["@@none"]
},
"disable_in_regions": {
"@@remove": ["ap-northeast-1"],
"@@operators_allowed_for_child_policies": ["@@none"]
}
}
}
ルートにアタッチしたSecurity Hubポリシーも考慮すると、このポリシーは
- 東京リージョンでAWS Security Hubを有効化する
- 子OU・子AWSアカウントにアタッチされたSecurity Hubポリシーによる有効化リージョンの追加・削除・変更を禁止する
- 東京リージョン以外の全てのリージョンでAWS Security Hubを無効化する
- 子OU・子AWSアカウントにアタッチされたSecurity Hubポリシーによる無効化リージョンの追加・削除・変更を禁止する
という意味になる…と勘違いしていました。
disable_in_regionsフィールドで東京リージョン以外を列挙する方法では将来追加されるリージョンに柔軟に対応できません。
そのため、親のポリシーで全てのリージョンを指定しておき、子のポリシーで特定のリージョンのみ除外したかったのです。
この状態でOU直下のAWSアカウントのAWS Security Hubを確認してみると、大阪リージョンで無効化されていることが分かります。

そして、東京リージョンは有効化されているはず…でしたが、残念ながら無効化されています。

Security Hubポリシーを有効化してみた(正解編)
AWS公式ドキュメントによると、@@remove演算子の挙動は以下の通りです。
@@remove– Removes the specified inherited settings from the effective policy, if they exist. You can use this operator with only multi-valued settings.This operator removes only the specified values from the array of values inherited from the parent policies. Other values can continue to exist in the array and can be inherited by child policies.
@@remove演算子は親のポリシーから継承した値の配列から指定した値を削除します。
今回はルートにアタッチしたSecurity Hubポリシーから["ALL_SUPPORTED"]を継承しており、この配列にap-northeast-1という要素は含まれないため、結果的に["ALL_SUPPORTED"]をそのまま継承してしまっています。
…というわけで、ルートにアタッチするSecurity Hubポリシーを変更します。
まず、AWS Security Hubのパブリックプレビューが提供されているリージョンの一覧をAWS公式ドキュメントから取得します。
Security Hub supports the following AWS Regions for this public preview release.
- Asia Pacific (Tokyo)
- Asia Pacific (Seoul)
- Asia Pacific (Osaka)
- Asia Pacific (Mumbai)
- Asia Pacific (Singapore)
- Asia Pacific (Sydney)
- Canada (Central)
- Europe (Frankfurt)
- Europe (Stockholm)
- Europe (Ireland)
- US West (N. California)
- US West (Oregon)
- Europe (London)
- Europe (Paris)
- South America (São Paulo)
- US East (N. Virginia)
- US East (Ohio)
The following are opt-in AWS Regions, which require that you enable them before you can access them.
- Africa (Cape Town)
- Asia Pacific (Hong Kong)
- Asia Pacific (Jakarta)
- Europe (Milan)
- Middle East (Bahrain)
次に、ルートにアタッチするSecurity Hubポリシーのdisable_in_regionsフィールドの値をこれらのリージョンのリージョンコードに変更します。
{
"securityhub": {
"enable_in_regions": {
"@@assign": [],
"@@operators_allowed_for_child_policies": ["@@append"]
},
"disable_in_regions": {
"@@assign": [
"ap-northeast-1",
"ap-northeast-2",
"ap-northeast-3",
"ap-south-1",
"ap-southeast-1",
"ap-southeast-2",
"ca-central-1",
"eu-central-1",
"eu-north-1",
"eu-west-1",
"us-west-1",
"us-west-2",
"eu-west-2",
"eu-west-3",
"sa-east-1",
"us-east-1",
"us-east-2",
"af-south-1",
"ap-east-1",
"ap-southeast-3",
"eu-south-1",
"me-south-1"
],
"@@operators_allowed_for_child_policies": ["@@remove"]
}
}
}
これで東京リージョンにてAWS Security Hubが有効化されました。

Discussion