-
Invoke
npm i
to install dependencies -
⚠️ Before installing a stack to your aws account using aws cdk you need to prepare the account using a cdk bootstrap -
(Optional) If you want to use CloudWatch Dashboards (both Shield or Firewall) - You need to enable your target accounts to share CloudWatch data with the central security account follow this to see how to do it, or use the templates from here:
-
(Optional) If you want to use the UnutilizedWafs Feature - You need to enable your target accounts with a Cross Account Role - You can find an example CfnTemplate you can use here.
-
Assume AWS Profile
awsume PROFILENAME
-
(Optional) Enter
task generateprerequisitesconfig
Parameter | Value |
---|---|
Prefix | Prefix for all Resources |
BucketName [^1] | Name of the S3 Bucket |
KmsEncryptionKey | true or false |
ObjectLock - Days [^1] | A period of Days for ObjectLock |
ObjectLock - Mode [^1] | COMPLIANCE or GOVERNANCE |
FireHoseKey - KeyAlias [^1] | Alias for Key |
CrossAccountIdforPermissions [^1] | Id of AWS Account for CrossAccount Permission for Bucket and KMS Key(s) |
- When Deploying from a CI/CD pipeline, set an environment variable STACK_NAME to specify which resources to deploy.
export STACK_NAME=PreRequisiteStack
=> _prerequisites-stack.tsexport STACK_NAME=WAFStack
=> _web-application-firewall-stack.tsexport STACK_NAME=ShieldAdvancedStack
=> _shield-advanced-stack.ts
- Enter
task deploy config=NAMEOFYOURCONFIGFILE
- If STACK_NAME isn't set yet, select the type of resource to be deployed (Pre-requisite Stacks, WAF or Shield Advanced)
-
Create new ts file for you WAF and configure Rules in the Configuration (see owasptopten.ts to see structure) or use enter
task generate-waf-skeleton
-
Assume AWS Profile
awsume / assume PROFILENAME
-
(Optional)
- Enter
task generate-waf-skeleton
- Enter
task generate-shield-skeleton
- Enter
-
When Deploying from a CI/CD pipeline, set an environment variable STACK_NAME to specify which resources to deploy.
export STACK_NAME=PreRequisiteStack
=> _prerequisites-stack.tsexport STACK_NAME=WAFStack
=> _web-application-firewall-stack.tsexport STACK_NAME=ShieldAdvancedStack
=> _shield-advanced-stack.ts
-
Enter
task deploy config=NAMEOFYOURCONFIGFILE
-
If STACK_NAME isn't set yet, select the type of resource to be deployed (Pre-requisite Stacks, WAF or Shield Advanced)