[Osaka/Yokohama] Looking for infrastructure/server side engineers!

[Osaka/Yokohama] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[Global exclusive service] Beyond's MSP in North America and China

[Global exclusive service] Beyond's MSP in North America and China

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

【AWS IAM】特定のホストゾーンのみ閲覧できるポリシー設定

*ぶたのほし (兵庫尼崎)

こんにちは!
株式会社ビヨンド大阪オフィスのラーメン王、ヒデです。
今回が12回目の投稿です。

前回はサブディレクトリで表示しているWordPressサイトをトップページで表示させる方法について書きました!
変更方法は比較的簡単にできますが、設定箇所を間違えると画面が真っ白になるなど不具合が発生します。
その問題の解決策も紹介しているので気になる人はぜひ、確認してみてくださいね。

 

 

概要

『このホストゾーンのみ閲覧できるユーザーを作りたいけど.....
これってマジでどうやって作んのよ.......』

 

上記のことってありませんでしょうか?
別会社さんに特定ホストゾーンの確認だけしてもらいたいけど、
閲覧のみできる権限調整がわからないなどあると思います。
僕もAWSのリファレンスや他の記事などの情報を元に調べましたが、かなり時間がかかりました。。。
しかし、これを見れば、簡単に権限の設定ができますので、一緒に見ていきましょう!

 

 

設定方法

①Route53>ホストゾーンにある該当のドメイン名のホストゾーンIDをコピー

 

 

 

②IAM>ポリシー>【ポリシーを作成】

 

 

 

③ポリシーの作成>JSONタブ内に記載して【次のステップ:タグ】をクリック

arn:aws:route53:::hostedzone/xxxxxxxxxxxxxxxxxxの部分にホストゾーンIDを入れてください

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "route53:GetHostedZone",
                "route53:ListVPCAssociationAuthorizations",
                "route53:ListResourceRecordSets",
                "route53:GetDNSSEC",
                "route53:ListTagsForResource",
                "route53:GetHostedZoneLimit"
            ],
            "Resource": [
                "arn:aws:route53:::hostedzone/xxxxxxxxxxxxxxxxxx"
            ]
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Allow",
            "Action": [
                "route53:ListHostedZones",
                "route53:ListHostedZonesByName",
                "route53:GetHostedZoneCount"
            ],
            "Resource": "*"
        }
    ]
}

 

アクション一覧
アクション名 説明
GetHostedZone Route 53がホストゾーンに割り当てた4つのネームサーバーを含む、指定されたホストゾーンに関する情報を取得する権限を付与する
ListVPCAssociationAuthorizations 他のアカウントによって作成され、指定されたホストゾーンに関連付けることができるVPCのリストを取得する権限を付与します
ListResourceRecordSets 指定されたホストゾーン内のレコードを一覧表示する権限を付与します
GetDNSSEC 特定のホストゾーンのDNSSECに関する情報(ホストゾーンの鍵署名鍵を含む)を取得する権限を付与する
ListTagsForResource 1つのヘルスチェックまたはホストされたゾーンのタグを一覧表示する権限を付与します
GetHostedZoneLimit 指定されたホストゾーンの指定された制限値を取得する権限を付与する
ListHostedZones 現在のAWSアカウントに関連するパブリックおよびプライベートホストゾーンのリストを取得する権限を付与します。
ListHostedZonesByName ホストされているゾーンのリストを辞書順に取得する許可を与えます。ホストされたゾーンは、ラベルを逆にした名前でソートされます(例: com.example.www
GetHostedZoneCount 現在のAWSアカウントに関連するホストされたゾーンの数を取得する権限を付与します。

 

Resource types一覧
Resource type名 説明
hostedzone ホストゾーンIDを指定してアクションに制限を持たせることができます

 

 

 

 

④以下を指定して【次のステップ:確認】をクリック

キー:Name

ポリシー:*お好きな名前を指定してください

 

 

 

⑤ポリシーの確認で以下を指定して【ポリシーの作成】をクリック

名前:*お好きな名前を指定してください

 

 

 

 

⑥作成したポリシーをユーザーにアタッチ

 

 

 

⑦ログインして動作確認

*ヘルスチェックなどのホストゾーン以外を確認しようとすると以下エラーになります

 

 

*ホストゾーン一覧で権限の仕様上、他のホストゾーンの一覧だけ見れてしまいますが、中身を確認しようとすると以下エラーになります

ホストゾーン一覧画面

 

エラー画面

 

 

*レコードを作成・削除・編集しようとすると以下のエラーになります

 

 

 

まとめ

いかがでしたでしょうか?
ポリシーの設定はとても細かく権限の設定ができる分、公式リファレンス見てもわからないことが多いと思います。
僕もわかりにくくてとても苦戦しました。。。。

でも、この手順を利用すれば、簡単に特定のホストゾーンが閲覧できるポリシーが作成できるので、
もし、必要になりましたら、見てみてくださいね!
それでは、ご覧頂きありがとうございました!

この記事がお役に立てば【 いいね 】のご協力をお願いいたします!
3
読み込み中...
3 票, 平均: 1.00 / 13
1,216
X facebook はてなブックマーク pocket
[2024.6.30 CentOS support ended] CentOS server migration solution

[2024.6.30 CentOS support ended] CentOS server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

The person who wrote this article

About the author

Hide@Infrastructure Engineer

It all started with a very interesting interview.
A mid-career employee of the System Solutions Department in Osaka.My
job is to build and operate servers and clouds!
I have the qualifications of LPIC1, AWS SAA, and OCI Architect Associate.

Actually, I love ramen and
have investigated over 100 stores in Osaka (。-∀-) I'm striving to become the Ramen King of Nibi Beyond
!

I'm also on Twitter, so please follow me (´∇`)
Click on the Twitter mark on the right corner! !