Question: You will modify this template to secure MySQL. (I have added the template at to the very bottom of this question) You will note that

You will modify this template to secure MySQL. (I have added the template at to the very bottom of this question)

You will note that much has already been setup including various sections such as files, services, commands, etc. You must use the appropriate sections, rather than putting your code in User Data -- that must remain unedited.

As noted in lecture, it still allows someone to login to MySQL without a username and password. There are other issues that are non-secure about the default MySQL installation. The mysql_secure_installation command does all that is needed to properly secure MySQL. However, it does not lend itself to being easily called from a script. Your job is to research how to make this template do all the same things that mysql_secure_installation does. Basically there are a couple of ways of doing this:

  1. Somehow call mysql_secure_installation from the template
  2. OR just perform the same actions that the mysql_secure_installation does

Whatever solution you implement it must not in any way leak credentials such as the password. So, for instance, hardcoding the password in the template, or if the result of your solution exposes the password in history or log files.

aws TEMPLATE:

--- Description: Setup an Amazon Linux Web server

Parameters: DBRootPassword: Type: String Description: Root password for MySQL NoEcho: 'true' MinLength: 7 MaxLength: 41 AllowedPattern: '[a-zA-Z0-9]+' KeyName: Type: AWS::EC2::KeyPair::KeyName Description: Name of an existing EC2 keypair to enable SSH access to the instance SSHCIDR: Type: String Description: The CIDR block restricting SSH MinLength: 9 Default: 131.247.0.0/16 AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})' ConstraintDescription: must be a valid IP CIDR range of the form x.x.x.x/x

Mappings: Region2AMI: us-east-2: AMI: ami-0cd3dfa4e37921605 us-west-1: AMI: ami-0ec6517f6edbf8044

Resources: EC2Instance: Type: AWS::EC2::Instance Metadata: AWS::CloudFormation::Init: configSets: InstallAndConfig: - Install - Configure Install: packages: yum: httpd: [] mysql-server: []

files: /var/www/html/index.html: content: |

Annas CloudFormed Server

with CloudFormation Helper Scripts

Hi!!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!