{"id":23750605,"url":"https://github.com/cyberroute/security-groups-audit","last_synced_at":"2025-09-04T23:32:23.857Z","repository":{"id":269582561,"uuid":"907854480","full_name":"CyberRoute/security-groups-audit","owner":"CyberRoute","description":"This project automates the cleanup of unused AWS security groups","archived":false,"fork":false,"pushed_at":"2024-12-24T15:17:13.000Z","size":234,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T18:52:04.330Z","etag":null,"topics":["aws","aws-lambda"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CyberRoute.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-24T14:59:08.000Z","updated_at":"2024-12-25T16:48:07.000Z","dependencies_parsed_at":"2024-12-24T16:19:01.914Z","dependency_job_id":"9ef296f9-f1f3-455d-9faf-f2017cc640e8","html_url":"https://github.com/CyberRoute/security-groups-audit","commit_stats":null,"previous_names":["cyberroute/security-groups-audit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CyberRoute/security-groups-audit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberRoute%2Fsecurity-groups-audit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberRoute%2Fsecurity-groups-audit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberRoute%2Fsecurity-groups-audit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberRoute%2Fsecurity-groups-audit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CyberRoute","download_url":"https://codeload.github.com/CyberRoute/security-groups-audit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberRoute%2Fsecurity-groups-audit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273688269,"owners_count":25150299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-lambda"],"created_at":"2024-12-31T16:23:19.381Z","updated_at":"2025-09-04T23:32:18.837Z","avatar_url":"https://github.com/CyberRoute.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Cleanup Unused Security Groups\nThis project automates the cleanup of unused AWS EC2 security groups. It identifies security groups that are not associated with any network interfaces, instances, or Lambda functions, and removes them. Additionally, it tracks the number of deletions via CloudWatch metrics.\n\n## Features\n- Identifies unused EC2 security groups across AWS infrastructure.\n- Deletes unused security groups (except the default security group).\n- Tracks the number of deleted security groups in AWS CloudWatch metrics.\n- Runs automatically on a schedule using AWS Lambda and CloudWatch Events.\n\n## Prerequisites\nNode.js 20.x\nAWS CLI configured with appropriate permissions\nServerless Framework version 3.x\n\n## Permissions Required\nThe Lambda function requires the following permissions:\n\n- ec2:DescribeSecurityGroups\n- ec2:DescribeNetworkInterfaces\n- ec2:DescribeInstances\n- lambda:ListFunctions\n- ec2:DeleteSecurityGroup\n- cloudwatch:PutMetricData\n\n## Installation\n\n```bash\ngit clone \u003crepository-url\u003e\ncd cleanup_unused_security_groups\nnpm install\nserverless deploy\n```\n\n## Configuration\nThe function is triggered on a schedule using AWS CloudWatch Events. Update the schedule in serverless.yml if needed.\n\n## Sample CloudWatch log\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"/img/log.png\" width=\"800px\"\u003c/img\u003e \n\u003c/div\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyberroute%2Fsecurity-groups-audit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyberroute%2Fsecurity-groups-audit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyberroute%2Fsecurity-groups-audit/lists"}