Skip to main content

More Info:

This rule checks if Amazon Elastic Compute Cloud (Amazon EC2) uses multiple Elastic Network Interfaces (ENIs) or Elastic Fabric Adapters (EFAs). The rule is NON_COMPLIANT an Amazon EC2 instance use multiple network interfaces.

Risk Level

Low

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)
  • ISO/IEC 27017
  • ISO/IEC 27018
  • ISO/IEC 27701
  • KSA PDPL
  • MAS Technology Risk Management (Singapore)
  • MITRE ATT&CK (Cloud)
  • 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 issue of an EC2 instance using multiple Elastic Network Interfaces (ENIs) in AWS, you can follow these steps using the AWS Management Console:
  1. Identify the EC2 Instance:
    • Log in to your AWS Management Console.
    • Go to the EC2 dashboard.
    • Identify the EC2 instance that is using multiple ENIs.
  2. Detach Unnecessary ENIs:
    • Select the EC2 instance that is using multiple ENIs.
    • In the Description tab, under Network interfaces, you will see the list of attached ENIs.
    • Identify the additional ENIs that are not required for the instance.
    • Select the unnecessary ENIs one by one and click on the “Actions” dropdown.
    • From the dropdown, select “Detach network interface”.
    • Confirm the action to detach the ENI from the EC2 instance.
  3. Delete Unnecessary ENIs (Optional):
    • If the ENIs are no longer needed in your account, you can also choose to delete them.
    • Go to the EC2 dashboard and select “Network Interfaces” from the left-hand menu.
    • Identify the unnecessary ENIs and select them.
    • Click on the “Actions” dropdown and choose “Delete network interface”.
    • Confirm the action to delete the ENI.
  4. Verify Configuration:
    • After detaching or deleting the unnecessary ENIs, go back to the EC2 instance Description tab.
    • Ensure that the EC2 instance is now using only the required ENI.
  5. Update Security Groups and Route Tables (if necessary):
    • If the ENIs that were detached had specific security group rules or were associated with custom route tables, make sure to update the security groups and route tables associated with the remaining ENI to ensure connectivity and proper network routing.
By following these steps, you should be able to remediate the issue of an EC2 instance using multiple Elastic Network Interfaces in AWS and ensure that it is using only the necessary ENIs.

To remediate the issue of an EC2 instance using multiple Elastic Network Interfaces (ENIs) in AWS using the AWS CLI, you can follow these steps:Step 1: List all the instances with multiple ENIs
Step 2: Identify the instance you want to work on based on the InstanceId.Step 3: Detach the additional ENIs from the instance
Replace <AttachmentID> with the attachment ID of the additional ENI you want to detach.Step 4: Verify that the additional ENIs have been detached successfully
Replace <InstanceId> with the InstanceId of the instance you worked on.Step 5: If the issue persists, you may need to stop and start the instance for the changes to take effect.
By following these steps, you can remediate the issue of an EC2 instance using multiple Elastic Network Interfaces in AWS using the AWS CLI.
To remediate the issue of an EC2 instance using multiple Elastic Network Interfaces (ENIs) in AWS using Python, you can follow these steps:
  1. Identify the EC2 instances with multiple ENIs: Use the AWS SDK for Python (Boto3) to list all EC2 instances in your account and identify instances with more than one ENI attached.
  1. Detach extra ENIs: For instances identified with multiple ENIs, you can choose to detach the extra ENIs. Here’s how you can do it:
  1. Verify the remediation: After detaching the extra ENIs, verify that each EC2 instance has only one ENI attached.
By following these steps, you can use Python and Boto3 to identify EC2 instances with multiple ENIs attached and detach the extra ENIs to remediate the misconfiguration.
Detaching a secondary ENI is disruptive: any traffic using that interface’s IPs or security groups will stop, and Terraform will destroy the aws_network_interface_attachment.secondary_to_instance (and the ENI itself if you also remove aws_network_interface.secondary).terraform plan should show the secondary aws_network_interface_attachment (and optionally the secondary aws_network_interface) being destroyed, and no additional network_interface blocks on the aws_instance, leaving only the primary interface (DeviceIndex 0).

Additional Reading: