Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
@liflig/cdk-cloudfront-auth
Advanced tools
CDK Constructs for adding authentication for a CloudFront Distribution
Easily add Cognito-based authorization to your CloudFront distribution, to place static files behind authorization.
This is based on https://github.com/aws-samples/cloudfront-authorization-at-edge.
npm install @liflig/cdk-cloudfront-auth
Deploy the Lambda@Edge functions to us-east-1:
// In a stack deployed to us-east-1.
const authLambdas = new AuthLambdas(this, "AuthLambdas", {
regions: ["eu-west-1"], // Regions to make Lambda version params available.
})
Deploy the Cognito and CloudFront setup in whatever region of your choice:
const auth = new CloudFrontAuth(this, "Auth", {
cognitoAuthDomain: `${domain.domainName}.auth.${region}.amazoncognito.com`,
authLambdas, // AuthLambdas from above
userPool, // Cognito User Pool
})
const distribution = new cloudfront.Distribution(this, "Distribution", {
defaultBehavior: auth.createProtectedBehavior(origin),
additionalBehaviors: auth.createAuthPagesBehaviors(origin),
})
auth.updateClient("ClientUpdate", {
signOutUrl: `https://${distribution.distributionDomainName}${auth.signOutRedirectTo}`,
callbackUrl: `https://${distribution.distributionDomainName}${auth.callbackPath}`,
})
If using CloudFrontWebDistribution
instead of Distribution
:
const distribution = new cloudfront.CloudFrontWebDistribution(this, "Distribution", {
originConfigs: [
{
behaviors: [
...auth.authPages,
{
isDefaultBehavior: true,
lambdaFunctionAssociations: auth.authFilters,
},
],
},
],
})
The CloudFrontAuth
construct accepts a requireGroupAnyOf
property
that causes access to be restricted to only users in specific groups.
FAQs
CDK Constructs for adding authentication for a CloudFront Distribution
The npm package @liflig/cdk-cloudfront-auth receives a total of 1,574 weekly downloads. As such, @liflig/cdk-cloudfront-auth popularity was classified as popular.
We found that @liflig/cdk-cloudfront-auth demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.