Saturday, June 9, 2012

NAP 802.1x Enforcement with Cisco Switch (ตอนที่1)

บทความวันนี้ผมขอยกเรื่องเกี่ยวกับ security ทางด้าน network มาพูดถึงกันสักเรื่องหนึ่งครับ ซึ่ง feature ที่ผมจะกล่าวถึงนั้นจริงๆ ต้องบอกว่าไม่ใช่ว่าเพิ่งจะมีใน Windows Server 2008 R2 แต่ feature นี้จริงๆ มีใน Windows Server 2008 RTM ครับ

Network Access Control (NAP) เป็น Built-in Roles ที่มีมาพร้อมกับ Windows Server 2008/Windows Server 2008 R2 เป็น Roles ที่ทำหน้าที่ในเรื่องของการตรวจสอบสถานะของเครื่องคอมพิวเตอร์(client machine) ก่อนจะเข้าถึงระบบ network ที่เราได้ทำการ Enforcement ไว้เช่น

กรณีเราใช้ NAP Enforcement Policy กับ DHCP Service กรณีที่ client plug สายแลนไปที่ switch หรือ connect ไปยัง access point เพื่อขอ ip address จาก DHCP server มาใช้งานขบวนการของ NAP เองจะมีการทำ System Health Validate (SHV) ตามเงื่อนไขที่  NPS Policy กำหนดไว้ (ตัวอย่างการตรวจสอบข้อมูลในเครื่อง client ที่เรากำหนดได้เช่น Turn on Windows Firewall ไหม?, มีการติดตั้ง Antivirus และ signature virus อับเดตหรือไม่? , etc.)

ซึ่งตัวอย่างที่ผมยกมาเกี่ยวกับการ Enforcement ไปยัง DHCP Service แต่จุดอ่อนของ Enforcement DHCP คือกรณีถ้า user สามารถ fix ip ได้เองและ ip ที่ fix นั้นข้อมูลถูกต้องขบวนการในการตรวจสอบข้อมูลที่เครื่อง client จะไม่เกิดขึ้น ทำให้ยังมีความเสี่ยงในเรื่องความปลอดภัยอยู่ดี

ดังนั้นผมจะยกหัวข้อของ NAP ในการทำ Enforcement ที่ดูน่าเชื่อถือและปลอดภัยมากขึ้นในระบบ Network คือการกำหนด NAP ให้ Enforcement ไปยังตัว Network Device ตรงๆ แต่ NAP เองไม่สามารถคุยกับ Network Device ได้โดยตรง เราจึงนำมาตรฐานกลางที่ Network Device ส่วนใหญ่รองรับมาเป็นตัวกลางในการติดต่อกันระหว่าง NAP และ Network Device มาตรฐานนั้นก็คือ IEEE 802.1x (802.1x wikipedia , 802.1x IEEE)

ก่อนจะเข้าถึงขั้นตอนการติดตั้งและ config มาดู diagram ที่ผมจำลองขึ้นมาในการเขียนบนความนี้กันก่อนครับจะได้เห็นภาพกว้างๆ ก่อน ก่อนที่เราจะลงลึกไปสู่ขั้นตอนการติดตั้งและ config ต่างๆ

image

จาก Diagram ตามรูปขออธิบายในส่วนของการออกแบบรวมทั้งการทำงานรวมกับ NAP

VLAN 3 – Compliant เมื่อไหร่ก็ตามที่ Users ทำการต่อสายแลนเข้ามาในระบบ และเครื่อง client มีข้อมูลครบตามที่ NPS Policy กำหนดไว้ถือว่าผ่านเงื่อนไข Compliant client จะได้รับแจก ip address ที่อยู่ใน subnet 192.168.88.0/24 และสามารถจะติดต่อกับ server ใดๆ ก็ได้ใน VLAN 3

VLAN 2 – Non Compliant เมื่อไหร่ก็ตามที่ Users ทำการต่อสายแลนเข้ามาในระบบ และเครื่อง client มีข้อมูลไม่ครบตามที่ NPS Policy กำหนดไว้ถือว่าเข้าเงื่อนไข Non-Compliant client จะได้รับแจก ip address ที่อยู่ใน subnet 192.168.100.0/24 และสามารถจะติดต่อกับ server ที่อยู่ใน VLAN 2 ได้เท่านั้น (ในที่นี้สมมุติว่าเรามีการติดตั้ง server WSUS, Antivirus เพื่อให้เครื่อง client ทำการ update patch, update signature antivirus เพื่อให้เครื่อง client เข้าเงื่อนไข compliant)

VLAN 1 – Non Nap-Capable กรณีที่เครื่อง client ไม่ support NAP เชื่อมต่อเข้ามาในระบบ  client จะได้รับ ip address ที่อยู่ใน subnet 192.168.0.0/24 และจะไม่สามารถติดต่อไปยังที่อื่นๆได้

เมื่อเราตั้ง scenarios ในการทดสอบได้ตาม diagram เรียบร้อยแล้วเราจะมาทำการติดตั้งและ config ให้ได้ตาม diagram ด้านบนกันครับ

เริ่มจากที่เครื่อง DC ก่อน ขั้นตอนในส่วนการติดตั้ง OS,promote domain, ติดตั้ง CA ผมขอข้ามไปนะครับ สามารถค้นหาอ่านได้ในบทความย้อนหลังของผมก็ได้ครับ มีที่ต้องทำเพิ่มอย่างเดียวคือสร้าง Group – NAP Client Computers ขึ้นมาเท่านั้น

image

 

เครื่อง NPS เราจะทำการติดตั้ง Network Policy Server Role อย่างเดียวครับ

ก่อนการติดตั้งให้เราทำการ Request Computer Certificate มาติดตั้งบนเครื่อง NPS ก่อนนะครับ

image

image

จากนั้นทำการติดตั้ง Network Policy and Access Services Role ครับ

image

เลือกเฉพาะ Network Policy Server

image 

เลือก Certificate สำหรับทำ SSL (ที่ทำการ Request computer certificate ไปก่อนหน้านั้น)

image

หลังจากติดตั้ง Role เสร็จให้ทำการติดตั้ง Group Policy Management ต่อ

image

 

จากนั้นจะเข้าสู่ขั้นตอนการ config NPS Policy

1. เปิด Network Policy Server Console ขึ้นมา จากนั้นคลิ๊ก Configure NAP

image

2. ในหน้านี้ให้เลือก IEEE 802.1X (Wired)

image

3. ในหน้า Radius Client ให้ใส่ ip address ของ switch ที่จะ forward radius message มาที่ NPS Server

image

image

image

4. ในหน้านี้กด Next ไป

image

5. ในหน้านี้กด Next ไป

image

6. ในหน้านี้ให้ทำการกำหนดค่า Traffic Control ทั้งสองส่วนข้อมูลตามนี้

image

Full Access Network

image

Restricted Access Network

image

7. ในหน้านี้กด Next

image

8. ในหน้านี้กด Finish เสร็จขั้นตอนการ Config 802.1x (wired) policy

image

 

ปรับแต่ง Network Policy  Non NAP-Capable ให้เป็น VLAN 1

image

image

 

จากขั้นตอนด้านบนจะเป็นการกำหนดค่า Config ต่างๆ เพื่อให้รองรับ 802.1X แบบ Wired เรายังเหลือค่า config ที่ต้องทำเพิ่มบนตัว switch cisco ที่เตรียมไว้ทดสอบ 802.1X (ต้องมั่นใจว่ารุ่น switch รองรับ 802.1x ด้วยครับ)

SW Model: Catalyst 3550 (Configuration support 802.1X)

Building configuration...

Current configuration : 3009 bytes
!
version 12.2
no service pad
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname SW3550
!
!
aaa new-model
aaa authentication dot1x default group radius
aaa authorization network default group radius
!
aaa session-id common
ip subnet-zero
!
!
!
!
!
!
dot1x system-auth-control
no file verify auto
spanning-tree mode pvst
spanning-tree extend system-id
!
vlan internal allocation policy ascending
!
!
interface FastEthernet0/1
switchport mode dynamic desirable
!
interface FastEthernet0/2    (interface นี้เอาไว้ให้ client ใช้งานติดต่อกับ server ที่อยู่ใน vlan 3 ได้ยังไม่ได้ enable 802.1x ขึ้นมาใช้งาน)
 switchport access vlan 3
switchport mode access
spanning-tree portfast

!
interface FastEthernet0/3
description to Hyper-V Server
switchport access vlan 3
switchport mode access
spanning-tree portfast

!
interface FastEthernet0/4 (interface ที่ทดสอบ 802.1x)
switchport mode access
dot1x pae authenticator
dot1x port-control auto
dot1x reauthentication
no cdp enable
spanning-tree portfast

!
interface FastEthernet0/5
switchport mode dynamic desirable
!
interface FastEthernet0/6 (interface ที่ทดสอบ 802.1x)
switchport mode access
dot1x pae authenticator
dot1x port-control auto
dot1x reauthentication
no cdp enable
spanning-tree portfast

!
interface FastEthernet0/7
switchport mode dynamic desirable
!
interface FastEthernet0/8
switchport mode dynamic desirable
!
interface FastEthernet0/9
switchport mode dynamic desirable
!
interface FastEthernet0/10
switchport mode dynamic desirable
!
interface FastEthernet0/11
switchport mode dynamic desirable
!
interface FastEthernet0/12
switchport mode dynamic desirable
!
interface FastEthernet0/13
switchport mode dynamic desirable
!
interface FastEthernet0/14
switchport mode dynamic desirable
!
interface FastEthernet0/15
switchport mode dynamic desirable
!
interface FastEthernet0/16
switchport mode dynamic desirable
!
interface FastEthernet0/17
switchport mode dynamic desirable
!
interface FastEthernet0/18
switchport mode dynamic desirable
!
interface FastEthernet0/19
switchport mode dynamic desirable
!
interface FastEthernet0/20
switchport mode dynamic desirable
!
interface FastEthernet0/21
switchport mode dynamic desirable
!
interface FastEthernet0/22
switchport mode dynamic desirable
!
interface FastEthernet0/23
switchport mode dynamic desirable
!
interface FastEthernet0/24
switchport mode dynamic desirable
!
interface GigabitEthernet0/1
switchport mode dynamic desirable
!
interface GigabitEthernet0/2
switchport mode dynamic desirable
!
interface Vlan1
ip address 192.168.0.1 255.255.255.0
ip helper-address 192.168.88.21

!
interface Vlan2
description NONCOMPLIANT_VLAN
ip address 192.168.100.1 255.255.255.0
ip helper-address 192.168.88.21

!
interface Vlan3
description COMPLIANT_VLAN
ip address 192.168.88.1 255.255.255.0
ip helper-address 192.168.88.21

!
ip classless
ip http server
ip http secure-server
!
!
snmp-server community public RO
radius-server host 192.168.88.31 auth-port 1812 acct-port 1813 key P@ssw0rd
radius-server source-ports 1645-1646

!
control-plane
!
!
line con 0
line vty 5 15
!
end

 

ในบทความหน้าเราจะมาดูวิธีการทดสอบกันครับ ในบทความนี้จะพูดถึงเฉพาะในส่วน server เป็นหลัก

Sunday, June 3, 2012

ติดตั้ง Domain Controller บน Windows Server 2012 RC

กลับมาอีกครั้งครับหลังจากที่ห่างหายไปนานเลยสำหรับ blog นี้ไม่ค่อยมีเวลามาอับเดตข้อมูลบน blog นี้สักเท่าไหร่ ไปให้เวลาศึกษาเกี่ยวกับ System Center 2012 ซะส่วนใหญ่

วันนี้มีโอกาศเลยนำบทความเกี่ยวกับ Windows Server เวอร์ชั่นใหม่ล่าสุดที่ใกล้ออกตัวเต็มเช่นกันมานำเสนอให้คนที่สนใจในแวดวง IT ได้ลองศึกษากันครับ

ในบทความนี้เราจะมาดูกันว่าขั้นตอนในการติดตั้ง Domain Controller บน Windows Server 2012 เหมือนหรือแตกต่างจาก Windows Server 2008 R2 หรือไม่ประการใดครับ

ไม่พูดพร่ำทำเพลงเลยครับเดียวเข้าสู่ข้้นตอนการติดตั้งเลยดีกว่า ก่อนอื่นเองผมเดรียมเครื่อง VM

ที่ติดตั้ง Windows Server 2012 RC ไว้แล้ว ทำการตั้งชื่อเครื่อง กำหนดไอพี ให้กับ VM เรียบร้อยแล้วเหลือแค่ขั้นตอนการ promote domain controller ขึ้นมาทำหน้าที่ Directory Service ครับ

1. เปิด Server Manager ขึ้นมาครับ (หน้าตาแตกต่างกับ 2008 R2 ไปมากพอสมควรครับ)

image

2. คลิ๊กไปที่ Manage –> Add Roles and Features (มุมบนขวามือ)

image

3. ในหน้านี้กด Next ไปก่อนครับ

image

4. ในหน้านี้ก็กด Next ข้ามไปครับ (คง option เดิมไว้)

image

5. ในหน้านี้ก็กด Next ข้ามไปครับ (คง option เดิมไว้)

image

6. ติ๊กเลือก Active Directory Directory Service.

image

7. กด add features ที่จำเป็นสำหรับ AD DS แล้วกด Next ถัดไป

image

8. ในหน้านี้กด Next

image

9. ในหน้านี้กด Next

image

10. ในหน้านี้ติ๊ก option Restart server automatically if required. จากนั้นกด install

image

11. กด close เพื่อปิดหน้าต่างการติดตั้ง (ยังติดตั้ง AD DS ไม่เสร็จสิ้นครับ มีต่อ)

image

12. คลิ๊กที่ AD DS ด้านซ้ายมือ จากนั้นกดที่ More..(ที่วงสีแดงเอาไว้).

image

13. กดที่ Promote this server to a domain controller.(ที่วงสีแดงเอาไว้)

image

14. จะเริ่มหน้าต่างการ promote domain ขึ้นมาให้เลือก Add a new forest และใส่ชื่อ Root domain name: ….. ที่ต้องการจากนั้นกด Next.

image

15. ในหน้านี้จะให้เราเลือก Forest Functional Level, Domain Functional Level และกำหนดพาสเวิร์ดสำหรับ DSRM ให้กำหนดข้อมูลให้ครบถ้วนจากนั้นกด Next. (ในที่นี้ผมเลือก Forest and Domain Functional Level = 2012 RC เดียวมาดูกันว่าจะมีอะไรแตกต่างไปจาก Functional Level ของ 2008 R2)

image

16. ในหน้านี้กด Next ไปก่อนครับ

image

17. ในหน้านี้กด Next.

image

18. ในหน้านี้กด Next.

image

19. ในหน้านี้กด Next.

image

20. ในหน้านี้กด Install เพื่อเริ่ม promote domain controller เมื่อติดตั้งเสร็จเรียบร้อยระบบจะทำการ reboot เครื่องให้อัตโนมัติ.

image

21. หลังจาก reboot เรียบร้อย ล็อกอินเครื่องเสร็จลองเปิด AD users and Computers ขึ้นมาตรวจสอบ.

image

 

จบขั้นตอนการ promote domain controller บน windows server 2012 ครับ

ในบทความหน้าผมจะนำเสอนว่า new feature ในส่วนที่เกี่ยวข้องกับ Directory Service บน Windows Server 2012 มีอะไรเพิ่มเข้ามาใหม่บ้าง

โปรดติดตามได้ในบทความหน้าครับ