https://github.com/spirosoik/credentials-janitor
A lambda function which detects and remove unused IAM credentials in AWS
https://github.com/spirosoik/credentials-janitor
aws aws-lambda devops-tools golang iam
Last synced: about 1 year ago
JSON representation
A lambda function which detects and remove unused IAM credentials in AWS
- Host: GitHub
- URL: https://github.com/spirosoik/credentials-janitor
- Owner: spirosoik
- License: apache-2.0
- Created: 2021-02-14T13:18:08.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-15T15:04:17.000Z (over 5 years ago)
- Last Synced: 2025-03-28T02:23:42.043Z (over 1 year ago)
- Topics: aws, aws-lambda, devops-tools, golang, iam
- Language: Go
- Homepage:
- Size: 40 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# credentials-janitor
A lambda function which detects and remove unused IAM credentials for AWS users.
## Purpose
Respecting security we need to remove IAM user credentials that are not
used anymore and notify them back that we revoked their credentials (login profile + access keys).
## How To
We are going to schedule a CloudWatch event to invoke the lambda function periodically. Lambda function
will do the listing and will check when they used last time the login profile and access keys. The max time
is configurable as environment variable which can be passed in the lambda deployment.
### Architecture

## Deploy
```
make
```
The above will run the followings:
- Build Binary for lambda
- Prepare the artifact for Lambda
- Upload Lambda to provided S3 bucket
- Apply terraform (note: you need to provide env vars for terraform or use your own `.tfvars`)
For terraform details you can read the [documentation](terraform/aws/README.md)