Bobcares

Bastion host AWS CloudFormation: Configuration and Easy Setup

by | Oct 23, 2022

 let us take a closer look at the bastion host aws cloudformation and the configurations necessary to set it up with the support of our AWS support services at Bobcares.

Linux Bastion Hosts on AWS

Amazon Web Services creates the Quick Start (AWS). Quick Starts are reference installations that assist users in deploying popular technologies on AWS using best practices from AWS. This Quick Start sets up Linux bastion hosts on AWS.

Architecture for Deploying Bastion Host on AWS CloudFormation

Deploying this Quick Start with the default parameters creates the AWS Cloud environment for the following Linux Bastion Hosts. The bastion host no longer has a public IP address assigned by default for remote access.

We can connect to the Linux instance using Session Manager, an AWS Systems Manager feature.

With this article let’s setup the following:

  • A highly available architecture with two Availability Zones.
  • A virtual private cloud (VPC) has been set up with public and private subnets. It is in accordance with AWS best practices to give us our own virtual network on AWS.
  • In the public subnets:

    a) Gateways for managed network address translation (NAT) to provide outbound internet access for resources in private subnets.

    b) An Auto Scaling group Linux bastion host for connecting to Amazon Elastic Compute Cloud instances in public and private subnets.

  • The Linux bastion host shell history logs are present in the Amazon CloudWatch log group.
  • AWS Systems Manager for access to the bastion host.

The template that deploys this Quick Start into an existing VPC skips the asterisk-marked components. It will request the existing VPC setup.

Deployment options

This Quick Start provides the following deployment options:

  • Install Linux Bastion Hosts in a new VPC. This option creates a new Amazon Web Services environment. It will include a VPC, private and public subnets, NAT gateways, Linux bastion hosts, and other materials.
  • Install Linux Bastion Hosts within an live VPC. This option creates Linux Bastion Hosts within the existing AWS architecture.

This Quick Start includes templates for each of these available options. It also allows us to set up Classless Inter-Domain Routing (CIDR) blocks, instance kinds, and Linux Bastion Hosts.

Predeployment steps

We must build a key pair to access the Linux bastion server through SSH and the AWS Systems Manager. We can also perform optional customization on the Linux bastion host banner.

As seen in the image below, this Quick Start offers a banner for the Linux bastion hosts:

bastion host aws cloudformation

To turn on the banner, we may set the Bastion banner option to true during deployment. By default, the banner is off. It is better to turn it on upon release. This will makes the users aware of the recording of all of their activities.

To personalize the banner, we must first create an ASCII text file with the banner’s content. We have to upload the file to an S3 bucket or another publicly available place. The host should be able to view the file.

Deployment steps

Follow the steps given below for deployment for bastion host aws cloudformation:

  1. To begin, log in to the AWS account and run the Quick Start, as given under Deployment choices. The AWS CloudFormation interface opens with a template already filled up. The deployment process takes roughly 5 minutes.
  2. Select the appropriate AWS Region and then click Next.
  3. Keep the default setting for the template URL on the Create stack page, and then click Next.
  4. If necessary, modify the stack name on the Specify stack information page. Examine the template’s settings. Fill in the blanks with the values for the parameters that require it. Review the default settings for all other limits and make any important changes. Select Next, we may examine and modify the rules and limits.

    Change the default values for the following Amazon Simple Storage Service (Amazon S3) rules limits. This is unless we are changing the Quick Start templates for the projects. Quick Start S3 bucket name, Quick Start S3 bucket Region, and Quick Start S3 key prefix. When we change these settings, code references will update to link to the new Quick Start site.

  5. We may define tags for resources in the stack and select advanced settings on the Configure stack options page. Click on the Next button.
  6. Review and approve the template choices on the Review page. Select all of the checkboxes under Capabilities to recognize that the template produces AWS Identity. And it will let  Access Management (IAM) resources that may require the ability to grow macros automatically.
  7. To deploy the stack, choose Create stack.
  8. When the stack’s status is CREATE COMPLETE, the Linux Bastion Hosts deployment is complete.
  9. Select the Outputs tab to see the newly produced resources.

Postdeployment steps

Before getting into the set up we have to confirm that we can log in to the bastion host. After that Connect to the bastion host. Depending on your Linux distribution, choose one of the following user names:

  • Amazon Linux / SUSE Linux Enterprise Server (SLES): ec2 user
  • CentOS: centos
  • Ubuntu: ubuntu

When we deploy the templates, we provide the Linux distribution in the Bastion AMI operating system limit and rules.

[Need assistance with similar queries? We are here to help]

Conclusion

To conclude we have now learned more about the bastion host aws cloudformation and the configuration steps necessary to set it up with the support of our AWS Support Services at Bobcares.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF