Network: Proxy (direct/redirection, transparent), SQUID

Про Security: Cisco IronPort AsyncOS based solutions (WSA, ESA) – Web & Email security отдельная статья.

Анализ рынка proxy и два

  • Proxy зачастую лучше NGFW в задачах гранулярности инспекции – глубокая инспекция (напр. запрещение методов) HTTP, antivirus, URLF, SSL inspection, etc (см. WSA). Кроме того будучи промежуточным устройством они по умолчанию обеспечивают некоторую доп. защиту в сравнении с прямым доступом машины в сеть. Кто то даже умудряется всю безопасность завязать на explicit (явно настроенный на клиенте) proxy – все сотрудники/устройства (независимо от местоположения: hq/branch/remote worker) подключаются по ssl/tls через интернет/корп. сеть к proxy и не нужны vpn, ngfw и проч. Так же у proxy есть методы балансировки и отказоустойчивости из коробки, даже не используя какие то балансировщики (через pak file, см. WSA).
There is a big difference on how these devices are working. FTD is doing inline inspection, meaning that it is acting as man-in-the middle for your connections (in your IP header you have PC IP as a source and some IP as destination, usually public one, e.g. of cisco.com). This can often be very tricky, as PC is unaware that someone/something is messing with their connections and can report some issues. On the other hand, WSA is working as a proxy (explicit or a transparent one), meaning that connections are coming to WSA as destined to WSA (in your IP header you have PC IP as a source and WSA as destination, and inside the packet, you are asking your WSA to proxy you to some URL, like cisco.com). This also means that you are talking only to your WSA, while your WSA is talking to the Internet, protecting you directly from certain exploits that could potentially target your PC directly otherwise (in this case, they would be destined to WSA, which is a security device, and much harder to be targeted).
Again, due to its nature, some things are much easier to be achieved if you have explicit proxy (e.g. file analysis for malware). Let's not forget SSL/TLS decryption also, which is normally quite demanding for devices such as FTD and degrading performance significantly, which is not something you would want from an edge device which is susceptible to DoS attacks.
I'm of an opinion that URL filtering on FTD is convenient for some smaller customers, which are not very demanding and are looking into some basic functionality. For customers who are interested in doing full blown URL filtering, I'm always advising WSA as a separate system meant for this functionality (and from recently Umbrella SIG, as it can do cloud-based proxy).
  • Proxy часто используются для выхода внутренних (не важно внутри сети или подключенных к proxy из интернета) пользователей в интернет.
  • Трафик на корпоративный proxy зачастую ходит только внешний, для proxy прописывается список исключений, в который включены внутренние ресурсы.
  • Пример reverse proxy – ngrok, часто используют девелоперы для своей работы. Может быть полезно для демонстрации в паблик демо-версии WEB проекта.

  • Transparent proxy – не требуется настройка proxy на машине пользователя, прозрачен для пользователя. Китайский Great Firewall использует transparent proxy для анализа/блокировки трафика на основе URI (HTTP) или SNI (HTTPS). Пример описания transparent proxy и редирект трафика на него с использованием WCCP/PBR описан в Cisco WSA.
The Chinese firewall is made of transparent proxies filtering web traffic. These proxies scan the requested URI, the "Host" Header and the content of the web page (for HTTP requests) or the Server Name Indication (for HTTPS requests) for target keywords.
Like for DNS filtering, this method is keyword based. Encrypting the Server Name Indication can be used to bypass this method of filtering. It is currently in development by the IETF,[43] and is offered as a setting in Firefox.

 

Продукты

Open source

    • Squid – основной open source продукт для реализации proxy, используется для фильтрации/дешифрования HTTPS трафика, для масштабирования в рамках продуктов зачастую запускается множество экземпляров squid
    • Nginx – веб сервер, но так же может работать в режиме proxy
    • Fiddler – пример отладочного прокси-сервера, используемого для регистрации, проверки и изменения трафика HTTP и HTTPS между компьютером и веб-сервером.

Commercial

    • Cisco WSA– поддерживает как transparent, так и direct/redirection режим
    • Symantec ProxySG (BlueCoat) – один из лидеров рынка SWG
    • Microsoft ForeFront – до сих пор используется в ряде организаций

 

Настройка SQUID сервера
Установка и настройка базового Proxy на базе Squid. По сути для базовой работы нужно только прописать allow подсети (на неразрешенные подсети будет выдавать forbidden).
# Squid server
sudo apt update
sudo apt install squid

vim.tiny /etc/squid/squid.conf
acl allcomputers src 192.168.1.0/255.255.255.0 # before line "http_access deny all"
acl allcomputers src 192.168.2.0/255.255.255.0
acl allcomputers src 192.168.3.0/255.255.255.0
http_access allow allcomputers

systemctl restart squid.service
systemctl status squid.service
Настройка proxy клиента

Simplest check

curl -v -x http://your.proxy.server:port http://www.google.com/

Simple proxy (Linux)

export http_proxy=http://your.proxy.server:port
export https_proxy=https://your.proxy.server:port
sudo pip2 install statistics --proxy http://your.proxy.server:port # альтернатива при работе через sudo
OS Updates (Linux Debian)
vim.tiny /etc/apt/apt.conf.d/10proxy
Acquire::http::proxy "http://your.proxy.server:port/";
Acquire::https::proxy "http://your.proxy.server:port/";
Acquire::::Proxy "true";

Domain proxy

работает точно в Windows CMD

set http_proxy=http://domain\login:pass@ip:port
set https_proxy=https://domain\login:pass@ip:port

работает точно в Linux

export http_proxy="http://domain\login:pass@ip:port"
export https_proxy="http://domain\login:pass@mip:port"

 

 

 

Leave a Reply