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
tinyproxyuser (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, useStandard_D2s_v5or larger and raiseMaxClientsin the configuration.
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.
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 1002First 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.txtExpected 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:8888Confirm 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))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.shExpected 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 BasicAuthReview 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.confExpected 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>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.txtExpected 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:8888Point 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.
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/16Apply 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.
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.
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 YesCreate /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.
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
BasicAuthline. - Keep the proxy closed. The
Allowrules restrict access to localhost and private ranges. Never addAllow 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.logrecords connections and errors.
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
Overview
Tinyproxy is a small, fast, open source HTTP and HTTPS forward proxy daemon. Clients on your network send their requests to it, it makes each request on their behalf, and it returns the response. It is a single lightweight service with a plain text configuration file and a small memory footprint.
This image runs Tinyproxy as an egress control proxy for your own VPC. It gives you one auditable outbound hop for instances that must reach the internet but should not have a general route to it. An open forward proxy is an abuse vector, so the image is closed by default in three ways, and it can prove it.
What you get:
- A deny by default source address allow list. The shipped
/etc/tinyproxy/tinyproxy.confpermits loopback and the private RFC1918 and RFC4193 ranges only. Because at least oneAllowrule is present, Tinyproxy denies every source that does not match, including the entire public internet, and it does so before it looks at credentials. There is deliberately noAllow 0.0.0.0/0anywhere in the image. - Mandatory proxy authentication with no shared secret. On first boot the instance generates its own proxy password and injects it into the configuration. Every client must present that username and password. Nothing is baked into the image, so no two instances share a credential.
- A closed security group by default. The Marketplace recommended security group for this listing opens SSH only. You open the proxy port yourself, scoped to your own VPC or subnet CIDR, so an accidental default never exposes it to the internet.
- Tunnelled (
CONNECT) connections restricted to the standard TLS ports, so the proxy cannot be used to reach arbitrary TCP services, and the proxy identification header disabled - Tinyproxy 1.11.1, installed from the distribution archive and running as the unprivileged
tinyproxysystem user - A hardened
/etc/tinyproxy/tinyproxy.confwith a deny by default source address allow list and no allow all rule tinyproxy.servicelistening on TCP 8888tinyproxy-firstboot.service, which generates this instance's proxy password, injects it, re-asserts the secure configuration, and proves the posture before reporting ready/usr/local/sbin/tinyproxy-roundtrip.sh, a one command proof of the whole security posture/usr/local/sbin/tinyproxy-exposure-check.sh, which fails closed if anything unexpected is listening on a non loopback address- A root only credentials file at
/root/tinyproxy-credentials.txt - Ubuntu 24.04 LTS base with the latest patches and unattended security upgrades enabled
- 24/7 SecureAnyCloud support
Prerequisites
Before you deploy this image you need:
- An Amazon Web Services account where you can launch EC2 instances
- IAM permissions to launch instances, create security groups, and subscribe to AWS Marketplace products
- An EC2 key pair in the target Region for SSH access to the instance
- A VPC and subnet in the target Region. The proxy instance needs outbound internet access, but the clients that use it do not
- A security group that allows inbound TCP 22 from your management network. You add inbound TCP 8888, scoped to your own VPC or subnet CIDR, in Step 3
- The AWS CLI (version 2) installed locally, if you plan to deploy from the command line
Connecting to your instance
Connect over SSH on port 22 as the default login user for the operating system variant you launched. This listing ships the following variant:
OS variant SSH login user
Ubuntu 24.04 LTS ubuntu
The proxy listens on TCP 8888 and is reached by your client hosts, not over SSH.
Launch the Instance from the AWS Marketplace
Sign in to the AWS Management Console, open the EC2 service, and select Launch instance. Under Application and OS Images, choose AWS Marketplace AMIs and search for Tinyproxy. Select the SecureAnyCloud listing, choose Select, then choose Continue on the subscription summary.
Choose an instance type of m5.large or larger. Tinyproxy is very light, but m5.large is the tested recommendation. Choose your EC2 key pair under Key pair (login). Under Network settings, select your VPC and a subnet with outbound internet access. Create or select a security group that allows inbound port 22 from your management network.
Select Launch instance. First boot initialization takes a few seconds after the instance state becomes Running and the status checks pass.
Launch the Instance from the AWS CLI
Run the following command to launch an instance from the SecureAnyCloud Tinyproxy Marketplace AMI into an existing subnet and security group. Replace <ami-id> with the AMI ID shown on the Marketplace listing, <key-name> with your EC2 key pair name, <subnet-id> with your subnet ID, and <security-group-id> with a security group that opens port 22 as described above.
aws ec2 run-instances \
--image-id <ami-id> \
--instance-type m5.large \
--key-name <key-name> \
--subnet-id <subnet-id> \
--security-group-ids <security-group-id> \
--metadata-options "HttpTokens=required,HttpEndpoint=enabled" \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=tinyproxy}]'On first boot the image resolves this instance's addresses using the EC2 Instance Metadata Service (IMDSv2), so it works with HttpTokens=required enabled.
Open the proxy port to your own network only
This step matters most, and it is deliberately left to you. The listing's recommended security group opens SSH only, so the proxy port is not reachable until you open it. Add one inbound rule for TCP 8888 and scope it to your own VPC or subnet CIDR, never to 0.0.0.0/0.
In the console, go to EC2 > Security Groups > your group > Inbound rules > Edit inbound rules > Add rule. Set Type to Custom TCP, Port range to 8888, and Source to Custom with your own VPC CIDR.
From the AWS CLI, replace <security-group-id> with your group and <your-vpc-cidr> with your own range:
aws ec2 authorize-security-group-ingress \
--group-id <security-group-id> \
--protocol tcp --port 8888 \
--cidr <your-vpc-cidr>Even if this rule is widened by mistake, the proxy still refuses a client from outside the private ranges. Step 7 proves it.
Connect via SSH
Connect as the ubuntu user. See the Connecting to your instance table above for other variants.
ssh ubuntu@<public-ip>The message of the day prints the proxy endpoint and the key operational commands when you log in.
Confirm the service is running
Check the service. First boot starts Tinyproxy after it generates this instance's proxy password and re-asserts the secure configuration.
systemctl is-active tinyproxyReal output from a running instance:
activeConfirm that the proxy owns port 8888:
sudo ss -ltnp | grep -E ':8888'Real output:
LISTEN 0 1024 0.0.0.0:8888 0.0.0.0:* users:(("tinyproxy",pid=6096,fd=3)) LISTEN 0 1024 [::]:8888 [::]:* users:(("tinyproxy",pid=6096,fd=3))Review the shipped access control list
Read the whole security posture in one place. This command prints the access control and tunneling directives from the live configuration. It deliberately does not print the BasicAuth line that holds this instance's password:
sudo grep -E '^(Port|Allow|ConnectPort|DisableViaHeader|ViaProxyName) ' /etc/tinyproxy/tinyproxy.confReal output from a running instance:
Port 8888 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 563Because at least one Allow rule is present, every source that does not match one of those lines is denied. Confirm that there is no allow all rule anywhere:
if
sudo grep -qE '^[[:space:]]*Allow[[:space:]]+0\.0\.0\.0/0' /etc/tinyproxy/tinyproxy.conf; then echo "FAILED: an allow all rule is present" exit 1 fi echo "Confirmed: no allow all rule; every source outside the allow list is denied"Real output:
Confirmed: no allow all rule; every source outside the allow list is deniedProve the whole posture with one command
Run the single command that the image ships to exercise every lock against the running service. It starts a temporary local origin, makes four requests with a normal client, and checks what the proxy did with each one.
sudo /usr/local/sbin/tinyproxy-roundtrip.shReal output from a running instance:
OK tinyproxy egress-control posture proven: allowed+authenticated 200, no-credential 407, wrong-credential 401, disallowed-source 127.0.0.2 403; deny-by-default ACL (loopback + RFC1918 only, no allow-all), per-instance BasicAuth, CONNECT limited to TLS portsEach part of that line means the following:
Request Result What it proves
Allowed source, correct credentials HTTP 200 The proxy actually works
Allowed source, no credentials HTTP 407 Proxy authentication is enforced
Allowed source, wrong credentials HTTP 401 The credential is really checked
Source outside the allow list, correct credentials HTTP 403 The access control list denies before authentication is even considered
The same proof runs on every first boot, so an instance that cannot demonstrate it never reports itself ready.
Tinyproxy answers 401 Unauthorized when a client sends a wrong proxy credential. It answers 407 Proxy Authentication Required only when the client sends no credential at all. Both are refusals. The distinction is upstream behavior, not a configuration choice.
Retrieve this instance's proxy credentials
First boot generates a proxy password unique to this instance and writes it, with the proxy endpoint, to a root only file. Nothing secret ships inside the image, so this file is the only place the credential exists.
Print the non secret fields and confirm that the password line is present, without showing the password on your screen:
sudo grep -E '^PROXY_(USER|PRIVATE_HOST|PORT|ENDPOINT)=' /root/tinyproxy-credentials.txt echo "PROXY_PASSWORD lines present: $(sudo grep -c '^PROXY_PASSWORD=' /root/tinyproxy-credentials.txt)"
sudo stat -c '%n %a %U:%G' /root/tinyproxy-credentials.txtReal output from a running instance:
PROXY_USER=sac PROXY_PRIVATE_HOST=172.31.90.248 PROXY_PORT=8888 PROXY_ENDPOINT=172.31.90.248:8888 PROXY_PASSWORD lines present: 1 /root/tinyproxy-credentials.txt 600 root:rootTo see the password itself, read the whole file. It looks like this, with the password replaced by an example value:
# Tinyproxy egress-control forward proxy - credentials for THIS instance, generated on
# its first boot. They are unique to this instance; nothing is baked into the image.
# Keep this file secret (0600 root:root).
# PROXY_USER=sac PROXY_PASSWORD=<PROXY_PASSWORD> PROXY_HOST=203.0.113.10 PROXY_PRIVATE_HOST=172.31.90.248 PROXY_PORT=8888 PROXY_ENDPOINT=172.31.90.248:8888PROXY_ENDPOINT uses the instance's private address on purpose. Clients elsewhere in your VPC should reach the proxy at that address.
Send a request through the proxy
Make a real outbound request through the proxy. The command reads the credential from the root only file at run time, so it never appears on screen:
PU=$(sudo grep '^PROXY_USER=' /root/tinyproxy-credentials.txt | cut -d= -f2-)
PP=$(sudo grep '^PROXY_PASSWORD=' /root/tinyproxy-credentials.txt | cut -d= -f2-)
curl -sS -o /dev/null -w 'authenticated request over HTTPS: HTTP %{http_code}\n' \
--max-time 20 -x "http://$PU:$PP@127.0.0.1:8888" https://example.com/
curl -sS -o /dev/null -w 'authenticated request over HTTP: HTTP %{http_code}\n' \
--max-time 20 -x "http://$PU:$PP@127.0.0.1:8888" http://example.com/Real output from a running instance:
authenticated request over HTTPS: HTTP 200 authenticated request over HTTP: HTTP 200The HTTPS request goes through a CONNECT tunnel on port 443, which is one of the two tunnel ports this image permits.
Now confirm that the same request without a credential is refused:
CODE=$(curl -sS -o /dev/null -w '%{http_code}' --max-time 20 -x http://127.0.0.1:8888 http://example.com/ 2>/dev/null) if [ "$CODE" = "407" ]; then echo "Confirmed: a request with no credentials was refused with HTTP 407" else echo "FAILED: expected HTTP 407 but observed HTTP $CODE" exit 1 fiReal output:
Confirmed: a request with no credentials was refused with HTTP 407Point your own clients at the proxy
On any host inside your VPC that the allow list covers, set the standard proxy environment variables. Replace USER and PASSWORD with the values from Step 8, and replace <proxy-private-ip> with the PROXY_PRIVATE_HOST value:
export http_proxy=http://USER:PASSWORD@<proxy-private-ip>:8888
export https_proxy=$http_proxy
export no_proxy=169.254.169.254,localhost,127.0.0.1 curl -sS -o /dev/null -w '%{http_code}\n' https://example.com/Keep 169.254.169.254 in no_proxy. The EC2 Instance Metadata Service must never be reached through a proxy.
For a system wide setting, most tooling also reads the same variables from /etc/environment. Package managers have their own settings. APT reads /etc/apt/apt.conf.d/, and dnf and yum read a proxy= line in their configuration file.
Confirm nothing else is exposed
Run the exposure check that ships with the image. It enumerates every listening socket and fails closed if anything unexpected is bound to a non loopback address. It runs during the build and again immediately before the image is captured, and you can run it yourself at any time:
sudo /usr/local/sbin/tinyproxy-exposure-check.sh "22 8888"Real output from a running instance:
--- non-loopback TCP listeners --- tcp 0.0.0.0:22 tcp 0.0.0.0:8888 tcp [::]:22 tcp [::]:8888 --- non-loopback UDP listeners --- udp 172.31.90.248%ens5:68 EXPOSURE_CHECK_OK (allowed tcp: 22 8888; allowed udp: 68 546)Only SSH and the proxy port are reachable from the network. The UDP entry is the DHCP client.
Read the proxy log
Read the proxy log. Every request through the proxy is logged in one place, which is the point of routing egress through a single hop.
sudo tail -4 /var/log/tinyproxy/tinyproxy.logReal output from a running instance:
CONNECT Jul 26 05:55:39.121 [6096]: Established connection to host "example.com" using file descriptor 7. INFO Jul 26 05:55:39.130 [6096]: Closed connection between local client (fd:6) and remote client (fd:7) CONNECT Jul 26 05:55:39.138 [6096]: Connect (file descriptor 6): 127.0.0.1 CONNECT Jul 26 05:55:39.142 [6096]: Request (file descriptor 6): GET http://example.com/ HTTP/1.1Set LogLevel Connect in the configuration to log every request line, or LogLevel Warning to reduce the output.
Widening the allow list to your own ranges
If your VPC CIDR is outside the RFC1918 ranges, or you want to narrow the allow list to a single subnet, edit the configuration and restart. Add or replace Allow lines, then apply the change:
sudo nano /etc/tinyproxy/tinyproxy.conf
# add, for example: Allow 10.42.0.0/16
sudo systemctl restart tinyproxy
sudo /usr/local/sbin/tinyproxy-roundtrip.shRe-run the proof after any configuration change to confirm that you have not opened the proxy by accident. Never add Allow 0.0.0.0/0, because that turns the instance into an open proxy.
Rotating the proxy password
The password lives on one line of the configuration file:
sudo nano /etc/tinyproxy/tinyproxy.conf
# edit the line: BasicAuth sac <new-password>
sudo systemctl restart tinyproxyThen update /root/tinyproxy-credentials.txt so it stays the single source of truth for the instance, and update every client that uses the password.
Filtering which destinations may be reached
Tinyproxy can also restrict where clients are allowed to go, which pairs well with egress control. Create a filter file with one pattern per line and reference it from the configuration:
sudo tee /etc/tinyproxy/filter >/dev/null <<'EOF' ^example\.com$ ^.*\.internal$ EOF
sudo tee -a /etc/tinyproxy/tinyproxy.conf >/dev/null <<'EOF' Filter "/etc/tinyproxy/filter" FilterURLs Off FilterExtended On FilterDefaultDeny Yes EOF
sudo systemctl restart tinyproxyFilterDefaultDeny Yes makes the filter an allow list: only destinations matching a pattern are reachable. Leave it off to use the filter as a block list instead.
Maintenance
Service control
sudo systemctl status tinyproxy
sudo systemctl restart tinyproxy
sudo journalctl -u tinyproxy -n 50 --no-pagerConfiguration
The single configuration file is /etc/tinyproxy/tinyproxy.conf. The distribution's stock file is kept alongside it as tinyproxy.conf.orig. After any change, restart the service and re-run the posture proof.
Updates
The image has unattended security upgrades enabled. To update Tinyproxy and the rest of the system manually, run:
sudo apt-get update && sudo apt-get upgrade -y sudo systemctl restart tinyproxy
sudo /usr/local/sbin/tinyproxy-roundtrip.shTuning
MaxClients (default 100 in this image) caps concurrent connections, and Timeout (600 seconds) controls how long an idle connection is held. Raise MaxClients before you raise the instance size, because Tinyproxy is rarely the bottleneck.
Troubleshooting
Symptom Likely cause Fix
Client gets HTTP 403 The client's source address is not covered by an Allow line Add the client's CIDR to /etc/tinyproxy/tinyproxy.conf and restart
Client gets HTTP 407 No proxy credential was sent Include the username and password in the proxy URL, or in your client's proxy authentication settings
Client gets HTTP 401 A credential was sent but it is wrong Re-read the password from /root/tinyproxy-credentials.txt
Connection times out from another host Security group does not allow TCP 8888 from that host Add the inbound rule from Step 3, scoped to your own CIDR
HTTPS works but a non standard TLS port fails CONNECT is restricted to ports 443 and 563 Add a ConnectPort line for the port you need, and only that port
Instance metadata calls fail on a client The metadata service is being sent through the proxy Add 169.254.169.254 to no_proxy
Support
SecureAnyCloud provides 24/7 technical support for this image by email and live chat.
- Email: sales@secureanycloud.com
- Live chat: available 24/7 on secureanycloud.com
Tinyproxy is free software maintained by the Tinyproxy project and its contributors, licensed under the GNU General Public License version 2. SecureAnyCloud is not affiliated with or endorsed by the Tinyproxy project.
Deploy on AWS
Launch Tinyproxy on AWS with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com