puresec / FunctionShield

A Serverless Security Library for Developers. Regain Control Over Your AWS Lambda & Google Cloud Functions Runtimes.
Other
39 stars 12 forks source link

Problem running command in combination with FunctionShield #6

Closed koenvg closed 5 years ago

koenvg commented 5 years ago

Problem

We created a lambda layer containing the following program because we use in multiple lambda's https://www.princexml.com/ We also have FunctionShield running in the same lambda to log all outgoing requests and this worked fine running on node 8 (More details below). When we tried upgrading Functionshield from v1 to v2 we ran into the following error.

ERROR   { Error: Command failed: /opt/prince/bin/prince --javascript --verbose --structured-log=normal /tmp/tmp.html -o /tmp/tmp-1.pdf

at ChildProcess.exithandler (child_process.js:294:12)
at ChildProcess.emit (events.js:198:13)
at ChildProcess.EventEmitter.emit (domain.js:448:20)
at maybeClose (internal/child_process.js:982:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
at Process.eval [as onexit] (webpack:////Users/kvgeert/workspace/inventive-designers/designer/node_modules/async-listener/glue.js?:188:31)
killed: false,
code: 1,
signal: null,
cmd:
'/opt/prince/bin/prince --javascript --verbose --structured-log=normal /tmp/tmp.html -o /tmp/tmp-1.pdf',
stdout: 'Unsupported execution environment\n',
stderr: '' }

We tried upgrading to node 10 and playing around with multiple settings but no luck. Disabling Function shield does the trick but we don't want to do that. Does this error originate from FunctionShield? Which steps can we take to debug this issue further?

Details:

Before: Lambda version: 8 Version Prince: 12.3 Version FunctionShield: 1.2.6 After: Lambda version: 10.x or 8 Version Prince: 12.3 Version FunctionShield: 2.0.6

0xh0b0 commented 5 years ago

Thanks for your detailed bug report. We just released a new FunctionShield version (2.0.7) that should fix the issue.

koenvg commented 5 years ago

I just tested it again and it works now. Thank you for the quick fix!