LINUX.ORG.RU
ФорумAdmin

Прозрачный squid. Использование wget, apt-get через https

 ,


0

2

Задача: Поднять серевер, через который можно будет обновлять ОС, ставить ПО из internet.

Имеется: Debian, CentOS

Понимаю, что если бы ОС не были разные, а только, например Debian то все можно было бы решить с помошью кэширования репозиториев apt-proxy \ apt-cacher \ apt-cacher-ng. Однако поскольку имеем еще и CentOS, то не этой ОС просто не будет работать yum. Решение, которое я пытаюсь внедрить -squid.

Имеем squid, который я собрал с поддержкой ssl:

#squid -v**

Squid Cache: Version 4.6 Service Name: squid Debian linux

This binary uses OpenSSL 1.1.1d 10 Sep 2019. For legal restrictions on distribution see https://www.openssl.org/source/license.html

configure options: '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--libexecdir=${prefix}/lib/squid' '--srcdir=.' '--disable-maintainer-mode' '--disable-dependency-tracking' '--disable-silent-rules' 'BUILDCXXFLAGS=-g -O2 -fdebug-prefix-map=/tmp/squid/squid-4.6=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -latomic' 'BUILDCXX=x86_64-linux-gnu-g++' '--with-build-environment=default' '--enable-build-info=Debian linux' '--datadir=/usr/share/squid' '--sysconfdir=/etc/squid' '--libexecdir=/usr/lib/squid' '--mandir=/usr/share/man' '--enable-inline' '--disable-arch-native' '--enable-async-io=8' '--enable-storeio=ufs,aufs,diskd,rock' '--enable-removal-policies=lru,heap' '--enable-delay-pools' '--enable-cache-digests' '--enable-icap-client' '--enable-follow-x-forwarded-for' '--enable-auth-basic=DB,fake,getpwnam,LDAP,NCSA,NIS,PAM,POP3,RADIUS,SASL,SMB' '--enable-auth-digest=file,LDAP' '--enable-auth-negotiate=kerberos,wrapper' '--enable-auth-ntlm=fake,SMB_LM' '--enable-external-acl-helpers=file_userip,kerberos_ldap_group,LDAP_group,session,SQL_session,time_quota,unix_group,wbinfo_group' '--enable-security-cert-validators=fake' '--enable-storeid-rewrite-helpers=file' '--enable-url-rewrite-helpers=fake' '--enable-eui' '--enable-esi' '--enable-icmp' '--enable-zph-qos' '--enable-ecap' '--disable-translation' '--with-swapdir=/var/spool/squid' '--with-logdir=/var/log/squid' '--with-pidfile=/var/run/squid.pid' '--with-filedescriptors=65536' '--with-large-files' '--with-default-user=proxy' '--with-gnutls' '--enable-ssl' '--enable-ssl-crtd' '--with-openssl' '--enable-linux-netfilter' 'build_alias=x86_64-linux-gnu' 'CC=x86_64-linux-gnu-gcc' 'CFLAGS=-g -O2 -fdebug-prefix-map=/tmp/squid/squid-4.6=. -fstack-protector-strong -Wformat -Werror=format-security -Wall' 'LDFLAGS=-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -latomic' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXX=x86_64-linux-gnu-g++' 'CXXFLAGS=-g -O2 -fdebug-prefix-map=/tmp/squid/squid-4.6=. -fstack-protector-strong -Wformat -Werror=format-security'

# lsb_release -d

Description: Debian GNU/Linux 10 (buster)

# cat /etc/squid/squid.conf

acl localnet src 10.0.0.0/8 acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1 acl SSL_ports port 443 acl Safe_ports port 80 # http acl Safe_ports port 21 # ftp acl Safe_ports port 443 # https acl Safe_ports port 70 # gopher acl Safe_ports port 210 # wais acl Safe_ports port 1025-65535 # unregistered ports acl Safe_ports port 280 # http-mgmt acl Safe_ports port 488 # gss-http acl Safe_ports port 591 # filemaker acl Safe_ports port 777 # multiling http acl CONNECT method CONNECT http_access allow manager localhost http_access deny manager http_access deny !Safe_ports http_access deny CONNECT !SSL_ports http_access allow localhost http_access allow localnet http_access deny all

http_port 3128 https_port 3129 intercept ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=4MB cert=/etc/squid/ssl/squid.pem key=/etc/squid/ssl/squid.key

sslproxy_cert_error allow all sslproxy_flags DONT_VERIFY_PEER

#always_direct allow all # если включить, перестает работать http ssl_bump server-first all ssl_bump none all sslcrtd_program /usr/lib/squid/security_file_certgen -s /var/lib/ssl_db -M 4MB

hierarchy_stoplist cgi-bin ? cache_dir ufs /var/spool/squid 2196 64 256 coredump_dir /var/spool/squid access_log /var/log/squid/access.log cache_log /var/log/squid/cache.log cache_store_log none shutdown_lifetime 3 second logfile_rotate 1

refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 refresh_pattern . 0 20% 4320

#ls /etc/squid/ssl/

squid.csr squid.der squid.key squid.pem

При текущем раскладе я имею только http. https не работатет.

1614847921.866 35412 10.55.200.200 TCP_MISS/503 2696 GET http://ftp.br.debian.org/debian/pool/main/t/telegram-desktop/telegram-desktop... - HIER_NONE/- text/html 1614850515.527 0 10.55.200.200 TCP_DENIED_ABORTED/200 0 CONNECT 10.55.200.1:3129 - HIER_NONE/- - 1614850516.530 0 10.55.200.200 TCP_DENIED_ABORTED/200 0 CONNECT 10.55.200.1:3129 - HIER_NONE/- - 1614850518.533 0 10.55.200.200 TCP_DENIED_ABORTED/200 0 CONNECT 10.55.200.1:3129 - HIER_NONE/- -

Подскажите, где я накосячил с конфигом? Если имеется другоее решение, буду благодарен за подсказку.

Ответ на: комментарий от mrvitkor

Нет. Как минимум там есть ботва acl_ssl_ports. Убери её.

Bers666 ★★★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.