Skip to content

Instantly share code, notes, and snippets.

@oorryy
Last active October 18, 2018 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oorryy/cb3179adb80ac50e4014376bd1f42a7f to your computer and use it in GitHub Desktop.
Save oorryy/cb3179adb80ac50e4014376bd1f42a7f to your computer and use it in GitHub Desktop.
const fs = require("fs");
const child_process = require("child_process");
const FunctionShield = require('@puresec/function-shield');
FunctionShield.configure(
{
policy: {
read_write_tmp: "alert",
create_child_process: "alert",
outbound_connectivity: "alert",
read_handler: "alert"
},
disable_analytics: false,
token: process.env.FUNCTION_SHIELD_TOKEN
});
module.exports.hello = (event, context, callback) => {
fs.writeFileSync("/tmp/node-alert", "data");
child_process.execSync("touch /tmp/child-alert");
child_process.execSync("curl google.com");
fs.readFileSync('/var/task/handler.js');
child_process.execSync("cat /var/task/handler.js");
callback(null, "done");
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment