ENGINEER BLOG

ENGINEER BLOG

AWS Directory Service(Microsoft AD)を試す

こんにちは。プラットフォームサービスの野口です。

directory_service_logo_1

今回はAWS Directory Service(Microsoft AD)の構築+αを試してみます。

0.はじめに

詳細は下記を見ていただくとして:
AWS Directory Service 管理ガイドAWS Directory Service 製品の詳細

AWS Microsoft AD(以降は"MSAD"と表記)とActive Directoryドメインサービスは、利用する場合の目的が異なります。
下記の二種類を簡単に比較します。

  1. MSADを導入
  2. EC2でWindowsServerを構築し、Active Directoryドメインサービスを導入

1はマネージド型サービスであり、Active Directoryの利用そのものが目的ではありません。
主な特徴を下記に挙げます。

  • 機能レベルとフォレストレベルはWindows Server2012 R2。
  • ドメインコントローラーはVPC内に冗長構成で配置される。
    2台未満にはできませんが増やすことは可能。
  • 自動で作成されるAdminユーザーは管理者権限を持っていない。
    (管理者権限を持ったアカウントが存在すると、それに対する管理が発生してしまうことを避けるため)

上位のことを実現するため、土台に時間をかけたくない場合は有用です。
例えば、「workspacesやWorkDocsなどのawsサービスの利用などを行いたいが、Active Directoryを構築、管理etcすることが面倒」というケースにおいては、利用価値があります。

対して、2はユーザーの管理やGPOの管理など、Active Directoryの利用そのものが目的です。

1.構築

1-1.構築

マネジメントコンソールのDirectory Serviceを選択し、実際に構築してみます。

1

これです。

2_org

迷いそうな項目は無いようです。1ステップで完了します。

3_org

そこそこ時間がかかります。 (ほぼ25分かかりました)

6_org

できました。サマリーです。
停止はできないようです。

5

スナップショットも自動で取得されます。
自動スナップショットの時間指定はできない、スナップショットの作成タイミングの時間までは分からない点は注意が必要です。
なお、手動スナップショットは1時間ほどかかります。

また、スナップショット作成中は下記の操作ができません。

  • ドメインコントローラの追加または削除
  • スキーマ拡張
  • MFA設定の更新
  • IPルーティング変更

また、こちらのページにもありますが、

Microsoft AD ディレクトリの場合は、2~3 時間かかることがあります。

リストアはかなりの時間がかかります。

1-2.ドメイン参加

MSADと同VPC内に作成したEC2のWindowsServerからドメインに参加してみます。
まずは、MSADのDNSをサマリーから確認し、サーバのDNSアドレスを変更します。

その後、ドメインへの参加を行います。

7

ドメイン参加のユーザー名とパスワードが求められました。
ユーザー名はadmin、パスワードはMSADを構築した際のパスワードを入力します。

8

参加できました。
以降は管理ツールで色々と見てみます。

2.いろいろお試し

2-1.フォレストの機能レベル、ドメインの機能レベル、ドメインサーバ名の確認

確認していきます。

40

フォレストの機能レベルです。

41

ドメインの機能レベルです。

14

ドメインサーバ名です。冗長化されています。

2-2.ドメインユーザーの操作

2-2-1.Adminユーザーの権限とDomain Adminsへの所属について

ドメインユーザーを操作してみます。

10

ユーザーとコンピューターの管理コンソール上では、OU構成はこのようになっていました。
自動でAdminユーザーが作成されていることが分かります。

Adminユーザーをもう少し見てみましょう。
Adminなので全ての操作が可能なように思えますが…

12

初期所属グループは"AWS Delegated Administrators"と"Domain Users"のみです。
試しにグループ:"Domain Admins"に参加できるか試してみます。

13

案の定権限が無く、所属できませんでした。
管理者アカウント権限についての詳細はこちら

2-2-2.ドメイン参加権限があるグループとAWS Delegated~グループについて

次にドメイン参加権限があるグループについて確認してみます。
適当なテスト用のドメインユーザーを作成した上で、
テスト用端末がこのドメインユーザーアカウントを利用してドメインに参加できるか試したところ、参加することができました。

作成したドメインユーザーはデフォルトで"Domain Users"グループに所属しています。
そして、"Domain Users"グループは、"AWS Delegated Add Workstation To Domain Users"と"Users"グループに所属しています。
"AWS Delegated Add Workstation To Domain Users”グループはドメイン参加権限があるため、ドメイン参加ができました。
※但し、後述するAWS Delegated~グループ一覧にもある通り、"AWS Delegated Add Workstation To Domain Users”グループのドメイン参加権限は10台のコンピュータ限定と記載されています。
永続的にドメイン参加権限を付与したい場合は、より強い権限を持ったグループの利用が適切かと思われます。

なお、ドメイン参加端末へのリモートデスクトップ接続ですが、"AWS Delegated Administrators"グループに所属させれば可能となりました。(他のグループでも可能だと思われますが、割愛します)

参考までにデフォルトで作成されている委任グループ(AWS Delegated~)の一覧を、以下に記載します。

グループ名 説明
AWS Delegated Account Operators AWS Provided Group: Members of this highly privileged security group are provided limited account management capability; password resets, unlocks etc.
AWS Delegated Add Workstations To Domain Users AWS Provided Group: Members of this privileged security group are provided the ability to domain join 10 computers (This is the Microsoft default limit)
AWS Delegated Administrators AWS Provided Group: Members of this highly privileged security group are provided the ability to manage AWS Managed Active Directory. Members of this group have FULL CONTROL of all sub-objects in the nct-test OU and group management rights to groups in AWS Delegated Groups OU
AWS Delegated Distributed File System Administrators AWS Provided Group: Members of this highly privileged security group are provided the ability to add/remove FRS, DFS-R, and DFS name spaces
AWS Delegated Domain Name System Administrators AWS Provided Group: Members of this highly privileged security group are provided the ability to manage AD integrated DNS
AWS Delegated Dynamic Host Configuration Protocol Administrators AWS Provided Group: Members of this highly privileged security group are provided the ability to authorize Windows DHCP servers in the enterprise
AWS Delegated Enterprise Certificate Authority Administrators AWS Provided Group: Members of this highly privileged security group are provided the ability to deploy and manage Microsoft Enterprise Certificate Authority infrastructure
AWS Delegated Fine Grained Password Policy Administrators AWS Provided Group: Members of this highly privileged security group are provided the ability to modify pre-created Fined Grained Password Policies
AWS Delegated Group Policy Administrators AWS Provided Group: Members of this highly privileged security group are provided the ability to perform Group Policy Management tasks (create/edit/delete/link)
AWS Delegated Kerberos Delegation Administrators AWS Provided Group: Members of this highly privileged security group are provided the ability to enable delgation on Computer and User Account Objects
AWS Delegated Managed Service Account Administrators AWS Provided Group: Members of this highly privileged security group are provided the ability to create and delete Managed Service Accounts
AWS Delegated Remote Access Service Administrators AWS Provided Group: Members of this highly privileged security group are provided the ability to add/remove RAS servers from the RAS and IAS Servers group
AWS Delegated Replicate Directory Changes Administrators AWS Provided Group: Members of this highly privileged security group are provided the ability to synchronize profile information in Active Directory with SharePoint Server
AWS Delegated Server Administrators AWS Provided Group: Members of this highly privileged security group are included in the local administrators group on all domain joined computers
AWS Delegated Sites and Services Administrators AWS Provided Group: Members of this highly privileged security group are provided the ability to rename the Default-First-Site-Name object in Active Directory Sites and Services
AWS Delegated Terminal Server Licensing Administrators AWS Provided Group: Members of this highly privileged security group are provided the ability to add/remove Terminal Server License servers from the Terminal Server License Servers group
AWS Delegated User Principal Name Suffix Administrators AWS Provided Group: Members of this highly privileged security group are provided the ability to add and remove User Principal Name Suffixes

2-3.グループポリシーの操作

続いてグループポリシーの操作を行いましたが、使えはする…といった感じです。

42

試しに、コマンドプロンプトへのアクセス禁止のポリシーを作成し、適用してみます。

43

できました。

使えはする…とした理由は下記です。

ドメインにおけるOUツリーの"Computer","Users"以外のOUに対して、ポリシーの制御を行うことはできません。
つまり、Default Domain Policyに対する変更もできないため、ドメインアカウントのパスワードポリシーなどは変更することができません。
ここらへんの制約はMSADでは厳しい部分がありますね。

2-4.DNSの操作

DNSの操作については、特に制約無く操作できそうです。
しかし、操作タブを選択した際などに砂時計状態になってしまうため、高いストレスが生じます。

44

3.おわりに

"EC2でWindowsServerを構築し、Active Directoryドメインサービスを導入したケース"とは目的が異なるため色々と制約はあります。
クライアントを管理するといった目的でMSADを導入する場合、Active Directoryの肝ともいえるGPO周りの制約が厳しいですね。
クライアント管理を目的とするならば、EC2でWindowsServerを構築し、Active Directoryドメインサービスを導入した方がよさそうです。
ただ、自動でペアで作成されることや自動スナップショット機能など、便利な部分もあるため、目的に合致すれば良いサービスかと思います。