sonarjs/aws-s3-bucket-public-access
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/aws-s3-bucket-public-access": "error",
},
},
];Amazon S3 bucket public access should be fully blocked
The documentation shows no incorrect example for this rule.
const s3 = require('aws-cdk-lib/aws-s3');
new s3.Bucket(this, 'id', {
bucketName: 'bucket',
blockPublicAccess: s3.BlockPublicAccess.BLOCK_ALL
});const s3 = require('aws-cdk-lib/aws-s3');
new s3.Bucket(this, 'id', {
bucketName: 'bucket',
blockPublicAccess: new s3.BlockPublicAccess({
blockPublicAcls : true,
blockPublicPolicy : true,
ignorePublicAcls : true,
restrictPublicBuckets : true
})
});Examples from the ESLint documentation.
sonarjs/aws-s3-bucket-public-access
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/aws-s3-bucket-public-access": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
S3 buckets should enforce HTTPS-only access
Amazon S3 buckets should have versioning enabled
S3 buckets should not grant access to all users or authenticated users
SageMaker notebook instances should be encrypted at rest
Administration services access should be restricted to specific IP addresses
Amazon SNS topics should be encrypted at rest