Proxy data leakage is when a device on the company network carries its traffic out through an unapproved proxy or tunnel. That traffic never reaches the corporate proxy, the DLP or the logs. Inspection layers only see the traffic that passes through them. To network devices, a file inside the tunnel is just one encrypted connection. This post covers the warning signs, egress and endpoint controls, log review and an approved path for legitimate needs.
The inspection blind spot
The corporate inspection chain assumes that traffic leaves through a single gate. The corporate forward proxy records which user went to which site. DLP (data loss prevention) scans uploaded content against rules. Firewall and DNS logs complete the record.
An unapproved proxy or tunnel breaks that assumption. The device moves its data to a server outside the company in an encrypted stream. The real destination and the content stay inside that stream. Even with an HTTPS tunnel, the corporate proxy only sees the host, the port and the site name. The details are in our HTTP CONNECT tunnel post.
| Layer | What it sees in approved traffic | What it sees in an unapproved tunnel |
|---|---|---|
| Corporate proxy log | Target site, user, bytes | Only the tunnel endpoint, or nothing |
| DLP | Uploaded content (if TLS inspection is on) | No content |
| Firewall | Flow to the proxy | Unusual port or direct egress |
| DNS log | Names of the sites visited | Name of the tunnel endpoint, or no query |
The cause is usually not malice. An employee sets up a personal proxy to reach a blocked site or to speed up a task. The result is the same: data leaving that device is now off the record.
Warning signs
Unapproved proxy use leaves traces in three records: the proxy log, the firewall and DNS. A single trace is not proof. When two or three traces line up on the same device, it needs a closer look.
| Record | Sign |
|---|---|
| Proxy log | CONNECT targets never seen before |
| Proxy log | CONNECT to ports other than 443: 1080, 3128, 8000, 8080 |
| Proxy log | A single high-byte tunnel that stays open for hours |
| Firewall | Direct egress attempts from clients to the internet |
| DNS | Port 53 and 853 traffic to external resolvers |
| DNS | Very long, random-looking subdomain queries |
The endpoint shows signs too. A manually entered proxy address may sit in the user profile. Environment variables such as HTTPS_PROXY may be set. A process you don't recognize may be listening on a local port. MITRE ATT&CK technique T1090 (Proxy) lists processes connecting to unusual ports and unexpected port-forwarding rules among the behaviors to monitor.
Long, random subdomains are a separate risk. Data can be carried piece by piece inside DNS queries. The proxy log never sees this traffic; only the DNS log does.
Egress rule
The most effective control is default-deny egress. Only the corporate proxy servers can reach the internet. Clients can only connect to the proxy's port. A direct connection to an unapproved proxy then stops at the firewall and is logged.
Set up the rule in this order:
- Close egress outside the proxy. Ports 80, 443 and all others are closed from client networks to the internet. The only open destination is the corporate proxy.
- Keep DNS inside. Clients query only internal resolvers. Block outbound port 53 and 853 traffic.
- Manage browser DNS settings. Set the browsers' DNS-over-HTTPS setting through corporate policy. Otherwise DNS queries hide inside ordinary HTTPS traffic.
- Separate the guest network. The network personal devices join has no access to company resources.
A network rule only sees traffic on the company network. When a laptop joins a phone's hotspot, the network rule no longer applies. That gap closes on the endpoint, with device policy and an endpoint agent.
Approved proxy list
An approved proxy list is a rule on the corporate proxy that states which external proxy endpoint may be used, and by whom. Most corporate proxies can block the "anonymizer" or "proxy" category as a whole. The list is the only exception to that block.
Each entry carries four facts: the external endpoint (for example pr.proxynet.io:8000), the source subnet or user group, the purpose and an expiry date. An exception with no source is an open door for the whole company. An exception with no expiry date gets forgotten for years.
A written policy completes the list. It should state two things plainly. Proxy, VPN and tunnel software outside the approved list is not used on company devices. A team that needs one applies to IT and gets access through the approved path.
Endpoint configuration
Endpoint configuration makes the proxy setting impossible for the user to change. Browsers offer enterprise policies for this. Once the setting comes from policy, any proxy address the user typed in is ignored.
In Firefox, the policies.json file looks like this. Mode: system uses the operating system's proxy setting. Locked: true stops the user from changing the setting and discards any earlier change.
{
"policies": {
"Proxy": {
"Mode": "system",
"Locked": true
}
}
}In Edge and Chrome, the ProxySettings policy does the same job. According to the Edge documentation, while the policy is active the browser also ignores proxy options passed on the command line. You can roll out the system proxy with Group Policy or a PAC file. How to write one is in our PAC file post.
Before you lock anything, look at the current state. The PowerShell commands below list the user's proxy setting, the system WinHTTP proxy and the proxy environment variables on a Windows device. They change nothing.
# User proxy setting
Get-ItemProperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' |
Select-Object ProxyEnable, ProxyServer, AutoConfigURL
# System WinHTTP proxy
netsh winhttp show proxy
# Proxy environment variables
Get-ChildItem Env: | Where-Object Name -match 'proxy' | Select-Object Name, ValueIf ProxyEnable is 1 and ProxyServer is not the corporate proxy, the device points somewhere else. Restricting admin rights and tying software installs to an allowlist keep these settings in place.
Log review
Log review means comparing the CONNECT lines in the proxy log with known targets. In Squid's native log format, a CONNECT line records the target as host:port. A new target, a port other than 443 or an unusual byte count is worth a look.
The Python script below reads a Squid access.log file. It takes the targets seen in the previous period from known.txt. An approved endpoint is skipped only when it comes from its allowed subnet.
import sys
from collections import defaultdict
# Usage: python connect_report.py access.log known.txt
log_file, known_file = sys.argv[1], sys.argv[2]
APPROVED = {("pr.proxynet.io", "8000"): "10.20.0."} # target: allowed source prefix
with open(known_file, encoding="utf-8") as f:
known = {line.strip() for line in f if line.strip()}
totals = defaultdict(lambda: [0, 0]) # (client, target, result) -> [requests, bytes]
for line in open(log_file, encoding="utf-8"):
field = line.split()
if len(field) < 10 or field[5] != "CONNECT":
continue
client, size, target = field[2], int(field[4]), field[6]
host, _, port = target.rpartition(":")
allowed = APPROVED.get((host, port))
if allowed and client.startswith(allowed):
continue
if port != "443" or host not in known:
totals[(client, target, field[3])][0] += 1
totals[(client, target, field[3])][1] += size
for (client, target, result), (count, size) in sorted(
totals.items(), key=lambda x: -x[1][1]):
print(f"{client:<12} {target:<24} {result:<16} {count:>3} req {size / 1e6:>8.1f} MB")On our sample log, the output was:
10.10.7.58 relay.example.net:443 TCP_TUNNEL/200 1 req 734.0 MB
10.10.9.3 files.example.net:1080 TCP_DENIED/403 1 req 0.0 MB
10.10.7.58 203.0.113.9:8000 TCP_TUNNEL/200 1 req 0.0 MBThe first line is a large tunnel to an unknown target. The second is a SOCKS port attempt that the rules denied. The third is a tunnel to an IP address on port 8000. The pr.proxynet.io:8000 line from the approved subnet did not make the report.
Watch the bytes field. In the native squid format, the bytes field (%<st) is the data sent to the client. To track data uploaded outward, add the %>st code, which shows the size received from the client, to your log format. Check on your own version that this value is filled in on CONNECT lines.
An approved path for teams
Banning proxy use outright pushes teams that need it onto off-the-record paths. A data team may truly need an external proxy for price monitoring, ad verification or country-specific testing. The right answer is to meet that need through a visible path.
The approved path has five parts:
- Request. The team states the purpose, target sites, expected volume and duration. The request also states that the target sites' terms and robots.txt will be respected.
- Separate egress point. Jobs run from a separate server or container subnet, not from a laptop.
- Narrow permission. The provider endpoint is opened on the approved list for this source only. If your provider offers an IP whitelist, also bind the account to this egress IP alone.
- Credentials in a vault. The
user:passdetails do not sit in a code repository or on a personal device. The job reads them from the vault at run time. - Chaining and logging. External proxy traffic passes through the corporate proxy. Squid does this with the
cache_peerdirective, by defining the provider as a parent proxy. The basics are in our Squid setup post.
Thanks to chaining, the corporate log keeps recording which job sent how much data to which provider endpoint. For jobs that need country-specific egress, Residential Proxy joins this setup as an HTTP parent. Review the permission every three or six months, and close the exception once the job ends.
How we tested
We ran the tests on December 3, 2026, on Windows 11. We ran the log script with Python 3.13.17 on a seven-line sample access.log that we wrote by hand in Squid's documented native format. The addresses in the sample come from ranges reserved for documentation. We did not try the script on a real Squid installation's log. We ran the PowerShell commands in Windows PowerShell 5.1. The policies.json, ProxySettings and cache_peer examples are based on official documentation; we did not test them separately.
The bottom line
Reduce egress to a single gate, lock the proxy setting on the endpoint and compare CONNECT targets with the known list every week. Give a team with a real need a separate egress point, narrow permission and a logged path. Above all, close direct internet egress from clients. Every other control depends on that rule. If you need to give target sites a fixed address for their IP allowlist, ISP Proxy joins the approved path the same way.
Sources
- MITRE ATT&CK, T1090 Proxy, detection and mitigations: attack.mitre.org
- Firefox Enterprise Policies, Proxy: firefox-admin-docs.mozilla.org
- Microsoft Edge policies, ProxySettings: learn.microsoft.com
- Squid configuration, cache_peer: squid-cache.org
- Squid configuration, logformat: squid-cache.org
Frequently asked questions
How can you tell an employee is using an unapproved proxy?
By combining records. Look for new CONNECT targets and ports other than 443 in the proxy log. Check the firewall for direct egress attempts and DNS for queries to external resolvers. On the endpoint, check for a manually entered proxy address and proxy environment variables. A single trace is not conclusive; start an investigation when several traces appear on the same device.
Can a corporate proxy see inside an HTTPS tunnel?
No, not without TLS inspection. The proxy sees the host and port in the CONNECT line and the site name in the TLS handshake. The path, headers and content are encrypted. Even with TLS inspection on, if a device can bypass the corporate proxy and go out directly, that traffic is never inspected. That is why the egress rule comes before inspection features.
Is blocking the proxy category enough?
No. A category block stops known proxy and tunnel services, but a newly launched server may not be in any category yet. Use the category block together with default-deny egress, locked endpoint settings and a weekly CONNECT review. A new-targets report is the simplest way to catch the endpoints the category misses.
Does a phone hotspot affect network rules?
Yes. The device leaves the company network, so the network rules no longer apply. Control then moves to the endpoint. Device policy, the endpoint agent and the DLP agent run whatever network the device is on. The written policy should also state which networks company devices may join and how to request exceptions.
What should you do if the data team wants to use a proxy?
Open an approved path. The team states the purpose, targets and duration. The job runs from a separate server, and the provider endpoint enters the approved list for that source only. Credentials stay in a vault. Traffic is chained through the corporate proxy, so logging continues. The permission is reviewed at set intervals.
What should you look for in DNS logs?
Three signs. The first is port 53 and 853 traffic that bypasses the internal resolver and goes to external servers. The second is queries for the names of known proxy and tunnel services. The third is very long, random-looking subdomains. That last one can point to data being carried inside DNS queries.




