LINUX.ORG.RU

прозрачный squid

 ,


0

1

fedora 26

squid -v
Squid Cache: Version 4.0.20
Service Name: squid

This binary uses OpenSSL 1.1.0h-fips  27 Mar 2018. For legal restrictions on distribution see https://www.openssl.org/source/license.html

configure options:  '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--exec_prefix=/usr' '--libexecdir=/usr/lib64/squid' '--localstatedir=/var' '--datadir=/usr/share/squid' '--sysconfdir=/etc/squid' '--with-logdir=/var/log/squid' '--with-pidfile=/var/run/squid.pid' '--disable-dependency-tracking' '--enable-eui' '--enable-follow-x-forwarded-for' '--enable-auth' '--enable-auth-basic=DB,fake,getpwnam,LDAP,NCSA,NIS,PAM,POP3,RADIUS,SASL,SMB,SMB_LM' '--enable-auth-ntlm=SMB_LM,fake' '--enable-auth-digest=file,LDAP' '--enable-auth-negotiate=kerberos' '--enable-external-acl-helpers=LDAP_group,time_quota,session,unix_group,wbinfo_group,kerberos_ldap_group' '--enable-storeid-rewrite-helpers=file' '--enable-cache-digests' '--enable-cachemgr-hostname=localhost' '--enable-delay-pools' '--enable-epoll' '--enable-icap-client' '--enable-ident-lookups' '--enable-linux-netfilter' '--enable-removal-policies=heap,lru' '--enable-snmp' '--enable-ssl' '--enable-ssl-crtd' '--enable-storeio=aufs,diskd,ufs,rock' '--enable-diskio' '--enable-wccpv2' '--enable-esi' '--enable-ecap' '--with-aio' '--with-default-user=squid' '--with-dl' '--with-openssl' '--with-pthreads' '--disable-arch-native' '--with-pic' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fPIC' 'LDFLAGS=-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -pie -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel' 'CXXFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fPIC' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'

настроено, все вроде как работает, но например если открываю сайт pikabu.ru через прокси, то он выглядит вот так

но если я открываю гугл, ютуб и т.д. то по https все ок открывается, в чем может проблема с pikabu ?

конфиг squid

acl localnet src 10.20.30.0/24        # RFC1918 possible internal network

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

dns_nameservers 8.8.8.8
http_access deny !Safe_ports

http_access deny CONNECT !SSL_ports

http_access allow localhost manager
http_access deny manager

http_access allow localnet
http_access allow localhost
http_access deny all

http_port 3128 intercept
#https_port 3129 intercept ssl-bump options=ALL:NO_SSLv3:NO_SSLv2 connection-auth=off cert=/etc/squid/squidCA.pem
https_port 3129 intercept  ssl-bump connection-auth=off cert=/etc/squid/squidCA.pem
http_port 3130

always_direct allow all
sslproxy_cert_error allow all
#sslproxy_flags DONT_VERIFY_PEER
tls_outgoing_options flags=DONT_VERIFY_PEER

#укажем правило со списком блокируемых ресурсов (в файле домены вида .domain.com)
acl blocked ssl::server_name "/etc/squid/blocked_https.txt"
#acl YOUTUBE ssl::server_name .googlevideo.com
acl whitelist src "/etc/squid/whitelist_ip.txt"
ssl_bump splice whitelist
acl step1 at_step SslBump1
ssl_bump peek step1

#терминируем соединение, если клиент заходит на запрещенный ресурс
#ssl_bump splice whitelist
ssl_bump terminate blocked
ssl_bump splice all

sslcrtd_program /usr/lib64/squid/security_file_certgen -s /var/lib/ssl_db -M 4MB

#acl YOUTUBE dstdomain .mirror.one.com
acl YOUTUBE ssl::server_name .mirror.one.com
delay_pools 1
delay_class 1 2
delay_parameters 1 -1/-1 6400/6400
delay_access 1 allow YOUTUBE

coredump_dir /var/spool/squid
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
cache_dir aufs /var/spool/squid 20000 49 256
maximum_object_size 61440 KB
minimum_object_size 3 KB

cache_swap_low 90
cache_swap_high 95
maximum_object_size_in_memory 512 KB
memory_replacement_policy lru
logfile_rotate 4

★

Последнее исправление: Garcia (всего исправлений: 1)

выключи его нафиг, если ты один пользователь, он тебе не нужен. федора известна своей «секьюрностью» по дефолту, ну а этот сайт вероятно не хочет общаться с прокси в таком конфиге

zor1984qq ★
()
Ответ на: комментарий от zor1984qq

будет не один пользователь, вот такие «извращенцы» хотят все это завести на федоре, почему именно он не хочет, а другие хотят общаться через прокси?

Garcia ★
() автор топика

Некоторые файлы на других доменах.

Подключаемые css, js тянуться не с pikabu. ru. grep DENI /var/log/squid3/access.log.(ну или где у тебя логи кальмара лежат)

libert0
()
Ответ на: Некоторые файлы на других доменах. от libert0

вот лог при запросе https://pikabu.ru

1536420242.750     59 10.20.30.1 NONE/409 4045 CONNECT cs.pikabu.ru:443 - HIER_NONE/- text/html
1536420242.750     58 10.20.30.1 NONE/409 4045 CONNECT cs.pikabu.ru:443 - HIER_NONE/- text/html
1536420242.750     59 10.20.30.1 NONE/409 4045 CONNECT cs.pikabu.ru:443 - HIER_NONE/- text/html
1536420242.750      0 10.20.30.1 NONE/000 0 NONE error:transaction-end-before-headers - HIER_NONE/- -
1536420242.750      0 10.20.30.1 NONE/000 0 NONE error:transaction-end-before-headers - HIER_NONE/- -
1536420242.750      0 10.20.30.1 NONE/000 0 NONE error:transaction-end-before-headers - HIER_NONE/- -
1536420242.754      0 10.20.30.1 NONE/200 0 CONNECT 185.31.115.197:443 - HIER_NONE/- -
1536420242.754      0 10.20.30.1 NONE/200 0 CONNECT 185.31.115.197:443 - HIER_NONE/- -
1536420242.754      0 10.20.30.1 NONE/200 0 CONNECT 185.31.115.197:443 - HIER_NONE/- -
1536420242.754      0 10.20.30.1 NONE/409 4045 CONNECT cs.pikabu.ru:443 - HIER_NONE/- text/html
1536420242.754      0 10.20.30.1 NONE/000 0 NONE error:transaction-end-before-headers - HIER_NONE/- -
1536420242.754      0 10.20.30.1 NONE/409 4045 CONNECT cs.pikabu.ru:443 - HIER_NONE/- text/html
1536420242.754      0 10.20.30.1 NONE/409 4045 CONNECT cs.pikabu.ru:443 - HIER_NONE/- text/html
1536420242.754      0 10.20.30.1 NONE/000 0 NONE error:transaction-end-before-headers - HIER_NONE/- -
1536420242.754      0 10.20.30.1 NONE/000 0 NONE error:transaction-end-before-headers - HIER_NONE/- -
1536420242.756     63 10.20.30.1 NONE/409 4051 CONNECT cs10.pikabu.ru:443 - HIER_NONE/- text/html
1536420242.756      0 10.20.30.1 NONE/000 0 NONE error:transaction-end-before-headers - HIER_NONE/- -
1536420242.758     56 10.20.30.1 NONE/409 4048 CONNECT cs7.pikabu.ru:443 - HIER_NONE/- text/html
...
1536420243.122      0 10.20.30.1 NONE/409 4048 CONNECT cs6.pikabu.ru:443 - HIER_NONE/- text/html
1536420243.122      0 10.20.30.1 NONE/409 4048 CONNECT cs6.pikabu.ru:443 - HIER_NONE/- text/html
1536420243.122      0 10.20.30.1 NONE/000 0 NONE error:transaction-end-before-headers - HIER_NONE/- -
1536420243.122      0 10.20.30.1 NONE/000 0 NONE error:transaction-end-before-headers - HIER_NONE/- -
1536420243.122      1 10.20.30.1 NONE/200 0 CONNECT 151.236.119.19:443 - HIER_NONE/- -
1536420243.122      1 10.20.30.1 NONE/200 0 CONNECT 91.240.170.34:443 - HIER_NONE/- -
1536420243.122      0 10.20.30.1 NONE/409 4048 CONNECT cs9.pikabu.ru:443 - HIER_NONE/- text/html
1536420243.122      0 10.20.30.1 NONE/000 0 NONE error:transaction-end-before-headers - HIER_NONE/- -
1536420243.634      0 10.20.30.1 NONE/200 0 CONNECT 87.250.251.119:443 - HIER_NONE/- -
1536420243.679      0 10.20.30.1 NONE/200 0 CONNECT 87.250.251.119:443 - HIER_NONE/- -
1536420243.731      0 10.20.30.1 NONE/200 0 CONNECT 87.250.250.92:443 - HIER_NONE/- -
1536420243.733      0 10.20.30.1 NONE/200 0 CONNECT 87.250.250.92:443 - HIER_NONE/- -
1536420243.736      0 10.20.30.1 NONE/200 0 CONNECT 87.250.250.92:443 - HIER_NONE/- -
1536420243.740      0 10.20.30.1 NONE/200 0 CONNECT 87.250.250.92:443 - HIER_NONE/- -
1536420244.004      0 10.20.30.1 NONE/200 0 CONNECT 87.250.250.92:443 - HIER_NONE/- -
1536420244.013      0 10.20.30.1 NONE/200 0 CONNECT 87.250.250.92:443 - HIER_NONE/- -
1536420244.115      1 10.20.30.1 NONE/200 0 CONNECT 172.217.20.206:443 - HIER_NONE/- -
1536420244.115      0 10.20.30.1 NONE/409 4066 CONNECT clients1.google.com:443 - HIER_NONE/- text/html
1536420244.115      0 10.20.30.1 NONE/000 0 NONE error:transaction-end-before-headers - HIER_NONE/- -
1536420244.118      0 10.20.30.1 NONE/200 0 CONNECT 172.217.20.206:443 - HIER_NONE/- -
1536420244.119      0 10.20.30.1 NONE/409 4066 CONNECT clients1.google.com:443 - HIER_NONE/- text/html
1536420244.119      0 10.20.30.1 NONE/000 0 NONE error:transaction-end-before-headers - HIER_NONE/- -
1536420244.164      0 10.20.30.1 NONE/200 0 CONNECT 87.250.250.92:443 - HIER_NONE/- -
1536420244.277      0 10.20.30.1 NONE/200 0 CONNECT 178.154.131.215:443 - HIER_NONE/- -
1536420244.547      0 10.20.30.1 NONE/200 0 CONNECT 216.58.215.98:443 - HIER_NONE/- -
1536420244.547      0 10.20.30.1 NONE/409 4096 CONNECT pagead2.googlesyndication.com:443 - HIER_NONE/- text/html
1536420244.547      0 10.20.30.1 NONE/000 0 NONE error:transaction-end-before-headers - HIER_NONE/- -
1536420244.548      0 10.20.30.1 NONE/200 0 CONNECT 216.58.215.98:443 - HIER_NONE/- -
1536420244.549      0 10.20.30.1 NONE/409 4096 CONNECT pagead2.googlesyndication.com:443 - HIER_NONE/- text/html
1536420244.549      0 10.20.30.1 NONE/000 0 NONE error:transaction-end-before-headers - HIER_NONE/- -
1536420244.558      0 10.20.30.1 NONE/200 0 CONNECT 216.58.215.98:443 - HIER_NONE/- -
1536420244.559      0 10.20.30.1 NONE/409 4096 CONNECT pagead2.googlesyndication.com:443 - HIER_NONE/- text/html
1536420244.559      0 10.20.30.1 NONE/000 0 NONE error:transaction-end-before-headers - HIER_NONE/- -
1536420244.560      0 10.20.30.1 NONE/200 0 CONNECT 216.58.215.98:443 - HIER_NONE/- -
1536420244.560      0 10.20.30.1 NONE/409 4096 CONNECT pagead2.googlesyndication.com:443 - HIER_NONE/- text/html
1536420244.560      0 10.20.30.1 NONE/000 0 NONE error:transaction-end-before-headers - HIER_NONE/- -
1536420244.570      1 10.20.30.1 NONE/200 0 CONNECT 216.58.215.98:443 - HIER_NONE/- -
1536420244.570      0 10.20.30.1 NONE/409 4096 CONNECT pagead2.googlesyndication.com:443 - HIER_NONE/- text/html
1536420244.570      0 10.20.30.1 NONE/000 0 NONE error:transaction-end-before-headers - HIER_NONE/- -
1536420244.571      0 10.20.30.1 NONE/200 0 CONNECT 216.58.215.98:443 - HIER_NONE/- -
1536420244.572      0 10.20.30.1 NONE/409 4096 CONNECT pagead2.googlesyndication.com:443 - HIER_NONE/- text/html
1536420244.572      0 10.20.30.1 NONE/000 0 NONE error:transaction-end-before-headers - HIER_NONE/- -
1536420244.756      0 10.20.30.1 NONE/200 0 CONNECT 216.58.215.98:443 - HIER_NONE/- -
1536420244.757      0 10.20.30.1 NONE/409 4096 CONNECT pagead2.googlesyndication.com:443 - HIER_NONE/- text/html
1536420244.757      0 10.20.30.1 NONE/000 0 NONE error:transaction-end-before-headers - HIER_NONE/- -
1536420245.352      0 10.20.30.1 NONE/409 4096 CONNECT pagead2.googlesyndication.com:443 - HIER_NONE/- text/html
1536420245.352      0 10.20.30.1 NONE/000 0 NONE error:transaction-end-before-headers - HIER_NONE/- -
1536420245.421      0 10.20.30.1 NONE/200 0 CONNECT 216.58.215.98:443 - HIER_NONE/- -
1536420245.421      0 10.20.30.1 NONE/409 4096 CONNECT pagead2.googlesyndication.com:443 - HIER_NONE/- text/html
1536420245.421      0 10.20.30.1 NONE/000 0 NONE error:transaction-end-before-headers - HIER_NONE/- -
1536420245.422      0 10.20.30.1 NONE/200 0 CONNECT 216.58.215.98:443 - HIER_NONE/- -
1536420245.422      0 10.20.30.1 NONE/409 4096 CONNECT pagead2.googlesyndication.com:443 - HIER_NONE/- text/html
1536420245.422      0 10.20.30.1 NONE/000 0 NONE error:transaction-end-before-headers - HIER_NONE/- -
1536420245.822      0 10.20.30.1 NONE/200 0 CONNECT 172.217.20.206:443 - HIER_NONE/- -
1536420245.822      0 10.20.30.1 NONE/409 4066 CONNECT clients1.google.com:443 - HIER_NONE/- text/html
...
1536420246.497   2332 10.20.30.1 TCP_TUNNEL/200 5124 CONNECT matchid.adfox.yandex.ru:443 - ORIGINAL_DST/87.250.250.92 -
1536420247.768   3755 10.20.30.1 TCP_TUNNEL/200 16305 CONNECT ads.adfox.ru:443 - ORIGINAL_DST/87.250.250.92 -
1536420247.787   3782 10.20.30.1 TCP_TUNNEL/200 10963 CONNECT ads.adfox.ru:443 - ORIGINAL_DST/87.250.250.92 -
1536420247.829   4095 10.20.30.1 TCP_TUNNEL/200 18574 CONNECT ads.adfox.ru:443 - ORIGINAL_DST/87.250.250.92 -
1536420247.839   5203 10.20.30.1 TCP_TUNNEL/200 28680 CONNECT yastatic.net:443 - ORIGINAL_DST/178.154.131.215 -
1536420247.841   5205 10.20.30.1 TCP_TUNNEL/200 35967 CONNECT yastatic.net:443 - ORIGINAL_DST/178.154.131.215 -
1536420247.847   4110 10.20.30.1 TCP_TUNNEL/200 15506 CONNECT ads.adfox.ru:443 - ORIGINAL_DST/87.250.250.92 -
1536420247.873   4133 10.20.30.1 TCP_TUNNEL/200 26360 CONNECT ads.adfox.ru:443 - ORIGINAL_DST/87.250.250.92 -
1536420247.882   4150 10.20.30.1 TCP_TUNNEL/200 27027 CONNECT ads.adfox.ru:443 - ORIGINAL_DST/87.250.250.92 -

про DENI ничего нет

Garcia ★
() автор топика
Ответ на: комментарий от libert0

Unused connections received in http_port or https_port or transactions terminated before reading[parsing] request headers logged with URI error:transaction-end-before-headers.

These errors are meant to be logged for clients that open and close connections without sending any HTTP headers (or without sending complete HTTP headers — you can log HTTP request size to distinguish these two cases).

влияет ли это на мою проблему, не понятно

Garcia ★
() автор топика

настроено, все вроде как работает, но например если открываю сайт pikabu.ru через прокси, то он выглядит вот так

Ужасное ШГ

madcore ★★★★★
()
Ответ на: комментарий от libert0

в итоге поднял на сервере unbound, поставил

dns_nameservers 127.0.0.1
указал его и для сквида и для винды

теперь все работает как надо

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