Other Articles
- EC2 Volume – Enable EBS Encryption
- EC2 Volume – Enable EBS Volume Backup
- EFS – Enable EFS Storage Backup
- EC2 Instance – Enable Deletion Protection
- EC2 Instance – Monitor CPU Utilization
- ECS Service – Monitor CPU Utilization
- ECS Service – Monitor Memory Utilization
- S3 Bucket – Block S3 Bucket Public Access
- S3 Bucket – Enable S3 Bucket Versioning
- S3 Bucket – Enable S3 Bucket Encryption
- RDS DB Instance – Enable Auto Minor Version Upgrade
- RDS DB Instance – Block Public Access
- RDS DB Instance – Monitor Free Storage Space
- RDS DB Instance – Monitor CPU Utilization
- RDS DB Instance – Encryption of Storage
- RDS DB Instance – Enable Deletion Protection
- SQS Queue – Monitor Message Age
- SQS Queue – Monitor Message Visibility
- DynamoDB Table – Enable Table Encryption
- DynamoDB Table – Enable Table Point In Time Recovery
- DynamoDB Table – Enable Table Deletion Protection
- DynamoDB Table – Monitor Table Read Capacity
- DynamoDB Table – Monitor Table Write Capacity
- DynamoDB Table – Monitor Table Latency
- Enable User MFA
- Enforce Key Rotation
- Enforce Active Key Limit
- Disable Unused User Credentials
- Enforce Group Permission
- Enable CloudTrail
- Enable AWS Security Hub
- Enforce Password Length
- Prohibit Password Reuse
- Purge Expired Certificates
- Check Root Access Keys Existence
- Enable Root MFA
- Establish Support Role
- Enable Key Rotation
- Encrypt CloudTrail Logs
- Enable GuardDuty
EC2 VPC – Ensure Flow Logs are Enabled
This check ensures that VPC flow logs are enabled to monitor traffic and support security analysis.
Check Details
- Resource: VPC
- Check: Ensure VPC flow logs are enabled
- Risk: Lack of flow logs can obscure network issues and security events
Remediation via AWS Console
-
Sign into the AWS Management Console and open VPC.
-
In the left navigation panel, select Your VPCs and choose a VPC.
-
In the right panel, go to the Flow Logs tab.
If no flow log exists, click Create Flow Log.
-
For Filter, select Reject.
-
Enter an IAM Role and Destination Log Group, then click Create Flow Log.
-
Verify logs in CloudWatch:
CloudWatch → Logs → Log groups.
Remediation via AWS CLI
-
Log in to the AWS Management Console and click the
CloudShell icon (
>_) in the top-right corner.
-
Create a file role_policy_document.json with the following content:
nano role_policy_document.json
Paste the following content. ctrl+O -> save and ctrl+X -> exit.{ "Version": "2012-10-17", "Statement": [ { "Sid": "AllowVPCFlowLogsAssumeRole", "Effect": "Allow", "Principal": { "Service": "vpc-flow-logs.amazonaws.com" }, "Action": "sts:AssumeRole" } ] } -
Create a file iam_policy.json with the following content:
nano iam_policy.json
Paste the following content. ctrl+O -> save and ctrl+X -> exit.{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "logs:CreateLogGroup", "logs:CreateLogStream", "logs:DescribeLogGroups", "logs:DescribeLogStreams", "logs:PutLogEvents", "logs:GetLogEvents", "logs:FilterLogEvents" ], "Resource": "\*" } ] } -
Create the IAM Role:
aws iam create-role --role-name vpc-flow-logs-role --assume-role-policy-document file://role_policy_document.json -
Create the IAM Policy:
aws iam create-policy --policy-name vpc-flow-logs-policy --policy-document file://iam_policy.json -
Attach the policy to the IAM role:
aws iam attach-role-policy --role-name vpc-flow-logs-role --policy-arn arn:aws:iam::<aws-account-id>:policy/vpc-flow-logs-policy -
Identify VPCs in the region:
aws ec2 describe-vpcs --region <region> -
Create Flow Logs for each VPC:
aws ec2 create-flow-logs \ --resource-type VPC \ --resource-ids <vpc-id> \ --traffic-type ALL \ --log-group-name <log-group-name> \ --deliver-logs-permission-arn arn:aws:iam::<aws-account-id>:role/vpc-flow-logs-role -
Repeat for all remaining VPCs in the region. Update
--regionaccordingly for other regions.