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.
lambduh-execute
Advanced tools
Execute any shell string or bash script from AWS Lambda
npm i --save lambduh-execute
var Q = require('q');
var execute = require('lambduh-execute');
//your lambda function
exports.handler = function(event, context) {
var result = {}
execute(result, {
shell: "echo `ls /tmp/`", // logs output of /tmp/ dir on your lambda machine
logOutput: true
})
.then(function(result) {
return execute(result, {
shell: "cp /var/task/ffmpeg /tmp/.; chmod 755 /tmp/ffmpeg", // copies an ffmpeg binary to /tmp/ and chmods permissions to run it
logOutput: true
})
})
.then(function(result) {
return execute(result, {
shell: "rm " + result.mp4Path // pulls in path from options object to fire dynamic script
});
})
.then(function(result) {
return execute(result, {
bashScript: "/tmp/path/to/bash/script" //you can also run a bash script
});
})
.then(function(result) {
return execute(result, {
bashScript: "/tmp/path/to/bash/script",
bashParams: ["filey-namey"] //and hand in any parameters you'd like
});
})
.then(function(result) {
context.done()
})
.fail(function(err) {
console.log("derp");
console.log(err);
context.done(null, err);
});
}
This module takes a script
object that can have a few options:
shell
field for writing a string of unix commands to be executedbaseScript
field with a path to the bash script to be executedbaseParams
array with params to be passed to the scriptlogOutput
boolean for showing the stdout and stderr logslogOutput
defaults to false.
The tests in this repo could use enforcement around logOutput
- I'm onto bigger fish for now, will hopefully get back to it.
FAQs
Execute any shell string or bash script from AWS Lambda
The npm package lambduh-execute receives a total of 4 weekly downloads. As such, lambduh-execute popularity was classified as not popular.
We found that lambduh-execute 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
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.