<div dir="ltr">Thank you for the suggestion!<div><br></div><div>I did think of allowing the domain name first during CONNECT phase, and then the full URL after connection established. However, other paths under the same site wont be blocked.</div><div><br></div><div>i.e. I can ask Squid to let <a href="http://example.com">example.com</a> pass through during CONNECT, and then let <a href="http://example.com/abc/logcin">example.com/abc/logcin</a> pass through after connection established. However, this will let other paths of <a href="http://example.com">example.com</a> pass Squid too (such as <a href="http://example.com/not_to_pass">example.com/not_to_pass</a>) because the it passes the ACL check during CONNECT phase.</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Mar 22, 2020 at 11:19 AM Alex Rousskov <<a href="mailto:rousskov@measurement-factory.com">rousskov@measurement-factory.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 3/20/20 5:48 PM, laviier wrote:<br>
> Hi,<br>
> <br>
> I have a use case that I want to access a certain URL path of a domain but<br>
> not other. i.e. I want client to be able to access <a href="http://example.com/abc/login" rel="noreferrer" target="_blank">example.com/abc/login</a>,<br>
> but not other paths.<br>
> <br>
> Hence, I created ACL rule to achieve that, see below:<br>
> <br>
> ```<br>
> acl to_domain_whitelist url_regex "/squid-config/whitelist/allow.acl"<br>
> acl http port 80<br>
> acl https port 443<br>
> acl connect method CONNECT<br>
> <br>
> http_access allow all to_domain_whitelist<br>
> http_access deny all<br>
> <br>
> http_reply_access allow all<br>
> <br>
> acl step1 at_step SslBump1<br>
> acl step2 at_step SslBump2<br>
> acl step3 at_step SslBump3<br>
> <br>
> ssl_bump peek step3<br>
> ssl_bump bump all<br>
> ```<br>
> <br>
> However the above code does not work properly, the URL regex matching<br>
> happens before Squid performs decryption so that it can only match against<br>
> the host name instead of full URL path. I wonder if there's a way to perform<br>
> the URL regex only after Squid knows the full url with SslBump? Below is a<br>
> briefing of the log. Thank you so much!!!!<br>
> ```<br>
> ---------<br>
> CONNECT <a href="http://example.com:443" rel="noreferrer" target="_blank">example.com:443</a> HTTP/1.1<br>
> Host: <a href="http://example.com:443" rel="noreferrer" target="_blank">example.com:443</a><br>
> User-Agent: curl/7.54.0<br>
> Proxy-Connection: Keep-Alive<br>
> X-Forwarded-For: xx.xxx.xx.xx<br>
> ----------<br>
> ...<br>
> 2020/03/20 14:51:43.067| 28,3| Acl.cc(158) matches: checked:<br>
> to_domain_whitelist = 0<br>
> 2020/03/20 14:51:43.071| 85,2| client_side_request.cc(745)<br>
> clientAccessCheckDone: The request CONNECT <a href="http://example.com:443" rel="noreferrer" target="_blank">example.com:443</a> is DENIED; last<br>
> ACL checked: all<br>
> ...<br>
<br>
If you want to make allow/deny decision based on individual request<br>
URLs, your http_access rules must allow the CONNECT request. Once Squid<br>
establishes (and bumps) the CONNECT tunnel, it will start processing<br>
individual requests and apply http_access rules to each of them.<br>
<br>
To allow a CONNECT request, do not use regular URL syntax because<br>
CONNECT requests use a different URI syntax. Sorry, I do not know<br>
whether a url_regex ACL can be used for CONNECT URIs, but you can use<br>
other ACLs if/as needed, of course.<br>
<br>
<br>
HTH,<br>
<br>
Alex.<br>
<br>
<br>
> ---------<br>
> GET /abc/login HTTP/1.1<br>
> Host: <a href="http://example.com" rel="noreferrer" target="_blank">example.com</a><br>
> User-Agent: curl/7.54.0<br>
> Accept: */*<br>
> ----------<br>
> ....<br>
> ```<br>
> <br>
> <br>
> <br>
> --<br>
> Sent from: <a href="http://squid-web-proxy-cache.1019090.n4.nabble.com/Squid-Users-f1019091.html" rel="noreferrer" target="_blank">http://squid-web-proxy-cache.1019090.n4.nabble.com/Squid-Users-f1019091.html</a><br>
> _______________________________________________<br>
> squid-users mailing list<br>
> <a href="mailto:squid-users@lists.squid-cache.org" target="_blank">squid-users@lists.squid-cache.org</a><br>
> <a href="http://lists.squid-cache.org/listinfo/squid-users" rel="noreferrer" target="_blank">http://lists.squid-cache.org/listinfo/squid-users</a><br>
> <br>
<br>
</blockquote></div>