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.
AWS SAM Translator is a library that transform SAM templates into AWS CloudFormation templates
The AWS Serverless Application Model (AWS SAM) transform is a AWS CloudFormation macro that transforms SAM templates into CloudFormation templates.
To use the SAM transform, add AWS::Serverless-2016-10-31
to the Transform
section of your CloudFormation template.
Benefits of using the SAM transform include:
Save the following as template.yaml
:
Transform: AWS::Serverless-2016-10-31
Resources:
MyFunction:
Type: AWS::Serverless::Function
Properties:
Runtime: nodejs18.x
Handler: index.handler
InlineCode: |
exports.handler = async (event) => {
console.log(event);
}
And deploy it with the SAM CLI:
sam sync --stack-name sam-app
The AWS::Serverless::Function
resource will create a AWS Lambda function that logs events it receives.
Under the hood, the template is transformed into the JSON equivalent of the following CloudFormation template:
Resources:
MyFunction:
Type: AWS::Lambda::Function
Properties:
Code:
ZipFile: |
exports.handler = async (event) => {
console.log(event);
}
Handler: index.handler
Role: !GetAtt MyFunctionRole.Arn
Runtime: nodejs18.x
Tags:
- Key: lambda:createdBy
Value: SAM
MyFunctionRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Action:
- sts:AssumeRole
Effect: Allow
Principal:
Service:
- lambda.amazonaws.com
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
Tags:
- Key: lambda:createdBy
Value: SAM
For a more thorough introduction, see the this tutorial in the Developer Guide.
You'll need to have Python 3.8+ installed.
Create a virtual environment:
python3 -m venv .venv
source .venv/bin/activate
Set up dependencies:
make init
Run tests:
make pr
See DEVELOPMENT_GUIDE.md
for further development instructions, and CONTRIBUTING.md
for the contributing guidelines.
The best way to interact with the team is through GitHub. You can either create an issue or start a discussion.
You can also join the #samdev
channel on Slack.
FAQs
AWS SAM Translator is a library that transform SAM templates into AWS CloudFormation templates
We found that aws-sam-translator 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.