Introduction
A bastion host serves as a secure entry point to your private Poolside subnets, enabling you to perform deployment tasks that require network access to resources not directly accessible from your local environment. The steps provided here focus on setting up a headless Linux bastion host. However, these instructions are equally applicable if you choose to deploy a GUI-based bastion host.Prerequisites
This document presumes that you have already deployed the AWS VPC and subnets for Poolside as documented in the AWS Networking Setup guide. Before you begin, ensure you have the following:- AWS Account Credentials: Access to an AWS account with permissions to create EC2 instances, configure networking, and manage IAM roles.
- VPC Information:
- vpc_id where Poolside will be deployed
- private_subnet_ids for the bastion host
- private_subnet_ids for Poolside
- Network Access:
- Ability to access the bastion host via SSH from your local machine.
- A GUI-based system with a web browser and network access to the Poolside API endpoint for the Splash CLI steps.
- Splash CLI Package: Provided by the Poolside team.
- Required Tools: List of tools to be installed on the bastion host (detailed in Step 3).
Deploy an EC2 Instance in the Public Subnet
A sample Terraform script is provided in the Appendix below. However, if you would like to deploy manually, begin by logging into the AWS Management Console and navigating to the EC2 service. Select the option to launch a new instance, the specifications for which should look similar to the following:- Name: poolside-bastion (or similar)
- AMI: Amazon Linux 2023 (or preferred AMI)
- Instance Type: t3.small
- Key Pair: Select or create a new one for SSH access
- Network:
- VPC: Choose the VPC where Poolside will be deployed
- Subnet: Choose a public subnet within the VPC
- Auto-assign Public IP: Enable
- Security Group:
- Create a new security group with the following inbound rule:
- Type: SSH
- Protocol: TCP
- Port Range: 22
- Source: Your trusted IP address or CIDR block
Configure Security Groups and Network Access
In order for your new bastion host to connect to Poolside’s network, you will need to ensure all network paths and ports are correctly configured.Modify Bastion Host Security Group
Ensure the security group allows outbound access to the private subnets where Poolside resides. This setting is generally enabled by default.Configure Private Subnets’ Security Groups
- EKS Cluster Security Group: Add an inbound rule to allow traffic from the bastion host’s security group on necessary ports, such as:
-
Type: HTTPS
- Protocol: TCP
- Port Range: 443
- Source: Bastion Host security group ID
- Node Security Groups: If needed, allow inbound SSH and other necessary ports from the bastion host.
Network Access Control Lists (NACLs)
Ensure NACLs associated with your subnets allow the necessary inbound and outbound traffic between the bastion host and the private subnets.- Inbound Rules: Allow traffic from the bastion host’s subnet CIDR to the private subnets.
- Outbound Rules: Allow traffic from the private subnets to the bastion host’s subnet CIDR.
Install Required Tools on the Bastion Host
Start by connecting to the bastion host via SSHConfigure AWS Credentials
To deploy the required Poolside’s resources, the bastion host needs appropriate AWS permissions. You have two options:- Create and attach a dedicated IAM Role (recommended)
- Navigate to Instance → ‘Actions’ → ‘Security’ → ‘Modify IAM role’
- Specify a set of (new or existing) AWS Access Keys for the Bastion’s AWS CLI
- Run
aws configureon the bastion host and input your key configs and default region
- Run
Required AWS Permissions
For either method, the following AWS permissions are required:- Amazon EKS: Full access to EKS services (
eks:*) - Amazon EC2:
- Describe actions for instances, VPCs, subnets, security groups, route tables, and volumes
- Create and manage security groups
- Create and manage EC2 instances for node groups
- Amazon ECR:
- Pull images
- Get authorization token
- Amazon S3: Full access to create, read, update, and delete S3 buckets and objects related to the Poolside deployment
- Amazon RDS: Full access to create, read, update, and delete RDS instances related to the Poolside deployment
- IAM: Create and manage roles and policies (limited to roles/policies related to Poolside)
- VPC: Describe and modify VPC components (subnets, route tables, NACLs)
- AWS Certificate Manager (ACM): Describe and list certificates
- AWS Key Management Service (KMS): Describe keys and create grants
Note: The specific permissions for your deployment may vary depending on your choices of container registry, certificate manager, etc. Always follow the principle of least privilege when assigning permissions.
Proceed to Poolside VPC Deployment
When the above steps have been completed, you can proceed to the Poolside VPC Deployment guide to complete the setup. The Poolside team will provide you with deployment scripts that will need to be transferred over to the bastion to complete the setup.Appendix
(Sample) Terraform Bastion Host Deployment Script
The following Terraform script is provided as a reference implementation. Before using or adapting this script for your environment, please consider the following:- Review thoroughly: Ensure the script aligns with your organization’s security policies, compliance requirements, and best practices.
- Customization: Modify all sections marked with ”# Replace” comments to reflect your specific AWS environment and requirements.
- IAM Policies: Pay special attention to the included IAM role policy. The provided resource scope is permissive and should be adjusted to adhere to your organization’s security standards.
main.tf