Connect to SAP in a private network through a proxy
If your SAP system is reachable only inside a private network, deploy an authenticated forward proxy on a VM so Glasslake test executions can reach it. SAP stays off the public internet, because access to the proxy is also private.
How the proxy works
Glasslake routes all cloud browser traffic through the proxy. The proxy authenticates each request, checks that the destination is on the allowlist, and forwards the connection to SAP over the private network.
| From | To | Connection |
|---|---|---|
| Glasslake cloud browser | Proxy VM (public IP, port 3128) | HTTPS with authentication |
| Proxy VM | SAP Fiori (private IP) | TCP tunnel over the private network |
Access is controlled at two independent layers: firewall rules control which ports are reachable on the VM, and proxy access rules control who can connect and which destinations they can reach.
Squid is the recommended implementation and is documented below. Nginx, Apache HTTPD, and HAProxy are also supported if they provide authenticated forward proxying, destination allowlisting, and secure exposure on a public endpoint.
Before you begin
| Requirement | Details |
|---|---|
| VM with public IP | AWS EC2, GCP Compute Engine, Azure VM, or equivalent, with a static public IP. On-premise VMs (VMware, Hyper-V, KVM) need a public IP or NAT. |
| OS | Ubuntu 22.04 LTS (recommended) or Ubuntu 20.04. |
| VM size | At least 1 vCPU and 1 GB RAM for testing; 2 vCPU and 2 GB RAM for production. |
| Network position | TCP connectivity from the VM to the SAP host on its port (commonly 443, 44300, or 8443). Place the VM in the same network as SAP or use a site-to-site VPN. |
| Firewall access | Inbound port 3128 open to 0.0.0.0/0. Inbound port 22 restricted to your admin IP. |
| SSH access | SSH key or password access to the VM. |
Install and configure Squid
Run these commands on the VM over SSH. All of them need sudo.
-
Update the system and install Squid and
apache2-utils(which provideshtpasswd):sudo apt-get update -y
sudo apt-get install squid apache2-utils -y -
Back up the default configuration:
sudo cp /etc/squid/squid.conf /etc/squid/squid.conf.bak -
Create the proxy credentials file. Replace
YOUR_USERNAMEwith your proxy user name, and enter a password when prompted:sudo htpasswd -c /etc/squid/passwd YOUR_USERNAME
sudo chown proxy:proxy /etc/squid/passwd
sudo chmod 640 /etc/squid/passwdwarningPort 3128 is open to the public internet. Use a password of at least 16 characters with mixed case, numbers, and symbols, and keep it private.
-
Write
/etc/squid/squid.conf. ReplaceSAP_PRIVATE_IPwith the private IP of your SAP system andSAP_PORTwith its port:# Glasslake HTTP Proxy Connector
http_port 3128
# Basic authentication
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd
auth_param basic realm Glasslake_Secure_Proxy
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive on
# Method and port ACLs
acl CONNECT method CONNECT
acl SSL_ports port 443
acl SSL_ports port SAP_PORT
acl Safe_ports port 80
acl Safe_ports port 443
acl Safe_ports port SAP_PORT
# Authentication ACL
acl authenticated proxy_auth REQUIRED
# Allowed destinations
acl sap_target dst SAP_PRIVATE_IP
acl aws_checkip dstdomain checkip.amazonaws.com
# Access rules: order is critical
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny !authenticated
http_access allow authenticated sap_target
http_access allow authenticated aws_checkip
http_access deny all -
Validate the configuration. The command must return no errors:
sudo squid -k parse -
Apply and enable Squid:
sudo systemctl reload squid
sudo systemctl enable squid
sudo systemctl status squid -
In your VM's firewall or security group, allow inbound TCP 3128 from 0.0.0.0/0 and inbound TCP 22 from your admin IP only. Deny all other inbound ports.
Validate the connection
Run these tests from any machine with internet access. Replace the placeholders with your values.
-
Send a request without credentials. It must return 407 Proxy Authentication Required:
curl -v -k -x http://<PROXY_IP>:3128 -I "https://<SAP_PRIVATE_IP>:<SAP_PORT>/<SAP_PATH>" -
Send a request with credentials. It must return 200 Connection established, and a second 200 from SAP means the application is reachable:
curl -v -k -x http://<USERNAME>:<PASSWORD>@<PROXY_IP>:3128 -I "https://<SAP_PRIVATE_IP>:<SAP_PORT>/<SAP_PATH>" -
Send a request to a destination that isn't allowlisted. It must return 403 Forbidden:
curl -v -k -x http://<USERNAME>:<PASSWORD>@<PROXY_IP>:3128 -I "https://www.google.com"
To watch live traffic, run sudo tail -f /var/log/squid/access.log. TCP_TUNNEL/200 means traffic is flowing to SAP, TCP_DENIED/407 means credentials were missing or invalid, and TCP_DENIED/403 means the destination isn't allowlisted.
Share the connection details with Glasslake
| Field | Description |
|---|---|
| Proxy server URL | Public IP or hostname of the VM on port 3128, in the format http://<ip>:3128. |
| Proxy username | The user name you created. |
| Proxy password | The password you created. |
| SAP URL | The full internal URL of the SAP application, used to verify end-to-end connectivity. |
| SAP username | An SAP user with the minimum permissions needed for integration and validation tests. |
| SAP password | The password for that SAP user. |
Share passwords only through your approved secure secret-sharing channel. Never paste them into email, chat, or documents.
Harden and maintain the proxy
- Restrict port 22 to your admin IP. Don't leave SSH open to 0.0.0.0/0.
- Create a separate proxy user per client or per Glasslake project, so you can revoke access individually.
- Keep the
sap_targetallowlist as specific as possible. Prefer single IPs over subnet ranges. - Install fail2ban with a Squid filter to block IPs that generate repeated 407 responses.
- Keep Squid access logs for at least 30 days, and consider shipping them to CloudWatch, Datadog, or an equivalent.
To rotate or revoke credentials, run the following, then reload Squid:
# Update the password for an existing user
sudo htpasswd /etc/squid/passwd YOUR_USERNAME
# Delete a user (revokes access immediately)
sudo htpasswd -D /etc/squid/passwd YOUR_USERNAME
sudo systemctl reload squid
Troubleshooting
| Symptom | Likely cause | Action |
|---|---|---|
| 407 with valid credentials | The credentials file has the wrong permissions or path. | Run echo "user pass" | sudo /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd. It must return OK. |
| Connection refused on port 3128 | Squid isn't running, or the firewall blocks the port. | Run sudo systemctl status squid and check the inbound rule for 3128. |
| 200 from the proxy but no SAP response | SAP isn't reachable from the VM. | On the VM, run nc -vz <SAP_IP> <SAP_PORT>. It must succeed. |
| 403 for the SAP destination | The sap_target IP or the port doesn't match. | Check that acl sap_target dst matches exactly and that the SAP port is in both SSL_ports and Safe_ports. |
| Squid fails to reload | Configuration syntax error. | Run sudo squid -k parse and fix the reported errors. |
| Authentication isn't enforced | http_access deny !authenticated is missing or in the wrong place. | Make sure it appears before any http_access allow rule. |