
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@alma-cdk/origin-verify
Advanced tools
npm i -D @alma-cdk/origin-verify
Enforce API Gateway REST API, AppSync GraphQL API, or Application Load Balancer traffic via CloudFront by generating a Secrets Manager secret value which is used as a CloudFront Origin Custom header and a WAFv2 WebACL header match rule.
Essentially this is an implementation of AWS Solution “Enhance Amazon CloudFront Origin Security with AWS WAF and AWS Secrets Manager” without the secret rotation.
This construct is still versioned with v0
major version and breaking changes might be introduced if necessary (without a major version bump), though we aim to keep the API as stable as possible (even within v0
development). We aim to publish v1.0.0
soon and after that breaking changes will be introduced via major version bumps.
import { OriginVerify } from '@alma-cdk/origin-verify';
import { Distribution } from 'aws-cdk-lib/aws-cloudfront';
const api: RestApi; // TODO: implement the RestApi
const apiDomain: string; // TODO: implement the domain
const verification = new OriginVerify(this, 'OriginVerify', {
origin: api.deploymentStage,
});
new Distribution(this, 'CDN', {
defaultBehavior: {
origin: new HttpOrigin(apiDomain, {
customHeaders: {
[verification.headerName]: verification.headerValue,
},
protocolPolicy: OriginProtocolPolicy.HTTPS_ONLY,
})
},
})
For more detailed example usage see /examples
directory.
Additionally, you may pass in custom secretValue
if you don't want to use a generated secret (which you should use in most cases):
const myCustomValue = SecretValue.unsafePlainText('foobar');
const verification = new OriginVerify(this, 'OriginVerify', {
origin: api.deploymentStage,
secretValue: myCustomValue,
});
OriginProtocolPolicy.HTTPS_ONLY
!In your CloudFront distribution Origin configuration use OriginProtocolPolicy.HTTPS_ONLY
to avoid exposing the verification.headerValue
secret to the world.
secretValue.unsafeUnwrap()
?Internally this construct creates the headerValue
by using AWS Secrets Manager but the secret value is exposed directly by using secretValue.unsafeUnwrap()
method: This is:
FAQs
Enforce origin traffic via CloudFront.
We found that @alma-cdk/origin-verify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.