แสดงบทความที่มีป้ายกำกับ Security แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ Security แสดงบทความทั้งหมด

วันพฤหัสบดีที่ 15 กันยายน พ.ศ. 2554

Cut Through Authentication on the ASA


Cut-Through Authentication proxy on the ASA is an excellent way to track and authorize users when they access resources on the network that you may not want them to access to originally. I have used it to track user activities, authorize users to different network devices from time to time that they really should not be accessing whenever they feel, and to provide a user a way to override the firewall policies that have been defined for a given subnet. In other words, it is a very useful function and I believe it’s function is vital for users as well as the network administrator. Just so you know, this feature is just like the Auth-Proxy or Network Admission technologies on an IOS router.

Here is the topology we will be working with. I have setup a PC so we can simulate a typical user experience.



Guidelines

Any user on the 192.0.2.0/24 subnet (Inside) will have to authenticate through to the ASA when accessing the IOS Firewall Router.
This user authentication through the ASA will be of the most secure form.
The ASA will use local authentication for the users for the time being
Setup Cut-Through Proxy

So the first step would be to define IP addressing and initialize interfaces as well as routing. The HTTP services have been enabled on the IOS router as well as local authentication/authorization of users to this service. We will focus our efforts on the ASA for our cut through authentication.

So step one is going to make sure we have connectivity to the devices first. So let us make sure we can ping 198.18.0.2 from our PC (PC is 192.0.2.100 in my environment)

C:\ >ping 198.18.0.2
Pinging 198.18.0.2 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 198.18.0.2:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
Ok, already not a good start. From the ASA I can ping the PC as well as the IOS router. The default gateway of each of these devices points to the ASA. Hmmm. Don’t forget about icmp inspection or allowing icmp echo-replies back through the firewall on the outside interface. Here we will inspect icmp.

ciscoasa(config)# fixup protocol icmp
INFO: converting ‘fixup protocol icmp ‘ to MPF commands
Ok, now lets try our ping again

C:\ >ping 198.18.0.2
Pinging 198.18.0.2 with 32 bytes of data:
Reply from 198.18.0.2: bytes=32 time<1ms TTL=63
Reply from 198.18.0.2: bytes=32 time<1ms TTL=63
Reply from 198.18.0.2: bytes=32 time<1ms TTL=63
Reply from 198.18.0.2: bytes=32 time<1ms TTL=63
Ping statistics for 198.18.0.2:
Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
oximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
Ok, that looks better. The other test I like to do is access the http server on the IOS Router to make sure that we are able to get the default web page from the router so we know that this worked before we started our configuration. This will make it so there is one less thing to check if it doesn’t work. So let’s define an access-list to classify the interesting traffic for cut-through proxy:

ciscoasa(config)# access-list ctap permit ip any host 198.18.0.2
And let’s configure our local username and password as our guidelines say to use the local database:

ciscoasa(config)# username cisco password cisco
Now we will enable cut-through proxy with our interesting traffic and local database authentication :

ciscoasa(config)# aaa authentication match ctap inside LOCAL
So what should we see at this point is a web authentication box popup that is asking us for credentials. This is the cut through authentication service requesting user credentials before allowing the connection onto the IOS router. So we will enter our credentials of cisco/cisco. Then click on “OK” for the web authentication and we should be allowed to the IOS Router now.

Let’s verify the user on the ASA

ciscoasa(config)# sh uauth
Current Most Seen
Authenticated Users 1 1
Authen In Progress 1 1
user ‘cisco’ at 192.0.2.100, authenticated
absolute timeout: 0:05:00
inactivity timeout: 0:00:00
With the ASA we have another option in which the user authentication experience occurs. Instead of the popup, we can have a webpage display the authentication prompt. It is a little more user friendly this way and is more like the auth-proxy http web page from an IOS router, only better. To do this we enter the following command.

ciscoasa(config)# aaa authentication listener http inside redirect
Using the above option, we could also redirect the authentication to another port if needed using the argument “port ‘#’” in the command shown above.

So in our guidelines we actually wanted the most secure mode of communications. Well, using http in this fashion is not secure at all. So we will want to change our configuration so that we request the user credentials using https.

To do this, we will install 2 commands.

ciscoasa(config)# aaa authentication listener https inside redirect
ciscoasa(config)# aaa authentication secure-http-client
Now depending on how the ASA is configured for PKI support, you will either come to a page with a certificate warning or you will go right the authentication page. This is now a secure login screen for the user.

This concludes our quick introduction into Cut-Through Authentication on the ASA. There are several more features than can become involved such as including an ACS server for authentication/authorization, virtual telnet/http, and even downloadable access-lists that can override an interface access-list. Join me in feature posts where we will discuss these enhancements. I hope this is useful to you and thank you for visiting this post.

วันศุกร์ที่ 9 กรกฎาคม พ.ศ. 2553

Cisco ASA to Cisco IOS Router Site to Site VPN reference

วิธีการทำ VPN Site to Site ระหว่าง ASA และ IOS Router นะครับ ผมแนะนำใช้ Wizard ทั้ง 2 ฝั่งจะง่ายกว่าครับ ซึ่งต้องทำการ set encryption algorithm ทั้ง 2 ฝั่งให้ตรงกัน มันก็จะสามารถทำ tunnel connection กันได้แล้วครับ แต่หากใครอยากจะใช้ CLI ก็ตามด้านล่างเลยนะครับ

Cisco IOS Router Configuration

crypto isakmp policy 10
encryption 3des
auth pre-share
hash md5
group 2

crypto isakmp key address

ip access-list extended vpn-acl permit ip

crypto ipsec transform-set 3DES-MD5 esp-3des esp-md5-hmac

crypto map VPN 10 ipsec-isakmp
set transform 3DES-MD5
match address vpn-acl
set peer

interface FastEthernet 0/0
crypto map VPN

——————————————————————-

Cisco ASA configuration

sysopt connection permit-vpn

crypto isakmp policy 10
authentication pre-share
encryption 3des
hash md5

tunnel-group type ipsec-l2l
tunnel-group ipsec-attributes
pre-shared-key

access-list vpn-acl permit ip

crypto ipsec transform-set 3DES-MD5 esp-3des esp-md5-hmac

crypto map VPN 10 set transform-set 3DES-MD5
crypto map VPN 10 match address vpn-acl
crypto map VPN 10 set peer

crypto isakmp enable outside
crypto map VPN interface outside

Related posts:

1.ASA VPN Setup Configuration reference commands.
2.Cisco ASA troubleshooting Commands
3.IPv4 Multicast Addressing Quick Reference.
4.Cisco Site-to-Site VPN Comparison Sheet

วันเสาร์ที่ 19 มิถุนายน พ.ศ. 2553

Introducing IDS and IPS
Intrusion Detection Systems (IDS)

มีความสามารถในการตรวจจับ Traffic ที่เป็นอันตรายต่อระบบได้แต่ไม่สามารถหยุดหรือป้องกันได้ด้วยตัวเอง เพราะว่ามันทำงานในการวิเคราะห์ Traffic ที่ถูก Copy มาจาก Traffic จริงๆ ทำให้การทำงานจะไม่ส่งผลกระทบต่อประสิทธิภาพของเครือข่ายที่ใช้งานอยู่
โดยปกติ monitor interface ของ Sensor จะทำงานใน Promiscuous Mode หมายถึงว่ามันจะตรวจสอบ Traffic ทั้งหมดที่ถูกส่งมาหามันโดยให้อุปกรณ์เครือข่ายตัวอื่นๆ ทำการคัดลอกข้อมูลและส่งมาให้มัน โดยมันสามารถทำได้แค่แจ้งเตือน เพื่อให้ผู้ดูแลระบบทราบถึงปัญหาหรือภัยคุกคามในระบบ และดำเนินการแก้ไขต่อไป โดย Sensor ที่ทำงานใน Mode นี้สามารถใช้เพียง Interface เดียวสำหรับการ monitor Traffic ในหนึ่ง segment ได้
Intrusion Prevention Systems (IPS)
เป็น IDS ที่ทำงานใน Mode in-line คือวิเคราะห็ Traffic จริงๆของระบบเครือข่าย มีความสามารถในการตรวจจับและหยุดยั้ง Traffic ที่เป็นอันตรายได้ อาจจะส่งผลกระทบต่อเครือข่ายได้ เช่นการ Drop Packet ต่างๆ
ใน Inline Mode Sensor จะถูกวางไว้บนเส้นทางที่ใช้รับ-ส่งข้อมูลในระบบ IPS สามารถที่จะหยุดหรือป้องกันการโจมตีได้ โดย sensor ที่ทำงานใน mode นี้จะต้องใช้อย่างน้อย 2 Interface โดยจะต้อง Configure ทั้ง 2 Interface เป็น Pair interface กัน โดยจะทำงานใน Layer 2

IDS and IPS Common Characteristics
Cisco Sensor นั้นจะใช้กฏที่เรียกว่า Signature ในการตรวจสอบ Traffic โดย Signature-Based คือกลุ่มของรูปแบบของกฏ ที่ไว้ใช้เปรียบเทียบกับ Traffic โดยจะทำการบันทึกรูปแบบการโจมตีต่างๆไว้เป็น Signature โดยมันจะตรวจสอบทุกๆ Packet ที่ผ่านเข้า-ออกตัวมันและเมื่อมี Traffic ใดที่มีลักษณะตรงกับที่ Signature ได้ระบุไว้มันก็จะทำตาม Action ที่ได้ระบุไว้ใน Signature นั้นๆ เช่น แจ้งเตือน หรือ Drop Packet นั้นทิ้ง บาง Signature จะเรียกว่า atomic signature โดยจะตรวจสอบ Traffic ที่มีลักษณะเป็น Packet เพียง Packet เดียว หรือ Composite Signature ที่ตรวจสอบ Traffic โดยการระบุรูปแบบของ Packet หลายๆ Packet ต่อเนื่องกันมาตามลำดับก็ได้
Placement of IDS and IPS Sensors
ในการที่จะตัดสินใจว่าจะให้ Sensor ทำงานใน Mode ใดระหว่าง Promiscuous (IDS) หรือ In-line (IPS) ควรจะดูจากลักษณะของความต้องการใช้งาน โดยทั้ง 2 โหมดจะมีลักษณะดังนี้

IPS มีลักษณะ
-เมื่อต้องการให้ Sensor สามารถทำการ Drop หรือ Deny Packet ได้
-การ Drop หรือ Deny สามารถหยุด Packet ที่เป็นอันตรายหรือผิดปกติได้
-Sensor สามารถตรวจสอบ Stream normalization ได้
-IPS Action สามารถหยุดการทำงานของ Worm ได้
-ถ้าตัวอุปกรณ์ error หรือ fail จะส่งผลกระทบต่อเครือข่าย
-อาจส่งผลกระทบต่อประสิทธิภาพของเครือข่าย เช่นความเร็วโดยรวมลดลง
-สามารถทำงานร่วมกับ Time-Sensitive Application ได้ เช่น VoIP
IDS มีลักษณะ
-เมื่อไม่ต้องการให้ Sensor Drop หรือ Deny Packet ใดๆ
-การทำงานของ Sensor จะไม่ส่งผลกระทบต่อเครือข่ายที่ใช้งานปกติ
-ถ้าตัวอุปกรณ์ error หรือ fail จะไม่ส่งผลกระทบต่อเครือข่าย
-ไม่สามารถหยุดการโจมตีหรือภัยคุกคามได้ ด้วยตัวมันเอง
Sensor Placementควรที่จะวาง Sensor ไว้บริเวณ ทางเข้า-ออกของเครือข่ายส่วนที่ต้องการจะป้องกัน ซึ่งใน Sensor จะมีการกำหนด Security Policy สำหรับเครือข่ายนั้นๆ ซึ่ง Security Policy นี้สามารถใช้อันเดียวกันทั้งหมด หรือแยกแต่ละ Policy ตามแต่ละส่วนของเครือข่ายได้ และควรที่จะมีการกำหนดเครื่องที่อนุญาตให้เข้ามาจัดการ Sensor ได้ด้วย
Sensor on Outside
-Monitor all Traffic
-อาจมี False Positive จำนวนมาก
-ไม่สามารถตรวจจับการโจมตีที่เกิดขึ้นภายในได้
Sensor on Inside
-Monitor Traffic ที่ถูกคัดกรองมากแล้วจาก Firewall หรือ Gateway
-มี False Positive น้อยกว่า
-สามารถหยุด Traffic ที่เป็นอันตรายในระดับ Application Layer ที่ Firewall ไม่สามารถตรวจพบได้

Types of IDS and IPS Sensors
Profile-Based Intrusion Dectection
จะมีการสร้าง Profile ขึ้น และจะทำการแจ้งเตือนเมื่อมีเหตุการณ์ที่อยู่นอกเหนือจาก Profile นี้ขึ้น โดย Profile จะสร้างมาจากการเก็บตัวอย่างการใช้งานปกติของผู้ใช้ตามช่วงเวลาที่กำหนด เพื่อเก็บไว้เป็นตัวอย่างใช้ในการเปรียบเทียบ Traffic ต่อไป
ปัญหาของวิธีการนี้ก็คือ ผู้ใช้อาจจะมีการใช้งานที่ไม่ตรงกับ Profile ที่ได้เก็บตัวอย่างไว้เสมอไป ซึ่ง Profile ที่ใช้เป็นการใช้งานปกติในปัจจุบัน อาจจะไม่สามารถใช้เป็น Profile สำหรับวันอื่นๆก็ได้ ซึ่งจะทำให้เกิด False Positive จำนวนมากตามมา
Signature-Based Intrusion Dectection
Signature-Based สามารถที่จะลดจำนวนการเกิด False Positive ลง โดย Signature คือกลุ่มรูปแบบของกฏ หรือรูปแบบการโจมตีประเภทต่างๆ ที่ไว้ใช้เปรียบเทียบกับ Traffic
Cisco Sensor นั้นใช้ Signature-Based ในการทำงาน โดยจะตรวจสอบทุกๆ Packet ถ้าพบว่ามี Traffic ใดที่มีรูปแบบที่ตรงกับ Signature มันจะไปทำตาม Action ที่ได้ระบุไว้ใน Signature นั้นๆ เช่นแจ้งเตือน หรือ Drop Packet
ข้อเสียของวิธีนี้ก็คือ ถ้าการโจมตีเป็นรูปแบบใหม่ที่ไม่มีใน Signature มันจะไม่สามารถตรวจจับได้ ซึ่งจะต้องมีการ Update Signature เสมอเพื่อให้สามารถตรวจจับรูปแบบการโจมตีใหม่ๆได้

วันพฤหัสบดีที่ 27 สิงหาคม พ.ศ. 2552

ASA URL filtering

มีคนถามมาเยอะนะครับ เกี่ยวกับการ block url ต่างๆ หรือ url filtering ผ่านตัว Firewall ASA เพียวๆ ที่บอกว่าเพียวๆ หมายความว่า มันไม่มี module CSC, AIP เสียบอยู่เลยนะครับ ซึ่งบางคนอาจจะประยุกต์โดยการเอา ip ของเว็บไซต์นั้นไป deny ไม่ให้ network ข้างในออกไปที่ ip นั้นๆ ตัว url filtering เป็นหนึ่งใน Feature ที่ ASA สามารถทำได้นะครับ

ผมไป search มาแล้วไปเจอวิธีการใช้งาน regular expressions นำมา map เพื่อจะ block ได้ โดย configuration ก็จะมีตามด้านล่างนี้นะครับ โดยการที่เราอาจจะใช้ domain name จาก url หรือคำต่างๆ จาก uri ได้ สมมุติว่า เราจะ block เว็บไซต์ cisco และ link ที่มีคำว่า test ซึ่งอยู่ภายใน url cisco เราสามารถสร้าง regular expressions (regex) และนำไป map เข้ากับ class-maps ชนิด http และจะใช้ policy-maps ไป drop action ของ class-map นี้อีกทีนึง โดยต้องไปทำที่ interface ใดๆ หรือ global ของ ASA ตามตัวอย่างด้านล่างนี้

regex blockex1 "/test/"
regex blockex2 "cisco\.com"

class-map type inspect http match-any block-url-class
match request uri regex blockex1
match request header host regex blockex2

policy-map type inspect http block-url-policy
parameters
class block-url-class
drop-connection log
policy-map global_policy
class inspection_default
inspect http block-url-policy

service-policy global_policy global

แต่หากเป็นการ block เว็บไซต์เยอะๆ แนะนำว่าให้ใช้ websense หรือ N2H2 ที่ integrate มากับ ASA อยู่แล้วมาใช้งานนะครับ ซึ่งมันจะสามารถ provide web filtering ได้ดีกว่าการที่เรามาใช้ regex ครับ :)

Firewall ASA Basic Configuration

บทความจะขอกล่าวถึงเรื่อง Firewall ของ Cisco นะครับ ซึ่งเป็นตระกูล ASA ซึ่งจะรวมความสามารถของ PIX Firewall และ VPN มาอยู่ใน Box เดียวกัน อีกทั้งยังสามารถเลือกใส่ Module Anti-X หรือ IPS อย่างใดอย่างหนึ่งได้อีกด้วยนะครับ เอาหละ .... ผมจะแปะ command เบื้องต้นไว้ให้ โดยครั้งแรกที่เราได้ ASA มา เราก็จัดการ console เข้าไปที่ CLI นะครับ แล้วก็พิมพ์ตามด้านล่างนี้ แต่ ip อาจจะแตกต่างกัน เพื่อจะ manage ASA ได้ผ่านทาง GUI หรือผ่านโปรแกรม ASDM อีกในคราวถัดไปครับ ลองเอาไปประยุกต์เข้ากับ site ที่เราจะไป implement ดูครับ

ปกติแล้ว Firewall จะมี interface 3 ฝั่งนะครับ ก็คือ inside, outside และ dmz เราจะเริ่มที่ set ขา interface ของ Firewall ก่อนนะครับ

Firewall(config)# interface gigabitethernet0
Firewall(config-if)# speed auto
Firewall(config-if)# duplex auto
Firewall(config-if)# nameif inside
Firewall(config-if)# security-level 100
Firewall(config-if)# ip address 172.16.1.1 255.255.0.0
Firewall(config-if)# no shutdown


Firewall(config)# interface gigabitethernet1
Firewall(config-if)# speed auto
Firewall(config-if)# duplex auto
Firewall(config-if)# nameif outside
Firewall(config-if)# security-level 0
Firewall(config-if)# ip address 172.17.1.1 255.255.0.0
Firewall(config-if)# no shutdown


Firewall(config)# interface gigabitethernet2
Firewall(config-if)# speed auto
Firewall(config-if)# duplex auto
Firewall(config-if)# nameif dmz
Firewall(config-if)# security-level 50
Firewall(config-if)# ip address 172.18.1.1 255.255.0.0

Firewall(config-if)# no shutdown

กำหนดให้สามารถ http หรือใช้ GUI ได้ผ่านทาง interface ไหน และ password เป็นอะไร

Firewall(config)# http server enable
Firewall(config)# http 172.16.0.0 255.255.0.0 inside
Firewall(config)# enable password cisco

หมดมุขแล้วครับ ... คนที่คลุกคลีกับ Firewall ของ Cisco อยู่คงจะคุ้นเคยกับ command เหล่านี้ดี ไว้จะมา update ที่ยากๆ ขึ้นกว่านี้นะครับ ไว้เจอกันใหม่โอกาสหน้า สวัสดีครับ ....

วันเสาร์ที่ 20 มิถุนายน พ.ศ. 2552

Enabling NetFlow on a Catalyst 6500

บทความนี้จะพูดถึง netflow ซึ่งเป็น protocol propietary ของ Cisco นะครับ ซึ่งก็คือ Cisco เป็น vendor เดียวที่พัฒนาโปรโตคอลนี้ขึ้นมาและนำมาใช้ในลักษณะการบริหารจัดการเครือข่ายผ่านอุปกรณ์ที่รองรับได้

เมื่อเราเปิดพอร์ตหรือ VLAN ให้เริ่มฟังก์ชั่นการทำงานของ Netflow ขึ้นบนอุปกรณ์ สิ่งที่เกิดขึ้นก็คือ พอร์ต หรือ VLAN นั้นๆ จะทำการพ่นข้อมูลตามตัวอย่างด้านล่างออกมาครับ

• IP source address
• IP destination address
• Source port
• Destination port
• Layer 3 protocol type
• Type of service
• Router or switch interface

ปัจจุบัน Netflow ได้ออก version มาหลายๆ version ได้แก่ V.1, 5, 7 (บน Cat6500) และ 9 ตามลำดับ ปกติแล้วทั่วๆ ไป admin มักจะเปิดการทำงาน version 5 ส่วน vesion 9 ก็จะเหมือน version 5 เกือบทุกอย่างครับ ยกเว้นสิ่งที่มันเพิ่มขึ้นมาก็คือ มันจะบอก Source และ Destination MAC Addresses ด้วยครับ

โดยปกติแล้ว Netflow สามารถ enable ได้บนเราเตอร์เกือบทุก Series ของ Cisco แต่บนสวิตซ์จะสามารถใช้งานได้บาง Series เท่านั้นนะครับ อย่างเช่นตระกูลของ Catalyst 4500+Sup V, Catalyst 4500+Sup IV+Netflow daughter card และ Catalyst 6500 Series เท่านั้นครับ

เอาหละครับ คราวนี้ก็เป็นตัวอย่างของการเปิด Netflow บน ios ของ Catalyst 6500 Series นะครับ ผมเชื่อว่าหลายๆ มหาวิทยาลัยก็ใช้งานกันอยู่เหมือนกัน เพราะ Netflow มันมีประโยชน์มากจริงๆ โดยเฉพาะหากเรามี Netflow Collector Software อยู่แล้วด้วย เช่น CS-MARS, Netflow Analyzer ของ Manage Engine เป็นต้น

IOS(config)# mls netflow
IOS(config)# mls flow ip interface-full
IOS(config)# mls flow ipv6 interface-full
IOS(config)# mls nde sender version 7
IOS(config)# ip flow-export source vlan 1
IOS(config)# ip flow-export destination 10.10.10.100 200

วิธีตรวจสอบบน ios นะครับ เราจะใช้คำสั่ง

IOS# sh mls netflow ip

ขอขอบคุณหนังสือ LAN Switching Security 2007 จาก Cisco Press ด้วยครับ :)

วันอังคารที่ 5 พฤษภาคม พ.ศ. 2552

ไข้หวัดหมู ไข้หวัดเม็กซิโก ไข้หวัดใหญ่สายพันธุ์ใหม่

เมื่อเช้าผมได้ดูข่าวไข้หวัดหมู -> ไข้หวัดเม็กซิโก -> จนปัจจุบันมีชื่อเรียกเป็นทางการว่า ไข้หวัดใหญ่ สายพันธุ์ใหม่ ปี 2009 (ใครเป็นคนคิดก็ไม่รู้ ช่างยาวได้เพียงนี้) ซึ่งตอนนี้ได้มีการตื่นตัว และพูดถึงกันเยอะมาก จากการฟังข่าวได้พูดถึงที่ฮ่องกงยันพบผู้ติดเชื้อแล้ว ถือเป็นประเทศแรกในเอเชีย และมีผู้ติดต้องสงสัยว่าติดไข้หวัดตัวนี้อีกหลายคน โดยส่วนตัวผมเคยไปฮ่องกง 1 ครั้ง ผมพบว่าคนไทยไปช้อปปิ้งที่นั้นกันค่อนข้างเยอะมาก เรียกว่าไปเดินตามถนนเดินชนคนไทยด้วยกันได้เลย แถมร้านอาหารบางร้านก็ยังมีเมนูอาหารเป็นภาษาไทยอีกด้วย เลยเกรงว่ากลับมาจากฮ่องกงจะมีของฝากเป็นเจ้าไวรัส H1N1 แถมมาด้วย

นอกเรื่องไปหน่อยครับ เข้าเรื่องดีกว่า ที่ฮ่องกงนี่แหละครับ ในสนามบินที่เรารู้จักกันดี คือสนามบิน เช็คแล็ปก็อก (CHEK LAP KOK) ซึ่งติดอันดับสนามบินที่สะดวกสบายที่สุดในโลกด้วย ที่นี่เอง คนที่จะเดินทางออกไปนอกประเทศก็สามารถเดินทางได้ไปเป็นปกติ แต่คนที่กลับมาเข้าฮ่องกงเนี่ยสิ โดยเฉพาะคนที่กลับมาจากเม็กซิโกจะเข้ามาได้ จะต้องมีการตรวจเช็ค สแกน และวัดความร้อนภายในร่างกายกันอย่างละเอียด เรียกว่า Filter กันตั้งแต่ Gateway ทางเข้าประเทศเลยทีเดียว ได้ยินมาอย่างนี้ จึงทำผมให้นึกถึงนิยามของ Firewall เลยหละครับว่า "คนในออกได้ คนนอกห้ามเข้า"

ถ้าคนนอกจะเข้าได้ ต้องผ่าน policy ที่ได้ทำการวางไว้ตรง Gateway ก็คือที่ Firewall เนี่ยแหละครับ ผมเลยเอา clip video เรื่อง SDN - Self Defend Network มาให้ดูกันเล่นๆ ครับ (จับมาโยงกันดื้อๆ ไปเลยครับ ฮ่าๆ ๆ)

http://www.cisco.com/web/TH/about/video/ie20080803.html

แล้วก็มีคลิปของตัว Virus and Spam Blocker ซึ่งมันเป็น Mini IronPort หรือคล้ายๆ กับ IronPort C Series เลยก็ว่าได้ ออกมาใหม่ ราคาผมเห็นแล้ว ถือว่าค่อนข้างถูกมากๆ เมื่อเปรียบเทียบกับประสิทธิภาพการทำงาน ลองดูโฆษณาจาก youtube นะครับ

ช่วงนี้อากาศมันเอาแน่เอานอนไม่ได้ แดดออกเปรี้ยงๆ จู่ๆ ฝนก็เทลงมาเลย ฝากกลอนส่งท้ายไว้นะครับ

สุขภาพดี ชีวีปลอดภัย ห่างไกลไข้หวัดหมู ...... //ลาไปก่อนนะคร้าบบบบ Bibi .... :)

PING to Cisco ASA 5500 Series Firewall

กาลครั้งหนึ่งนานมาแล้ว ทางลูกค้าถามทางผมมาว่า "ทำไม ping ตัว Firewall ASA แล้วมันไม่มี icmp reply ตอบกลับมาเลย" สงสัย configure ผิดหรือเปล่า หรือว่า Interface ของ ASA เดี๊ยงไปแล้ว ... ผมก็เลยเสนอแนะไปว่า ให้ลอง show interface เล่นๆ ดู หรือเข้าไปดูผ่าน ASDM ถ้ามันยัง up อยู่ก็ตัดประเด็น hardware เสียไปได้เลย

ผลปรากฏว่ามันก็ยัง up อยู่เหมือนเดิม แถมยังเล่นอินเทอร์เน็ตได้ปกติ เร็วปรื๊ดดดดดดด .... ผมเลยจัดการเฉลยทางลูกค้าไปตรงๆ ดีกว่าว่า ปกติ Firewall ด้าน traffic inbound มันจะปิด icmp protocol ไว้ ส่วน outbound นั้นโดย default แล้วจะอนุญาตให้ icmp protocol เข้ามาได้แต่จะ deny reply เอาไว้ พูดภาษาชาวบ้านก็คือไม่ให้ตอบ icmp reply กลับไปนั่นเอง (มาถึงถูก แต่กลับไม่ถูก) โดย default เป็นแบบนี้ก็เนื่องจากเหตุผลเรื่อง Security นี่แหละครับ ดังนั้นหากจะ troubleshooting โดยการ ping ไปที่ขา interface inside หรือ outside ต้องมีการเปิด (permit) อนุญาติให้ icmp message ตอบกลับมาได้นั่นเอง

Note inbound คือ ผั่งที่ traffic วิ่งจาก security-level ต่ำไปสูง หมายความว่า traffic จะวิ่งเข้ามายัง inside network และรวมไปถึง traffic ที่วิ่งมายัง DMZ Zone ด้วย
outbound คือ ฝั่งที่ traffic วิ่งจาก security-level สูงไปต่ำ หมายความว่า traffic จะวิ่งจากข้างใน ออกไปยัง outside network

วิธีการทำก็ไม่ยากเลยครับ เราสามารถใช้ ASDM ใช้เม้าส์จิ้มๆๆๆ ไม่กี่ครั้งก็เรียบร้อยแล้วครับ ตาม step ด้านล่างนี้นะครับ :)

Configuration > Device Management > add > จากนั้นก็ใส่ icmp type (แนะนำว่าเลือกเป็น any ไปเลยครับ ), ขา interface ที่เราต้องการอยากให้ ping ได้, Action เลือกเป็น permit และกำหนด ip address/subnet mask ซึ่งจะเป็นวงที่เราอนุญาตให้ ping ได้ครับ อย่าลืมกด Apply นะครับ เพื่อ activate ให้ Firewall มันรับคำสั่งไปทำงานได้ .....

Note. ดังนั้นหากใครก็ตาม configure ASA เรียบร้อยแล้ว test ping มาที่ขา interface ของ firewall ไม่เจอ ก็อย่าเพิ่งตกอกตกใจไปนะครับ ไปเปิด icmp message ก็เท่านั้นเองครับ (จริงๆ แล้วก็คือ เปิดให้ Firewall มันไม่เป็นใบ้ ให้มันสามารถตอบกลับมายัง host ที่ ping ออกไปได้)
Note. อีกประการนึงก็คือ ต้องเช็คด้วยว่า Access Rule ของ Firewall เราได้ทำการ permit ip ที่เราอนุญาตให้ ping เจอไว้แล้วด้วยแล้วหรือยัง ??? (Configuration > Firewall > Access Rule) โดยปกติมักจะไม่มีปัญหาในช่วงแรกที่เรา configure Firewall ใหม่ๆ เนื่องจาก โดย Default ฝั่ง inside มักจะเปิด permit ip any any ไว้เรียบร้อยแล้ว

รายละเอียดเพิ่มเติม ซึ่งสามารถใช้ Command Line ได้ เข้าไปดูได้ตาม url ที่ให้มานี้เลยครับ
http://www.cisco.com/en/US/products/hw/vpndevc/ps2030/products_tech_note09186a0080094e8a.shtml http://www.cisco.com/en/US/products/ps6120/products_tech_note09186a0080734db7.shtml

วันจันทร์ที่ 4 พฤษภาคม พ.ศ. 2552

CS-MARS choice for Log Server

ผมเพิ่งจะ Implement CS-MARS ของ Cisco เสร็จไปหมาดๆ จำนวน 2 site เป็น Education และ Hospitality Account จึงได้วิธีหรือสูตรที่จะคิดจำนวนวัน ที่สามารถเก็บ Log file ได้มาแบ่งปันกันครับ

Example สมมุติว่าเราใช้รุ่น MARS110R และ event โดยเฉลี่ยทุก 1 วินาทีประมาณ 100 event และ ขนาดของ event ใหญ่ 300 bytes

Day = Usable storage / (Event size x EPS x 86,400)
CS-MARS110R Total = 1,500 GB Available storage = 866GB >>> ประมาณว่าใช้งานได้เกินครึ่งมานิดเดียว ส่วนที่หายไปเนี่ยก็เป็นพวก OS, MARS Software (Protego Networks), Oracle database
Average Event size = 300 bytes EPS = 100 event/second, k = 86,000
Day = 866x10^9 / (300 x 100 x 86,000) = 335.65 วัน

ดังนั้นวันที่เก็บได้ประมาณ 335 วัน ต้องทำการ archieve file ต่างๆ เหล่านี้ไปยัง backup server ผ่านทาง NFS protocol แต่จะเห็นกฎหมายให้เก็บแค่ 90 วัน ดังนั้น MARS ตัวนี้สามารถรองรับพรบ.คอมพิวเตอร์ได้อย่างสบายๆ

ผมได้ข้อคิดจาก MARS เผื่อคนที่คิดจะซื้อจะได้กลับมาดูก่อนว่า เหมาะสมกับโครงสร้างเครือข่ายของเราหรือเปล่า

1.คนที่กำลังจะซื้อ MARS ไปประดับบริษัท ควรจะมี Firewall ASA5500 Series ของ Cisco ถ้าให้ดีมี IPS Module เสียบไปด้วย จะทำ MARS วิเคราะห์ในรายละเอียดได้มาก เนื่องจาก Default Rule มักจะสร้างมาจากตัว ASA, IPS และเกิดเป็น Incident ต่างๆ ขึ้นมาบน Dashboard

2.MARS สามารถเก็บ RAW Message หรือ event ต่างๆ ของอุปกรณ์ที่ไม่ใช่ Cisco ก็ได้ เช่น Juniper Netscreen, Extreme, Checkpoint, Web Server ต่างๆ เป็นต้น ตลอดจน log ของ OS software ได้อีกด้วย แต่หากไม่มีอยู่ใน List ก็สามารถใช้ custom parser ในการ create patern ตาม syntax ของยี่ห้อนั้นๆ ได้เช่นเดียวกัน อันนี้ยาส์สสสสสกกกกกกก ..... เลยยยยย

3.คนที่คิดว่าจะเอา MARS ไปเก็บ log ของพวก Switch อย่างเดียว อยากจะบอกว่า คิดผิดแล้วครับ เพราะ switch มันไม่ค่อยผลิต log อะไรมากมาย นอกจาก up and down interface ครับ และ admin name ที่เข้ามาบริหารจัดการตัวอุปกรณ์ อาจจะผ่านทาง console, telnet หรือ ssh ครับ :)

4.เราสามารถ add topology ของ network ไปจนถึง เราเตอร์ของ ISP ได้เลย เพียงแค่บอก network ที่เราต้องการให้ MARS มัน update

5.ใครจะเอา netflow พ่นออกมาเก็บที่ MARS ตรงที่ MARS ควร Configure คลิ๊กแค่ Enable netflow เท่านั้น อย่างอื่นปล่อยมันไป มิฉะนั้น มันจะไปเก็บเป็น event (raw message) ไปด้วย

6.spanning tree ที่ switch จะต้อง Run เอาไว้ เพื่อที่จะทำหน้าที่ Layer 2 Discovery และ Mitigation นั่นเอง

7.Mitigation บน MARS ใน Layer2 สามารถกดปุ่ม push ได้เลย มันจะ write ไปผ่านทาง telnet, ssh ที่เราเปิดขึ้นมา และ snmp ที่เปิดเป็นแบบ rw หากเป็น Layer3 ต้อง manual CLI บนอุปกรณ์นั้นๆ

8.การ Add อุปกรณ์ NAC Appliance เข้าไป ผมไม่สามารถเห็นอุปกรณ์ NAC ใน topology ได้ แต่ดูจาก report มันเก็บ log มาเรียบร้อยแล้ว ก็งงๆ อยู่ว่าตกลงมันต้องเห็นหรือเปล่า ใครเคยทำแล้วช่วยตะโกนมาบอกผมหน่อยนะครับ ตกลงมันต้องเห็นใน topology หรือเปล่าครับ

ไว้แค่นี้ก่อน แล้วจะมาอัพเดทให้เรื่อยๆ ครับ :)