1

Please bear as I am totally new to squid.

I need to setup a squid transparent proxy to for NAT and allow URL filtering in AWS. I followed thisAWS Link AWS link and everything works as expected. However, the proxy works only for sites that are listening to 80 or 443. Now I need to allow some non standard ports like 8080 as some clients need to talk to servers listening on them.

Below is the current squid conf.

visible_hostname squid
cache deny all

Log format and rotation

logformat squid %ts.%03tu %6tr %>a %Ss/%03>Hs %<st %rm %ru %ssl::>sni %Sh/%<a %mt logfile_rotate 10 debug_options rotate=10

Handling HTTP requests

http_port 3128 http_port 3129 intercept acl allowed_http_sites dstdomain "/etc/squid/whitelist.txt" http_access allow allowed_http_sites

Handling HTTPS requests

https_port 3130 cert=/etc/squid/ssl/squid.pem ssl-bump intercept acl SSL_port port 443 http_access allow SSL_port acl allowed_https_sites ssl::server_name "/etc/squid/whitelist.txt" acl step1 at_step SslBump1 acl step2 at_step SslBump2 acl step3 at_step SslBump3 ssl_bump peek step1 all ssl_bump peek step2 allowed_https_sites ssl_bump splice step3 allowed_https_sites ssl_bump terminate step2 all #below line is custom- not from aws. This is to allow self signed certs on trusted sites sslproxy_cert_error allow allowed_https_sites http_access deny all

How do I allow 8080 also here ? Note that this is a transparent proxy, so I do not want to change any settings at client side.

I added the following lines to the conf, but it seems not working.

acl SSL_ports port 8080
acl Safe_ports port 8080

1 Answers1

0

Okay, so I just figured out what to do. It is not required to change anything in the conf file. Instead just had to add an iptables rule as follows.

sudo iptables -t nat -A PREROUTING -p tcp --dport 8080 -j REDIRECT --to-port 3129

The required rules for 80 and 443 were given in the AWS documentation itself.