More Info:
Deletion Protection flag should be enabled in order to prevent accidental deletions.Risk Level
LowAddress
Reliability, Operational Maturity, SecurityCompliance Standards
HIPAA, NISTTriage and Remediation
Remediation
Using Console
Using Console
Sure, here are the step-by-step instructions to remediate the misconfiguration of ELBs not having deletion protection flag enabled in AWS using the AWS console:
- Open the AWS Management Console and navigate to the EC2 service.
- From the navigation pane, click on the “Load Balancers” option.
- Select the ELB that you want to remediate and click on its name to open its details page.
- In the “Attributes” section of the details page, locate the “Deletion Protection” option and click on the “Edit” button next to it.
- Select the checkbox next to “Enable deletion protection” and click on the “Save” button to enable deletion protection for the ELB.
- Once the deletion protection is enabled, you will see a lock icon next to the ELB name indicating that it is protected from accidental deletion.
- Repeat the above steps for all the ELBs that need to be remediated.
Using CLI
Using CLI
To remediate the misconfiguration of ELBs not having deletion protection flag enabled, you can follow the below steps:Note: Replace Note: Replace
- Open your AWS CLI and run the following command to enable deletion protection on all your ELBs:
<ELB_NAME>
with the name of the ELB that you want to enable deletion protection for.- To verify that the deletion protection flag is enabled, run the following command:
<ELB_NAME>
with the name of the ELB that you want to verify deletion protection for.- If the deletion protection flag is not enabled, repeat step 1 for all the ELBs that you want to enable deletion protection for.
Using Python
Using Python
To remediate the misconfiguration of ELBs not having deletion protection flag enabled, you can use the following steps in Python:
- Import the necessary AWS SDK modules:
- Initialize a boto3 client for Elastic Load Balancing:
- Get a list of all the existing ELBs in your AWS account:
- For each ELB, check if the deletion protection flag is enabled. If not, enable it:
- Run the Python script to enable deletion protection for all the ELBs in your AWS account.