Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
This is an AWS CDK Construct to make deploying a single page website (Angular/React/Vue) to AWS S3 behind SSL/Cloudfront as easy as 5 lines of code.
This is an AWS CDK Construct to make deploying a single page website (Angular/React/Vue) to AWS S3 behind SSL/Cloudfront as easy as 5 lines of code.
npm install --save cdk-spa-deploy
As of version 103.0 this construct now declares peer dependencies rather than bundling them so you can use it with any version of CDK higher than 103.0 without waiting on me to release a new version. The downside is that you will need to install the dependencies it uses for yourself, here is a list:
{
"constructs": "^3.3.75",
"@aws-cdk/aws-certificatemanager": "^1.103.0",
"@aws-cdk/aws-cloudfront": "^1.103.0",
"@aws-cdk/aws-iam": "^1.103.0",
"@aws-cdk/aws-route53": "^1.103.0",
"@aws-cdk/aws-route53-patterns": "^1.103.0",
"@aws-cdk/aws-route53-targets": "^1.103.0",
"@aws-cdk/aws-s3": "^1.103.0",
"@aws-cdk/aws-s3-deployment": "^1.103.0",
"@aws-cdk/core": "^1.103.0"
}
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
import aws_cdk.core as cdk
from cdk_spa_deploy import SPADeploy
class CdkStack(cdk.Stack):
def __init__(self, scope, id, *, description=None, env=None, stackName=None, tags=None, synthesizer=None, terminationProtection=None, analyticsReporting=None):
super().__init__(scope, id, description=description, env=env, stackName=stackName, tags=tags, synthesizer=synthesizer, terminationProtection=terminationProtection, analyticsReporting=analyticsReporting)
SPADeploy(self, "spaDeploy").create_basic_site(
index_doc="index.html",
website_folder="../blog/dist/blog"
)
SPADeploy(self, "cfDeploy").create_site_with_cloudfront(
index_doc="index.html",
website_folder="../blog/dist/blog"
)
pip install cdk-spa-deploy
Note As of version 103.0 this construct now declares peer dependencies rather than bundling them so you can use it with any version of CDK higher than 103.0 without waiting on me to release a new version. The downside is that you will need to install the dependencies it uses for yourself. The npm versioms are listed above.
from aws_cdk import core
from spa_deploy import SPADeploy
class PythonStack(core.Stack):
def __init__(self, scope: core.Construct, id: str, **kwargs) -> None:
super().__init__(scope, id, **kwargs)
SPADeploy(self, 'spaDeploy').create_basic_site(
index_doc='index.html',
website_folder='../blog/blog/dist/blog'
)
SPADeploy(self, 'cfDeploy').create_site_with_cloudfront(
index_doc='index.html',
website_folder='../blog/blog/dist/blog'
)
This project has now been published to nuget, more details to follow soon but you can find it here
Note As of version 103.0 this construct now declares peer dependencies rather than bundling them so you can use it with any version of CDK higher than 103.0 without waiting on me to release a new version. The downside is that you will need to install the dependencies it uses for yourself. The npm versioms are listed above.
# package manager
Install-Package CDKSPADeploy -Version 1.80.0
# .NET CLI
dotnet add package CDKSPADeploy --version 1.80.0
# Package reference
<PackageReference Include="CDKSPADeploy" Version="1.80.0" />
# Paket CLI
paket add CDKSPADeploy --version 1.80.0
A version has now been published to maven.
Note As of version 103.0 this construct now declares peer dependencies rather than bundling them so you can use it with any version of CDK higher than 103.0 without waiting on me to release a new version. The downside is that you will need to install the dependencies it uses for yourself. The npm versioms are listed above.
<dependency>
<groupId>com.cdkpatterns</groupId>
<artifactId>CDKSPADeploy</artifactId>
<version>1.81.0</version>
</dependency>
If you purchased your domain through route 53 and already have a hosted zone then just use the name to deploy your site behind cloudfront. This handles the SSL cert and everything for you.
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
SPADeploy(self, "spaDeploy", encrypt_bucket=True).create_site_from_hosted_zone(
zone_name="cdkpatterns.com",
index_doc="index.html",
website_folder="../website/dist/website"
)
You can also pass the ARN for an SSL certification and your alias routes to cloudfront
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
import aws_cdk.core as cdk
from cdk_spa_deploy import SPADeploy
class CdkStack(cdk.Stack):
def __init__(self, scope, id, *, description=None, env=None, stackName=None, tags=None, synthesizer=None, terminationProtection=None, analyticsReporting=None):
super().__init__(scope, id, description=description, env=env, stackName=stackName, tags=tags, synthesizer=synthesizer, terminationProtection=terminationProtection, analyticsReporting=analyticsReporting)
SPADeploy(self, "cfDeploy").create_site_with_cloudfront(
index_doc="../blog/dist/blog",
certificate_aRN="arn:...",
cf_aliases=["www.alias.com"]
)
Pass in one boolean to tell SPA Deploy to encrypt your website bucket
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
SPADeploy(self, "cfDeploy", encrypt_bucket=True).create_basic_site(
index_doc="index.html",
website_folder="website"
)
Pass in an array of CloudFront Behaviors
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
SPADeploy(self, "cfDeploy").create_site_with_cloudfront(
index_doc="index.html",
website_folder="website",
cf_behaviors=[{
"is_default_behavior": True,
"allowed_methods": cf.CloudFrontAllowedMethods.ALL,
"forwarded_values": {
"query_string": True,
"cookies": {"forward": "all"},
"headers": ["*"]
}
}, {
"path_pattern": "/virtual-path",
"allowed_methods": cf.CloudFrontAllowedMethods.GET_HEAD,
"cached_methods": cf.CloudFrontAllowedCachedMethods.GET_HEAD
}
]
)
Pass in a boolean and an array of IP addresses and your site is locked down!
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
SPADeploy(stack, "spaDeploy",
encrypt_bucket=True,
ip_filter=True,
ip_list=["1.1.1.1"]
).create_basic_site(
index_doc="index.html",
website_folder="website"
)
An object is now returned containing relevant artifacts created if you need to make any further modifications:
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
FAQs
This is an AWS CDK Construct to make deploying a single page website (Angular/React/Vue) to AWS S3 behind SSL/Cloudfront as easy as 5 lines of code.
We found that cdk-spa-deploy demonstrated a healthy version release cadence and project activity because the last version was released less than 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
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.