• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
Xin chào ! Nếu đây là lần đầu tiên bạn đến với diễn đàn, xin vui lòng danh ra một phút bấm vào đây để đăng kí và tham gia thảo luận cùng VnPro.

Announcement

Collapse
No announcement yet.

Block nhiều website và block key word trên ASA 5510

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Block nhiều website và block key word trên ASA 5510

    Chào mọi người,

    Mình có con ASA5510 mình muốn block nhiều trang web trên nó và mình muốn block key word trên nó. Ai có tài liệu hoặc chỉ dẫn gì hướng dẫn mình, xin cảm ơn!

  • #2
    bạn vào đây xem thử ứng dụng được không.
    Cisco ASA 5500-X Series Next-Generation Firewalls - Some links below may open a new browser window to display the document you selected.

    Comment


    • #3
      Bây giờ mình sẽ thực hiện block tất cả máy tại cty, sau đó mình sẽ mở tất cả vào những dịch vụ cần thiết như website của công ty, skype, yahoo,... rồi một số máy mình cho full ra internet, thì cụ thể mình làm như thế nào, pro nào chỉ mình với?
      Cụ thể là vậy:
      mình có lớp ip 192.168.100.0/24
      - Block range: 192.168.100.20 --> 192.168.100.200 không truy cập internet được, trừ các trang abc.com, skype, yahoo, email
      - Full internet từ 192.168.100.2 --> 192.168.100.19

      Ai chỉ dẫn mình với!
      Last edited by jerrybu01; 04-03-2013, 12:56 PM.

      Comment


      • #4
        Mình cấu hình cho phép và cấm dãy ip 192.168.172.0/24



        ASA5510(config)# object network FULL-IP-INTERNET
        ASA5510(config-network-object)# range 192.168.172.1 192.168.172.20
        ASA5510(config-network-object)# nat (inside,outside) source dynamic any interface
        ASA5510(config)# access-list inside_in permit ip object FULL-IP-INTERNET any

        ASA5510(config)# object network DENY-IP-INTERNET
        ASA5510(config-network-object)# range 192.168.172.21 192.168.172.254
        ASA5510(config-network-object)# nat (inside,outside) source dynamic any interface

        ASA5510(config)#access-list Inside_in permit tcp object DENY-IP-INTERNET any eq 80
        ASA5510(config)#access-list inside_access_out permit tcp any any eq 25
        ASA5510(config)#access-list inside_access_out permit tcp any any eq 110
        ASA5510(config)#access-list Inside_in deny ip object DENY-IP-INTERNET any

        ASA5510(config)#access-group Inside_in in interface inside

        Ở phần DENY-IP-INTERNET mình hạn chế internet nhưng sẽ cho vào email, 3 websites nhưng cấu hình thì thấy chưa ổn, ai hướng dẫn cho mình thêm phần cấu hình cho website vào ví dụ: vnexpress.net, cisco.com, microsoft.com

        Comment


        • #5
          Bạn xem qua mấy cái link này xem có hữu dụng không nha.

          This document describes how to configure the Cisco Security Appliances ASA/PIX 8.x that uses Regular Expressions with Modular Policy Framework (MPF) in order to block the certain websites (URLs).
          Lâm Văn Tú
          Email :
          cntt08520610@gmail.com
          Viet Professionals Co. Ltd. (VnPro)
          149/1D Ung Văn Khiêm P25 Q.Bình thạnh TPHCM
          Tel: (08) 35124257 (5 lines)
          Fax (08) 35124314
          Tập tành bước đi....


          Comment


          • #6
            Thanks Mr. Lâm Văn Tú
            Mấy cái này mình cũng đã tham khảo, cái này thì mình sẽ hạn chế và mở 1 số trang web cho phép trên cùng 1 lớp mạng. Ở đây mình gặp khó khăn là có 1 lớp mạng (192.168.172.0/24) mình muốn địa chỉ IP từ 192.168.172.1 --> 192.168.172.25 ra full internet. IP còn lại thì mình sẽ hạn chế internet chỉ cho vào 1 số trang ví dụ như: vnexpress.net, vnpro.vn như vậy thì làm sao mình có thể gán các trang web này vào số IP còn lại này. Ai có cách giải quyết vấn đề này hay có hướng giải quyết sáng suốt hơn không?cho mình xin ý kiến nha!

            Comment


            • #7
              À cái vụ này, thì mình làm cái access-list thôi.
              Đầu tiên, viết cái regex:
              !Định nghĩa các biểu thức chính qui, chỉ ra các web site đang quan tâm
              !
              regex url1 ".+yahoo.com"
              regex url2 ".+ngoisao.net"
              regex url3 ".+vnpro.org"
              regex url4 ".+thanhnien.com.vn"
              Tiếp theo viết class-map để add regex vô
              class-map type regex match-any URL
              match regex url1
              ...
              Tiếp theo viết class-map type inspect
              class-map type inspect http match-all class3
              match request header host regex class URL
              Sau đó viết cái ACL:
              Ví dụ:
              access-list abc extended deny tcp [ALLOW IP] 255.255.255.255 any eq 80
              access-list abc extended permit tcp any any eq 80

              Gán access-list vào class map

              class-map classhttp
              match access-list abc
              Viết policy map
              policy-map type inspect po-http
              parameters
              class class3
              drop-connection log
              Gán HTTP Inpsection Policy Map

              policy-map global_policy
              class classhttp
              inspect http po-http
              Cuối cùng gán global_policy cho tất cả các interface

              service-policy global_policy global
              Last edited by lamvantu; 07-03-2013, 09:56 AM.
              Lâm Văn Tú
              Email :
              cntt08520610@gmail.com
              Viet Professionals Co. Ltd. (VnPro)
              149/1D Ung Văn Khiêm P25 Q.Bình thạnh TPHCM
              Tel: (08) 35124257 (5 lines)
              Fax (08) 35124314
              Tập tành bước đi....


              Comment


              • #8
                Cảm ơn Mr.Lâm Văn Tú nhiều! để mình thử cấu hình

                Comment


                • #9
                  Xin chào,

                  Mình đã thử cấu hình khi con ASA của mình hiện là full internet cho range IP 192.168.172.1/24 (Hiện tại cấu hình của ASA mình là full internet và mình cấu hình theo như dưới)
                  1. Truy cập full internet
                  ASA5510(config)# object network Full-internet-Access
                  ASA5510(config-network-object)# range 192.168.172.1 192.168.172.25
                  ASA5510(config-network-object)# nat (inside,outside) dynamic interface
                  ASA5510(config-network-object)# access-list inside_access_out permit ip object Full-internet-Access any

                  2. Hạn chế truy cập internet, full các loại mail
                  ASA5510(config)# object network Deny-internet-Access
                  ASA5510(config-network-object)# range 192.168.172.26 192.168.172.254
                  ASA5510(config-network-object)# nat (inside,outside) dynamic interface
                  ASA5510(config-network-object)# access-list Inside_in deny ip object Deny-internet-Access any

                  ASA5510(config)#access-list inside_in permit tcp any any eq 25
                  ASA5510(config)#access-list inside_in permit tcp any any eq 110

                  ASA5510(config)#access-group access_out in interface inside

                  regex url1 "vnexpress\.net"
                  regex url2 "tuoitre\.net"
                  regex url3 “vdict\.com”
                  regex url4 “translate\.google\.com\.vn”

                  class-map type regex match-any URL
                  match regex url1
                  match regex url2
                  match regex url3
                  match regex url4

                  class-map type inspect http match-all class3
                  match request header host regex class URL

                  access-list inside_in extended deny tcp object Deny-internet-Access any eq 80
                  access-list inside_in extended permit tcp any any eq 80

                  class-map classhttp
                  match access-list inside_in

                  policy-map type inspect po-http
                  parameters
                  class class3
                  drop-connection log

                  policy-map global_policy
                  class classhttp
                  inspect http po-http

                  service-policy global_policy global

                  Mình cấu hình xong: range ip 1 vào full internet -->OK
                  range ip 2: bị block tất cả, ko truy cập được trang nào và kể cả vào webmail
                  Last edited by jerrybu01; 15-03-2013, 04:32 PM.

                  Comment


                  • #10
                    Cái Regex đó chạy ngon lành cành đào luôn, Nhưng pac nào chặn dc face thì PM mình cái nhé

                    Comment


                    • #11
                      Đây là cấu hình hiện giờ của con ASA, theo yêu cầu thì mình chưa làm được, vì sau khi cấu hình như vậy thì tất cả vẫn vào internet full chưa ai bị chặn, mình cũng bó tay rồi!

                      ASA5510# show run
                      : Saved
                      :
                      ASA Version 8.3(1)
                      !
                      hostname ASA5510
                      domain-name lohoi.local
                      enable password *******
                      passwd *************** encrypted
                      names
                      !
                      interface Ethernet0/0
                      description Connect_to_Modem
                      nameif outside
                      security-level 0
                      ip address 10.0.0.2 255.255.255.248
                      !
                      interface Ethernet0/1
                      description Connect_to_Router2911
                      nameif inside
                      security-level 100
                      ip address 172.16.17.2 255.255.255.240
                      !
                      interface Ethernet0/2
                      shutdown
                      no nameif
                      no security-level
                      no ip address
                      !
                      interface Ethernet0/3
                      shutdown
                      no nameif
                      no security-level
                      no ip address
                      !
                      interface Management0/0
                      description Management
                      nameif management
                      security-level 100
                      ip address 192.168.1.1 255.255.255.0
                      !
                      regex url1 "vnexpress\.net"
                      regex url2 "flpvietnam\.com"
                      ftp mode passive
                      clock timezone ICT 7
                      dns server-group DefaultDNS
                      domain-name lohoi.local
                      object network obj-any
                      subnet 0.0.0.0 0.0.0.0
                      object network ftpserver
                      host 192.168.100.90
                      description FTP server
                      object network remote_desktop
                      host 192.168.100.111
                      object network remote_vnc
                      host 192.168.100.100
                      object network FullAccess
                      range 192.168.100.1 192.168.100.25
                      object network DenyAccess
                      range 192.168.100.26 192.168.100.254
                      access-list 101 extended permit icmp any any
                      access-list 101 extended permit icmp any any echo-reply
                      access-list 101 extended permit tcp any any
                      access-list outside_access_in extended permit tcp any object ftpserver eq ftp
                      access-list outside_access_in extended permit tcp any host 192.168.100.111 eq 3389

                      access-list outside_access_in extended permit tcp any host 192.168.100.100 eq 5900

                      access-list inside_access_out extended permit ip object FullAccess any
                      access-list inside_in extended permit tcp any any eq smtp
                      access-list inside_in extended permit tcp any any eq pop3
                      access-list inside_in extended deny ip object DenyAccess any
                      access-list inside_in extended deny tcp object DenyAccess any eq www
                      access-list inside_in extended permit tcp any any eq www
                      pager lines 24
                      logging enable
                      logging asdm informational
                      mtu outside 1500
                      mtu inside 1500
                      mtu management 1500
                      icmp unreachable rate-limit 1 burst-size 1
                      asdm image disk0:/asdm-631.bin
                      asdm history enable
                      arp timeout
                      !
                      object network obj-any
                      nat (inside,outside) dynamic interface
                      object network ftpserver
                      nat (inside,outside) static interface service tcp ftp ftp
                      object network remote_desktop
                      nat (inside,outside) static interface service tcp 3389 3389
                      object network remote_vnc
                      nat (inside,outside) static interface service tcp 5900 5900
                      object network FullAccess
                      nat (inside,outside) dynamic interface
                      object network DenyAccess
                      nat (inside,outside) dynamic interface
                      access-group outside_access_in in interface outside
                      route outside 0.0.0.0 0.0.0.0 10.0.0.1 1
                      route inside 192.168.88.160 255.255.255.224 172.16.17.1 1
                      route inside 192.168.100.0 255.255.255.0 172.16.17.1 1
                      timeout xlate 3:00:00
                      timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
                      timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
                      timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
                      timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
                      timeout tcp-proxy-reassembly 0:01:00
                      dynamic-access-policy-record DfltAccessPolicy
                      aaa authentication ssh console LOCAL
                      http server enable
                      http 192.168.1.0 255.255.255.0 management
                      http authentication-certificate inside
                      http authentication-certificate management
                      no snmp-server location
                      no snmp-server contact
                      snmp-server enable traps snmp authentication linkup linkdown coldstart
                      crypto ipsec security-association lifetime seconds 28800
                      crypto ipsec security-association lifetime kilobytes 4608000
                      telnet timeout 5
                      ssh 192.168.100.0 255.255.255.0 inside
                      ssh timeout 5
                      console timeout 0
                      threat-detection basic-threat
                      threat-detection statistics host
                      threat-detection statistics port
                      threat-detection statistics protocol
                      threat-detection statistics access-list
                      no threat-detection statistics tcp-intercept
                      webvpn
                      username admin password ******************* encrypted privilege 15
                      !
                      class-map type regex match-any URL
                      match regex url1
                      match regex url2
                      class-map type inspect http match-all class3
                      match request header host regex class URL
                      class-map inspection_default
                      match default-inspection-traffic
                      class-map classhttp
                      match access-list inside_in
                      !
                      !
                      policy-map type inspect dns preset_dns_map
                      parameters
                      message-length maximum client auto
                      message-length maximum 512
                      policy-map global_policy
                      class inspection_default
                      inspect dns preset_dns_map
                      inspect ftp
                      inspect h323 h225
                      inspect h323 ras
                      inspect rsh
                      inspect rtsp
                      inspect esmtp
                      inspect sqlnet
                      inspect skinny
                      inspect sunrpc
                      inspect xdmcp
                      inspect sip
                      inspect netbios
                      inspect tftp
                      inspect ip-options
                      class classhttp
                      policy-map type inspect http po-http
                      parameters
                      class class3
                      drop-connection log
                      !
                      service-policy global_policy global
                      prompt hostname context
                      call-home
                      profile CiscoTAC-1
                      no active
                      destination address http https://tools.cisco.com/its/service/oddce/services/DD
                      CEService
                      destination address email callhome@cisco.com
                      destination transport-method http
                      subscribe-to-alert-group diagnostic
                      subscribe-to-alert-group environment
                      subscribe-to-alert-group inventory periodic monthly
                      subscribe-to-alert-group configuration periodic monthly
                      subscribe-to-alert-group telemetry periodic daily
                      Cryptochecksum:9840729fa36cada0607c53d61352fa25
                      : end
                      ASA5510#

                      Comment


                      • #12
                        Cấu hình ASA của mình như bên dưới nhưng mình chặn các địa chỉ ip từ 192.168.172.26 --> 192.168.172.254, nhưng theo cấu hình dưới nó vẫn vào full internet cho tất cả, ai xem qua cấu hình rồi hướng dẫn giúp mình.
                        Last edited by jerrybu01; 18-03-2013, 02:24 PM.

                        Comment


                        • #13
                          Hiện tại con ASA của mình mặc định là đang chạy cho user full ra internet hết, và mình cấu hình như bên dưới để 1 số IP ra full internet, số còn lại hạn chế chỉ ra 1 số trang và tất cả email. Sau khi mình cấu hình như bên dưới thì tất cả vẫn ra internet bình thường? ai giải quyết giúp mình cái yêu cầu này

                          ASA5510(config)# object network FullAccess
                          ASA5510(config-network-object)# range 192.168.172.1 192.168.172.25
                          ASA5510(config-network-object)# nat (inside,outside) dynamic interface
                          ASA5510(config-network-object)# access-list inside_access_out permit ip object FullAccess any
                          ASA5510(config)# object network DenyAccess
                          ASA5510(config-network-object)# range 192.168.172.26 192.168.172.254
                          ASA5510(config-network-object)# nat (inside,outside) dynamic interface
                          ASA5510(config-network-object)# access-list inside_in permit tcp any any eq 25
                          ASA5510(config)# access-list inside_in permit tcp any any eq 110
                          ASA5510(config)# access-list inside_in deny ip object DenyAccess any
                          ASA5510(config)# regex url1 "vnexpress\.net"
                          ASA5510(config)# regex url2 "flpvietnam\.com"
                          ASA5510(config)# class-map type regex match-any URL
                          ASA5510(config-cmap)# match regex url1
                          ASA5510(config-cmap)# match regex url2
                          ASA5510(config)# class-map type inspect http match-all class3
                          ASA5510(config-cmap)# match request header host regex class URL
                          ASA5510(config-cmap)# access-list inside_in extended deny tcp object DenyAcces any
                          ASA5510(config)# access-list inside_in extended permit tcp any any eq 80
                          ASA5510(config)# class-map classhttp
                          ASA5510(config-cmap)# match access-list inside_in
                          ASA5510(config-cmap)# policy-map type inspect http po-http
                          ASA5510(config-pmap)# parameters
                          ASA5510(config-pmap-p)# class class3
                          ASA5510(config-pmap-c)# drop-connection log
                          ASA5510(config-pmap-c)# policy-map global_policy
                          ASA5510(config-pmap)# class classhttp
                          ASA5510(config-pmap-c)# service-policy global_policy global
                          WARNING: Policy map global_policy is already configured as a service policy
                          ASA5510(config)#

                          Comment


                          • #14
                            Mình làm theo kiểu này thì nó block toàn bộ range ip của mình luôn, không hiểu sao luôn, không biết có sai chỗ nào không?
                            Xin mọi người hướng dẫn giúp.

                            object network Full-internet-Access

                            range 192.168.172.1 192.168.172.25
                            nat (inside,outside) dynamic interface


                            object network Deny-internet-Access
                            range 192.168.172.26 192.168.172.254
                            nat (inside,outside) dynamic interface


                            access-list inside_in permit tcp any any eq 25
                            access-list inside_in permit tcp any any eq 110
                            access-list inside_in permit tcp any any eq 80
                            access-list Inside_in permit ip object Full-internet-Access any
                            access-list Inside_in deny ip object Deny-internet-Access any [optional]

                            access-group inside_in in interface inside

                            regex url1 "vnexpress\.net"
                            regex url2 "tuoitre\.net"
                            regex url3 “vdict\.com”
                            regex url4 “translate\.google\.com\.vn”

                            class-map type inspect http match-any block-url-class
                            match request header host regex url1
                            match request header host regex url2
                            match request header host regex url3
                            match request header host regex url4

                            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

                            Comment


                            • #15
                              Cấu hình chặn Web trên ASA 5510

                              Originally posted by lamvantu View Post
                              À cái vụ này, thì mình làm cái access-list thôi.
                              Đầu tiên, viết cái regex:


                              Tiếp theo viết class-map để add regex vô


                              Tiếp theo viết class-map type inspect


                              Sau đó viết cái ACL:
                              Ví dụ:


                              Gán access-list vào class map



                              Viết policy map


                              Gán HTTP Inpsection Policy Map



                              Cuối cùng gán global_policy cho tất cả các interface
                              Mình đã làm theo hướng dẫn ở trên của Tú. Cụ thể:
                              firewall(config)#regex url1 ".facebook.com"
                              Sau khi nhấn Enter thì có thông báo Invalid input detected at '^' marker.Vậy nguyên nhân do sao thế. Mong bạn giúp đỡ.

                              Comment

                              Working...
                              X