How cm-kajiwara-taishi/aws-security-hub-automated-response-and-remediation works
Project type and purpose
• This is an AWS-native, event-driven, open-source solution (“AWS Security Hub Automated Response and Remediation”) written in TypeScript and Python, using the AWS CDK to generate CloudFormation templates.
• Purpose: automatically remediate AWS Security Hub findings by mapping incoming findings to “playbooks” (SSM Automation runbooks) and shared remediation runbooks.
File structure
• Top-level “source” directory breaks into:
• LambdaLayers (reusable Python code loaded as Lambda layers)
• Orchestrator (Step Functions + Lambdas that receive Security Hub events and dispatch playbooks)
• playbooks (CDK TS code + Lambda/SSM runbook assets for each standard: AFSBP, CIS120, PCI321, and user-defined NEWPLAYBOOK)
• remediation_runbooks (shared SSM Automation documents + Python helper scripts)
• solution_deploy (CDK TS code for the SolutionDeployStack that wires everything and defines member stacks, log stacks, remediation runbook stacks)
• deployment (build scripts, unit-test runners)
• Configuration/build files: package.json, tsconfig.json, jest.config.js, buildspec.yml.
Key insights from the README
• EventBridge rules trigger remediation workflow.
• Orchestrator is a Step Functions state machine with several Python Lambdas from LambdaLayers.
• Each playbook package is a CDK construct that bundles: a TS “bin” entrypoint, test suite, SSM runbook YAMLs under ssmdocs, and parsing scripts.
• Remediation runbooks and IAM roles are created by the remediation_runbooks construct.
• Deployment uses two S3 buckets (global & regional), build-and-upload scripts, and solution_deploy CDK.