Secure-by-default AWS CDK constructs with CDK property injection support.
Status: Early stage. Only S3 (SecureBucket) is implemented today. Requires aws-cdk-lib >= 2.196.0.
- Construct:
SecureBucket— CIS-critical settings (encryption, block public access, SSL, object ownership) are always enforced. - Tiers:
HIGH/MEDIUM/LOWfor operational settings (versioning, logging, removal policy). - Injectors: Property injectors including
TieredSecureBucketDefaults(tighten-only). - Compliance:
S3BucketCompliance.report()— enforced controls are verified by synthesis tests.
Property injectors set defaults; they do not block someone from using L1 CfnBucket directly.
From npm (after publish):
npm install aws-cdk-secure-constructsFrom this repo (local):
npm install
npm run build
npm run test:local-build # pack + install + cdk synthimport { App, Stack } from 'aws-cdk-lib';
import { SecureBucket, SecurityLevel } from 'aws-cdk-secure-constructs';
const app = new App();
const stack = new Stack(app, 'MyStack');
new SecureBucket(stack, 'Data', {
securityLevel: SecurityLevel.HIGH,
});Tiered injector (org-wide floor):
import { PropertyInjectors } from 'aws-cdk-lib';
import { Bucket } from 'aws-cdk-lib/aws-s3';
import { TieredSecureBucketDefaults, SecurityLevel } from 'aws-cdk-secure-constructs';
PropertyInjectors.of(app).add(
new TieredSecureBucketDefaults({ securityLevel: SecurityLevel.MEDIUM })
);
new Bucket(stack, 'RawBucket', { enforceSSL: false }); // CIS-critical fields still enforcedMore examples: examples/, examples/local-consumer/ (tests the published tarball).
npm install
npm run build # jsii -> lib/
npm test
npm run lint
npm run test:local-build
npm run release -- patch # from clean main only; tags and triggers CI publishMIT — see LICENSE.