Module 1: Create an InfoSec approved secure golden image
You will be using an EC2 Image Builder wizard which will walk you through from the beginning to the end. It is the easiest way to get started.
- From the EC2 Image Builder landing page, select Create image pipeline.
- On the Define Recipe page, create an image recipe, which includes your source image and components.
- Under Source image, select Windows for OS.
- For image, choose Select managed images and click Browser images. Select Windows Server 2019 English Full Base x86 with the latest version.
- Check the option, Always build latest version.
- For Build components, click Browse build components. Select stig-build-windows-low with the latest version then click Choose. Click Browse build components again, select update-windows and click Choose. Ensure the order of the component shown is in the order that was selected (Stig-build-windows-low then update-windows).
- For Test components, select reboot-test-windows.
- Click Next.
- On the Configure pipeline page, name the pipeline and enter its description. For IAM role, click Create new instance profile role which open IAM console in a new tab. You are going to create an EC2 instance role with EC2InstanceProfileForImageBuilder and AmazonSSMManagedInstanceCore managed policy attached.
- Click Roles in the left menu and click Create role button. Choose AWS service for trusted entity then select EC2. Click Next: Permission.
- Under Attach permissions policies, search for the policy mentioned in #9 then check the checkbox in front of it. Click Next: Tags
- You can enter the tag here. Click Next: Review
- Review your configuration then click Create role.
- Now go back to EC2 Image Builder Configuration pipeline. For IAM role, select the role created in the previous step. If it does not show up in the dropdown, click the refresh button next to it.
- For Build schedule, select Manual.
- You will skip the infrastructure settings and leave it with the default value. Click Next.
- Skip Associate license configuration to AMI as well.
- For Output AMI, enter the name and tags.
- For AMI distribution settings, us-east-1 is already select. Add us-east-2. Click Review.
- Review the configuration then click Create Pipeline.
- Check the checkbox in front of the pipeline, click the Action dropdown on the top left then select Run pipeline.
- After the pipeline execution has been initiate, you can click the Pipeline name which will lead to the pipeline information. You can also see the status of the running pipeline here.
- After the Status changed to available, explore the new image that just created under Images.
- Go to EC2 Management Console and create a new instance from this AMI.