Hello Team,
I’m new to Squid and need some support on advance topic, request you to advice on this requirement.
I’m trying to achieve below scenario for HTTPs traffic.
Client———>VPN———>SQUID—————>Internet
Condition:
- VPN and SQUID on same machine
- I didn’t want end-user (client) to know about proxy, so no configuration allowed on client end.
- I’m ok to restrict/allow traffic based on SNI, so no need to decrypt the SSL packet
I was following this article to achieve this
https://wiki.squid-cache.org/ConfigExamples/Intercept/SslBumpExplicit
I have success fully rerouted the traffic on CentOS7 machine towards SQUID
HTTP traffic is working as expected, I’m able to apply policy based on custom build Helper (Python)
SQUID not able to decode the HTTPs URL even I used ssl-bump with intercept after going over resources on internet.
Notably I got below errors,
X-Squid-Error: ERR_INVALID_REQ 0ERROR: No forward-proxy ports configured.
Below is the Firewalld config
services: http https ipsecports: 500/udp 4500/udp 3127/tcp 3126/tcpprotocols:masquerade: yesforward-ports: port=80:proto=tcp:toport=3127:toaddr=10.128.0.4port=443:proto=tcp:toport=3126:toaddr=10.128.0.4
Below is the Squid.conf
Error log:debug_options ALL,1 11,3 20,3## Recommended minimum configuration:## Example rule allowing access from your local networks.# Adapt to list your (internal) IP networks from where browsing# should be allowedacl localnet src 10.0.0.0/8 # RFC1918 possible internal networkacl localnet src 172.16.0.0/12 # RFC1918 possible internal networkacl localnet src 192.168.0.0/16 # RFC1918 possible internal networkacl localnet src fc00::/7 # RFC 4193 local private network rangeacl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machinesacl SSL_ports port 443acl Safe_ports port 80 # httpacl Safe_ports port 21 # ftpacl Safe_ports port 443 # httpsacl Safe_ports port 70 # gopheracl Safe_ports port 210 # waisacl Safe_ports port 1025-65535 # unregistered portsacl Safe_ports port 280 # http-mgmtacl Safe_ports port 488 # gss-httpacl Safe_ports port 591 # filemakeracl Safe_ports port 777 # multiling httpacl CONNECT method CONNECT## Recommended minimum Access Permission configuration:## Deny requests to certain unsafe ports#http_access deny !Safe_ports# Deny CONNECT to other than secure SSL ports#http_access deny CONNECT !SSL_ports# Only allow cachemgr access from localhosthttp_access allow localhost managerhttp_access deny manager# do not cache anythingcache deny all# We strongly recommend the following be uncommented to protect innocent# web applications running on the proxy server who think the only# one who can access services on "localhost" is a local user#http_access deny to_localhost## INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS## Example rule allowing access from your local networks.# Adapt localnet in the ACL section to list your (internal) IP networks# from where browsing should be allowedhttp_access allow localnethttp_access allow localhost# And finally deny all other access to this proxyhttp_access allow all# Squid normally listens to port 3128http_port 3127 intercept#http_port 3126http_port 3126 ssl-bump intercept \cert=/etc/squid/cert/myCA.pem \generate-host-certificates=on dynamic_cert_mem_cache_size=4MBsslcrtd_program /usr/lib64/squid/ssl_crtd -s /var/spool/squid/ssl_db -M 4MB# Uncomment and adjust the following to add a disk cache directory.#cache_dir ufs /var/spool/squid 100 16 256# Leave coredumps in the first cache dircoredump_dir /var/spool/squid## Add any of your own refresh_pattern entries above these.#refresh_pattern ^ftp: 1440 20% 10080refresh_pattern ^gopher: 1440 0% 1440refresh_pattern -i (/cgi-bin/|\?) 0 0% 0refresh_pattern . 0 20% 4320sslproxy_cert_error allow all#ssl bump#ssl_bump peek allssl_bump stare allssl_bump bump all
2020/04/01 12:55:13.459 kid1| 20,3| store.cc(521) unlock: store_client::copy unlocking key 67A641E2D51E4D78DC31FD1B1792BE59 e:=sXINV/0x5560eb4c70a0*32020/04/01 12:55:13.459 kid1| 20,2| store.cc(949) checkCachable: StoreEntry::checkCachable: NO: not cachable2020/04/01 12:55:13.459 kid1| 20,3| store.cc(483) lock: storeUnregister locked key 67A641E2D51E4D78DC31FD1B1792BE59 e:=sXINV/0x5560eb4c70a0*32020/04/01 12:55:13.459 kid1| 20,3| store.cc(521) unlock: storeUnregister unlocking key 67A641E2D51E4D78DC31FD1B1792BE59 e:=sXINV/0x5560eb4c70a0*32020/04/01 12:55:13.459 kid1| 20,3| store.cc(521) unlock: clientReplyContext::removeStoreReference unlocking key 67A641E2D51E4D78DC31FD1B1792BE59 e:=sXINV/0x5560eb4c70a0*22020/04/01 12:55:13.459 kid1| 20,3| store.cc(521) unlock: ClientHttpRequest::loggingEntry unlocking key 67A641E2D51E4D78DC31FD1B1792BE59 e:=sXINV/0x5560eb4c70a0*12020/04/01 12:55:13.459 kid1| 20,3| store.cc(1239) release: releasing e:=sXINV/0x5560eb4c70a0*0 67A641E2D51E4D78DC31FD1B1792BE592020/04/01 12:55:13.459 kid1| 20,3| store.cc(402) destroyMemObject: destroyMemObject 0x5560eb4d0f402020/04/01 12:55:13.459 kid1| 20,3| MemObject.cc(110) ~MemObject: del MemObject 0x5560eb4d0f402020/04/01 12:55:13.459 kid1| 20,3| store.cc(420) destroyStoreEntry: destroyStoreEntry: destroying 0x5560eb4c70a82020/04/01 12:55:13.459 kid1| 20,3| store.cc(402) destroyMemObject: destroyMemObject 02020/04/01 12:55:14.008 kid1| 20,3| store.cc(774) storeCreatePureEntry: storeCreateEntry: 'error:invalid-request'2020/04/01 12:55:14.008 kid1| 20,3| MemObject.cc(97) MemObject: new MemObject 0x5560eb4d0f402020/04/01 12:55:14.008 kid1| 20,3| store.cc(499) setReleaseFlag: StoreEntry::setReleaseFlag: '[null_store_key]'2020/04/01 12:55:14.008 kid1| 20,3| store_key_md5.cc(89) storeKeyPrivate: storeKeyPrivate: NONE error:invalid-request2020/04/01 12:55:14.008 kid1| 20,3| store.cc(447) hashInsert: StoreEntry::hashInsert: Inserting Entry e:=XI/0x5560eb4c70a0*0 key '0255EA5E5890358FC3F4287C4CA0E49F'2020/04/01 12:55:14.008 kid1| 20,3| store.cc(483) lock: storeCreateEntry locked key 0255EA5E5890358FC3F4287C4CA0E49F e:=XIV/0x5560eb4c70a0*12020/04/01 12:55:14.008 kid1| 20,3| store.cc(483) lock: StoreEntry::storeErrorResponse locked key 0255EA5E5890358FC3F4287C4CA0E49F e:=XIV/0x5560eb4c70a0*22020/04/01 12:55:14.008 kid1| 20,3| store.cc(1862) replaceHttpReply: StoreEntry::replaceHttpReply: error:invalid-request2020/04/01 12:55:14.008 kid1| 20,2| store.cc(949) checkCachable: StoreEntry::checkCachable: NO: not cachable2020/04/01 12:55:14.008 kid1| 20,3| store.cc(1048) complete: storeComplete: '0255EA5E5890358FC3F4287C4CA0E49F'2020/04/01 12:55:14.008 kid1| 20,3| store.cc(1337) validLength: storeEntryValidLength: Checking '0255EA5E5890358FC3F4287C4CA0E49F'2020/04/01 12:55:14.008 kid1| 20,2| store.cc(949) checkCachable: StoreEntry::checkCachable: NO: not cachable2020/04/01 12:55:14.008 kid1| 20,3| store.cc(521) unlock: StoreEntry::storeErrorResponse unlocking key 0255EA5E5890358FC3F4287C4CA0E49F e:=sXINV/0x5560eb4c70a0*22020/04/01 12:55:14.008 kid1| 20,3| store.cc(483) lock: store_client::copy locked key 0255EA5E5890358FC3F4287C4CA0E49F e:=sXINV/0x5560eb4c70a0*22020/04/01 12:55:14.008 kid1| ERROR: No forward-proxy ports configured.2020/04/01 12:55:14.008 kid1| 20,3| store.cc(483) lock: ClientHttpRequest::loggingEntry locked key 0255EA5E5890358FC3F4287C4CA0E49F e:=sXINV/0x5560eb4c70a0*32020/04/01 12:55:14.008 kid1| 11,2| client_side.cc(1393) sendStartOfMessage: HTTP Client local=172.217.4.46:443 remote=10.15.1.100:53362 FD 10 flags=332020/04/01 12:55:14.008 kid1| 11,2| client_side.cc(1394) sendStartOfMessage: HTTP Client REPLY:---------HTTP/1.1 400 Bad RequestServer: squid/3.5.20Mime-Version: 1.0Date: Wed, 01 Apr 2020 12:55:14 GMTContent-Type: text/html;charset=utf-8Content-Length: 4033X-Squid-Error: ERR_INVALID_REQ 0Vary: Accept-LanguageContent-Language: enX-Cache: MISS from proto-vpnX-Cache-Lookup: NONE from proto-vpn:0Via: 1.1 proto-vpn (squid/3.5.20)Connection: close
_______________________________________________ squid-users mailing list squid-users@xxxxxxxxxxxxxxxxxxxxx http://lists.squid-cache.org/listinfo/squid-users