enigma-memory 0.1.0
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/LICENSE +55 -0
- package/README.md +379 -0
- package/apps/cli/bin/enigma.mjs +1117 -0
- package/apps/desktop/src/app.js +1327 -0
- package/apps/desktop/src/index.html +1373 -0
- package/apps/desktop/src/styles.css +386 -0
- package/apps/gateway/bin/enigma-gateway.mjs +52 -0
- package/apps/gateway/src/server.mjs +1403 -0
- package/apps/native-host/README.md +265 -0
- package/apps/native-host/bin/enigma-native-host.mjs +499 -0
- package/apps/native-host/manifests/com.enigma.native_host.chrome.json +9 -0
- package/apps/native-host/manifests/com.enigma.native_host.edge.json +9 -0
- package/apps/native-host/manifests/com.enigma.native_host.firefox.json +9 -0
- package/apps/relay/bin/enigma-relay.mjs +52 -0
- package/apps/relay/src/server.mjs +1571 -0
- package/apps/verifier/bin/enigma-verify.mjs +240 -0
- package/deploy/docker-compose.production.example.yml +150 -0
- package/deploy/kubernetes/enigma-backend.example.yaml +580 -0
- package/package.json +196 -0
- package/packages/adapters/PACKAGE_CONTRACT.md +47 -0
- package/packages/adapters/src/index.js +183 -0
- package/packages/boundary/src/index.js +468 -0
- package/packages/connectors/src/index.js +533 -0
- package/packages/core/src/index.js +766 -0
- package/packages/enterprise/src/index.js +505 -0
- package/packages/importers/src/index.js +1083 -0
- package/packages/mcp-server/bin/enigma-mcp.mjs +19 -0
- package/packages/mcp-server/src/index.js +1185 -0
- package/packages/mesh/src/index.js +531 -0
- package/packages/metering/PACKAGE_CONTRACT.md +20 -0
- package/packages/metering/src/index.js +246 -0
- package/packages/optimizer/src/index.js +707 -0
- package/packages/passport/src/index.js +651 -0
- package/packages/settlement/PACKAGE_CONTRACT.md +28 -0
- package/packages/settlement/src/index.js +369 -0
- package/packages/storage/PACKAGE_CONTRACT.md +23 -0
- package/packages/storage/src/index.js +392 -0
- package/packages/vault/src/index.js +904 -0
- package/scripts/build-ai-orchestration-plan.mjs +248 -0
- package/scripts/build-cloudflare-pages-release-packet.mjs +287 -0
- package/scripts/build-cloudflare-token-policy.mjs +239 -0
- package/scripts/build-cloudflare-token-request.mjs +314 -0
- package/scripts/build-demo-assets.mjs +263 -0
- package/scripts/build-edge-backend-workers.mjs +353 -0
- package/scripts/build-goal-completion-audit.mjs +398 -0
- package/scripts/build-hosted-probe-worker.mjs +191 -0
- package/scripts/build-operator-acceptance-packet.mjs +254 -0
- package/scripts/build-operator-evidence-starter.mjs +525 -0
- package/scripts/build-production-backend-env-kit.mjs +384 -0
- package/scripts/build-production-dependency-report.mjs +369 -0
- package/scripts/build-production-handoff-packet.mjs +475 -0
- package/scripts/build-production-readiness-manifest.mjs +209 -0
- package/scripts/build-production-status-board.mjs +297 -0
- package/scripts/build-production-storage-migration.mjs +86 -0
- package/scripts/build-production-workplan.mjs +371 -0
- package/scripts/build-review-packet.mjs +594 -0
- package/scripts/check.mjs +419 -0
- package/scripts/cloudflare-ops.mjs +1672 -0
- package/scripts/cloudflare-secret-env.mjs +128 -0
- package/scripts/collect-hosted-backend-live-evidence.mjs +263 -0
- package/scripts/infrastructure-readiness.mjs +944 -0
- package/scripts/install-enigma-local.mjs +270 -0
- package/scripts/memory-optimization-benchmark.mjs +242 -0
- package/scripts/monitor-live-endpoints.mjs +358 -0
- package/scripts/release-audit.mjs +5588 -0
- package/scripts/release-provenance.mjs +250 -0
- package/scripts/run-backend-readiness-smoke.mjs +220 -0
- package/scripts/validate-backup-restore-drill.mjs +166 -0
- package/scripts/validate-cloudflare-credentials.mjs +112 -0
- package/scripts/validate-cloudflare-worker-inspect.mjs +179 -0
- package/scripts/validate-domain-tls.mjs +248 -0
- package/scripts/validate-hosted-backend-live.mjs +319 -0
- package/scripts/validate-incident-drill.mjs +221 -0
- package/scripts/validate-kms-custody.mjs +235 -0
- package/scripts/validate-legal-compliance-approval.mjs +274 -0
- package/scripts/validate-monitoring-alerting.mjs +263 -0
- package/scripts/validate-network-access-policy.mjs +285 -0
- package/scripts/validate-operator-acceptance.mjs +298 -0
- package/scripts/validate-production-manifests.mjs +325 -0
- package/scripts/validate-public-site-security.mjs +252 -0
- package/scripts/validate-security-threat-model.mjs +285 -0
- package/scripts/validate-service-settlement.mjs +256 -0
- package/scripts/validate-support-sla.mjs +190 -0
- package/scripts/validate-tenant-policy-approval.mjs +228 -0
- package/scripts/validate-usage-metering.mjs +224 -0
- package/scripts/validate-whitepaper-claims.mjs +166 -0
- package/specs/boundary-manifest-v1.schema.json +35 -0
- package/specs/capsule-v1.schema.json +55 -0
- package/specs/claim-boundary-manifest-v1.schema.json +22 -0
- package/specs/connector-profile-v1.schema.json +62 -0
- package/specs/deletion-tombstone-v1.schema.json +26 -0
- package/specs/enterprise-policy-v1.schema.json +59 -0
- package/specs/gateway-request-v1.schema.json +32 -0
- package/specs/goal-completion-audit-v1.schema.json +70 -0
- package/specs/hosted-backend-live-evidence-v1.schema.json +147 -0
- package/specs/import-report-v1.schema.json +214 -0
- package/specs/infrastructure-readiness-manifest-v1.schema.json +130 -0
- package/specs/memory-event-v1.schema.json +42 -0
- package/specs/mesh-node-v1.schema.json +126 -0
- package/specs/passport-v1.schema.json +50 -0
- package/specs/production-handoff-packet-v1.schema.json +149 -0
- package/specs/receipt-v1.schema.json +61 -0
- package/specs/relay-record-v1.schema.json +43 -0
- package/specs/state-checkpoint-v1.schema.json +37 -0
- package/specs/trust-bundle-v1.schema.json +56 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { realpathSync } from 'node:fs';
|
|
3
|
+
import { readFile } from 'node:fs/promises';
|
|
4
|
+
import { pathToFileURL } from 'node:url';
|
|
5
|
+
import {
|
|
6
|
+
verifyReceipt,
|
|
7
|
+
verifyReceiptChain,
|
|
8
|
+
verifyCheckpoint,
|
|
9
|
+
} from '../../../packages/core/src/index.js';
|
|
10
|
+
|
|
11
|
+
function json(value) {
|
|
12
|
+
return JSON.stringify(value, null, 2);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function asArray(value) {
|
|
16
|
+
return Array.isArray(value) ? value : [];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function publicKeyFromBundle(bundle) {
|
|
20
|
+
if (bundle?.publicKey) return bundle.publicKey;
|
|
21
|
+
if (bundle?.public_key) return bundle.public_key;
|
|
22
|
+
if (bundle?.signer?.publicKey) return bundle.signer.publicKey;
|
|
23
|
+
if (bundle?.signer?.public_key) return bundle.signer.public_key;
|
|
24
|
+
if (bundle?.keyring?.publicKey) return bundle.keyring.publicKey;
|
|
25
|
+
if (bundle?.keyring?.public_key) return bundle.keyring.public_key;
|
|
26
|
+
if (bundle?.keypair?.publicKey) return bundle.keypair.publicKey;
|
|
27
|
+
if (bundle?.keys?.publicKey) return bundle.keys.publicKey;
|
|
28
|
+
const issuer = bundle?.trust_bundle?.trusted_issuers?.[0] ?? bundle?.trust?.trusted_issuers?.[0];
|
|
29
|
+
return issuer?.public_key ?? issuer?.publicKey ?? null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function callVerifier(fn, attempts) {
|
|
33
|
+
let lastError;
|
|
34
|
+
for (const args of attempts) {
|
|
35
|
+
try {
|
|
36
|
+
const result = fn(...args);
|
|
37
|
+
if (result && typeof result.then === 'function') {
|
|
38
|
+
throw new TypeError('async verifier functions are not supported by the offline CLI');
|
|
39
|
+
}
|
|
40
|
+
return result;
|
|
41
|
+
} catch (error) {
|
|
42
|
+
lastError = error;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
throw lastError;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function normalizeVerdict(result) {
|
|
49
|
+
if (result === true) return { ok: true, errors: [] };
|
|
50
|
+
if (result === false) return { ok: false, errors: [{ code: 'VERIFY_FALSE', message: 'Verifier returned false.' }] };
|
|
51
|
+
if (result && typeof result === 'object') {
|
|
52
|
+
if ('ok' in result) return { ok: Boolean(result.ok), errors: asArray(result.errors) };
|
|
53
|
+
if ('valid' in result) return { ok: Boolean(result.valid), errors: asArray(result.errors) };
|
|
54
|
+
}
|
|
55
|
+
return { ok: Boolean(result), errors: [] };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function makeError(code, message, details = undefined) {
|
|
59
|
+
return details === undefined ? { code, message } : { code, message, details };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function firstPresent(...values) {
|
|
63
|
+
for (const value of values) {
|
|
64
|
+
if (value !== undefined && value !== null) return value;
|
|
65
|
+
}
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function committedVaultState(bundle) {
|
|
70
|
+
const vault = bundle?.vault && typeof bundle.vault === 'object' ? bundle.vault : {};
|
|
71
|
+
return {
|
|
72
|
+
receiptLogRoot: firstPresent(vault.receipt_log_root, bundle?.receipt_log_root),
|
|
73
|
+
activeSetRoot: firstPresent(vault.active_set_root, vault.active_root, bundle?.active_set_root, bundle?.active_root),
|
|
74
|
+
sequence: firstPresent(vault.sequence, bundle?.sequence),
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function verifierError(error, fallbackCode, fallbackMessage) {
|
|
79
|
+
if (typeof error === 'string') return makeError(fallbackCode, error);
|
|
80
|
+
if (error && typeof error === 'object') {
|
|
81
|
+
return makeError(error.code ?? fallbackCode, error.message ?? fallbackMessage, error);
|
|
82
|
+
}
|
|
83
|
+
return makeError(fallbackCode, fallbackMessage, error);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function chainOptionsForBundle({ publicKey, checkpoints, bundle }) {
|
|
87
|
+
return {
|
|
88
|
+
publicKey,
|
|
89
|
+
checkpoints,
|
|
90
|
+
bundle,
|
|
91
|
+
verifyEmbeddedReceiptLogRoot: true,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function compareCommittedRoots(chainResult, committed, errors) {
|
|
96
|
+
if (!chainResult || typeof chainResult !== 'object') return;
|
|
97
|
+
if (committed.receiptLogRoot !== undefined && chainResult.receipt_log_root !== committed.receiptLogRoot) {
|
|
98
|
+
errors.push(makeError('BUNDLE_RECEIPT_LOG_ROOT_MISMATCH', 'Receipt chain root does not reach committed vault.receipt_log_root.', {
|
|
99
|
+
committed_receipt_log_root: committed.receiptLogRoot,
|
|
100
|
+
computed_receipt_log_root: chainResult.receipt_log_root,
|
|
101
|
+
}));
|
|
102
|
+
}
|
|
103
|
+
if (committed.activeSetRoot !== undefined && chainResult.active_set_root !== committed.activeSetRoot) {
|
|
104
|
+
errors.push(makeError('BUNDLE_ACTIVE_SET_ROOT_MISMATCH', 'Receipt chain final active_set_root does not match committed vault active root.', {
|
|
105
|
+
committed_active_root: committed.activeSetRoot,
|
|
106
|
+
computed_active_set_root: chainResult.active_set_root,
|
|
107
|
+
}));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function compareCommittedSequence(receipts, committed, errors) {
|
|
112
|
+
if (committed.sequence === undefined) return;
|
|
113
|
+
if (!Number.isInteger(committed.sequence) || committed.sequence < 0) {
|
|
114
|
+
errors.push(makeError('BUNDLE_SEQUENCE_INVALID', 'Committed vault.sequence must be a non-negative integer.'));
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (receipts.length === 0) return;
|
|
118
|
+
const lastSequence = receipts.at(-1)?.sequence;
|
|
119
|
+
if (lastSequence !== committed.sequence - 1) {
|
|
120
|
+
errors.push(makeError('BUNDLE_SEQUENCE_MISMATCH', 'Receipt chain does not reach committed vault.sequence.', {
|
|
121
|
+
committed_sequence: committed.sequence,
|
|
122
|
+
last_receipt_sequence: lastSequence,
|
|
123
|
+
}));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
export function verifyBundle(bundle) {
|
|
131
|
+
const receipts = asArray(bundle?.receipts);
|
|
132
|
+
const checkpoints = asArray(bundle?.checkpoints ?? bundle?.passport?.checkpoints);
|
|
133
|
+
const publicKey = publicKeyFromBundle(bundle);
|
|
134
|
+
const errors = [];
|
|
135
|
+
const committed = committedVaultState(bundle);
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
if (!bundle || typeof bundle !== 'object') {
|
|
139
|
+
return { ok: false, errors: [makeError('BUNDLE_INVALID', 'Bundle must be a JSON object.')] };
|
|
140
|
+
}
|
|
141
|
+
if (receipts.length === 0) {
|
|
142
|
+
errors.push(makeError('RECEIPTS_MISSING', 'Bundle does not contain receipts.'));
|
|
143
|
+
}
|
|
144
|
+
if (!publicKey) {
|
|
145
|
+
errors.push(makeError('PUBLIC_KEY_MISSING', 'Bundle does not contain an offline verifier public key.'));
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (publicKey && receipts.length > 0) {
|
|
149
|
+
try {
|
|
150
|
+
const chainOptions = chainOptionsForBundle({ publicKey, checkpoints, bundle });
|
|
151
|
+
const chainResult = callVerifier(verifyReceiptChain, [
|
|
152
|
+
[{ receipts, ...chainOptions }],
|
|
153
|
+
[receipts, chainOptions],
|
|
154
|
+
]);
|
|
155
|
+
const chainVerdict = normalizeVerdict(chainResult);
|
|
156
|
+
if (!chainVerdict.ok) errors.push(...chainVerdict.errors.map((error) => verifierError(error, 'RECEIPT_CHAIN_INVALID', 'Receipt chain did not verify.')));
|
|
157
|
+
compareCommittedRoots(chainResult, committed, errors);
|
|
158
|
+
} catch (error) {
|
|
159
|
+
errors.push(makeError('RECEIPT_CHAIN_INVALID', error.message));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
for (const receipt of receipts) {
|
|
163
|
+
try {
|
|
164
|
+
const receiptVerdict = normalizeVerdict(callVerifier(verifyReceipt, [
|
|
165
|
+
[{ receipt, publicKey }],
|
|
166
|
+
[receipt, publicKey],
|
|
167
|
+
]));
|
|
168
|
+
if (!receiptVerdict.ok) errors.push(makeError('RECEIPT_INVALID', `Receipt ${receipt?.receipt_id ?? '<unknown>'} did not verify.`, receiptVerdict.errors));
|
|
169
|
+
} catch (error) {
|
|
170
|
+
errors.push(makeError('RECEIPT_INVALID', `Receipt ${receipt?.receipt_id ?? '<unknown>'} failed verification: ${error.message}`));
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
compareCommittedSequence(receipts, committed, errors);
|
|
176
|
+
|
|
177
|
+
if (receipts.length > 0 && checkpoints.length > 0 && publicKey) {
|
|
178
|
+
const lastReceipt = receipts.at(-1);
|
|
179
|
+
const lastCheckpoint = checkpoints.at(-1);
|
|
180
|
+
try {
|
|
181
|
+
const checkpointVerdict = normalizeVerdict(callVerifier(verifyCheckpoint, [
|
|
182
|
+
[{ checkpoint: lastCheckpoint, receipts, publicKey, bundle }],
|
|
183
|
+
[lastCheckpoint, receipts, publicKey],
|
|
184
|
+
]));
|
|
185
|
+
if (!checkpointVerdict.ok) errors.push(...checkpointVerdict.errors.map((error) => verifierError(error, 'CHECKPOINT_INVALID', 'Checkpoint did not verify.')));
|
|
186
|
+
} catch (error) {
|
|
187
|
+
errors.push(makeError('CHECKPOINT_INVALID', error.message));
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if (lastCheckpoint?.receipt_log_root && lastReceipt?.receipt_log_root && lastCheckpoint.receipt_log_root !== lastReceipt.receipt_log_root) {
|
|
191
|
+
errors.push(makeError('STALE_CHECKPOINT', 'Latest checkpoint receipt_log_root does not match the latest receipt.'));
|
|
192
|
+
}
|
|
193
|
+
if (lastCheckpoint?.active_memory_root && lastReceipt?.active_set_root && lastCheckpoint.active_memory_root !== lastReceipt.active_set_root) {
|
|
194
|
+
errors.push(makeError('STALE_CHECKPOINT', 'Latest checkpoint active_memory_root does not match the latest receipt.'));
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
return {
|
|
200
|
+
ok: errors.length === 0,
|
|
201
|
+
schema: 'enigma.verification_report.v1',
|
|
202
|
+
checked_at: new Date().toISOString(),
|
|
203
|
+
receipt_count: receipts.length,
|
|
204
|
+
checkpoint_count: checkpoints.length,
|
|
205
|
+
errors,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export async function readBundle(path) {
|
|
210
|
+
return JSON.parse(await readFile(path, 'utf8'));
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export async function main(argv = process.argv.slice(2), io = { stdout: process.stdout, stderr: process.stderr }) {
|
|
214
|
+
const file = argv.find((arg) => !arg.startsWith('-'));
|
|
215
|
+
if (!file || argv.includes('--help') || argv.includes('-h')) {
|
|
216
|
+
io.stdout.write(`${json({ usage: 'enigma-verify <exported-bundle.json>', output: 'JSON verification report' })}\n`);
|
|
217
|
+
return 0;
|
|
218
|
+
}
|
|
219
|
+
try {
|
|
220
|
+
const report = verifyBundle(await readBundle(file));
|
|
221
|
+
io.stdout.write(`${json(report)}\n`);
|
|
222
|
+
return report.ok ? 0 : 1;
|
|
223
|
+
} catch (error) {
|
|
224
|
+
io.stdout.write(`${json({ ok: false, schema: 'enigma.verification_report.v1', checked_at: new Date().toISOString(), errors: [makeError('VERIFY_CLI_ERROR', error.message)] })}\n`);
|
|
225
|
+
return 2;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
function isMainModule(metaUrl) {
|
|
229
|
+
if (!process.argv[1]) return false;
|
|
230
|
+
try {
|
|
231
|
+
return metaUrl === pathToFileURL(realpathSync(process.argv[1])).href;
|
|
232
|
+
} catch {
|
|
233
|
+
return metaUrl === pathToFileURL(process.argv[1]).href;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
if (isMainModule(import.meta.url)) {
|
|
239
|
+
process.exitCode = await main();
|
|
240
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# Enigma backend Docker Compose production reference.
|
|
2
|
+
# Operator reference only: this file is not go-live evidence and does not prove
|
|
3
|
+
# backend availability. Provide real external storage, KMS/signing material,
|
|
4
|
+
# SIEM export, backups, monitoring, ingress/TLS, and acceptance evidence first.
|
|
5
|
+
|
|
6
|
+
services:
|
|
7
|
+
relay:
|
|
8
|
+
image: ghcr.io/enigma-ai/enigma:operator-pinned-digest-required
|
|
9
|
+
entrypoint: ["enigma-relay"]
|
|
10
|
+
command: ["serve", "--host", "0.0.0.0", "--port", "8787"]
|
|
11
|
+
env_file:
|
|
12
|
+
- ./operator-env/relay.production.env
|
|
13
|
+
secrets:
|
|
14
|
+
- relay_signing_key
|
|
15
|
+
- external_storage_dsn
|
|
16
|
+
- kms_key_ref
|
|
17
|
+
- backup_target_uri
|
|
18
|
+
- operator_acceptance_evidence_uri
|
|
19
|
+
environment:
|
|
20
|
+
NODE_ENV: production
|
|
21
|
+
ENIGMA_BACKEND_MODE: production
|
|
22
|
+
ENIGMA_REQUIRE_EXTERNAL_STORAGE: "true"
|
|
23
|
+
ENIGMA_REQUIRE_EXTERNAL_KMS: "true"
|
|
24
|
+
ENIGMA_DISABLE_LOCAL_DEMO_FALLBACK: "true"
|
|
25
|
+
ENIGMA_REQUIRE_OPERATOR_ACCEPTANCE_EVIDENCE: "true"
|
|
26
|
+
ENIGMA_READINESS_FAIL_CLOSED: "true"
|
|
27
|
+
ENIGMA_RELAY_BACKEND_HOST_REF: operator-required-relay-backend-host-ref
|
|
28
|
+
ENIGMA_RELAY_DNS_TLS_REF: operator-required-relay-dns-tls-ref
|
|
29
|
+
ENIGMA_RELAY_RUNTIME_AUTH_REF: operator-required-relay-runtime-auth-ref
|
|
30
|
+
ENIGMA_RELAY_MONITORING_REF: operator-required-relay-monitoring-ref
|
|
31
|
+
ENIGMA_SIEM_REF: operator-required-siem-ref
|
|
32
|
+
ENIGMA_BACKUP_TARGET_URI_FILE: /run/secrets/backup_target_uri
|
|
33
|
+
ENIGMA_NETWORK_ACCESS_POLICY_REF: operator-required-network-access-policy-ref
|
|
34
|
+
ENIGMA_KMS_CUSTODY_REF: operator-required-kms-custody-ref
|
|
35
|
+
ENIGMA_KMS_KEY_REF: operator-required-kms-key-ref
|
|
36
|
+
ENIGMA_TENANT_POLICY_APPROVAL_REF: operator-required-tenant-policy-approval-ref
|
|
37
|
+
ENIGMA_USAGE_METERING_REF: operator-required-usage-metering-ref
|
|
38
|
+
ENIGMA_SERVICE_SETTLEMENT_REF: operator-required-service-settlement-ref
|
|
39
|
+
ENIGMA_MONITORING_ALERTING_REF: operator-required-monitoring-alerting-ref
|
|
40
|
+
ENIGMA_PUBLIC_SITE_SECURITY_REF: operator-required-public-site-security-ref
|
|
41
|
+
ENIGMA_SECURITY_THREAT_MODEL_REF: operator-required-security-threat-model-ref
|
|
42
|
+
ENIGMA_LEGAL_COMPLIANCE_APPROVAL_REF: operator-required-legal-compliance-approval-ref
|
|
43
|
+
ENIGMA_SUPPORT_SLA_REF: operator-required-support-sla-ref
|
|
44
|
+
ENIGMA_INCIDENT_DRILL_REF: operator-required-incident-drill-ref
|
|
45
|
+
ENIGMA_BACKUP_RESTORE_DRILL_REF: operator-required-backup-restore-drill-ref
|
|
46
|
+
ENIGMA_OPERATOR_ACCEPTANCE_DECISION: operator-required-go-decision
|
|
47
|
+
ENIGMA_RELAY_SIGNING_KEY_FILE: /run/secrets/relay_signing_key
|
|
48
|
+
ENIGMA_EXTERNAL_STORAGE_DSN_FILE: /run/secrets/external_storage_dsn
|
|
49
|
+
ENIGMA_KMS_KEY_REF_FILE: /run/secrets/kms_key_ref
|
|
50
|
+
ENIGMA_OPERATOR_ACCEPTANCE_EVIDENCE_URI_FILE: /run/secrets/operator_acceptance_evidence_uri
|
|
51
|
+
ports:
|
|
52
|
+
- "127.0.0.1:8787:8787"
|
|
53
|
+
read_only: true
|
|
54
|
+
user: "1000:1000"
|
|
55
|
+
cap_drop: ["ALL"]
|
|
56
|
+
security_opt:
|
|
57
|
+
- no-new-privileges:true
|
|
58
|
+
tmpfs:
|
|
59
|
+
- /tmp:rw,noexec,nosuid,size=64m
|
|
60
|
+
healthcheck:
|
|
61
|
+
test: ["CMD-SHELL", "node -e \"Promise.all([fetch('http://127.0.0.1:8787/livez'),fetch('http://127.0.0.1:8787/readyz')]).then(rs=>process.exit(rs.every(r=>r.ok)?0:1)).catch(()=>process.exit(1))\""]
|
|
62
|
+
interval: 30s
|
|
63
|
+
timeout: 3s
|
|
64
|
+
retries: 3
|
|
65
|
+
start_period: 10s
|
|
66
|
+
restart: unless-stopped
|
|
67
|
+
|
|
68
|
+
gateway:
|
|
69
|
+
image: ghcr.io/enigma-ai/enigma:operator-pinned-digest-required
|
|
70
|
+
entrypoint: ["enigma-gateway"]
|
|
71
|
+
command: ["serve", "--host", "0.0.0.0", "--port", "8797"]
|
|
72
|
+
env_file:
|
|
73
|
+
- ./operator-env/gateway.production.env
|
|
74
|
+
secrets:
|
|
75
|
+
- gateway_signing_key
|
|
76
|
+
- external_storage_dsn
|
|
77
|
+
- kms_key_ref
|
|
78
|
+
- siem_export_endpoint
|
|
79
|
+
- backup_target_uri
|
|
80
|
+
- operator_acceptance_evidence_uri
|
|
81
|
+
environment:
|
|
82
|
+
NODE_ENV: production
|
|
83
|
+
ENIGMA_BACKEND_MODE: production
|
|
84
|
+
ENIGMA_REQUIRE_EXTERNAL_KMS: "true"
|
|
85
|
+
ENIGMA_REQUIRE_EXTERNAL_STORAGE: "true"
|
|
86
|
+
ENIGMA_REQUIRE_SIEM_EXPORT: "true"
|
|
87
|
+
ENIGMA_DISABLE_LOCAL_DEMO_FALLBACK: "true"
|
|
88
|
+
ENIGMA_REQUIRE_OPERATOR_ACCEPTANCE_EVIDENCE: "true"
|
|
89
|
+
ENIGMA_READINESS_FAIL_CLOSED: "true"
|
|
90
|
+
ENIGMA_GATEWAY_BACKEND_HOST_REF: operator-required-gateway-backend-host-ref
|
|
91
|
+
ENIGMA_GATEWAY_DNS_TLS_REF: operator-required-gateway-dns-tls-ref
|
|
92
|
+
ENIGMA_GATEWAY_MONITORING_REF: operator-required-gateway-monitoring-ref
|
|
93
|
+
ENIGMA_GATEWAY_STORAGE_REF: operator-required-gateway-storage-ref
|
|
94
|
+
ENIGMA_SIEM_REF: operator-required-siem-ref
|
|
95
|
+
ENIGMA_GATEWAY_ADMIN_AUTH_REF: operator-required-gateway-admin-auth-ref
|
|
96
|
+
ENIGMA_GATEWAY_DATA_PLANE_AUTH_REF: operator-required-gateway-data-plane-auth-ref
|
|
97
|
+
ENIGMA_BACKUP_TARGET_URI_FILE: /run/secrets/backup_target_uri
|
|
98
|
+
ENIGMA_NETWORK_ACCESS_POLICY_REF: operator-required-network-access-policy-ref
|
|
99
|
+
ENIGMA_KMS_CUSTODY_REF: operator-required-kms-custody-ref
|
|
100
|
+
ENIGMA_KMS_KEY_REF: operator-required-kms-key-ref
|
|
101
|
+
ENIGMA_TENANT_POLICY_APPROVAL_REF: operator-required-tenant-policy-approval-ref
|
|
102
|
+
ENIGMA_USAGE_METERING_REF: operator-required-usage-metering-ref
|
|
103
|
+
ENIGMA_SERVICE_SETTLEMENT_REF: operator-required-service-settlement-ref
|
|
104
|
+
ENIGMA_MONITORING_ALERTING_REF: operator-required-monitoring-alerting-ref
|
|
105
|
+
ENIGMA_PUBLIC_SITE_SECURITY_REF: operator-required-public-site-security-ref
|
|
106
|
+
ENIGMA_SECURITY_THREAT_MODEL_REF: operator-required-security-threat-model-ref
|
|
107
|
+
ENIGMA_LEGAL_COMPLIANCE_APPROVAL_REF: operator-required-legal-compliance-approval-ref
|
|
108
|
+
ENIGMA_SUPPORT_SLA_REF: operator-required-support-sla-ref
|
|
109
|
+
ENIGMA_INCIDENT_DRILL_REF: operator-required-incident-drill-ref
|
|
110
|
+
ENIGMA_BACKUP_RESTORE_DRILL_REF: operator-required-backup-restore-drill-ref
|
|
111
|
+
ENIGMA_OPERATOR_ACCEPTANCE_DECISION: operator-required-go-decision
|
|
112
|
+
ENIGMA_GATEWAY_ADMIN_AUTH_BEARER_SHA256: operator-required-admin-bearer-sha256
|
|
113
|
+
ENIGMA_GATEWAY_DATA_PLANE_AUTH_BEARER_SHA256: operator-required-data-plane-bearer-sha256
|
|
114
|
+
ENIGMA_GATEWAY_SIGNING_KEY_FILE: /run/secrets/gateway_signing_key
|
|
115
|
+
ENIGMA_KMS_KEY_REF_FILE: /run/secrets/kms_key_ref
|
|
116
|
+
ENIGMA_SIEM_EXPORT_ENDPOINT_FILE: /run/secrets/siem_export_endpoint
|
|
117
|
+
ENIGMA_EXTERNAL_STORAGE_DSN_FILE: /run/secrets/external_storage_dsn
|
|
118
|
+
ENIGMA_OPERATOR_ACCEPTANCE_EVIDENCE_URI_FILE: /run/secrets/operator_acceptance_evidence_uri
|
|
119
|
+
ports:
|
|
120
|
+
- "127.0.0.1:8797:8797"
|
|
121
|
+
read_only: true
|
|
122
|
+
user: "1000:1000"
|
|
123
|
+
cap_drop: ["ALL"]
|
|
124
|
+
security_opt:
|
|
125
|
+
- no-new-privileges:true
|
|
126
|
+
tmpfs:
|
|
127
|
+
- /tmp:rw,noexec,nosuid,size=64m
|
|
128
|
+
healthcheck:
|
|
129
|
+
test: ["CMD-SHELL", "node -e \"Promise.all([fetch('http://127.0.0.1:8797/livez'),fetch('http://127.0.0.1:8797/readyz')]).then(rs=>process.exit(rs.every(r=>r.ok)?0:1)).catch(()=>process.exit(1))\""]
|
|
130
|
+
interval: 30s
|
|
131
|
+
timeout: 3s
|
|
132
|
+
retries: 3
|
|
133
|
+
start_period: 10s
|
|
134
|
+
restart: unless-stopped
|
|
135
|
+
|
|
136
|
+
secrets:
|
|
137
|
+
relay_signing_key:
|
|
138
|
+
file: ./operator-secrets/relay-signing-key
|
|
139
|
+
gateway_signing_key:
|
|
140
|
+
file: ./operator-secrets/gateway-signing-key
|
|
141
|
+
external_storage_dsn:
|
|
142
|
+
file: ./operator-secrets/external-storage-dsn
|
|
143
|
+
kms_key_ref:
|
|
144
|
+
file: ./operator-secrets/kms-key-ref
|
|
145
|
+
backup_target_uri:
|
|
146
|
+
file: ./operator-secrets/backup-target-uri
|
|
147
|
+
siem_export_endpoint:
|
|
148
|
+
file: ./operator-secrets/siem-export-endpoint
|
|
149
|
+
operator_acceptance_evidence_uri:
|
|
150
|
+
file: ./operator-secrets/operator-acceptance-evidence-uri
|