Skip to main content

More Info:

Ensuring Termination Protection feature is enabled for EC2 instances that are not part of ASGs.

Risk Level

Low

Address

Reliability, Security

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
  • SWIFT Customer Security Controls Framework
  • Sarbanes-Oxley IT General Controls
  • UK NCSC Cyber Assessment Framework

Triage and Remediation

Remediation

Using Console

To remediate the Termination Protection Should Be Enabled misconfiguration in AWS using the AWS console, follow these steps:
  1. Login to the AWS Management Console.
  2. Navigate to the EC2 Dashboard.
  3. Select the instance that you want to enable termination protection for.
  4. Click on the “Actions” button and select “Instance Settings”.
  5. Click on “Change Termination Protection”.
  6. Select the “Enable” option and click “Save”.
  7. A confirmation message will appear indicating that the termination protection has been enabled.
  8. Repeat steps 3-7 for each instance that needs termination protection enabled.
By following these steps, you will have successfully remediated the Termination Protection Should Be Enabled misconfiguration for your AWS environment.

To remediate the misconfiguration “Termination Protection Should Be Enabled” for an EC2 instance in AWS using AWS CLI, follow the below steps:
  1. Open the AWS CLI on your local machine.
  2. Run the following command to enable termination protection for an EC2 instance:
    Replace <instance-id> with the ID of the EC2 instance for which you want to enable termination protection.
  3. Verify that the termination protection is enabled for the instance by running the following command:
    If the output shows "Value": false, it means that termination protection is enabled for the instance.
  4. Repeat the above steps for all the EC2 instances in your AWS account to ensure that termination protection is enabled for all of them.
Note: Enabling termination protection is a safety measure to prevent accidental termination of instances. However, it should not be used as a substitute for proper backup and disaster recovery planning.
The following steps can be followed to remediate the “Termination Protection Should Be Enabled” misconfiguration in AWS using Python:
  1. Import the necessary libraries:
  1. Create an EC2 client:
  1. Get a list of all instances:
  1. Enable termination protection for each instance:
This will enable termination protection for all instances in your AWS account.
Enabling disable_api_termination = true prevents this instance from being terminated via console, CLI, or API until you set it back to false; this change does not force instance replacement.To verify, terraform plan should show an in-place update on the aws_instance.PROTECTED_INSTANCE resource setting disable_api_termination from false (or null) to true.

Additional Reading: