четверг, 28 ноября 2013 г.

Как создается IPSEC туннель, примеры Cisco IOS

Готовлюсь к экзамену 642-637 Secure. Читаю одноименную книжку. Теперь всё ясно и понятно про IPSec и GRE. Зарисовки из конфигов рутеров в GNS.

IKE фаза 1 (Main mode or Aggressive mode)
1. Negotiate phase (согласование опций)
1.1 Hashing: MD5, SHA
1.2 Authentikation: PSK, RSA Sigs
1.3 Group (DH): 1,2,5
1.4 Lifetime of tunnel wo traffic seconds
1.5 Encryption: DES, 3DES, AES
2. Setup Keys (DH)
3. Authenticate
4. IKE phase 1 SA/tunnel ready


IKE фаза 2
1. Negotiate phase 2 (Quick mode)
1.1 Hashing: MD5/SHA HMAC
1.2 (Already authenticated)
1.3 Group/PFS (DH) Можно выбрать ещё раз
1.4 Lifetime: time or data (для туннеля 2)
1.5 Encryption
2. IKE phate 2 SA/Tunnel ready


---
Вариант 1 - обычный IPsec


!
crypto isakmp policy 100
encr aes
authentication pre-share
group 5
lifetime 360
crypto isakmp key GnsTest address 172.16.2.2
!
!
crypto ipsec transform-set GNSTEST esp-aes esp-sha-hmac
!
crypto map GNS-CM 10 ipsec-isakmp
set peer 172.16.2.2
match address 101
!
!

среда, 9 октября 2013 г.

Полезные команды Linux на одном листе

Оригинал тут - http://www.f-notes.info/linux:linux_command

КомандаОписание
Системная информация
archотобразить архитектуру компьютера
uname -m
uname -rотобразить используемую версию ядра
dmidecode -qпоказать аппаратные системные компоненты - (SMBIOS / DMI)
hdparm -i /dev/hdaвывести характеристики жесткого диска
hdparm -tT /dev/sdaпротестировать производительность чтения данных с жесткого диска
cat /proc/cpuinfoотобразить информацию о процессоре
cat /proc/interruptsпоказать прерывания
cat /proc/meminfoпроверить использование памяти
cat /proc/swapsпоказать файл(ы) подкачки
cat /proc/versionвывести версию ядра
cat /proc/net/devпоказать сетевые интерфейсы и статистику по ним
cat /proc/mountsотобразить смонтированные файловые системы
lspci -tvпоказать в виде дерева PCI устройства
lsusb -tvпоказать в виде дерева USB устройства
dateвывести системную дату
cal 2007вывести таблицу-календарь 2007-го года
date 041217002007.00установить системные дату и время ММДДЧЧммГГГГ.СС (МесяцДеньЧасМинутыГод.Секунды)
clock -w

понедельник, 30 сентября 2013 г.

ASA URL Filtering

Оригинал тут - https://supportforums.cisco.com/docs/DOC-1268

Introduction

One of the ASA features is url filtering. It can be used to block or allow users from going to certain urls/websites. This article aims to educate the user on how to use this feature. After reading it carefully someone should be able to take full advantage of url filtering and use it for his needs.

In this article we will either block or allow domains in urls and words in the uri. Of course the ASA can match on other things too. They can be found in the ASA configuration guides. From now and onwards we will allow or block the cisco.com domain. In other words, any user browsing to any page that is behind cisco.com will be subject to url filtering. Such pages would be www.cisco.com/index.html or cisco.com/exampledir/page.html. Also, we will allow or block "/test/" in the uri. In other words, any page path that contains "/test/" will be url filtered. Examples are www.examplesite.com/exampledir/test/page.html or www.anyurl.com/test/examplepage.jsp or www.anything.com/onedir/seconddir/test

The mechanism used to apply url filtering is Modular Policy Framework (MPF). We will create regular expressions (regex) that will be matched in class-maps of type http. These class-maps will be used in policy-maps to define the drop action. Then the policy-maps will be applied with an http inspection in another policy-map that will be applied to an interface. In that way the http inspection action will be applied to the traffic that hits an interface.

NOTE: Though, we need to highlight that for Enterprise URL Filtering, customers should be steered toward using WebSense or N2H2 integration with the ASA. Such web filtering engines can provide much more robust filtering based on classes of sites. URL filtering directly on the ASA using regex, should be used only sparsely when broad classifications can be applied, with limited regex patterns. The ASA will not scale being used in an enterprise with large regex matches and large volumes of HTTP traffic.


Block specific urls

Lets assume that we want to block some specific websites. For example we want to block specific anything under cisco.com and uris that contain "/test/". We will create the regexes and match them in a class-map. Note that if ANY regex is matched then the class-map will actually be met. Then in the policy-map block-url-policy whatever meets the class-map (cisco.com OR uri containing "/test/") is reset. The rest are allowed (not cisco.com and not uri containing "/test/"). The policy-map block-url-policy is used for http inspection in another policy-map (global_policy) and applied with a service-policy.
 
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