다중 요소 인증(MFA)에 AWS Single Sign-ON 대응
AWS Single Sign-on은 MFA 애플리케이션을 사용하는 다요소 인증에 단독으로 대응하기 때문에 RADIUS를 따로 준비할 필요가 없다.
https://aws.amazon.com/jp/about-aws/whats-new/2019/10/increase-aws-single-sign-on-security-with-multi-factor-authentication-using-authenticator-apps/
(2019-01-19 Update)
AWS Single Sign-on을 통해 로그인할 때 E-Mail 기반 인증이 가능합니다.
https://qiita.com/daimatsu/items/666319c2209cbbcd4aa8
개요
참고 자료
RADIUS 서버의 구축은 다음과 같은 AWS 공식 블로그를 기반으로 합니다.
워크스페이스의 다요소 인증에 관한 것이지만 RADIUS 서버의 설정과 관련한 정보는 그대로 사용할 수 있다.
프로비저닝
절차.
스마트폰 애플리케이션 Google Authenticator 설치
여기서부터 설치해.
Android: https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&hl=ja
iPhone: https://itunes.apple.com/jp/app/google-authenticator/id388497605?mt=8
RADIUS 서버 구축
EC2 인스턴스에 RADIUS 서버를 구축합니다.
FreeRADIUS 및 기타 필요한 패키지 설치
$ sudo yum -y update
$ sudo yum -y install freeradius freeradius-utils git gcc pam-devel qrencode qrencode-libs qrencode-devel autoconf automake libtool
소스에서 Google Authenticator PAM module 설치
GiitHub에서 소스 파일을 다운로드한 후 설치합니다.
$ git clone https://github.com/google/google-authenticator-libpam.git
$ cd google-authenticator-libpam
$ ./bootstrap.sh
$ ./configure
$ make
$ sudo make install
OS 설정
$ sudo groupadd radius-enabled
호스트 이름 변경# ホスト名は適宜、DNSで名前解決できる必要はありません。
$ sudo hostnamectl set-hostname mfa.example.com
/etc/hosts# このEC2インスタンスのIPを指定
xxx.xxx.xxx.xxx mfa.example.com
FreeRADIUS 설정
PAM을 사용하여 인증하려면 루트 사용자를 사용해야 합니다.
/etc/raddb/radiusd.conf
--- radiusd.conf.def 2019-01-07 08:28:13.122132617 +0000
+++ radiusd.conf 2019-01-07 08:29:06.218050333 +0000
@@ -435,8 +435,8 @@
# member. This can allow for some finer-grained access
# controls.
#
- user = radiusd
- group = radiusd
+ user = root
+ group = root
# Core dumps are a bad thing. This should only be set to
# 'yes' if you're debugging a problem with the server.
radius-enabled
PAM을 사용하는 그룹만 설정합니다.etc/raddb/users
--- users.def 2019-01-07 08:34:43.485527661 +0000
+++ users 2019-01-07 08:36:06.921398359 +0000
@@ -64,6 +64,9 @@
#DEFAULT Group == "disabled", Auth-Type := Reject
# Reply-Message = "Your account has been disabled."
#
+DEFAULT Group != "radius-enabled", Auth-Type := Reject
+ Reply-Message = "Your account has been disabled."
+DEFAULT Auth-Type := PAM
#
# This is a complete entry for "steve". Note that there is no Fall-Through
/etc/raddb/sites-available/default--- default.def 2019-01-07 08:40:04.841029649 +0000
+++ default 2019-01-07 08:40:24.072999845 +0000
@@ -510,7 +510,7 @@
#
# Pluggable Authentication Modules.
-# pam
+ pam
# Uncomment it if you want to use ldap for authentication
#
$ sudo ln -s /etc/raddb/mods-available/pam /etc/raddb/mods-enabled/pam
pam_google_authenticator.so
경로가 통과하는 곳으로 복사하거나 전보로 쓰십시오.--- radiusd.def 2019-01-07 08:42:40.052789114 +0000
+++ radiusd 2019-01-07 08:43:28.216714473 +0000
@@ -1,6 +1,9 @@
#%PAM-1.0
-auth include password-auth
-account required pam_nologin.so
-account include password-auth
-password include password-auth
-session include password-auth
+#auth include password-auth
+#account required pam_nologin.so
+#account include password-auth
+#password include password-auth
+#session include password-auth
+auth requisite /usr/local/lib/security/pam_google_authenticator.so
+account required pam_permit.so
+session required pam_permit.so
RADIUS 프로토콜에 연결할 서브넷 및 연결 암호를 설정합니다./etc/raddb/clients.conf
--- clients.conf.def 2019-01-07 08:45:45.584501591 +0000
+++ clients.conf 2019-01-07 08:48:22.312258707 +0000
@@ -248,6 +248,11 @@
# secret = testing123-2
#}
+client shared-service {
+ ipaddr = x.x.x.x/y #実際にお使いの VPC ネットワークアドレス等を指定して下さい
+ secret = xxxxxxxxxx
+}
FreeRADIUS 시작
$ sudo systemctl enable radiusd
$ sudo systemctl start radiusd
사용자 등록
콘솔에 표시된 QR 코드를 스마트폰 애플리케이션의 Google Authenticator를 통해 스캔한 후 로그인합니다.
$ sudo useradd -g radius-enabled username0 # 実際のユーザー名に合わせてください
$ sudo -u username0 /usr/local/bin/google-authenticator
Do you want authentication tokens to be time-based (y/n) y
Warning: pasting the following URL into your browser exposes the OTP secret to Google:
https://www.google.com/chart?xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[QR コード]
Your new secret key is: xxxxxxxxxxxx
Enter code from app (-1 to skip):
몇 가지 문제의 내용은 다음과 같다.Do you want authentication tokens to be time-based (y/n)
시간 기반 인증 토큰을 사용하시겠습니까?
Do you want me to update your "/home/XXXXXX/.google_authenticator"file (y/n)
파일을 업데이트하시겠습니까?
업데이트하지 않으면 표시된 QR 코드로 로그인할 수 없습니다.
Do you want to disallow multiple uses of the same authentication token? This restricts you to one login about every 30s, but it increases your chances to notice or even prevent man-in-the-middle attacks (y/n)
동일한 인증 영패를 여러 번 사용하는 것을 금지합니까?이 제한에 따라 30초에 한 번만 접속할 수 있지만 중간인 공격이나 금지에 주의할 가능성이 높다.
By default, tokens are good for 30 seconds and in order to compensate for possible time-skew between the client and the server, we allow an extra token before and after the current time. If you experience problems with poor time synchronization, you can increase the window from its default size of 1:30min to about 4min. Do you want to do so (y/n)
기본적으로 영패는 30초에 한 번씩 사용되며, 현재 시간 전이나 이후의 영패에서도 이 영패를 허용하여 클라이언트와 서버의 시간 이동에도 대응할 수 있습니다.만약 시간 동기화 상태가 좋지 않고 문제가 있으면 기본 1분 반의 창을 약 4분으로 확장할 수 있습니다.진행하시겠습니까?
If the computer that you are logging into isn't hardened against brute-force login attempts, you can enable rate-limiting for the authentication module. By default, this limits attackers to no more than 3 login attempts every 30s. Do you want to enable rate-limiting (y/n)
로그인한 컴퓨터가 총 공격에 의해 보호되지 않으면 인증 모듈을 통해 횟수를 제한할 수 있습니다.이 제한은 30초 동안 3회 이상 로그인을 시도할 수 없습니다.횟수 제한을 실시합니까?
사용자 인증 테스트
$ radtest [username] [OneTimePassword] [IPAddress]:1812 10 [RADIUSPassword]
Sent Access-Request Id 81 from 0.0.0.0:47762 to [IPAddress]:1812 length 78
User-Name = "[username]"
User-Password = "[OneTimePassword]"
NAS-IP-Address = [IPAddress]
NAS-Port = 10
Message-Authenticator = 0x00
Cleartext-Password = "[OneTimePassword]"
Received Access-Accept Id 81 from [IPAddress]:1812 to 0.0.0.0:0 length 20
Directory Service 구축
AD 커넥터 구성
카탈로그 유형 AD 커넥터를 선택합니다.
크기에 따라 디렉터리 크기를 선택하십시오.
사용 환경에 따라 VPC 및 서브넷을 선택하십시오.지정된 VPC 서브넷에 AD 커넥터를 생성합니다.
AD에 대한 연결 정보를 설정합니다.
다중 요소 인증 사용
작성된 디렉토리를 선택하고 네트워크 및 보안 탭에서 다중 요소 인증을 활성화합니다.
RADISU 서버에 대한 정보를 입력합니다.
AWS Single Sign-ON 설정
생성된 Directory Service(AD Connector)를 지정합니다.
AWS 계정에 사용자를 할당합니다.
사용자를 찾아 선택합니다.
액세스 권한을 설정합니다.
로그인
사용자 포털을 방문하여 정상적으로 로그인하다.
코드를 확인해야 하기 때문에 여기에 MFA 코드를 입력한다.
기타 정보
Directory Service 정보
Reference
이 문제에 관하여(다중 요소 인증(MFA)에 AWS Single Sign-ON 대응), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/daimatsu/items/75b5924e06a4394b83d2텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)