Just like firewall we can create an entry in VPC Network ACL to block certain IP addresses e.g. repeated hacking attempts.
E.g. say we want to block this IP: 185.153.199.126
To do this in AWS Console, go to VPC > Network ACLs to add a DENY inbound rules entry.
| 50 | ALL Traffic | ALL | ALL | 185.153.199.126/32 | DENY |
Or do this from AWS command line tool:
>aws --region ap-southeast-2 ec2 create-network-acl-entry --network-acl-id acl-10f62475 --ingress --rule-number 50 --protocol -1 --cidr-block 54.163.251.208/32 --rule-action deny
If using command line tool make sure the access key has the required permission e.g. use the SportLogic “cli” IAM user.