This rule ensures that network interfaces do not have unrestricted security groups attached.
Rule | Ensure network interface does not have unrestricted security group attached |
Framework | CloudDefense.AI Security |
Severity | ✔ Critical |
Rule Description:
The rule "Ensure network interface does not have unrestricted security group attached for CloudDefense" ensures that network interfaces in your CloudDefense environment are not associated with security groups that have unrestricted access.
Rule Troubleshooting:
If this rule fails, it means that one or more network interfaces within your CloudDefense environment have unrestricted security group attachments. To troubleshoot this, follow these steps:
Identify the network interfaces:
Check associated security groups:
Validate security group rules:
Update security group rules:
Revalidate the rule:
Relevant Code:
This rule does not require any specific code. However, you can use the AWS CLI or SDKs to automate the identification and modification of security group rules.
Remediation Steps:
Here are the step-by-step instructions to remediate the rule by using the AWS Command Line Interface (CLI):
Identify the network interfaces:
aws ec2 describe-network-interfaces --filters "Name=tag:CloudDefense,Values=true"
Check associated security groups:
Validate security group rules:
Update security group rules:
Example command to modify an inbound rule:
aws ec2 revoke-security-group-ingress --group-id <security-group-id> --protocol <protocol> --port <port> --source-cidr <source-cidr>
Example command to modify an outbound rule:
aws ec2 revoke-security-group-egress --group-id <security-group-id> --protocol <protocol> --port <port> --destination-cidr <destination-cidr>
Replace
<security-group-id>
, <protocol>
, <port>
, <source-cidr>
, or <destination-cidr>
with the corresponding values for the rule you want to modify.Revalidate the rule:
Note: Make sure you have appropriate AWS credentials configured and the AWS CLI properly installed to execute the commands successfully.