JAWS-UG CLI #33 LT - AWS Directory ServiceをLDAP Serverとして利用してみた

19
JAWS-UG CLI #33 LT AWS Directory Serviceを LDAP Serverとして 利用してみた 2015/11/23 Mon Nobuhiro Nakayama

Transcript of JAWS-UG CLI #33 LT - AWS Directory ServiceをLDAP Serverとして利用してみた

JAWS-UG CLI #33 LTAWS Directory ServiceをLDAP Serverとして利用してみた

2015/11/23 Mon

Nobuhiro Nakayama

{

"name":"Nobuhiro Nakayama",

"company":"UCHIDAYOKO CO., LTD.",

"favorite aws services":[

"Storage Gateway",

"Directory Service",

"IAM",

"AWS CLI"

],

"certifications":[

"AWS Certified Solutions Architect-Professional",

"AWS Certified SysOps Administrator-Associate",

"Microsoft Certified Solutions Expert Server Infrastructure",

"Microsoft Certified Solutions Expert SharePoint",

"IPA Network Specialist", "IPA Information Security Specialist"

]

}

Agenda

• ID管理の実態

• LDAP連携をやってみた

• GitLabの場合

2015/11/23 3

ID管理の実態

• システム毎に独自DBでID管理?

• 工数∝ユーザ数×システム数

• THE 刺身タンポポ!

• メンテナンスされず、放置されるユーザ

• 退職したユーザによる不正なアクセスなど、リスクが増加

• ユーザも大変・・・

• 覚えきれないパスワード・・・

• パスワードの使い回しが横行・・・

• パスワードポリシーを厳しくするとユーザの負担が増大・・

2015/11/23 4

ID管理および認証機能の一元化

• Directory ServiceのディレクトリはLDAPをしゃべれる!

• ユーザと認証を集約できる

• 管理工数∝ユーザ数

• 単一のIDで各システムを利用できる

• ユーザが覚える必要のあるパスワードが削減できる

2015/11/23 5

GitLabでやってみた

• 手順

• Directoryの作成

• #32の資料をご確認ください

• GitLabのインストール

• 認証連携の設定

2015/11/23 6

GitLabのインストール

• 手っ取り早くインストールしたい場合

• Install a GitLab CE Omnibus package

• https://about.gitlab.com/downloads/#centos6

• Amazon Linuxの場合、lokkitによる設定は省略

• 詳細はこちら

• Installation from source

• http://doc.gitlab.com/ce/install/installation.html

2015/11/23 7

設定ファイル

• 以下の設定ファイルを編集

• sudo vi /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml

• GitLab CE Omnibus packageでインストールした環境であることが前提

2015/11/23 8

編集前

#

# 3. Auth settings

# ==========================

## LDAP settings

# You can inspect a sample of the LDAP users with login access by running:

# bundle exec rake gitlab:ldap:check RAILS_ENV=production

ldap:

enabled: false

host:

port:

uid:

method: # "tls" or "ssl" or "plain"

bind_dn:

password:

active_directory:

allow_username_or_email_login:

base:

user_filter:

2015/11/23 9

編集後

#

# 3. Auth settings

# ==========================

## LDAP settings

# You can inspect a sample of the LDAP users with login access by running:

# bundle exec rake gitlab:ldap:check RAILS_ENV=production

ldap:

enabled: true

host: ***.***.***.***

port: 389

uid: sAMAccountName

method: plain # "tls" or "ssl" or "plain"

bind_dn: CN=Administrator,CN=Users,DC=gitlab,DC=local

password: ********

active_directory: true

allow_username_or_email_login: false

base: DC=gitlab,DC=local

user_filter:

2015/11/23 10

再起動後・・・

2015/11/23 11

識別名とは?

• Sambaでは、ユーザやコンピュータは階層的に管理されている

• 階層の位置を識別名で表現する

• 上位の階層ほど、後半に記載

2015/11/23 12

ADSIエディタ

• Windowsでユーザを管理する際、オブジェクトの詳細な属性を確認および編集できる

2015/11/23 13

ADSIエディタ

2015/11/23 14

ADSIエディタ

2015/11/23 15

sAMAccountName

2015/11/23 16

Demo

2015/11/23 17

まとめ

• IDは集中管理しましょう

• 管理工数が増えるだけでなく、セキュリティ上のリスクも増える

• LDAP連携は簡単です

2015/11/23 18

余談

• GitLabでは、RedisやPostgreSQL、Postfixを利用している

• Elastic CacheやRDS、SESなどで代替した環境を構築するハンズオンとか、実用的なものをやってみたい

2015/11/23 19