Apache Guacamole - Hardened Remote Desktop Gateway
by Lynxroute
Apache Guacamole 1.6.0 - CIS Level 1 hardened RDP/VNC/SSH gateway on Ubuntu 24.04 LTS, SBOM + CIS
What is Apache Guacamole
Apache Guacamole is a clientless remote desktop gateway. Your users reach RDP, VNC, SSH and telnet targets from an ordinary browser over HTTPS - no client, no plugin, no agent on the target machine. Connections are defined once by an administrator and shared with the users and groups who need them, so credentials for the target hosts never have to be handed out. Every session is brokered through a single audited entry point, and connection history is recorded in the built-in database. Guacamole is a top-level Apache Software Foundation project, licensed Apache-2.0.
Why self-host Apache Guacamole
A remote access gateway sees every keystroke and every frame of every session, which makes it one of the least appealing things to delegate to a third party. Self-hosting keeps session traffic, recorded history and target-host credentials inside your own subscription and network boundary - what data-residency and GDPR reviews ask for - with no per-seat licensing on contractor or auditor access.
What this VM image adds
Security hardening:
- Unique admin password per instance - a 24-character password is generated on your instance at first launch and written to /root/guacamole-credentials.txt (mode 600); no shared or preset credential ships in the image
- TLS-only perimeter - nginx terminates HTTPS on 443 and proxies the display tunnel over WebSocket; port 80 is firewall-closed, so there is no cleartext entry point
- guacd bound to localhost - the protocol proxy listens only on 127.0.0.1:4822 and is never reachable from the network
- PostgreSQL bound to localhost - the authentication and connection database listens only on 127.0.0.1:5432
- Sandboxed protocol daemon - guacd handles input from remote hosts, so it runs unprivileged under a systemd sandbox (ProtectSystem=strict, PrivateTmp, PrivateDevices, NoNewPrivileges)
- Minimal extension surface - only the PostgreSQL authentication extension is installed; nothing optional is enabled
- CVE scan - every image is scanned for vulnerabilities with Trivy before release
- UFW firewall - only 22 and 443 accepted; the servlet container, guacd and the database are unreachable externally
- fail2ban - SSH brute-force protection
- AppArmor - mandatory access control
OS hardening (CIS Level 1):
- CIS Level 1 hardened - CIS Ubuntu 24.04 LTS Level 1 Benchmark via ansible-lockdown
- auditd - system call auditing for critical paths
- SSH hardening - PasswordAuthentication disabled, key-only access
- Kernel hardening - SYN cookies, ASLR, rp_filter, TCP BBR
- /tmp as tmpfs - nosuid, nodev, noexec
- Azure IMDS endpoints - egress rules pre-configured (169.254.169.254, 168.63.129.16)
Compliance artifacts (inside the VM):
- SBOM - CycloneDX 1.6 at /etc/lynxroute/sbom.json
- CIS Conformance Report - OpenSCAP HTML at /etc/lynxroute/cis-report.html
- Tailored CIS profile - /usr/share/doc/lynxroute/CIS_TAILORED_PROFILE.md
- Session history - every connection recorded in the built-in PostgreSQL database, visible under Settings
Quick Start
- Deploy the VM from Azure Marketplace (Standard_D2s_v3 or larger recommended)
- SSH: ssh -i key.pem <username>@<PUBLIC_IP> (username set during VM creation, default: azureuser)
- Read the generated password: sudo cat /root/guacamole-credentials.txt
- Open https://<PUBLIC_IP>/, accept the self-signed certificate, and sign in as guacadmin
- Add a target under Settings, then Connections, then New Connection: pick RDP, VNC, SSH or telnet, enter the host and port, save. It appears on the home screen and opens in the browser.
- Create per-user accounts under Settings, then Users, granting each only the connections it needs
- Replace the self-signed certificate before production. Certbot and its nginx plugin are pre-installed; domain validation needs inbound port 80, closed by default: sudo ufw allow 80/tcp, open 80 in the network security group, then sudo certbot --nginx -d yourdomain.com
Restrict inbound 443 to your own address range until you have signed in and changed the admin password: anyone who reaches the gateway first can attempt to authenticate against it.