Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
To remediate the insecure configuration of Network Load Balancers (NLBs) in AWS, you can follow the below steps:
- Log in to your AWS console and navigate to the EC2 Dashboard.
- Click on the “Load Balancers” option from the left-hand menu.
- Select the Network Load Balancer that you want to remediate.
- Click on the “Listeners” tab.
- In the “Listeners” tab, review the settings for each listener and ensure that they are using secure protocols such as HTTPS or SSL/TLS.
- If any of the listeners are using insecure protocols such as HTTP, click on the “Edit” button next to the listener.
- In the “Edit Listener” window, change the protocol to HTTPS or SSL/TLS.
- If you are using SSL/TLS, select a valid SSL/TLS certificate from the dropdown list.
- Click on the “Save” button to save the changes.
- Repeat steps 6-9 for all listeners that are using insecure protocols.
- Once all listeners are updated, review the security group settings for the NLB.
- Ensure that the security group only allows traffic from trusted sources and that it is not open to the public.
- If necessary, update the security group settings to restrict traffic to trusted sources.
- Click on the “Save” button to save the changes.
- Finally, review the NLB settings to ensure that they are compliant with your organization’s security policies and best practices.
Using CLI
Using CLI
To remediate the insecure configuration of Network Load Balancer (NLB) in AWS, you can follow the below steps using AWS CLI:
- Open the AWS CLI on your local machine or EC2 instance.
-
Run the following command to describe the listener configuration of your NLB:
Replace
<load_balancer_arn>with the ARN of your NLB. - Check the output for the “Protocol” and “SslPolicy” fields. If the “Protocol” is set to “TLS” or “HTTPS”, and the “SslPolicy” is set to “ELBSecurityPolicy-2016-08” or any other outdated policy, then it is considered an insecure configuration.
-
To remediate this misconfiguration, run the following command to update the SSL policy of the listener:
Replace
<listener_arn>with the ARN of the listener that needs to be updated. - After running the above command, verify that the SSL policy has been updated successfully by running the “describe-listeners” command again.
- Repeat steps 3 to 5 for all the listeners of your NLB.
- Once all the listeners have been updated, verify that the NLB no longer has any insecure configurations by running the “describe-listeners” command again.
Using Python
Using Python
To remediate an insecure configuration in AWS NLBs using Python, you can follow the below steps:Note: Make sure that you have the necessary permissions to update the security group associated with the NLB.
- Identify the insecure configuration: In this case, the insecure configuration is related to the security group of the Network Load Balancer (NLB). Make sure that the security group associated with the NLB is properly configured to allow only necessary traffic.
- Use Boto3 to update the security group: Boto3 is a Python library for AWS that allows you to interact with AWS services. You can use Boto3 to update the security group associated with the NLB.
- Define the NLB ARN: To update the security group, you need to define the ARN of the NLB. You can get the ARN of the NLB from the AWS Management Console or by using Boto3.
- Define the security group ID: Define the security group ID of the security group that you want to associate with the NLB. You can get the security group ID from the AWS Management Console or by using Boto3.
-
Update the security group: Use the
modify_network_interface_attributemethod of the EC2 client to update the security group associated with the NLB. Pass the NLB ARN and the security group ID as parameters to the method.

