Script to find all unused security group rules in aws

Job ID: 30966170

Budget: $15 – $25 USD

I have a bunch of security group RULES attached to my instances in aws and I wan to clean them up. is there a way to find those unused rules and delete them.
Related categories: PHP System Admin Linux Amazon Web Services Ubuntu