Skip to main content

More Info:

This rule checks if Amazon Elastic Compute Cloud (Amazon EC2) instances are protected by a backup plan. The rule is NON_COMPLIANT if the Amazon EC2 instance is not covered by a backup plan.

Risk Level

High

Address

Configuration

Compliance Standards

  • APRA CPS 234 (Australia)
  • BSI C5 (Germany)
  • Brazil LGPD
  • CCPA / CPRA (California)
  • CIS Critical Security Controls v8
  • CMMC 2.0
  • CSA Cloud Controls Matrix v4
  • Cloudanix Best Practice
  • DPDPA
  • Digital Operational Resilience Act (EU)
  • Essential 8
  • ISO/IEC 27017
  • ISO/IEC 27018
  • ISO/IEC 27701
  • KSA PDPL
  • MAS Technology Risk Management (Singapore)
  • MITRE ATT&CK (Cloud)
  • NIS2 Directive
  • NIST SP 800-171
  • NYDFS 23 NYCRR 500
  • Reserve Bank of India (RBI) Master Direction – Information Technology Framework
  • SWIFT Customer Security Controls Framework
  • Sarbanes-Oxley IT General Controls
  • Securities and Exchange Board of India (SEBI) - Cloud Security Adoption Framework
  • UK NCSC Cyber Assessment Framework

Triage and Remediation

Remediation

Using Console

To remediate the misconfiguration of EC2 instances not having a backup plan in AWS, you can set up automated backups using Amazon EBS snapshots. Here’s a step-by-step guide on how to do this using the AWS Management Console:
  1. Sign in to the AWS Management Console: Go to https://aws.amazon.com/ and sign in to the AWS Management Console using your credentials.
  2. Navigate to the EC2 Dashboard: Click on the “Services” dropdown menu at the top of the page, select “EC2” under the “Compute” section to go to the EC2 Dashboard.
  3. Select the EC2 Instance: In the EC2 Dashboard, select the EC2 instance for which you want to set up automated backups.
  4. Create an Amazon EBS Snapshot:
    • Select the EBS volume attached to the EC2 instance.
    • Click on the “Actions” dropdown menu, navigate to “Create snapshot” and click on it.
    • Enter a descriptive name for the snapshot and click on “Create snapshot”.
  5. Set up Automated Backups:
    • In the EC2 Dashboard, under the “ELASTIC BLOCK STORE” section, click on “Snapshots”.
    • Select the snapshot that you created in the previous step.
    • Click on the “Actions” dropdown menu and select “Create Lifecycle Policy”.
    • Enter a name for the policy, set the frequency and retention period for backups, and click on “Create policy”.
  6. Monitor Backup Status:
    • To monitor the backup status, go to the EC2 Dashboard, click on “Instances” in the navigation pane, and select the EC2 instance.
    • Under the “Description” tab, you can view the details of the automated backups and their status.
By following these steps, you have successfully set up automated backups for your EC2 instance using Amazon EBS snapshots, ensuring that you have a backup plan in place for protection.

To remediate the misconfiguration of EC2 instances not having backup plan protection in AWS using AWS CLI, you can follow these steps:
  1. Identify EC2 Instances: First, you need to identify the EC2 instances that do not have backup plan protection enabled. You can use the following AWS CLI command to list all EC2 instances in your account:
  2. Enable Backup Plan Protection: To enable backup plan protection for EC2 instances, you can create a backup plan using AWS Backup service. Here’s an example command to create a backup plan:
  3. Assign Backup Plan to EC2 Instances: Next, you need to assign the backup plan to the EC2 instances. You can use the following AWS CLI command to assign the backup plan to the EC2 instances:
  4. Verify Backup Plan Protection: Finally, you should verify that the backup plan protection has been successfully enabled for the EC2 instances. You can check the backup status using the AWS Backup console or the following AWS CLI command:
By following these steps, you can remediate the misconfiguration of EC2 instances not having backup plan protection enabled in AWS using AWS CLI.
To remediate the misconfiguration of EC2 instances not having a backup plan protection in AWS using Python, you can follow these steps:
  1. Identify EC2 Instances: Use the Boto3 library in Python to list all the EC2 instances in your AWS account.
  1. Create AMI Backups: For each identified EC2 instance, create an AMI backup. This will serve as a snapshot of the instance that can be used to restore it if needed.
  1. Set Up Lifecycle Policies: Configure lifecycle policies to manage the retention of your AMIs to avoid unnecessary costs and clutter. You can do this using the create_lifecycle_policy method in Boto3.
  1. Automate Backup Process: Set up a cron job or a Lambda function to automate the backup process at regular intervals.
By following these steps, you can ensure that your EC2 instances have a backup plan protection in place in AWS using Python.
Substitute:
  • UNIQUE_SELECTION_NAME with a backup selection name unique within this backup plan (e.g., ec2-my-app-server).
  • AWS_ACCOUNT_ID with your 12‑digit AWS account ID.
  • EXISTING_BACKUP_PLAN_ID with the ID of the existing backup plan you want this instance protected by.
  • aws_instance.TARGET_EC2_INSTANCE with the Terraform resource for the EC2 instance to protect, or replace the comment with its literal ARN.
This change does not force replacement of the EC2 instance; it only adds it to a backup selection under the specified backup plan.To verify, terraform plan should show creation of one new aws_backup_selection resource and no changes to the existing EC2 instance resource.

Additional Reading: