s3-checker
v1.0.0
Published
Checks if an AWS S3 bucket is publicly exposed.
Maintainers
Readme
s3-checker
Checks if an AWS S3 bucket is publicly exposed or not.
Installation
Install via npm
npm i s3-checkerInstall via yarn
yarn add s3-checkerUsage
const { evaluateS3BucketExposure } = require('s3-checker');
const bucketPolicy = {
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::example-bucket/*"
}
]
};
const result = evaluateS3BucketExposure(bucketPolicy);
console.log(result);Output
{
"exposed": true,
"reasons": [
"Statement with Effect 'Allow' applies to Principal '*'.",
"Public 's3:GetObject' permission detected."
]
}