TRENDING
A mountain gorilla looks at the camera from green forest undergrowth
October 29, 2026
How to Compress Time-Series Metrics in Python With Gorilla Delta-of-Delta and XOR Encoding
A bronze-framed hourglass with white sand beside a small Ferris wheel ornament on a wooden table against a teal wall
October 29, 2026
NIST’s Final Post-Quantum Transition Report Puts Every Quantum-Vulnerable Public-Key Scheme on One 2030 and 2035 Clock, and Three Federal Documents Word the Deadline Three Ways
Six weathered stone columns of the Temple of Apollo at Delphi, Greece, standing on a stone platform above a valley of olive groves
October 29, 2026
Honeypots Recorded Probes Against Oracle E-Business Suite CVE-2026-101767 Seven Days After Its Patch, and the Finder’s Write-Up Is Dated Patch Day
Vintage silver stopwatch with a chain on a black background, its dial showing seconds from 5 to 60
October 29, 2026
How to Find a Slow Query in PostgreSQL 18 With pg_stat_statements, Read Its EXPLAIN ANALYZE Plan, and Fix It With the Right Index
A wooden Tower of Hanoi puzzle on a market table, with three pegs and stacked discs of different sizes
October 29, 2026
Two Labs’ Claimed Refutations of the Exponential Time Hypothesis Turn Verification Into a Statement-Reading Problem, and Their Lean Theorems Promise Only That a Constant Exists
29 Oct 2026
SXZ.io SXZ.io
  • Home
Search the Site
Popular Searches:
Technology Amazon AI
Recent Posts
A flock of snow geese in flight, seen as dark silhouettes against an orange and red sunset sky with layered clouds
How to Run Zero-Downtime Schema Migrations on PostgreSQL 18 and Block Unsafe ALTER TABLE Statements With a Python Lint Gate
October 28, 2026
An old green steel truss bridge resting on temporary supports beside a new arch bridge under completion on a river in Portland, Oregon
The Angular 2 Rewrite Turns a Migration Lesson Into a Security Bill: AngularJS Still Draws 533,480 Downloads a Week, and 10 Advisories Have No Open-Source Fix
October 28, 2026
Hundreds of yellow rubber ducks floating in a river enclosure during a duck race
WordPress 7.1.4 Closes an Unauthenticated Race in Its Own Update Routine, but 19 Older Branches Had No Backport Hours After Release
October 28, 2026
SXZ.io SXZ.io
  • Home

Categories

Articles 270 Posts
News 273 Posts
Learning Hub 243 Posts
Home/Learning Hub/Squid Proxy on Ubuntu: The Access-Control Checklist
Learning Hub

Squid Proxy on Ubuntu: The Access-Control Checklist

A concise Squid setup guide for hosting admins: install, bind intentionally, whitelist client networks, keep deny-all ordering, and prove it with logs.

June 9, 2026 5 Min Read
69

A Squid proxy is useful only if it is deliberately scoped. DigitalOcean’s current Squid-on-Ubuntu guide walks through installation and client testing, but hosting admins should treat the first production question as access control: who is allowed to use this proxy, from where, and how will you prove it later? Source: DigitalOcean Community Tutorials

Table Of Content

  • 1. Install it, then verify the service
  • 2. Bind the port intentionally
  • 3. Whitelist clients, then keep deny-all
  • 4. Prove access in the logs
  • Production validation: keep Squid from becoming an open proxy
  • Target system: Ubuntu/Debian Squid host
  • Target system: Ubuntu/Debian after editing Squid configuration
  • Target system: Ubuntu/Debian proxy host using UFW
  • Verification from allowed and denied clients
  • Platform notes before copying this Ubuntu Squid pattern elsewhere
  • Target system: RHEL-family host using firewalld, concept example only
  • Review checklist before exposing port 3128

1. Install it, then verify the service

On Ubuntu 24.04 LTS, the Ubuntu manpage identifies the squid package as an HTTP web proxy caching server. Source: Ubuntu manpages

sudo apt update
sudo apt install squid
systemctl status squid

Use systemctl status squid as a verification step, not as your only monitoring. A service can be running and still be mis-scoped.

2. Bind the port intentionally

Squid’s http_port directive controls where Squid listens for HTTP proxy requests. The Squid documentation shows the directive as the place to set listening addresses and ports. Source: Squid http_port docs

# /etc/squid/squid.conf
http_port 3128

If the proxy should serve only a private network, combine the Squid rule set with firewall policy so port 3128 is not reachable from the public internet.

3. Whitelist clients, then keep deny-all

Squid uses acl entries to define access lists, and http_access rules to allow or deny requests. The Squid docs state that http_access defaults to deny unless rules exist, and the recommended examples place specific allow rules before the final deny rule. Source: Squid ACL docs Source: Squid http_access docs

# Replace with your real admin/VPN subnet.
acl hosting_admins src 203.0.113.0/24
http_access allow hosting_admins
http_access deny all

Do not copy the example subnet into production. Replace it with your VPN, office, bastion, or private management network.

4. Prove access in the logs

Squid’s access_log directive controls whether and how HTTP transactions are logged, and the documentation notes that one line is logged for every matching request when access logging is enabled. Source: Squid access_log docs

sudo tail -f /var/log/squid/access.log
curl -x http://SERVER_IP:3128 https://example.com/

For hosting operations, this is the habit that matters: change one rule, reload Squid, test from an allowed client, test from a denied client, and confirm the result in the access log. A proxy without a log trail becomes guesswork during abuse review.

Production validation: keep Squid from becoming an open proxy

This runbook applies to an Ubuntu or Debian Squid host using the packaged service name squid, the main configuration file at /etc/squid/squid.conf, and a network firewall such as UFW or a cloud security group. Squid access rules and firewall rules should agree with each other: Squid decides who is allowed to proxy requests, while the firewall decides who can reach the listening port at all. The Squid http_access documentation is clear that rule order matters, so place narrow allow rules before the final deny rule and test from both an allowed and a denied source. Squid http_access docs

Target system: Ubuntu/Debian Squid host

# /etc/squid/squid.conf
# Replace these examples before production use.
http_port 192.0.2.10:3128

acl hosting_admins src 203.0.113.0/24
http_access allow hosting_admins
http_access deny all

If the proxy should listen on one private address only, bind http_port to that address instead of every interface. Squid documents http_port as the directive that controls the socket Squid listens on, so this is the right place to make the listening address explicit. Squid http_port docs If the proxy must listen publicly, compensate with both a strict firewall rule and a specific Squid ACL. Avoid a broad rule such as http_access allow all; that is the classic open-proxy mistake.

Target system: Ubuntu/Debian after editing Squid configuration

sudo squid -k parse
sudo squid -k reconfigure
systemctl status squid --no-pager

squid -k parse should succeed before you reconfigure the running daemon. If parsing fails, do not reload or restart; fix the syntax while the old process is still serving traffic. If reconfigure succeeds but clients still fail, check whether the service is listening on the expected address and whether another firewall layer is blocking the port. The Ubuntu Squid man page identifies Squid as the local web proxy/caching daemon and documents the service command context for packaged Ubuntu systems. Ubuntu squid man page

Target system: Ubuntu/Debian proxy host using UFW

sudo ufw allow from 203.0.113.0/24 to any port 3128 proto tcp
sudo ufw status numbered

On a cloud VPS, repeat the same scoping in the provider security group. UFW can be correct while the provider firewall still allows the world, or the reverse. Also check IPv6: a proxy locked down for IPv4 but reachable on a public IPv6 address can still be abused. Ubuntu’s server firewall documentation explains UFW as Ubuntu’s default firewall management interface, so this command path is Ubuntu/Debian-specific rather than a generic Linux instruction. Ubuntu firewall documentation

Verification from allowed and denied clients

Target system: allowed admin workstation or VPN client

curl --proxy http://PROXY_IP:3128 --head https://example.com/

Target system: denied workstation outside the approved source range

curl --proxy http://PROXY_IP:3128 --connect-timeout 5 --head https://example.com/

Target system: Ubuntu/Debian Squid host while running both tests

sudo tail -n 50 /var/log/squid/access.log

A good result is boring: the allowed client receives a normal HTTP response, the denied client fails or receives a Squid denial, and the access log shows the difference. Squid’s access_log documentation describes request logging, which makes the log check part of the control rather than an afterthought. Squid access_log docs For HTTPS, successful proxying often appears as a CONNECT request, while rejected clients commonly show TCP_DENIED/403. If both clients are allowed, review ACL order and firewall scope. If both are denied, review the source CIDR, NAT/VPN egress address, http_port binding, and cloud firewall. If nothing appears in access.log, the request may not be reaching Squid at all.

Platform notes before copying this Ubuntu Squid pattern elsewhere

The commands above are for Ubuntu/Debian because they use the Ubuntu package name, service behavior, UFW example, and /etc/squid/squid.conf path. On a RHEL-family server such as RHEL, AlmaLinux, Rocky Linux, or many non-cPanel CloudLinux systems, the same Squid directives are still relevant, but the package and firewall commands usually change to dnf, systemctl, and firewall-cmd. Do not paste the UFW rule into a RHEL-family host and assume the firewall is handled. The safe translation is to keep the Squid ACL logic identical, then implement the port restriction in the firewall tool that host actually uses.

Target system: RHEL-family host using firewalld, concept example only

sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="203.0.113.0/24" port protocol="tcp" port="3128" accept'
sudo firewall-cmd --reload
sudo firewall-cmd --list-all

That example is intentionally labeled as RHEL-family, not Ubuntu. The Squid documentation remains the authority for acl, http_access, http_port, and access_log; the operating system documentation controls the firewall syntax. On cPanel/WHM hosting, be even more careful: shared hosting accounts generally should not run a public Squid proxy at all, and root-managed services should be coordinated through the host’s firewall and abuse policy. A hosting proxy becomes an abuse target quickly if it accepts unauthenticated traffic from the internet.

Review checklist before exposing port 3128

  • Does Squid listen only on the intended interface?
  • Does the host firewall restrict the same source range as the Squid ACL?
  • Does the cloud firewall or provider security group repeat that restriction?
  • Have you tested both an allowed and a denied client?
  • Can you identify the client IP, requested host, and result in access.log during an abuse review?

Tags:

Access ControlLinux HostingNetwork SecuritySquid ProxyUbuntu Server

Share

Blue Ethernet cables connected to a network switch in a server rack.
Previous Post

Kubernetes Secret Sprawl Is an Access-Control Problem

Padlock symbolizing data security, privacy, and password protection
Next Post

Wordfence Weekly Report Flags 159 WordPress Vulnerabilities

No Comment! Be the first one.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Latest
28 Oct
How to Run Zero-Downtime Schema Migrations on PostgreSQL 18 and Block Unsafe ALTER TABLE Statements With a Python Lint Gate
28 Oct
The Angular 2 Rewrite Turns a Migration Lesson Into a Security Bill: AngularJS Still Draws 533,480 Downloads a Week, and 10 Advisories Have No Open-Source Fix
Trending
October 28, 2026
How to Run Zero-Downtime Schema Migrations on PostgreSQL 18 and Block Unsafe ALTER TABLE Statements With a Python Lint Gate
October 28, 2026
The Angular 2 Rewrite Turns a Migration Lesson Into a Security Bill: AngularJS Still Draws 533,480 Downloads a Week, and 10 Advisories Have No Open-Source Fix
October 28, 2026
WordPress 7.1.4 Closes an Unauthenticated Race in Its Own Update Routine, but 19 Older Branches Had No Backport Hours After Release
October 28, 2026
How to Compress Time-Series Metrics in Python With Gorilla Delta-of-Delta and XOR Encoding
October 28, 2026
NIST’s Final Post-Quantum Transition Report Puts Every Quantum-Vulnerable Public-Key Scheme on One 2030 and 2035 Clock, and Three Federal Documents Word the Deadline Three Ways
October 28, 2026
Honeypots Recorded Probes Against Oracle E-Business Suite CVE-2026-101767 Seven Days After Its Patch, and the Finder’s Write-Up Is Dated Patch Day

Related Posts

A laptop wrapped in a chain and padlock, illustrating least-privilege controls for AI agents.
Learning Hub

How to Secure Tool-Using AI Agents Before They Touch Production

June 8, 2026
Colorful sticky notes arranged on an office wall, symbolizing governance checklists and planning.
Learning Hub

AI Governance for Agentic Apps: A Practical Checklist for Builders

June 8, 2026
A technician connects green fiber optic cables at a data center, representing a private production inference endpoint.
Learning Hub

How to Deploy a Fine-Tuned LLM Behind a Private Production Inference Endpoint

June 8, 2026
Narrow aisle behind black supercomputer racks in a data center
Learning Hub

Kubernetes SELinux Volume Labeling: What Cluster Operators Should Audit Before v1.37

June 8, 2026
SXZ.io SXZ.io
  • [email protected]

Categories

Articles
Learning Hub
News

All Rights Reserved by SXZ.io ©2026