Sergey Matvienko
e5734208e9
Hardened tb-js-executor sandbox script invocation (JVN#16937365)
The args array passed into the sandbox carried the host realm prototype
chain, so a script could reach the host Function constructor via
args.constructor.constructor and execute arbitrary code in the host
process (read files, run shell commands, dump env vars).
Construct args inside the sandbox context using vm.runInContext('[]'),
then populate with string primitives. The resulting array's prototype
chain belongs to the sandbox realm, so constructor traversal cannot
escape. Strings are primitives and safe to cross the realm boundary.
Affects use_sandbox=true path only. The use_sandbox=false path
(invokeFunction) is intentionally left as-is and explicitly marked as
dangerous-by-design — it compiles and runs user-supplied scripts in
the host realm via vm.compileFunction (parsingContext only isolates
parsing, not execution). It remains as a documented performance
trade-off for trusted, non-public clusters; a startup WARN is logged
when script.use_sandbox=false, and an operator-facing yaml comment
sits next to the setting in config/default.yml.
Reported by Hiroki Imai, LAC Co., Ltd.
3 weeks ago
Viacheslav Klimov
5b5b4dff6b
Update license header
5 months ago
Igor Kulikov
5cf26d4851
Update license header
1 year ago
Vladyslav_Prykhodko
0a969f22b3
Clear JS executor proto models
1 year ago
Vladyslav_Prykhodko
d35bdcc981
Clear JS executor dependencies and code
1 year ago
Sergey Matvienko
f9d2549c2c
js-executor: added request body on debug level
2 years ago
Vladyslav_Prykhodko
5c6b4122d3
Add SSL support for Kafka queue connection in JS executor
2 years ago
Sergey Matvienko
751abe159a
js executor log memory usage as a single line
2 years ago
Ivan Raznatovskyi
09fc025e12
Initial commit from another fork
2 years ago
Igor Kulikov
c5a72ed8df
Update license header to 2024 year.
2 years ago
Seraphym-Tuhai
29c3eddc8a
Merge with branch 'develop/3.5' of github.com:thingsboard/thingsboard
3 years ago
Igor Kulikov
cbdc4517e4
Update license header year to 2023
3 years ago
Igor Kulikov
25f8ff2aef
Handle undefined script execution result.
4 years ago
YevhenBondarenko
e32bd456b7
added memory usage log to the js-executors
4 years ago
ViacheslavKlimov
2d262146ad
Remote JS executor to work with tb-node of previous version
4 years ago
ViacheslavKlimov
831332be7b
Use hash of tenant id and body when resolving script for remote JS executor
4 years ago
ViacheslavKlimov
7aab188d0c
Do not send script body to remote JS executor on each invoke request
4 years ago
ViacheslavKlimov
8d735f4886
Add script invocation result size check to remote JS executor
4 years ago
Vladyslav_Prykhodko
b4592f5f92
Fix incorrect start JavaScript Executor AWS SQS queue
4 years ago
Vladyslav_Prykhodko
bbc43c2572
Graceful shutdown JavaScript Executor Microservice and minor change in logs
4 years ago
Vladyslav_Prykhodko
ed6e636918
Refactor JS-Executor microservice to typescript
4 years ago
Sergey Matvienko
4968d0101c
je-executors: expireTs implemented to drop any expired message and prevent congestion on js eval requests queue
4 years ago
Vladyslav_Prykhodko
352abb3f60
JS-executor: Fixed incorrect parse error code for message
4 years ago
Vladyslav_Prykhodko
8f4746c64d
JS-executor: Added logs compilation time; Cache script map delete min used script
4 years ago
Igor Kulikov
da4c742872
Update license year to 2022
4 years ago
Sergey Matvienko
cda6f3678b
js-executor: fixed license header
5 years ago
Sergey Matvienko
98bea8eaf5
js-executor: http livenessProbe added
5 years ago
Sergey Matvienko
ff7fa6237f
js-executor: zero check and code cleanup
5 years ago
Vladyslav_Prykhodko
ab5f1b5b63
js-executor: ScriptMap optimize work
5 years ago
Vladyslav_Prykhodko
41391dbef8
js-executor: code format
5 years ago
Sergey Matvienko
a4e28ad945
js-executor fixed promises for each message for Kafka batches
5 years ago
Sergey Matvienko
93bea70205
js-executor: added parameters for producer TB_KAFKA_BATCH_SIZE and TB_KAFKA_LINGER_MS; added print stats frequency SCRIPT_STAT_PRINT_FREQUENCY
5 years ago
Sergey Matvienko
35e2ff99c3
js-executor: send messages as batch
5 years ago
Sergey Matvienko
0c88665654
js-executor: scriptMap refactored from Object to the Map()
5 years ago
Sergey Matvienko
c94dc5972e
remote js-executor: parameter added TB_KAFKA_ACKS="1"
5 years ago
Sergey Matvienko
a569058c29
remote js-executor: added metric response sent to queue ms in debug level; parameter added SLOW_QUERY_LOG_BODY="true" to enable log bloat
5 years ago
Sergey Matvienko
d25d13d7c0
remote js-executor: added slow query log, log config on service start
5 years ago
Igor Kulikov
d31358b2ea
Update license header - set 2021 year
5 years ago
Andrii Shvaika
30a2d19d2d
Fixes to Kafka JS headers issue
6 years ago
Andrew Shvayka
7a47cd503b
Revert "Develop/2.5 js executor ( #2685 )"
This reverts commit 1599b24c3a .
6 years ago
Yevhen Bondarenko
1599b24c3a
Develop/2.5 js executor ( #2685 )
* moved kafka from service.js to own module
* created awsSqs, pubSub, rabbitmq js-executors
* revert RemoteJsInvokeService
* revert thingsboard.yml
* added queue settings to js-executor
* refactored queue factories
* added queue params to pubsub js-executor
* azure service bus js-executor
6 years ago
YevhenBondarenko
43b2eedbd5
azure service bus js-executor
6 years ago
YevhenBondarenko
0dc31fbdde
created awsSqs, pubSub, rabbitmq js-executors
6 years ago
Andrew Shvayka
38ebbe2576
Revert "Merge with master. AlarmRepository.findAlarms is failing ( #2663 )"
This reverts commit 2c02406ee5 .
6 years ago
Andrew Shvayka
2c02406ee5
Merge with master. AlarmRepository.findAlarms is failing ( #2663 )
* Merge with master. AlarmRepository.findAlarms is failing
* Fix Alarm repository. Add queue type list select.
Co-authored-by: Igor Kulikov <ikulikov@thingsboard.io>
6 years ago
YevhenBondarenko
4fb309c37e
moved kafka from service.js to own module
6 years ago
YevhenBondarenko
1dd3334825
moved jsinvoke.proto to queue, fixed js-executor, added createRemoteJsRequestTemplate to RuleEngine and Core factories
6 years ago
Igor Kulikov
3e2a87135f
Prepare for merge with master
6 years ago
Igor Kulikov
850d6d948c
Update License header year to 2020
6 years ago
Igor Kulikov
1265a9a1e3
Revert "Update License header year to 2020"
This reverts commit 9b42397c4a .
6 years ago