
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@aligent/aws-waf-stack
Advanced tools
This repository defines a Node module for a AWS CDK stack module which can be included into an environment.
Please note the following instructions rely on @aligent/aws-cdk-pipeline-stack which provides automated stack deployments based on AWS CodePipelines. The pipelines portions can be disregarded if you would prefer to only deploy the WAF stack.
This stack configures an AWS CodePipeline application which will deploy an instance of the WAFStack based on changes to the configured repository/branch. There are two AWS accounts involved: ToolsAccount and TargetAccount, where we don't want the TargetAccount to access to the whole version control system, e.g. BitBucket or GitHub, as they currently can't limit the access to repository level.

cdk deploy to create a CodePipeline in ToolsAccount via CloudFormationNOTE: npm ver.7 will cause an issue a later stage hence ver.6 is required until this issue is resolved: https://github.com/npm/cli/issues/2610
Install cdk first (npm install -g aws-cdk, or this instruction) and follow the steps described below.
In order to have AWS ToolsAccount be able to talk to the version control system, create CodeStar Connection. This is a one-off task between the two, though, hence reusable across multiple projects. Connecting to BitBucket, for example
Initialise a CDK project
$ npx cdk init app --language=typescript
Bootstrap the TargetAccount to grant the ToolsAccount the permission to create resources. This is per-region basis.
$ env CDK_NEW_BOOTSTRAP=1 npx cdk bootstrap \
--profile <TargetAccountProfile> \
--cloudformation-execution-policies arn:aws:iam::aws:policy/AdministratorAccess \
--trust <ToolsAccountId> \
aws://<TargetAccountId>/<region>
Install this node module
$ npm install @aligent/aws-cdk-waf-stack
$ npm install @aligent/aws-cdk-pipeline-stack
Replace project files
bin/<projectName.ts> in the project with sample/waf.ts of this repolib/<projectName-stack.ts> in the project with sample/environments.ts of this repoUpdate lib/environments.ts with the details. You need the below information
Update bin/waf.ts if needed, e.g. additional environments or stack name changes.
Run npm install and update cdk.json:
app: replace <project_name.ts> with waf.ts.context: add "@aws-cdk/core:newStyleStackSynthesis": trueRebuild cdk.context.json (not needed in this project/stack)
Test by running npx cdk synth and npx cdk ls. For further testing and customisation, refer to the Local development section below. By now you are going to see two stacks per each environment; one for Pipeline deployment, the other for direct deployment. See Step 12 down below.
Push the code to the relevant branch
Deploy the stack, e.g. npx cdk deploy <target-WAF-environment> --profile <ToolsAccountProfile> to create the CodePipeline, followed by TargetAccount WAF resource creation.
If you don't need a pipeline/cross-account deployment, deploy <target-WAF-environment>/<target-WAF-environment>/stack directly to the target account by npx cdk deploy <StackName> --profile <TargetAccountProfile>
By default, WebACL this stack creates will work in COUNT mode to begin with.After a certain period of monitoring under real traffic and load, apply necessary changes, e.g. IP allow_list or rate limit, to avoid service interruptions before switching to BLOCK mode.
NPM link can be used to develop the module locally.
cd into this repositorynpm linkcd into the downstream repo (target project, etc) and run npm link 'aws-waf-stack'
The downstream repository should now include a symlink to this module. Allowing local changes to be tested before pushing.FAQs
## Overview
We found that @aligent/aws-waf-stack demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.