corporate AWS Marketplace

Guacamole Bastion Cluster for High Availability

Guacamole is a browser based remote access tool that provides easy access to hosts in your VPC. Both Windows desktops (RDP) and Linux terminals (SSH) are supported. No client software needs to be installed, an HTML5 capable web browser is all you need. This also enables administrators in corporate environments behind restrictive proxies to access remote servers on AWS.

This product ships with version 1.1.0 of the popular open-source HTML5 RDP and SSH client Apache Guacamole (http://guacamole.apache.org/) and GuAWS, an agent that queries your AWS environment to automatically discover running instances. GuAWS is continuously scanning your VPC for new instances using the AWS API. Your servers are organized by security groups which makes it easy to find the right instance and manage access. Additionally, connections opened by users are logged to CloudWatch logs.

This cluster configuration provides a highly available deployment of the Guacamole Bastion Host through the use of Auto Scaling Groups and the Application Load Balancer. The cluster is deployed using CloudFormation and is ready to go within 5 minutes after launch.

Cluster Network Diagram

Prerequisites

The following resources are required to exist before the template can be deployed:

Setup Instructions

Step 1: Prepare MySQL Server

  1. Create a new database and user on the MySQL server. Connect to your MySQL server and execute the following command. It is recommended to change the default password in the first line to something more secure.

    CREATE USER 'guacamole'@'%' IDENTIFIED BY 'guacamole';
    GRANT DELETE,UPDATE,INSERT,SELECT ON guacamole.* TO 'guacamole'@'%';
    
  2. If you have an existing Guacamole instance and want to migrate, go to Step 2.

  3. Download and import guaws.sql. Execute the following command. Replace the host parameter with your MySQL server and the user with your administrative user on the server that has permissions to create tables and databases.

     mysql --host mysqlserver --user=root --password < guaws.sql
    

Step 2 (optional): Migrate Database

If you are migrating from a single instance deployment to the cluster deployment you will want to move existing users and connections to the new environment.

  1. Connect to your existing Guacamole instance through SSH with the ec2-user user.
  2. Run the following command to create a dump of your MySQL database to a file
     mysqldump --protocol=TCP --skip-lock-tables --add-drop-table --user=guacamole --password=guacamole --databases guacamole > backup.sql
    
  3. Import the dump into your new MySQL server. Replace the host parameter with your MySQL server and the user with your administrative user on the server that has permissions to create tables and databases.

     mysql --host mysqlserver --user=root --password < backup.sql
    

Step 3 (optional): Create Security Group

The Guacamole EC2 instances must be able to connect to the database server. If your database already allows incoming connections from within the VPC then this step is optional.

To create a new security group using the console

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/v2/home#SecurityGroups.

  2. Choose Create Security Group.

  3. Specify a name and description for the security group.

  4. For VPC, choose the ID of the VPC.

  5. On the Outbound tab, edit the first rule, set Type to MySQL/Aurora and set the Destination to the security group of your database server.

Additionally, the security group of your database server needs to be configured to allow incoming requests from the security group that you just created.

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/v2/home#SecurityGroups.

  2. Select your database security group.

  3. On the Inbound tab, click Edit.

  4. In the dialog, set Type to MySQL/Aurora and set the Source to the security group that you just created.

Step 4: Launch Stack

The stack can be launched by clicking on the button below. You can also download the CloudFormation template and deploy it manually.

Please ensure that the subnets for the EC2 instances (InstanceSubnets) have internet access or a CloudFormation VPC Endpoint configured. Otherwise the EC2 instance cannot signal the CloudFormation stack of their successful deployment.

If you want Guacamole to be accessible from the internet, make sure that the subnets (LoadBalancerSubnets) are internet facing (sometimes referred to as public subnets).

If the stack fails to enter the CREATE_COMPLETE state within 10 minutes the deployment has most likely failed. In that case, please double check that instances within the InstanceSubnets can reach the CloudFormation API endpoint.

Launch Stack

Step 5: Access the Load Balancer

Wait until the stack is in the CREATE_COMPLETE state. Open the Output tab of the CloudFormation stack that was deployed in Step 2. Copy and paste the GuacamoleUrl value into your browser. You should see the login screen. The username is guacadmin and the password is guacamole. Please change the password after login by accessing the account settings in the upper right menu.

If you see a blank page instead, the database connection settings might be wrong or the EC2 instance has no network connectivity to the database server. Please make sure that the security groups attached to the EC2 instances have sufficient permissions to access the database server.

Step 6 (optional): Assign DNS Record

Follow the guide on Routing Traffic to an ELB Load Balancer to associate a custom domain name with the load balancer. Make sure that the domain name matches the ACM certificate to prevent certificate warnings in the browser.

Apache Guacamole, Guacamole, Apache, the Apache feather logo, and the Apache Guacamole project logo are trademarks of The Apache Software Foundation.