@ethernity-cloud/sdk-js 1.5.5 → 1.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/info.js +306 -0
- package/nodenithy/build/securelock/src/ecld_state.js +251 -18
- package/nodenithy/build/securelock/src/etny_crypto.js +211 -211
- package/nodenithy/build/securelock/src/etny_exec.js +13 -2
- package/nodenithy/build/securelock/src/models.js +275 -275
- package/nodenithy/build/securelock/src/securelock.js.tmpl +632 -586
- package/nodenithy/build/securelock/src/task_status.js +4 -0
- package/nodenithy/build.mjs +30 -0
- package/nodenithy/run/__pycache__/swift_stream_service.cpython-312.pyc +0 -0
- package/nodenithy/run/image_registry.js +371 -371
- package/nodenithy/src/preStart.js +44 -44
- package/package.json +7 -4
- package/pynithy/build/docker-compose.yml +67 -67
- package/pynithy/run/certs/cert.pem +31 -31
- package/pynithy/run/certs/challenge.crt +10 -10
- package/pynithy/run/certs/key.pem +52 -52
- package/pynithy/run/docker-compose-final.yml +59 -59
- package/pynithy/run/docker-compose-swift-stream.yml +27 -27
- package/pynithy/run/docker-compose.yml +55 -55
- package/pynithy/run/image_registry.js +371 -371
|
@@ -17,6 +17,10 @@ class TaskStatus {
|
|
|
17
17
|
static CONFIG_ERROR = 32;
|
|
18
18
|
static EXECUTION_TIMEOUT = 33; // Started but produced no result within the order duration.
|
|
19
19
|
static ESR_GAS_LIMIT_EXCEEDED = 34; // ESR commits would exceed the per-order relayed-gas budget.
|
|
20
|
+
static SECURITY_VIOLATION = 35; // A state commit was authorized under a caller other than
|
|
21
|
+
// the task's submitter (the in-enclave ownership check was
|
|
22
|
+
// bypassed). Set by the securelock on a detected forged
|
|
23
|
+
// caller, and by the trustedzone re-adjudication.
|
|
20
24
|
}
|
|
21
25
|
|
|
22
26
|
module.exports = {
|
package/nodenithy/build.mjs
CHANGED
|
@@ -115,6 +115,36 @@ try {
|
|
|
115
115
|
process.exit(1);
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
// Safety lint: flag dynamic code execution -- especially of task input --
|
|
119
|
+
// before the image is sealed. A hard error only for the case that actually
|
|
120
|
+
// opens the enclave to a submitter (eval / Function of ___etny_data_set___);
|
|
121
|
+
// everything else is a warning. See payloadLint.mjs for scope + opt-out.
|
|
122
|
+
try {
|
|
123
|
+
const { analyze } = await import('../payloadLint.mjs');
|
|
124
|
+
const src = fs.readFileSync(backendFile, 'utf8');
|
|
125
|
+
const { findings, optedOut } = analyze(src, 'src/serverless/backend.js');
|
|
126
|
+
if (!optedOut) {
|
|
127
|
+
const warnings = findings.filter((f) => f.severity === 'warning');
|
|
128
|
+
const errors = findings.filter((f) => f.severity === 'error');
|
|
129
|
+
for (const f of warnings) {
|
|
130
|
+
console.warn(`WARNING: src/serverless/backend.js:${f.line}: ${f.message}`);
|
|
131
|
+
}
|
|
132
|
+
if (errors.length) {
|
|
133
|
+
console.error('');
|
|
134
|
+
console.error('ERROR: unsafe dynamic execution of task input in src/serverless/backend.js:');
|
|
135
|
+
for (const f of errors) console.error(` line ${f.line}: ${f.message}`);
|
|
136
|
+
console.error('');
|
|
137
|
+
console.error(' This would let a task submitter run arbitrary code inside your enclave');
|
|
138
|
+
console.error(' and reach other users\' state. Fix it, or if the input is genuinely');
|
|
139
|
+
console.error(' trusted, add `// ecld: allow-eval` on that line to acknowledge the risk.');
|
|
140
|
+
process.exit(1);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
} catch (e) {
|
|
144
|
+
// The lint is best-effort; never block a build on the linter itself failing.
|
|
145
|
+
console.warn(`WARNING: payload safety lint skipped (${e && e.message ? e.message : e})`);
|
|
146
|
+
}
|
|
147
|
+
|
|
118
148
|
console.log(`Creating destination directory: ${destDir}`);
|
|
119
149
|
fs.mkdirSync(destDir, { recursive: true });
|
|
120
150
|
|
|
Binary file
|