시스코 애니 커넥트는 도메인 계정 + 구글 MFA는하기 FreeRADIUS 인증 통합

목적 : 사용자가 시스코 애니 커넥트 다이얼을 사용하는 경우, 부여 된 구글 인증을 통해 AD 계정 암호 및 동적 코드를 입력합니다. 시스코 ASA 포인트는하기 FreeRADIUS 인증 및 AD하기 FreeRADIUS 연계 google_authenticator을한다.

첫째, 환경 소개

  • 토폴로지

【애니 커넥트하기 FreeRADIUS 광고 MFA】 TOPO

  • 실험 환경 CentOS8는 두 개의 네트워크 카드, 인터넷에 액세스하기위한 하나 개의 카드를 가지고, 네트워크 카드는 방화벽 영역 내에 위치하고 있습니다.
  • 여기 CentOS8에 사용 된 바와 같이, (CentOS7을 수행 할 수 있습니다)하기 FreeRADIUS와 Google 인증 프로그램을 설치합니다. 윈도우 서버 2016 AD 설치 프로세스가 여기에 설명되지 않습니다, AD 서비스를 설치됩니다. 사용자는 휴대 전화에서 구글 인증 자 APP을 설치해야합니다.
  • 애니 커넥트 사용자 전화 번호, 사용자 이름과 암호, 비밀번호 입력 상자에 입력 한 비밀번호 + 동적 코드 구현 AD 계정 코드 + 동적 이중 인증을.

두, CentOS8 환경 설정

  • 시스템 업데이트

    [root@centos8 ~]# yum update
  • 시간대 변경

    [root@centos8 /]# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
  • 정확한 시간 여부 확인

    [root@centos8 /]#ll /etc/localtime
  • 닫기 SELinux를 일시적으로 종료하고 영구적으로 마감했다.

    [root@centos8 ~]# setenforce 0
    [root@centos8 ~]# sed -i 's/=enforcing/=permissive/g' /etc/selinux/config
  • 보기의 SELinux 상태입니다.

    [root@centos8 ~]# getenforce
    Permissive
  • 방화벽 (옵션)를 끄고,이 실험은 방화벽 닫히지 않았습니다.
    [root@centos8 ~]# systemctl stop firewalld.service
    [root@centos8 ~]# systemctl disable firewalld.service

세,하기 FreeRADIUS 설치 및 구성

3.1하기 FreeRADIUS 설치

  • 하기 FreeRADIUS 설치

    [root@centos8 ~]# yum install freeradius freeradius-utils
  • 시작 반경 서비스

    [root@centos8 ~]# systemctl enable --now radiusd.service
  • 방화벽 통관 반경
    [root@centos8 ~]# firewall-cmd --add-service=radius --permanent
    [root@centos8 ~]# firewall-cmd --reload

3.2하기 FreeRADIUS 설정 파일을 수정

  • 이 루트 권한이 있어야합니다 수 있도록하기 FreeRADIUS 때문에 .google_authenticator 토큰, 디렉토리의 모든 사용자에 대한 액세스 권한이 있어야합니다.
[root@centos8 ~]# vi /etc/raddb/radiusd.conf

        #user = radiusd
        #group = radiusd
        user = root
        group = root
  • 취소 pam주석 반경 활성화 PAM (플러그 인증 모듈) 인증 모듈이 동적으로 로딩 될 수있다.
[root@centos8 ~]#  vi /etc/raddb/sites-enabled/default

        pam
  • 활성화 팸, 반경 PAM 모듈은 기본적으로 활성화되지 않습니다.
[root@centos8 ~]#  ln -s /etc/raddb/mods-available/pam /etc/raddb/mods-enabled/pam
  • 편집 /etc/raddb/clients.conf, 구성 파일을 시스코 ASAv에게 반경 인증 요청을 수락합니다. 라인의 끝은 방화벽과 공유 키 및 IP 주소를 추가 할 수 있습니다.
[root@centos8 ~]# vi /etc/raddb/clients.conf

client 192.168.1.254 {
 secret = cisco
 shortname = CiscoASA
 nastype = cisco
}

3.3하기 FreeRADIUS 서비스 테스트

  • 당신이 사용자 액세스를 거부해야하는 경우 새 사용자 그룹은 사용자가이 그룹에 추가 할 수 있습니다.
[root@centos8 ~]# groupadd radius-disabled
  • 편집 /etc/raddb/users"사용자 그룹 거부"섹션 "반경 비활성화"그룹의 생성.
[root@centos8 ~]# vi /etc/raddb/users

#DEFAULT        Group == "disabled", Auth-Type := Reject
#               Reply-Message = "Your account has been disabled."

DEFAULT         Group == "radius-disabled", Auth-Type := Reject
                Reply-Message = "Your account has been disabled."
DEFAULT         Auth-Type := PAM
  • CentOS는 새로운 로컬 테스트 반경 서비스를 차지한다.
[root@centos8 ~]# useradd radlocal
[root@centos8 ~]# passwd radlocal
更改用户 radlocal 的密码 。
新的 密码:radpassword
重新输入新的 密码:radpassword
passwd:所有的身份验证令牌已经成功更新。
  • 반경 모달 모드를 설정,이 명령은 인증이 실패 할 경우, 오류 메시지에 따라 오류의 원인을 찾을 수 유용합니다.
[root@centos8 ~]# radiusd -X
  • 새 창을 만들고, 지역 반경에, 관심을 지불하여 계정을 확인하는 테스트 Received Access-Accept인증을 나타냅니다.
[root@centos8 ~]# radtest radlocal radpassword localhost 18120 testing123
Sent Access-Request Id 9 from 0.0.0.0:41546 to 127.0.0.1:1812 length 78
        User-Name = "radlocal"
        User-Password = "radpassword"
        NAS-IP-Address = 172.20.29.110
        NAS-Port = 18120
        Message-Authenticator = 0x00
        Cleartext-Password = "radpassword"
Received Access-Accept Id 9 from 127.0.0.1:1812 to 127.0.0.1:41546 length 20
  • 오픈 radius -X기준 출력으로 창.
Listening on auth address 127.0.0.1 port 18120 bound to server inner-tunnel
Listening on proxy address * port 43164
Listening on proxy address :: port 40551
Ready to process requests
(0) Received Access-Request Id 9 from 127.0.0.1:41546 to 127.0.0.1:1812 length 78
(0)   User-Name = "radlocal"
(0)   User-Password = "radpassword"
(0)   NAS-IP-Address = 172.20.29.110
(0)   NAS-Port = 18120
(0)   Message-Authenticator = 0xeba37c10c860860bd3dcc7bff2c5edf0
(0) # Executing section authorize from file /etc/raddb/sites-enabled/default
(0)   authorize {
(0)     policy filter_username {
(0)       if (&User-Name) {
(0)       if (&User-Name)  -> TRUE
(0)       if (&User-Name)  {
(0)         if (&User-Name =~ / /) {
(0)         if (&User-Name =~ / /)  -> FALSE
(0)         if (&User-Name =~ /@[^@]*@/ ) {
(0)         if (&User-Name =~ /@[^@]*@/ )  -> FALSE
(0)         if (&User-Name =~ /\.\./ ) {
(0)         if (&User-Name =~ /\.\./ )  -> FALSE
(0)         if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/))  {
(0)         if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/))   -> FALSE
(0)         if (&User-Name =~ /\.$/)  {
(0)         if (&User-Name =~ /\.$/)   -> FALSE
(0)         if (&User-Name =~ /@\./)  {
(0)         if (&User-Name =~ /@\./)   -> FALSE
(0)       } # if (&User-Name)  = notfound
(0)     } # policy filter_username = notfound
(0)     [preprocess] = ok
(0)     [chap] = noop
(0)     [mschap] = noop
(0)     [digest] = noop
(0) suffix: Checking for suffix after "@"
(0) suffix: No '@' in User-Name = "radlocal", looking up realm NULL
(0) suffix: No such realm "NULL"
(0)     [suffix] = noop
(0) eap: No EAP-Message, not doing EAP
(0)     [eap] = noop
(0) files: users: Matched entry DEFAULT at line 69
(0)     [files] = ok
(0)     [expiration] = noop
(0)     [logintime] = noop
(0) pap: WARNING: No "known good" password found for the user.  Not setting Auth-Type
(0) pap: WARNING: Authentication will fail unless a "known good" password is available
(0)     [pap] = noop
(0)   } # authorize = ok
(0) Found Auth-Type = pam
(0) # Executing group from file /etc/raddb/sites-enabled/default
(0)   authenticate {
(0) pam: Using pamauth string "radiusd" for pam.conf lookup
(0) pam: Authentication succeeded
(0)     [pam] = ok
(0)   } # authenticate = ok
(0) # Executing section post-auth from file /etc/raddb/sites-enabled/default
(0)   post-auth {
(0)     update {
(0)       No attributes updated
(0)     } # update = noop
(0)     [exec] = noop
(0)     policy remove_reply_message_if_eap {
(0)       if (&reply:EAP-Message && &reply:Reply-Message) {
(0)       if (&reply:EAP-Message && &reply:Reply-Message)  -> FALSE
(0)       else {
(0)         [noop] = noop
(0)       } # else = noop
(0)     } # policy remove_reply_message_if_eap = noop
(0)   } # post-auth = noop
(0) Sent Access-Accept Id 9 from 127.0.0.1:1812 to 127.0.0.1:41546 length 0
(0) Finished request
Waking up in 4.9 seconds.
(0) Cleaning up request packet ID 9 with +50
Ready to process requests

네, SSSD 설치 구성

  • AD가 설치 및 구성되어, 다음과 같은 몇 가지 구성 정보 광고입니다. python.com 도메인 만들기, DNS는 AD가없는 냠 소프트웨어를 설치 방지하기 위해 CentOS는 DNS 점 이후 공공 주소를 해결할 수 있습니다.

【애니 커넥트하기 FreeRADIUS 광고 MFA】 광고-01.png

  • 분석 테스트 목적 mfatest,에 CentOS의 기록을 작성.

【애니 커넥트하기 FreeRADIUS 광고 MFA】 광고-02.png

  • 설치 SSSD, CentOS8 내장되어.
[root@centos8 ~]# yum install sssd realmd adcli
[root@centos8 ~]# yum install oddjob oddjob-mkhomedir sssd samba-commontools
  • 수정 된 DNS, IP 주소 AD를 가리 킵니다.
[root@centos8 ~]# vi /etc/resolv.conf
nameserver 192.168.1.20
  • DNS 연결 테스트
[root@centos8 ~]# ping python.com
PING python.com (192.168.1.20) 56(84) bytes of data.
64 bytes from 192.168.1.20 (192.168.1.20): icmp_seq=1 ttl=128 time=0.205 ms
  • DNS 확인자 테스트
[root@centos8 ~]# nslookup
> mfatest.python.com
Server:         192.168.1.20
Address:        192.168.1.20#53

Name:   mfatest.python.com
Address: 1.1.1.1
  • CentOS는이 python.com 필드에 가입, 관리자 암호를 입력합니다.
[root@centos8 ~]# realm join python.com
Administrator 的密码:
  • 도메인 정보를 찾을 수 있습니다.
[root@centos8 ~]# realm list
python.com
  type: kerberos
  realm-name: PYTHON.COM
  domain-name: python.com
  configured: kerberos-member
  server-software: active-directory
  client-software: sssd
  required-package: oddjob
  required-package: oddjob-mkhomedir
  required-package: sssd
  required-package: adcli
  required-package: samba-common-tools
  login-formats: %[email protected]
  login-policy: allow-permitted-logins
  permitted-logins:
  permitted-groups: ***users
  • AD보기 CentOS8가 성공적으로 추가되었습니다.

【애니 커넥트하기 FreeRADIUS 광고 MFA】 광고-03.png

  • 광고 wintest에 테스트 사용자 만들기

【애니 커넥트하기 FreeRADIUS 광고 MFA】 광고-04.png

  • CentOS는 사용자 이름과 암호에 사용 AD 테스트를 로그인합니다.
[root@centos8 ~]# ssh -l [email protected] localhost
The authenticity of host 'localhost (::1)' can't be established.
ECDSA key fingerprint is SHA256:JNzSM2I5llmwVPjZAmZa0n1TS9dAZJYTgB2Odpq5IWA.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
[email protected]@localhost's password:
Activate the web console with: systemctl enable --now cockpit.socket

[[email protected]@centos8 ~]$ exit
注销
  • AD 생성 생성, 사용자 그룹 사용자 사용자

【애니 커넥트하기 FreeRADIUS 광고 MFA】 광고-05.png

  • CentOS는 자료는 허용 ***users이 시스템에서 인증이 그룹의 사용자를. 이 명령은 모든 도메인 계정 인증을 허용합니다 realm permit -all. 여기서 또한 SSH 인증 해제, 반경뿐만 아니라 분리, 인증의 방출은 생산 환경이 사용자 그룹 등록을 금지한다
    기록을 SSH.

    [root@centos8 ~]# realm permit -g ***users
  • 반경 디버그 모드를 켜

    [root@centos8 ~]#radius -X
  • 새로운 창에서, 인증을 테스트 반경 AD 계정 인증을 사용하여.
[root@centos8 ~]# radtest ***[email protected] Cisc0123 localhost 18120 testing123
Sent Access-Request Id 16 from 0.0.0.0:38424 to 127.0.0.1:1812 length 88
        User-Name = "***[email protected]"
        User-Password = "Cisc0123"
        NAS-IP-Address = 172.20.29.110
        NAS-Port = 18120
        Message-Authenticator = 0x00
        Cleartext-Password = "Cisc0123"
Received Access-Accept Id 16 from 127.0.0.1:1812 to 127.0.0.1:38424 length 20
  • 반경 디버그 모드는 로그를 볼 수 있습니다.
(2) Received Access-Request Id 16 from 127.0.0.1:38424 to 127.0.0.1:1812 length 88
(2)   User-Name = "***[email protected]"
(2)   User-Password = "Cisc0123"
(2)   NAS-IP-Address = 172.20.29.110
(2)   NAS-Port = 18120
(2)   Message-Authenticator = 0xd2adbf7920450d47617cc1c7128e437e
(2) # Executing section authorize from file /etc/raddb/sites-enabled/default
(2)   authorize {
(2)     policy filter_username {
(2)       if (&User-Name) {
(2)       if (&User-Name)  -> TRUE
(2)       if (&User-Name)  {
(2)         if (&User-Name =~ / /) {
(2)         if (&User-Name =~ / /)  -> FALSE
(2)         if (&User-Name =~ /@[^@]*@/ ) {
(2)         if (&User-Name =~ /@[^@]*@/ )  -> FALSE
(2)         if (&User-Name =~ /\.\./ ) {
(2)         if (&User-Name =~ /\.\./ )  -> FALSE
(2)         if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/))  {
(2)         if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/))   -> FALSE
(2)         if (&User-Name =~ /\.$/)  {
(2)         if (&User-Name =~ /\.$/)   -> FALSE
(2)         if (&User-Name =~ /@\./)  {
(2)         if (&User-Name =~ /@\./)   -> FALSE
(2)       } # if (&User-Name)  = notfound
(2)     } # policy filter_username = notfound
(2)     [preprocess] = ok
(2)     [chap] = noop
(2)     [mschap] = noop
(2)     [digest] = noop
(2) suffix: Checking for suffix after "@"
(2) suffix: Looking up realm "python.com" for User-Name = "***[email protected]"
(2) suffix: No such realm "python.com"
(2)     [suffix] = noop
(2) eap: No EAP-Message, not doing EAP
(2)     [eap] = noop
(2) files: users: Matched entry DEFAULT at line 69
(2)     [files] = ok
(2)     [expiration] = noop
(2)     [logintime] = noop
(2) pap: WARNING: No "known good" password found for the user.  Not setting Auth-Type
(2) pap: WARNING: Authentication will fail unless a "known good" password is available
(2)     [pap] = noop
(2)   } # authorize = ok
(2) Found Auth-Type = pam
(2) # Executing group from file /etc/raddb/sites-enabled/default
(2)   authenticate {
(2) pam: Using pamauth string "radiusd" for pam.conf lookup
(2) pam: Authentication succeeded
(2)     [pam] = ok
(2)   } # authenticate = ok
(2) # Executing section post-auth from file /etc/raddb/sites-enabled/default
(2)   post-auth {
(2)     update {
(2)       No attributes updated
(2)     } # update = noop
(2)     [exec] = noop
(2)     policy remove_reply_message_if_eap {
(2)       if (&reply:EAP-Message && &reply:Reply-Message) {
(2)       if (&reply:EAP-Message && &reply:Reply-Message)  -> FALSE
(2)       else {
(2)         [noop] = noop
(2)       } # else = noop
(2)     } # policy remove_reply_message_if_eap = noop
(2)   } # post-auth = noop
(2) Sent Access-Accept Id 16 from 127.0.0.1:1812 to 127.0.0.1:38424 length 0
(2) Finished request
Waking up in 4.9 seconds.
(2) Cleaning up request packet ID 16 with timestamp +6169
Ready to process requests
  • 그래서 도메인 이름을 사용하지 않는 사용자의 필요를 식별 할 수있는, 필요 구성 파일 /etc/sssd/sssd.conf False로 수정 진정한 use_fully_qualified_names 행의 값을 수정합니다.
[root@centos8 ~]# vi /etc/sssd/sssd.conf

use_fully_qualified_names = False
  • 다시 시작, 서비스리스트를 재 도메인 컨트롤러 정보를 SSSD 전과 대비 형식으로 기록.
[root@centos8 ~]# systemctl restart sssd

[root@centos8 ~]# realm list
python.com
  type: kerberos
  realm-name: PYTHON.COM
  domain-name: python.com
  configured: kerberos-member
  server-software: active-directory
  client-software: sssd
  required-package: oddjob
  required-package: oddjob-mkhomedir
  required-package: sssd
  required-package: adcli
  required-package: samba-common-tools
  login-formats: %U
  login-policy: allow-permitted-logins
  permitted-logins:
  permitted-groups: ***users
  • 이제 사용자를 식별 할 수있는 도메인 정보를 추가하지 마십시오.
[root@centos8 ~]# id ***user
uid=363201109(***user) gid=363200513(domain users) 组=363200513(domain users),363201108(***users)

다섯째, 설치 및 구성 구글 인증 자 PAM

5.1 설치 구글 인증 자

  • PAM은 빌드 환경을 준비
[root@centos8 ~]# yum install pam-devel make gcc-c++ git
[root@centos8 ~]# yum install automake autoconf libtool
  • 설치 파일을 다운로드 디렉토리가 여기 있습니다~
[root@centos8 ~]# git clone https://github.com/google/google-authenticator-libpam
  • 구글 - 인증 설치
    [root@centos8 ~]# cd google-authenticator-libpam/
    [root@centos8 google-authenticator-libpam]# ./bootstrap.sh
    [root@centos8 google-authenticator-libpam]# ./configure
    [root@centos8 google-authenticator-libpam]# make
    [root@centos8 google-authenticator-libpam]# make install

5.2 계좌 개설 이중 인증

  • 계정 광고로 전환
[root@centos8 ~]# su - ***[email protected]
  • 계정에 대한 이중 인증을 켭니다.
[***[email protected]@centos8 ~]$ 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?chs=200x200&chld=M|0&cht=qr&chl=otpauth://totp/***[email protected]@centos8%3Fsecret%3DOF2GUT37EUSG7Y2TYX57HKYRUY%26issuer%3Dcentos8
Failed to use libqrencode to show QR code visually for scanning.

如果安装了`libqrencode`,屏幕会出现一个二维码如果你的终端终端不支持显示二维码,可以手动打开这个网页链接(墙)来查看二维码或者手动输入后面的密钥(secret key)来代替扫描二维码,下面有5个紧
急救助码(emergency scratch code),
紧急救助码就是当你无法获取认证码时(比如手机丢了),可以当做认证码来用,每用一个少一个,但其实可以手动添加的,建议如果 root 账户使用 Google Authenticator 的话一定要把紧急救助码另外保存一
份。

Consider typing the OTP secret into your app manually.
Your new secret key is: OF2GUT37EUSG7Y2TYX57HKYRUY
Enter code from app (-1 to skip): 198586
Code confirmed
Your emergency scratch codes are:
  82763900
  77203549
  34651872
  82841984
  93446389

Do you want me to update your "/home/***[email protected]/.google_authenticator" file? (y/n) y
是否更新用户的 Google Authenticator 配置文件,选择 y 才能使上面操作对当前用户生效,其实就是在对应用户的 Home 目录下生成了一个 .google_authenticator 文件,
如果你想停用这个用户的 Google Authenticator 验证,只需要删除这个用户 Home 目录下的 .google_authenticator 文件就可以了。

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) y
每次生成的认证码是否同时只允许一个人使用?这里选择 y。

By default, a new token is generated every 30 seconds by the mobile app.
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. This allows for a
time skew of up to 30 seconds between authentication server and client. If you
experience problems with poor time synchronization, you can increase the window
from its default size of 3 permitted codes (one previous code, the current
code, the next code) to 17 permitted codes (the 8 previous codes, the current
code, and the 8 next codes). This will permit for a time skew of up to 4 minutes
between client and server.
Do you want to do so? (y/n) y
是否增加时间误差?这里选择 n或者y都行。

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) y
是否启用次数限制?
  • 위의 대화 형 매개 변수 설정도 (권장) 한 번 설정, 매개 변수의 의미에서 첫번째보기를 통해 사용할 수 있습니다.
[***[email protected]@centos8 ~]$google-authenticator -h
google-authenticator [<options>]
 -h, --help                     Print this message
 -c, --counter-based            Set up counter-based (HOTP) verification
 -C, --no-confirm               Don't confirm code. For non-interactive setups
 -t, --time-based               Set up time-based (TOTP) verification
 -d, --disallow-reuse           Disallow reuse of previously used TOTP tokens
 -D, --allow-reuse              Allow reuse of previously used TOTP tokens
 -f, --force                    Write file without first confirming with user
 -l, --label=<label>            Override the default label in "otpauth://" URL
 -i, --issuer=<issuer>          Override the default issuer in "otpauth://" URL
 -q, --quiet                    Quiet mode
 -Q, --qr-mode={NONE,ANSI,UTF8} QRCode output mode
 -r, --rate-limit=N             Limit logins to N per every M seconds
 -R, --rate-time=M              Limit logins to N per every M seconds
 -u, --no-rate-limit            Disable rate-limiting
 -s, --secret=<file>            Specify a non-standard file location
 -S, --step-size=S              Set interval between token refreshes
 -w, --window-size=W            Set window of concurrently valid codes
 -W, --minimal-window           Disable window of concurrently valid codes
 -e, --emergency-codes=N        Number of emergency codes to generate
  • 여기 Cisco_는 토큰 레이블 이름이 APP에 표시 될 것입니다 사용자를 @ centos8는 APP의 호스트 이름 레이블입니다.
[***[email protected]@centos8 ~]$ google-authenticator -t -f -d -l ***user@centos8 -i Cisco_*** -r 3 -R 30 -W
Warning: pasting the following URL into your browser exposes the OTP secret to Google:
  https://www.google.com/chart?chs=200x200&chld=M|0&cht=qr&chl=otpauth://totp/lql@centos8%3Fsecret%3DJQ355PSUBG52KJBUMDJVBSMDLU%26issuer%3DLQL.ME

5.3 PAM 구성 파일을 수정하고 동적 코드 테스트 AD 계정 로그인 반경을 추가합니다.

  • 찾기 pam_google_authenticator.so디렉토리
[root@centos8 ~]# find / -name pam_google_authenticator.so
/usr/local/lib/security/pam_google_authenticator.so
  • 에디터는 /etc/pam.d/radiusd,하기 FreeRADIUS 지역 유닉스 암호를 이야기하고 사용자를 인증하는 구글 인증 자 코드를 사용합니다.
[root@centos8 ~]# vi /etc/pam.d/radiusd

#%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       requisite    /usr/local/lib/security/pam_google_authenticator.so forward_pass
auth       required     pam_sss.so use_first_pass
account    required     pam_nologin.so
account    include      password-auth
session    include      password-auth
  • 반경 디버그 모드를 켜

    [root@centos8 ~]#radius -X
  • 암호로 구성된 새로운 창에 도메인 계정을 사용하여 테스트 RADIUS 인증 비밀번호 + 다이나믹 코드 .
[root@centos8 ~]# radtest ***[email protected] Cisc0123072009 localhost 18120 testing123
Sent Access-Request Id 119 from 0.0.0.0:49063 to 127.0.0.1:1812 length 88
        User-Name = "***[email protected]"
        User-Password = "Cisc0123072009"
        NAS-IP-Address = 172.20.29.110
        NAS-Port = 18120
        Message-Authenticator = 0x00
        Cleartext-Password = "Cisc0123072009"
Received Access-Accept Id 119 from 127.0.0.1:1812 to 127.0.0.1:49063 length 20
  • 동적 코드 AD 바인딩 테스트 로그
(3) Received Access-Request Id 119 from 127.0.0.1:49063 to 127.0.0.1:1812 length 88
(3)   User-Name = "***[email protected]"
(3)   User-Password = "Cisc0123072009"
(3)   NAS-IP-Address = 172.20.29.110
(3)   NAS-Port = 18120
(3)   Message-Authenticator = 0x457cc852a7cb00f054b1cc168f75998e
(3) # Executing section authorize from file /etc/raddb/sites-enabled/default
(3)   authorize {
(3)     policy filter_username {
(3)       if (&User-Name) {
(3)       if (&User-Name)  -> TRUE
(3)       if (&User-Name)  {
(3)         if (&User-Name =~ / /) {
(3)         if (&User-Name =~ / /)  -> FALSE
(3)         if (&User-Name =~ /@[^@]*@/ ) {
(3)         if (&User-Name =~ /@[^@]*@/ )  -> FALSE
(3)         if (&User-Name =~ /\.\./ ) {
(3)         if (&User-Name =~ /\.\./ )  -> FALSE
(3)         if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/))  {
(3)         if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/))   -> FALSE
(3)         if (&User-Name =~ /\.$/)  {
(3)         if (&User-Name =~ /\.$/)   -> FALSE
(3)         if (&User-Name =~ /@\./)  {
(3)         if (&User-Name =~ /@\./)   -> FALSE
(3)       } # if (&User-Name)  = notfound
(3)     } # policy filter_username = notfound
(3)     [preprocess] = ok
(3)     [chap] = noop
(3)     [mschap] = noop
(3)     [digest] = noop
(3) suffix: Checking for suffix after "@"
(3) suffix: Looking up realm "python.com" for User-Name = "***[email protected]"
(3) suffix: No such realm "python.com"
(3)     [suffix] = noop
(3) eap: No EAP-Message, not doing EAP
(3)     [eap] = noop
(3) files: users: Matched entry DEFAULT at line 69
(3)     [files] = ok
(3)     [expiration] = noop
(3)     [logintime] = noop
(3) pap: WARNING: No "known good" password found for the user.  Not setting Auth-Type
(3) pap: WARNING: Authentication will fail unless a "known good" password is available
(3)     [pap] = noop
(3)   } # authorize = ok
(3) Found Auth-Type = pam
(3) # Executing group from file /etc/raddb/sites-enabled/default
(3)   authenticate {
(3) pam: Using pamauth string "radiusd" for pam.conf lookup
(3) pam: Authentication succeeded
(3)     [pam] = ok
(3)   } # authenticate = ok
(3) # Executing section post-auth from file /etc/raddb/sites-enabled/default
(3)   post-auth {
(3)     update {
(3)       No attributes updated
(3)     } # update = noop
(3)     [exec] = noop
(3)     policy remove_reply_message_if_eap {
(3)       if (&reply:EAP-Message && &reply:Reply-Message) {
(3)       if (&reply:EAP-Message && &reply:Reply-Message)  -> FALSE
(3)       else {
(3)         [noop] = noop
(3)       } # else = noop
(3)     } # policy remove_reply_message_if_eap = noop
(3)   } # post-auth = noop
(3) Sent Access-Accept Id 119 from 127.0.0.1:1812 to 127.0.0.1:49063 length 0
(3) Finished request
Waking up in 4.9 seconds.
(3) Cleaning up request packet ID 119 with timestamp +6972
Ready to process requests

여섯, ASAv 애니 커넥트 구성

6.1 초기 구성 ASAv

  • 네트워크 관리에 방화벽 ssh를 MGMT 인터페이스를 통해 ASAv 인터페이스 초기화, 여기 I.
interface Management0/0
 nameif mgmt
 security-level 0
 ip address 192.168.100.100 255.255.255.0

ssh 0.0.0.0 0.0.0.0 mgmt

interface GigabitEthernet0/0
 nameif outside
 security-level 0
 ip address 202.100.1.254 255.255.255.0
!
interface GigabitEthernet0/1
 nameif inside
 security-level 100
 ip address 192.168.1.254 255.255.255.0

애니 커넥트 6.2 ASAv 업로드 이미지

  • 그 ASDM가 원활하게 연결할 수 있도록 열기 HTTP 서비스는 로컬 관리자 암호를 만들 수 있습니다.
http server enable 8000
http 0 0 mgmt
aaa authentication http console LOCAL
username admin password cisco privilege 15
  • ASDM 이미지는 로컬 애니 커넥트 ASAv를 업로드합니다.

【애니 커넥트하기 FreeRADIUS 광고 MFA】 ASDM-01
【애니 커넥트하기 FreeRADIUS 광고 MFA】 ASDM-02
【애니 커넥트하기 FreeRADIUS 광고 MFA】 ASDM-03
【애니 커넥트하기 FreeRADIUS 광고 MFA】 ASDM-04

  • 성공적으로 업로드 애니 커넥트 확인
    MFA-ASAv# dir
    Directory of disk0:/
    94     -rwx  41077110     08:07:22 Mar 05 2020  anyconnect-win-4.6.00362-webdeploy-k9.pkg

6.3 시스코 ASAv 애니 커넥트 로컬 인증.

  • 우선, 로컬 인증 애니 커넥트 다음 로컬 테스트로 인증 및 이중 인증을위한 인증하기 FreeRADIUS로 흐른다.
username ssluser password cisco

web***
 enable outside
 anyconnect image disk0:/anyconnect-win-4.6.00362-webdeploy-k9.pkg 1
 anyconnect enable
  • 여기서 사용 터널 분리.
access-list anyconnect_split standard permit 192.168.1.0 255.255.255.0
access-list anyconnect_filter_acl extended permit ip any 192.168.1.0 255.255.255.0

ip local pool ssl***_pool 192.168.50.100-192.168.50.200

group-policy anyconnect_group_policy internal
group-policy anyconnect_group_policy attributes
 ***-filter value anyconnect_filter_acl
 ***-tunnel-protocol ssl-client ssl-clientless
 split-tunnel-policy tunnelspecified
 split-tunnel-network-list value anyconnect_split
 address-pools value ssl***_pool
 web***
  anyconnect profiles value anyconnect_profile type user

username ssluser attributes
 ***-group-policy anyconnect_group_policy
  • 기본적 애니 커넥트으로 여기, RDP 방식을 기록 할 수 없습니다 내 관리 기계는 RDP 로그인을 통해입니다. 그래서 우리는 사용자가 일반 RDP를 기록 할 수 있습니다 그래서, 애니 커넥트 프로필을 수정해야합니다.

【애니 커넥트하기 FreeRADIUS 광고 MFA】 RDP-01

【애니 커넥트하기 FreeRADIUS 광고 MFA】 RDP-02

  • 당신이 ASDM하여 프로파일을 구성한 후, 명령 행 호출을 통해 프로필을 확인합니다.
group-policy anyconnect_group_policy attributes
 web***
  anyconnect profiles value anyconnect_profile type user

6.4 애니 커넥트 로컬 테스트 계정 로그인

【애니 커넥트하기 FreeRADIUS 광고 MFA】 로그인-01
【애니 커넥트하기 FreeRADIUS 광고 MFA】 로그인-02
【애니 커넥트하기 FreeRADIUS 광고 MFA】 로그인-03

6.5하기 FreeRADIUS 설정 및 테스트

  • 3A 구성 서버 포인트하기 FreeRADIUS.
aaa-server freeradius protocol radius
aaa-server freeradius (inside) host 192.168.1.10
 key cisco
 authentication-port 1812

tunnel-group DefaultWEB***Group general-attributes
 authentication-server-group freeradius
 default-group-policy anyconnect_group_policy
  • 수정 된 SSSD 구성 파일, 전에 여기 여부를 추가 할 수 있기 때문에 ASAv 사용 AD는 반경 서비스 테스트 계정 python.com의 도메인 이름이 될 수 있습니다.
MFA-ASAv# test aaa-server authentication freeradius host 192.168.1.10 username ***user password Cisc0123187977
INFO: Attempting Authentication test to IP address <192.168.1.10> (timeout: 12 seconds)
INFO: Authentication Successful
  • 반경 디버그 모드는 로그를 볼 수 있습니다
Listening on acct address :: port 1813 bound to server default
Listening on auth address 127.0.0.1 port 18120 bound to server inner-tunnel
Listening on proxy address * port 54915
Listening on proxy address :: port 45190
Ready to process requests
(0) Received Access-Request Id 4 from 192.168.1.254:30861 to 192.168.1.10:1812 length 86
(0)   User-Name = "***user"
(0)   User-Password = "Cisc0123187977"
(0)   NAS-IP-Address = 192.168.1.254
(0)   NAS-Port = 4
(0)   NAS-Port-Type = Virtual
(0)   Cisco-AVPair = "coa-push=true"
(0) # Executing section authorize from file /etc/raddb/sites-enabled/default
(0)   authorize {
(0)     policy filter_username {
(0)       if (&User-Name) {
(0)       if (&User-Name)  -> TRUE
(0)       if (&User-Name)  {
(0)         if (&User-Name =~ / /) {
(0)         if (&User-Name =~ / /)  -> FALSE
(0)         if (&User-Name =~ /@[^@]*@/ ) {
(0)         if (&User-Name =~ /@[^@]*@/ )  -> FALSE
(0)         if (&User-Name =~ /\.\./ ) {
(0)         if (&User-Name =~ /\.\./ )  -> FALSE
(0)         if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/))  {
(0)         if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/))   -> FALSE
(0)         if (&User-Name =~ /\.$/)  {
(0)         if (&User-Name =~ /\.$/)   -> FALSE
(0)         if (&User-Name =~ /@\./)  {
(0)         if (&User-Name =~ /@\./)   -> FALSE
(0)       } # if (&User-Name)  = notfound
(0)     } # policy filter_username = notfound
(0)     [preprocess] = ok
(0)     [chap] = noop
(0)     [mschap] = noop
(0)     [digest] = noop
(0) suffix: Checking for suffix after "@"
(0) suffix: No '@' in User-Name = "***user", looking up realm NULL
(0) suffix: No such realm "NULL"
(0)     [suffix] = noop
(0) eap: No EAP-Message, not doing EAP
(0)     [eap] = noop
(0) files: users: Matched entry DEFAULT at line 69
(0)     [files] = ok
(0)     [expiration] = noop
(0)     [logintime] = noop
(0) pap: WARNING: No "known good" password found for the user.  Not setting Auth-Type
(0) pap: WARNING: Authentication will fail unless a "known good" password is available
(0)     [pap] = noop
(0)   } # authorize = ok
(0) Found Auth-Type = pam
(0) # Executing group from file /etc/raddb/sites-enabled/default
(0)   authenticate {
(0) pam: Using pamauth string "radiusd" for pam.conf lookup
(0) pam: Authentication succeeded
(0)     [pam] = ok
(0)   } # authenticate = ok
(0) # Executing section post-auth from file /etc/raddb/sites-enabled/default
(0)   post-auth {![login-ad](https://i.imgur.com/yltINYr.png)
(0)     update {
(0)       No attributes updated
(0)     } # update = noop
(0)     [exec] = noop
(0)     policy remove_reply_message_if_eap {
(0)       if (&reply:EAP-Message && &reply:Reply-Message) {
(0)       if (&reply:EAP-Message && &reply:Reply-Message)  -> FALSE
(0)       else {
(0)         [noop] = noop
(0)       } # else = noop
(0)     } # policy remove_reply_message_if_eap = noop
(0)   } # post-auth = noop
(0) Sent Access-Accept Id 4 from 192.168.1.10:1812 to 192.168.1.254:30861 length 0
(0) Finished request
Waking up in 4.9 seconds.
(0) Cleaning up request packet ID 4 with timestamp +11
Ready to process requests
  • 반경 -X 실행, 다음과 같이 제공 할 수없는 경우, 일반적으로 반경 서비스는 포트 번호 1812의 리드를 복용 시작되었습니다.
Failed binding to auth address * port 1812 bound to server default: Address already in use
/etc/raddb/sites-enabled/default[59]: Error binding to port for 0.0.0.0 port 1812
  • 보기 UDP 포트 번호입니다.
[root@centos8 ~]# ss -ulnp
State  Recv-Q  Send-Q     Local Address:Port     Peer Address:Port
UNCONN 0       0              127.0.0.1:18120         0.0.0.0:*      users:(("radiusd",pid=15068,fd=14))
UNCONN 0       0                0.0.0.0:1812          0.0.0.0:*      users:(("radiusd",pid=15068,fd=10))
UNCONN 0       0                0.0.0.0:1813          0.0.0.0:*      users:(("radiusd",pid=15068,fd=11))
  • 당신이 사용할 수있는 pkill명령 반경이 모든 프로세스를 종료합니다.
[root@centos8 ~]# pkill radiusd

6.6 +를 사용하는 AD 애니 커넥트 계정 동적 코드 로그

  • 애니 커넥트 암호, 암호가 처음에 입력 AD, 6 개 입력 동적 코드 때. 여기에, 예를 들어, 암호는 Cisc0123동적 코드는 914714암호 상자를 입력해야합니다 Cisc0123914714.

【애니 커넥트하기 FreeRADIUS 광고 MFA】 로그인-01
【애니 커넥트하기 FreeRADIUS 광고 MFA】 로그인 - 광고
【애니 커넥트하기 FreeRADIUS 광고 MFA】 로그인-03

  • 동적 코드

【애니 커넥트하기 FreeRADIUS 광고 MFA】 코드

  • 애니 커넥트 로그인, 반경 디버그 로그.
(4) Received Access-Request Id 8 from 192.168.1.254:30861 to 192.168.1.10:1812 length 666
(4)   User-Name = "***user"
(4)   User-Password = "Cisc0123914714"
(4)   NAS-Port = 32768
(4)   Called-Station-Id = "202.100.1.254"
(4)   Calling-Station-Id = "202.100.1.10"
(4)   NAS-Port-Type = Virtual
(4)   Tunnel-Client-Endpoint:0 = "202.100.1.10"
(4)   Cisco-AVPair = "mdm-tlv=device-platform=win"
(4)   Cisco-AVPair = "mdm-tlv=device-mac=00-50-56-8e-14-a9"
(4)   Cisco-AVPair = "mdm-tlv=device-mac=00-50-56-8e-8a-ac"
(4)   Cisco-AVPair = "mdm-tlv=device-mac=00-50-56-8e-93-54"
(4)   Cisco-AVPair = "mdm-tlv=device-type=VMware, Inc. VMware7,1"
(4)   Cisco-AVPair = "mdm-tlv=device-platform-version=10.0.18362 "
(4)   Cisco-AVPair = "mdm-tlv=ac-user-agent=AnyConnect Windows 4.6.00362"
(4)   Cisco-AVPair = "mdm-tlv=device-uid=D7237D73128E45F4F2706858D0F4AC09129E5131839298ACB03D3999125B5FC1"
(4)   NAS-IP-Address = 192.168.1.254
(4)   Cisco-AVPair = "audit-session-id=c0a801fe000080005e60c235"
(4)   Cisco-AVPair = "ip:source-ip=202.100.1.10"
(4)   ASA-TunnelGroupName = "DefaultWEB***Group"
(4)   ASA-ClientType = AnyConnect-Client-SSL-***
(4)   Cisco-AVPair = "coa-push=true"
(4) # Executing section authorize from file /etc/raddb/sites-enabled/default
(4)   authorize {
(4)     policy filter_username {
(4)       if (&User-Name) {
(4)       if (&User-Name)  -> TRUE
(4)       if (&User-Name)  {
(4)         if (&User-Name =~ / /) {
(4)         if (&User-Name =~ / /)  -> FALSE
(4)         if (&User-Name =~ /@[^@]*@/ ) {
(4)         if (&User-Name =~ /@[^@]*@/ )  -> FALSE
(4)         if (&User-Name =~ /\.\./ ) {
(4)         if (&User-Name =~ /\.\./ )  -> FALSE
(4)         if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/))  {
(4)         if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/))   -> FALSE
(4)         if (&User-Name =~ /\.$/)  {
(4)         if (&User-Name =~ /\.$/)   -> FALSE
(4)         if (&User-Name =~ /@\./)  {
(4)         if (&User-Name =~ /@\./)   -> FALSE
(4)       } # if (&User-Name)  = notfound
(4)     } # policy filter_username = notfound
(4)     [preprocess] = ok
(4)     [chap] = noop
(4)     [mschap] = noop
(4)     [digest] = noop
(4) suffix: Checking for suffix after "@"
(4) suffix: No '@' in User-Name = "***user", looking up realm NULL
(4) suffix: No such realm "NULL"
(4)     [suffix] = noop
(4) eap: No EAP-Message, not doing EAP
(4)     [eap] = noop
(4) files: users: Matched entry DEFAULT at line 69
(4)     [files] = ok
(4)     [expiration] = noop
(4)     [logintime] = noop
(4) pap: WARNING: No "known good" password found for the user.  Not setting Auth-Type
(4) pap: WARNING: Authentication will fail unless a "known good" password is available
(4)     [pap] = noop
(4)   } # authorize = ok
(4) Found Auth-Type = pam
(4) # Executing group from file /etc/raddb/sites-enabled/default
(4)   authenticate {
(4) pam: Using pamauth string "radiusd" for pam.conf lookup
(4) pam: Authentication succeeded
(4)     [pam] = ok
(4)   } # authenticate = ok
(4) # Executing section post-auth from file /etc/raddb/sites-enabled/default
(4)   post-auth {
(4)     update {
(4)       No attributes updated
(4)     } # update = noop
(4)     [exec] = noop
(4)     policy remove_reply_message_if_eap {
(4)       if (&reply:EAP-Message && &reply:Reply-Message) {
(4)       if (&reply:EAP-Message && &reply:Reply-Message)  -> FALSE
(4)       else {
(4)         [noop] = noop
(4)       } # else = noop
(4)     } # policy remove_reply_message_if_eap = noop
(4)   } # post-auth = noop
(4) Sent Access-Accept Id 8 from 192.168.1.10:1812 to 192.168.1.254:30861 length 0
(4) Finished request
Waking up in 4.9 seconds.
(4) Cleaning up request packet ID 8 with timestamp +608
Ready to process requests

개인 블로그 : https://cswk.work

~

추천

출처blog.51cto.com/7461938/2476383