https://github.com/anshsinghsonkhia/s3-checker
Checks if an AWS S3 bucket is publicly exposed.
https://github.com/anshsinghsonkhia/s3-checker
aws aws-s3 npm-package
Last synced: 6 months ago
JSON representation
Checks if an AWS S3 bucket is publicly exposed.
- Host: GitHub
- URL: https://github.com/anshsinghsonkhia/s3-checker
- Owner: AnshSinghSonkhia
- License: mit
- Created: 2025-04-04T17:11:24.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-04-04T17:31:40.000Z (6 months ago)
- Last Synced: 2025-04-09T18:16:36.569Z (6 months ago)
- Topics: aws, aws-s3, npm-package
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/s3-checker
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# s3-checker
Checks if an AWS S3 bucket is publicly exposed or not.
[](https://www.npmjs.com/package/s3-checker) [](LICENSE)
# Installation
Install via npm
```sh
npm i s3-checker
```Install via yarn
```sh
yarn add s3-checker
```# Usage
```js
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
```json
{
"exposed": true,
"reasons": [
"Statement with Effect 'Allow' applies to Principal '*'.",
"Public 's3:GetObject' permission detected."
]
}
```