Deployment guide

Tinyproxy

Overview

Tinyproxy is a small, fast HTTP and HTTPS forward proxy daemon. It sits between clients and the web, forwards their outbound requests, and controls which clients may use it. It suits a simple outbound gateway, a jump host proxy, or controlled egress in a private network.

This image runs Tinyproxy 1.11.1 from the Ubuntu 24.04 archive as a closed forward proxy for use inside your own network. It is not an open proxy, because two independent locks protect it. A source address ACL answers only the machine itself (localhost) and hosts on private, RFC1918 ranges, and refuses every other source, including the public internet. There is deliberately no Allow 0.0.0.0/0. Mandatory HTTP Basic proxy authentication then requires a valid username and password on every request.

No proxy password is baked into the image. On first boot the VM generates a unique per VM password and writes it to a root only credentials file, so there is no default credential to leak.

What you get:

  • Tinyproxy 1.11.1 from the Ubuntu 24.04 archive, run under systemd as the unprivileged tinyproxy user (tinyproxy.service) and listening on TCP 8888
  • A secure forward proxy configuration: source address ACLs (localhost plus RFC1918 only), mandatory per VM Basic authentication, CONNECT tunnels restricted to TLS ports, and the Via header disabled
  • A unique proxy password generated on first boot and stored in /root/tinyproxy-credentials.txt (root only)
  • A self test tool, tinyproxy-roundtrip.sh, that proves an anonymous request is refused (HTTP 407) and an authenticated request succeeds (HTTP 200)
  • Ubuntu 24.04 LTS base with the latest security patches applied at build time and unattended security upgrades kept enabled
  • Azure Linux Agent for cloud integration and SSH key injection
  • 24/7 SecureAnyCloud support with a guaranteed 24 hour response SLA

Prerequisites

Before you deploy, you need:

  • An active Azure subscription, an SSH public key, and a VNet and subnet in the target region
  • A subscription to the Tinyproxy listing on Azure Marketplace
  • Network Security Group rules that allow TCP 22 (administration) and TCP 8888 (proxy) from the client networks that will use the proxy
  • Recommended virtual machine size: Standard_B2s (2 vCPU, 4 GB RAM), which is ample for a lightweight forward proxy serving a local network. For very high request volumes, use Standard_D2s_v5 or larger and raise MaxClients in the configuration.
1

Deploy from the Azure Portal

Search for Tinyproxy in Azure Marketplace, select the SecureAnyCloud publisher, and click Create. Configure the Network Security Group to allow TCP 8888 (proxy) from your client subnets and TCP 22 for administration. Restrict port 8888 to trusted client networks and never expose it to the public internet.

2

Deploy from the Azure CLI

RG="proxy-prod"; LOCATION="eastus"; VM_NAME="tinyproxy1" IMAGE_URN="sac1647283583153:tinyproxy-ubuntu-24-04:default:latest" SSH_KEY="$(cat ~/.ssh/id_rsa.pub)" az group create --name "$RG" --location "$LOCATION"
# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:tinyproxy-ubuntu-24-04:default:latest
az vm create \
  --resource-group "$RG" --name "$VM_NAME" \
  --image "$IMAGE_URN" \
  --size Standard_B2s \
  --admin-username azureuser \
  --ssh-key-values "$SSH_KEY" \
  --public-ip-sku Standard
# Open the proxy and admin ports on the VM's NSG (restrict 8888 to your client subnet):
az vm open-port --resource-group "$RG" --name "$VM_NAME" --port 8888 --priority 1001
az vm open-port --resource-group "$RG" --name "$VM_NAME" --port 22 --priority 1002
3

First boot

On first boot the image resolves the VM address, generates a unique per VM proxy password, and injects it into the Tinyproxy configuration. It then asserts the secure defaults, starts the service, and proves that an anonymous request is refused while an authenticated request succeeds. This completes within a minute. SSH in as azureuser and read the credentials:

sudo cat /root/tinyproxy-credentials.txt

Expected output (the password is unique to your VM):

proxy.user=sac proxy.pass=<per-VM-password> proxy.host=10.0.0.18 proxy.endpoint=10.0.0.18:8888
4

Confirm the service is running

Check that tinyproxy.service is active and owns port 8888. The ss output confirms that the tinyproxy process is the listener on :8888.

systemctl is-active tinyproxy.service
sudo ss -tulnp | grep -E ':8888 '

Expected output:

active tcp LISTEN 0 1024 0.0.0.0:8888 0.0.0.0:* users:(("tinyproxy",pid=26937,fd=3))
5

Make a request through the proxy

Send a request through the proxy with curl -x. A request without credentials is refused with HTTP 407 (Proxy Authentication Required). A request with the per VM credentials succeeds with HTTP 200. Read the username and password from the credentials file, then run the self test tool.

PROXY_USER="$(sudo grep -E '^proxy\.user=' /root/tinyproxy-credentials.txt | cut -d= -f2-)" PROXY_PASS="$(sudo grep -E '^proxy\.pass=' /root/tinyproxy-credentials.txt | cut -d= -f2-)" curl -x "http://127.0.0.1:8888" -s -o /dev/null -w 'anonymous request: HTTP %{http_code}\n' http://example.com/ curl -x "http://$PROXY_USER:$PROXY_PASS@127.0.0.1:8888" -s -o /dev/null -w 'authenticated request: HTTP %{http_code}\n' http://example.com/
sudo /usr/local/sbin/tinyproxy-roundtrip.sh

Expected output:

anonymous request: HTTP 407 authenticated request: HTTP 200 round-trip OK: anonymous request refused (HTTP 407), authenticated request with the per-VM password succeeded (HTTP 200); the shipped proxy is not open (localhost + RFC1918 only) and enforces per-VM BasicAuth
6

Review the configuration

Review the configuration. The SecureAnyCloud configuration is the whole of /etc/tinyproxy/tinyproxy.conf, and the stock file is backed up to tinyproxy.conf.orig. The version is 1.11.1 from the Ubuntu archive. The BasicAuth line carries this VM's unique password, which is masked below.

tinyproxy -v | head -1 grep -vE '^[[:space:]]*#|^[[:space:]]*$' /etc/tinyproxy/tinyproxy.conf

Expected output (comments and blank lines stripped for brevity; password masked):

tinyproxy 1.11.1 User tinyproxy Group tinyproxy Port 8888 Timeout 600 DefaultErrorFile "/usr/share/tinyproxy/default.html" StatFile "/usr/share/tinyproxy/stats.html" LogFile "/var/log/tinyproxy/tinyproxy.log" LogLevel Info PidFile "/run/tinyproxy/tinyproxy.pid" MaxClients 100 Allow 127.0.0.1 Allow ::1 Allow 10.0.0.0/8 Allow 172.16.0.0/12 Allow 192.168.0.0/16 Allow fc00::/7 ViaProxyName "sac" DisableViaHeader Yes ConnectPort 443 ConnectPort 563 BasicAuth sac <per-VM-password>
7

Verify the responsible defaults

Confirm the key security property. The Allow rules permit only localhost and the private RFC1918 ranges, there is no Allow 0.0.0.0/0, and the BasicAuth line forces every request to authenticate. A request without valid credentials is refused with HTTP 407.

grep -E '^[[:space:]]*(Allow|BasicAuth|ConnectPort|DisableViaHeader)' /etc/tinyproxy/tinyproxy.conf curl -x http://127.0.0.1:8888 -s -o /dev/null -w 'anonymous request: HTTP %{http_code}\n' http://example.com/
sudo grep -E '^proxy\.(user|host|endpoint)=' /root/tinyproxy-credentials.txt

Expected output (password masked):

Allow 127.0.0.1 Allow ::1 Allow 10.0.0.0/8 Allow 172.16.0.0/12 Allow 192.168.0.0/16 Allow fc00::/7 DisableViaHeader Yes ConnectPort 443 ConnectPort 563 BasicAuth sac <per-VM-password> anonymous request: HTTP 407 proxy.user=sac proxy.host=10.0.0.18 proxy.endpoint=10.0.0.18:8888
8

Point clients at the proxy

Configure the clients on your local network to use the VM as their HTTP and HTTPS proxy, with the credentials in the URL. On a Linux client, set the standard proxy environment variables. Replace <proxy-ip> with the VM public IP, or its private IP inside the VNet, and use the username and password from the credentials file:

export http_proxy="http://sac:<per-VM-password>@<proxy-ip>:8888"
export https_proxy="http://sac:<per-VM-password>@<proxy-ip>:8888"

The source address ACLs serve only clients on a private (RFC1918) subnet, or the VM itself. Keep the proxy and its clients on the same VNet or a peered network. For an application, set its proxy setting to http://sac:<per-VM-password>@<proxy-ip>:8888.

9

Allow additional client networks (optional)

If your clients are outside the default RFC1918 ranges, add an Allow line for their network. Edit /etc/tinyproxy/tinyproxy.conf and add your own network alongside the existing Allow lines:

# allow an extra trusted client subnet Allow 100.72.0.0/16

Apply the change with sudo systemctl restart tinyproxy. Allow only networks you control, and never add Allow 0.0.0.0/0. Basic authentication is enforced regardless of source address, so clients on the new subnet still need the proxy password.

10

Rotate or add proxy credentials (optional)

The per VM password lives on the BasicAuth line in /etc/tinyproxy/tinyproxy.conf. To rotate it, edit that line. To add a second username and password pair, add another BasicAuth <user> <password> line. Then restart the service:

BasicAuth sac <a-new-strong-password> BasicAuth teammate <another-strong-password>

Apply the change with sudo systemctl restart tinyproxy. Update the credentials file to match any change you make. Never remove the BasicAuth line, because that turns off authentication.

11

Restrict outbound destinations (optional)

Tinyproxy can filter which destinations clients may reach. Enable the filter in /etc/tinyproxy/tinyproxy.conf and point it at a file of allowed or denied domains:

Filter "/etc/tinyproxy/filter" FilterDefaultDeny Yes

Create /etc/tinyproxy/filter with one domain regex per line (for example \.ubuntu\.com$), then apply the change with sudo systemctl restart tinyproxy. With FilterDefaultDeny Yes, only destinations that match the file are allowed.

12

Security recommendations

  • Restrict the NSG. Allow TCP 8888 only from the client networks that need the proxy, and TCP 22 for administration only. Never expose port 8888 to the public internet.
  • Keep authentication on. The shipped configuration requires a per VM password on every request. Never remove the BasicAuth line.
  • Keep the proxy closed. The Allow rules restrict access to localhost and private ranges. Never add Allow 0.0.0.0/0.
  • Use destination filtering for egress control. Step 11 shows how to limit which sites clients may reach through the proxy.
  • Keep the OS and Tinyproxy patched. Unattended security upgrades remain enabled on the running VM.
  • Watch the logs. /var/log/tinyproxy/tinyproxy.log records connections and errors.
13

Support and Licensing

Tinyproxy is free software maintained by the Tinyproxy project and contributors, distributed under the GNU General Public License, version 2 (GPL-2.0). This image bundles the unmodified Ubuntu archive package. SecureAnyCloud provides the packaging, the forward proxy hardening, the closed by default configuration, the per VM authentication, the self test tool, and 24/7 support with a guaranteed 24 hour response SLA.

SecureAnyCloud is not affiliated with or endorsed by the Tinyproxy project. Tinyproxy is used here only to identify the software.

Deploy on Azure

Find Tinyproxy on Ubuntu 24.04 LTS in the Azure Marketplace, published by SecureAnyCloud. Deploy from the Portal or the Azure CLI as shown above.

Need Help?

Email sales@secureanycloud.com for deployment help, configuration questions, or licensing questions.

Deploy on Azure

Launch Tinyproxy on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.

View this image

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com

Deploy on Azure