- Windows update and squid
- Записки IT специалиста
- Устраняем ошибки Windows Update при работе через прокси-сервер Squid
- Squid
- Дополнительные материалы:
- Votum separatum — Yuri Voinov’s Blog
- вторник, 27 октября 2015 г.
- Squid: SSL Bump и Windows Update
- Navigation
- Search
- How do I make Windows Updates cache?
- Preventing Early or Frequent Replacement
- Why does it go so slowly through Squid?
- How do I stop Squid popping up the Authentication box for Windows Update?
- Squid problems with Windows Update v5
- AKA, Why does Internet Explorer work but the background automatic updates fail?
- Proxy configuration with proxycfg
- Proxy configuration with netsh
- Squid with SSL-Bump and Windows Updates
Windows update and squid
Добрый день!
Использую связку freebsd+SQUID+SAMS Rejik3 c авторизацией по NTLM.На клиентах win7 в ie указан прокси freebsd+SQUID+SAMS Rejik3 c авторизацией по NTLM. Шлюзом на клиенте прокся не является.на маршрутизаторе кот в инет натинг настроин только для прокси.
при нажатии кнопки поиск обновлений на клиенте появляется запрос «Введите учетные данные для проверки подлиности прокси-сервером.вот лог при попытке обновить винду
подсмотрел решения такие (но у меня не работают)
1.acl windowsupdate dstdomain -i «/usr/local/etc/squid/windowsupdate»
no_cache deny windowsupdate
http_access allow windowsupdate
# этот http_access нужно поставить перед http_access deny all
# не забываем, что squid.conf парсится сверху вниз и слева направо
в файлике /usr/local/etc/squid/windowsupdate пишем такое
в результате на эти сайты машины ходят сами без пароля, но через squid. В access.log будет IP-адрес.
2. похожее
acl windowsupdate dstdomain windowsupdate.microsoft.com
acl windowsupdate dstdomain .update.microsoft.com
acl windowsupdate dstdomain download.windowsupdate.com
acl windowsupdate dstdomain redir.metaservices.microsoft.com
acl windowsupdate dstdomain images.metaservices.microsoft.com
acl windowsupdate dstdomain c.microsoft.com
acl windowsupdate dstdomain www.download.windowsupdate.com
acl windowsupdate dstdomain wustat.windows.com
acl windowsupdate dstdomain crl.microsoft.com
acl CONNECT method CONNECT
acl wuCONNECT dstdomain www.update.microsoft.com
http_access allow CONNECT wuCONNECT
http_access allow windowsupdate
Есть еще предложение пустить обновление в обход squid но через freebsd, то бишь править конфигу ipfw
хотя я думаю что все таки при указаном пркокси в ie пакеты сразу попадают на squid а потом уже после обработки в ipfw
например на squid закрыл доступ к внешнему url на клиенте сообщение сответсвено Доступ к URL запрещен
в ipfw добавляю правило перед натом
/sbin/ipfw add fwd айпи внешнего url,80 tcp from any to айпи внешнего url 3128 in via em1
em1 внутрений интерфейс freebsd.
результат на клиенте сообщение Доступ к URL запрещен
Подскажите как добиться либо через squid либо в обход.
Оглавление |
|
Сообщения по теме | [Сортировка по времени | RSS] |
1. «обновление windows через squid или в обход» | + / – | |
Сообщение от PavelR (ok) on 09-Дек-11, 07:47 | ||
Ответить | Правка | ^ к родителю #0 | Наверх | Cообщить модератору |
3. «обновление windows через squid или в обход» | + / – | |
Сообщение от decrups (ok) on 09-Дек-11, 12:34 | ||
Спасибо за ответ. Записки IT специалистаТехнический блог специалистов ООО»Интерфейс»
Устраняем ошибки Windows Update при работе через прокси-сервер Squid
Внешнее проявление неисправности сводится к тому, что служба Windows Update не может загрузить обновления и сопровождается одним из кодов ошибки:
Для ее возникновения требуется сочетание нескольких факторов: наличия в сети прокси-сервера с аутентификацией пользователей и службы WPAD. Неподготовленного администратора данная ошибка застает врасплох, однако существует статья KB896226, которая подробно проливает свет на проблему и способы ее решения:
Если коротко, то суть происходящих событий следующая: для доступа к серверам Центра обновлений система использует службу Windows HTTP (WinHTTP), которая в свою очередь поддерживает автоматическое получение настроек прокси через WPAD. Т.е. все запросы к серверам обновлений будут автоматически направлены на прокси, это не доставляет проблем до тех пор, пока прокси-сервер не начинает требовать аутентификации клиентов. Службы Windows Update не могут пройти аутентификацию и возникает проблема с получением обновлений. Чтобы избавиться от этой ошибки следует выполнить рекомендации Microsoft и обеспечить анонимный доступ к серверам обновлений. Сделать это можно достаточно просто и несколькими способами. Рассмотрим их подробнее. SquidСистема контроля доступа Squid дает в руки администратора мощный инструмент управления и этим следует пользоваться. Тем более что стоящая перед нами задача ничем не отличается от URL-фильтрации по спискам, о которой мы рассказывали ранее. Создадим отдельный список для служб Windows Update: и внесем в него следующие записи: За его основу мы взяли список из KB896226 который актуализировали и дополнили исходя из собственного опыта и наработок коллег. Теперь создадим элемент ACL для работы со списком: Для того, чтобы обеспечить анонимный доступ к указанным ресурсам следует создать список доступа и разместить его раньше списков, требующих аутентификацию или производящих авторизацию, лучше всего сделать его одним из первых. После чего перезапустите прокси-сервер и проверьте доступ к серверам обновлений, он должен восстановиться. Существует также еще один вариант — направить трафик к серверам обновлений минуя прокси-сервер. В этом нам поможет протокол WPAD, точнее специальные правила в PAC-файле. На наш взгляд этот метод менее предпочтителен, но вполне имеет право на существование. Для его реализации добавьте в файл wpad.dat следующие инструкции: Изменения вступают в силу сразу, перезапускать службы не требуется. При использовании данного метода следует принять во внимание еще один момент — если вы принимали меры по запрету обхода прокси, например, при помощи iptables, то следует явно разрешить соединения к серверам обновлений. На текущий момент указанным серверам соответствуют следующие IP-адреса: Собственно, поэтому не рекомендуем данный способ, так как поддерживать один список доменных имен для Squid проще, чем два, тем более что соответствие доменных имен IP-адресам может меняться. В любом случае теперь вы понимаете источник проблемы и можете самостоятельно выбрать наиболее предпочтительный способ ее решения. Дополнительные материалы:Помогла статья? Поддержи автора и новые статьи будут выходить чаще: Или подпишись на наш Телеграм-канал: Votum separatum — Yuri Voinov’s BlogОсобое мнение — блог Юрия Воинова вторник, 27 октября 2015 г.Squid: SSL Bump и Windows UpdateДопустим, что вы — умная маша, сделали sniffing сессии WU, и увидели некоторые адреса авторизационных серверов до получения ошибки WindowsUpdate_80072F8F или чего-то подобного. Вы видите IP, скажем, 191.234.72.190. Делаете реверсивный запрос — обана! — и получаете примерно вот это: Сделайте так. Напишите файл url.nobump: Добавьте его в свой squid.conf в группу правил SSL Bump: Все. Ошибка ушла навсегда. Вам больше не надо вылавливать сети MS, используя сниффер и tcpiputils.com. Такой же набор надо выбрать и на стороне прокси, обращенной к клиенту: NavigationSearchHow do I make Windows Updates cache?Windows Update generally (but not always) uses HTTP Range-Offsets’ (AKA file partial ranges) to grab pieces of the Microsoft Update archive in parallel or using a random-access algorithm trying to reduce the web traffic. Some versions of Squid do not handle or store Ranges very well yet. A mix of configuration options are required to force caching of range requests. Particularly when large objects are involved. maximum_object_size. Default value is a bit small. It needs to be somewhere 100MB or higher to cope with the IE updates. UPDATE: Windows 8.1 upgrade pack requires up to 5GB objects to be cached. It will however, cache nicely provided the size limit is set high enough. range_offset_limit. Does the main work of converting range requests into cacheable requests. Use the same size limit as maximum_object_size to prevent conversion of requests for objects which will not cache anyway. With Squid-3.2 or later use the windowsupdate ACL list defined below to apply this offset limit only to windows updates. quick_abort_min. May need to be altered to allow the full object to download when the client software disconnects. Some Squid releases let range_offset_limit override properly, some have weird behavior when combined. Due to the slow-down problem below we recommend service packs be handled specially:
Preventing Early or Frequent ReplacementOnce you have done the above to cache updates you encounter the problem that some software often forces a full object reload instead of revalidation. Which pushes the cached content out and fetches new objects very frequently. An idea that was floating around suggested that you use a refresh_pattern regexp config to do your WU caching. I decided to test this idea out in my squid proxy, along with one or 2 other ideas (the other ideas failed hopelessly but the WU caching worked like a charm.) The idea basically suggested this: The original idea seemed to work in theory, yet in practicality it was pretty useless — the updates expired after 30 minutes, there were download inconsistencies, and a whole array of issues. So looking at the HTTP responses and documentation for refresh_pattern, there was an extra clause that could be added. This is how it changed: Now all that this line tells us to do is cache all .cab, .exe, .msu, .msu, .msf, .asf, .psf, .wma. to .zip from microsoft.com, and the lifetime of the object in the cache is 4320 minutes (aka 3 days) to 43200 minutes (aka 30 days). Each of the downloaded objects are added to the cache, and then whenever a request arrives indicating the cache copy must not be used it gets converted to an if-modified-since check instead of a new copy reload request. So adding it to the original Squid settings to do with refresh_pattern, we get: This should limit the system from downloading windows updates a trillion times a minute. It’ll hand out the Windows updates, and will keep them stored in the squid cache. I also recommend a 30 to 60GB cache_dir size allocation, which will let you download tonnes of windows updates and other stuff and then you won’t really have any major issues with cache storage or cache allocation or any other issues to do with the cache. . . Why does it go so slowly through Squid?The work-around used by many cache maintainers has been to set the above config and force Squid to fetch the whole object when a range request goes through. Compounding the problem and ironically causing some slowdowns is the fact that some of the Microsoft servers may be telling your Squid not to store the archive file. This means that Squid will pull the entire archive every time it needs any small piece. You will need to test your squid config with smaller values for the range_offset_limit bypass and see which provides the best results for you. Another symptoms which occasionally appear when attempting to force caching of windows updates is service packs. If the quick_abort_min, quick_abort_max, quick_abort_pct settings are set to abort a download incomplete and a client closes with almost but not quite enough of the service pack downloaded. That clients following requests will often timeout waiting for Squid to re-download the whole object from the start. Which naturally causes the problem to repeat on following restart attempts. How do I stop Squid popping up the Authentication box for Windows Update?Add the following to your squid.conf, assuming you have defined localnet to mean your local clients. It ‘MUST‘ be added near the top before any ACL that require authentication. The above config is also useful for other automatic update sites such as Anti-Virus vendors, just add their domains to the acl. |
Squid problems with Windows Update v5
AKA, Why does Internet Explorer work but the background automatic updates fail?
There seems to be some problems with Microsoft Windows to access the Windows Update website. This is especially a problem when you block all traffic by a firewall and force your users to go through a proxy.
Symptom: Windows Update gives error codes like 0x80072EFD and cannot update, automatic updates aren’t working too.
Cause: In earlier Windows-versions Windows Update takes the proxy-settings from Internet Explorer. Since XP SP2 this is not sure. At my machine I ran Windows XP SP1 without Windows Update problems. When I upgraded to SP2 Windows Update started to give errors when searching updates etc.
The problem was that WU did not go through the proxy and tries to establish direct HTTP connections to Update-servers. Even when I set the proxy in IE again, it didn’t help . It isn’t Squid’s problem that Windows Update doesn’t work, but it is in Windows itself. The solution is to use the ‘proxycfg’ or ‘netsh’ tool shipped with Windows. With this tool you can set the proxy for WinHTTP.
Similar issues are found with other Microsoft products in the same Windows versions. The commands below often fix all Microsoft proxy issues at once.
Proxy configuration with proxycfg
In Windows Vista, Server 2008 and later proxycfg is obsolete. Use netsh instead.
Proxy configuration with netsh
To reset proxy settings for WinHTTP use:
Squid with SSL-Bump and Windows Updates
In modern setups with Squid, Windows Update cannot be check updates with error «WindowsUpdate_80072F8F» or similar.
WU now uses its own pinned SSL certificate and must be spliced to work. When you use sniffer, you can see many IP’s with relatively big subnetworks. This leads to problems with a Squid-3.4 and causes serious problems when using Squid-3.5 or above.
To use splicing, you need to know the names of the servers, however, a recursive DNS query does not give a result.
To pass WU check through Squid splice, you only need to splice next MS servers:
For use in real setups, write file url.nobump:
Just add this file as Squid ACL as follows:
and you do not need to know all the IP authorization server for updates.
NOTE: In some countries WU can product SQUID_X509_V_ERR_DOMAIN_MISMATCH error via Akamai. To do WU, you can require to add this into your Squid’s config:
and add this to dstdom.broken:
NOTE: Depending your Squid’s configuration, you may need to change your Squid’s cipher configuration to this one:
and add this one to your bumped port’s configuration:
3DES and RC4 required to connect to WU and — attention! — Skype assets site.
WARNING: Some updates cannot be cached due to splice above. Beware!
WARNING: Adding 3DES and, especially, RC4, produces potentially weak ciphers via client and WU/Skype and some other sites. Be careful!