Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
yaml-blaster
Advanced tools
This was created to ease the pain of having to use a giant single-file AWS Cloudformation template by allowing variable replacement, file loading, and loops.
$ npm install -g yaml-blaster
Assuming your project looks like this
project
|
+-- template.yaml
|
+-- data.yaml
From the project directory just run
$ yaml-blaster \
-i template.yaml \ # The input template
-d data.yaml # A configuration file
Or from anywwhere run
$ yaml-blaster \
-i /full/path/to/project/template.yaml \
-d /full/path/to/project/data.yaml
To save the output to a file
$ yaml-blaster \
-i template.yaml \
-d data.yaml \
-o processed.yaml
Syntax: {{variable}}
- Replace variables in the template
template.yaml
AWSTemplateFormatVersion: '2010-09-09'
Resources:
MyS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: {{name}}
data.yaml
name: my-bucket-name
run
$ yaml-blaster \
-i template.yaml \
-d data.yaml
output
AWSTemplateFormatVersion: '2010-09-09'
Resources:
MyS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: my-bucket-name
Syntax: {{file:relative/path}}
- load a file and replace it in the template
By default, any variables in the loaded snippet will be replaced using the top-level scope of the data file.
project structure
project
|
+-- template.yaml
|
+-- data.yaml
|
+-- snippets
|
+-- bucket.yaml
template.yaml
AWSTemplateFormatVersion: '2010-09-09'
Resources:
{{file:sub-templates/bucket.yaml}}
snippets/bucket.yaml
{{logicalName}}:
Type: AWS::S3::Bucket
Properties:
BucketName: {{bucketName}}
data.yaml
logicalName: MyS3Bucket
bucketName: my-s3-bucket
output
AWSTemplateFormatVersion: '2010-09-09'
Resources:
MyS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName:my-s3-bucket
Syntax: {{path.to.value, file:relative/path}}
- load a file and replace variables under a specific scope
project structure
project
|
+-- template.yaml
|
+-- data.yaml
|
+-- snippets
|
+-- bucket.yaml
template.yaml
AWSTemplateFormatVersion: '2010-09-09'
Resources:
{{bucket1, file:sub-templates/bucket.yaml}}
{{bucket2, file:sub-templates/bucket.yaml}}
snippets/bucket.yaml
{{logicalName}}:
Type: AWS::S3::Bucket
Properties:
BucketName: {{bucketName}}
data.yaml
bucket1:
logicalName: MyFirstS3Bucket
bucketName: my-s3-bucket-1
bucket2:
logicalName: MySecondS3Bucket
bucketName: my-s3-bucket-2
output
AWSTemplateFormatVersion: '2010-09-09'
Resources:
MyFirstS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: my-s3-bucket-1
MySecondS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: my-s3-bucket-2
Syntax: {{for:path.to.array, file:relative/path}}
- add n number of instances of a snippet by referring to an array in the data file
project structure
project
|
+-- template.yaml
|
+-- data.yaml
|
+-- snippets
|
+-- bucket.yaml
template.yaml
AWSTemplateFormatVersion: '2010-09-09'
Resources:
{{for:buckets, file:sub-templates/bucket.yaml}}
snippets/bucket.yaml
{{logicalName}}:
Type: AWS::S3::Bucket
Properties:
BucketName: {{bucketName}}
data.yaml
buckets:
- logicalName: MyFirstS3Bucket
bucketName: my-s3-bucket-1
- logicalName: MySecondS3Bucket
bucketName: my-s3-bucket-2
output
AWSTemplateFormatVersion: '2010-09-09'
Resources:
MyFirstS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: my-s3-bucket-1
MySecondS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: my-s3-bucket-2
FAQs
Framework for pre-processing yaml files
The npm package yaml-blaster receives a total of 2 weekly downloads. As such, yaml-blaster popularity was classified as not popular.
We found that yaml-blaster 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.