A collection of advanced AWS CDK constructs to simplify AWS.
npm install advanced-cdk-constructsnpm install git+https://github.com/spensireli/advanced-cdk-constructs.gitThe GuardDutyConstruct provides a simplified way to deploy AWS GuardDuty with common security configurations.
import { GuardDutyConstruct, GuardDutyConstructProps } from 'advanced-cdk-constructs';import * as cdk from 'aws-cdk-lib';
import { Construct } from 'constructs';
import { GuardDutyConstruct } from 'advanced-cdk-constructs';
export class MyStack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
// Create GuardDuty with default settings
const guardDuty = new GuardDutyConstruct(this, 'MyGuardDuty');
}
}import * as cdk from 'aws-cdk-lib';
import { Construct } from 'constructs';
import { GuardDutyConstruct, GuardDutyConstructProps } from 'advanced-cdk-constructs';
export class MyStack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const guardDutyProps: GuardDutyConstructProps = {
enableGuardDuty: true,
kubernetesAuditLogs: true,
malwareProtection: true,
s3Logs: true,
};
const guardDuty = new GuardDutyConstruct(this, 'MyGuardDuty', guardDutyProps);
// Access the detector ID for other resources
console.log('GuardDuty Detector ID:', guardDuty.detectorId);
}
}| Property | Type | Default | Description |
|---|---|---|---|
enableGuardDuty |
boolean |
true |
Whether to enable GuardDuty |
kubernetesAuditLogs |
boolean |
true |
Enable Kubernetes audit logs monitoring |
malwareProtection |
boolean |
true |
Enable malware protection for EC2 instances |
s3Logs |
boolean |
true |
Enable S3 logs monitoring |
- Runtime Monitoring: Automatically enabled for comprehensive threat detection
- Kubernetes Audit Logs: Monitors Kubernetes cluster activities
- Malware Protection: Scans EC2 instances for malware
- S3 Logs Monitoring: Monitors S3 bucket activities for suspicious behavior
- Detector ID Access: Public property to reference the detector in other constructs
- Node.js 22.0.0 or higher
- AWS CDK CLI
- TypeScript
- Clone the repository:
git clone [email protected]:spensireli/advanced-cdk-constructs.git
cd advanced-cdk-constructs- Install dependencies:
npm install- Build the project:
npx projen buildRun the test suite:
npx projen test- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For issues and questions, please open an issue on the GitHub repository.