Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Ekam is yet another build tool for node, designed to handle file includes, regardless of the file format, although it is primarily aimed at building javascript, html and css files. It comes as a single command line utility.
As of the current version, only JavaScript is supported, although html and css are planned and easy to add, as well as other formats.
It is published on node package manager (npm). To install, do:
npm install ekam -g
ekam --help
Usage: ekam [options]
Options:
-h, --help output usage information
-V, --version output the version number
-b, --build <js or json file> Use the specified build file
-i, --init Creates default sample build files (build.json build.js)
-f, --force Overwrite existing build files
Ekam takes either a json file or a JavaScript file containing information about what it has to do.
ekam --build src/build.json
or
ekam --build src/build.js
Sample build.json and build.js files can be produced with the option init
(overwrite existing files with the force
option)
ekam --init
{
"input": {
"include": "**/*.js"
, "exclude": "build.json build.js"
}
, "output": {
"path": "../build"
, "mode": "0755"
, "clean": true
}
, "uglify": {
"mangle": {
"defines": {
"DEBUG": [ "name", "false" ]
}
}
, "squeeze": {
"make_seqs": true
, "dead_code": true
}
, "gen": {
}
}
}
build(
{
"input": {
"include": "**/*.js"
, "exclude": "build.json build.js"
}
, "output": {
"path": "../build"
, "mode": "0755"
, "clean": true
}
, "uglify": {
"mangle": {
"defines": {
"DEBUG": [ "name", "false" ]
}
}
, "squeeze": {
"make_seqs": true
, "dead_code": true
}
, "gen": {
}
}
}
)
The following properties are required:
input
include
(String): list of expressions or files to be processedexclude
(String): list of expressions or files to be excludedoutput
: the properties are the same as the ones defined in the fstream module
path
(String): path to the generated filesThe following properties are optional:
uglify
: contains the options object passed to the uglify()
methodTo run the tool with DEBUG information, set the DEBUG environment variable to a list of comma separated values:
DEBUG=ekam,build,include,file,js-parser,js-ast ekam --build src/build.json
Let's say we have to build a single javascript file split up in two files as well as its minified and debug versions. The example is provided in the examples/example1 directory.
Important only files with no parent dependency get built in the output directory.
The input files are defined under the src/ directory:
The output files are to be defined as (yes they are defined in the input directory!):
//include("file1.js", "file2.js")
//var DEBUG=true
//include("file1.js", "file2.js")
The files file1.js and file2.js should contain a line like the following one to include some debug traces:
//if(DEBUG)
console.log('DEBUG', ...)
//endif
//uglify("_file.js")
This is a temporary file that collects the content for the minified version.
//include("file1.js", "file2.js")
When the ekam
command is run, it creates the following files (note that the www/ directory is automatically created if it does not exist already):
FAQs
Package builder with includes
The npm package ekam receives a total of 1 weekly downloads. As such, ekam popularity was classified as not popular.
We found that ekam 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.