老外的配置供进一步参考
1. Implementing White list
! defining the URL to filter
regex UBI-URL1 "yahoo.com"
regex UBI-URL2 "ubiqube.com"
! grouping url in one object
class-map type regex match-any UBI-URL-LIST
match regex UBI-URL1
match regex UBI-URL2
! specified the matching traffic to block
class-map type inspect http match-all UBI-HTTP-MAP
match no request header host regex class UBI-URL-LIST
! declare action to matching traffic
policy-map type inspect http UBI-HTTP-INSPECT
class UBI-HTTP-MAP
reset log
!applying the inspection
policy-map global_policy
class inspection_default
inspect http UBI-HTTP-INSPECT
OR
2. Implementing black list
! defining the URL to filter
regex UBI-URL1 "yahoo.com"
regex UBI-URL2 "ubiqube.com"
! grouping url in one object
class-map type regex match-any UBI-URL-LIST
match regex UBI-URL1
match regex UBI-URL2
! specified the matching traffic to block
class-map type inspect http match-all UBI-HTTP-MAP
match request header host regex class UBI-URL-LIST
! declare action to matching traffic
policy-map type inspect http UBI-HTTP-INSPECT
class UBI-HTTP-MAP
reset log
!applying the inspection
policy-map global_policy
class inspection_default
inspect http UBI-HTTP-INSPECT
3. Monitore the result via the logs
URL accessed
07-10-10 08:16:27 5 %ASA-5-304001: 10.10.10.10 Accessed URL 213.30.157.8:/page.php?2
URL Blocked
07-10-10 08:16:52 5 %ASA-5-415008: HTTP - matched Class 22: UBI-HTTP-MAP in policy-map UBI-HTTP-inspect, header matched - Resetting connection from inside:10.10.10.10/1423 to outside: 209.85.135.103/80