device-identity: what a machine is, as a chain of signed statements checked offline (manufacturer credential, owners, firmware attestation, anchored on 28001; 175/175 with the AIP-23 verifier); conformance: the device-bundle vectors and the rules that cover them; control-plane console; README
This commit is contained in:
1 parent
5fb38c5d0b
commit
54028e07f4
215 files changed
+77436
-56
No files matched your search
@@ -2,7 +2,7 @@
|
||||
// implementare-aere.mjs: the published verifiers behind the one verdict form (verdict.mjs). This file holds NO verification rule of
|
||||
// its own: an AIP-23 envelope is judged by the reference verifier (verify-proof.mjs, run as the program it is), a payment by the
|
||||
// risk module, a receipt by the receipt verifier, a market timeline by the market judge, a dataset record, answer, consistency proof
|
||||
// or sample by the dataset module, a presentation of a credential by the identity verifier. What it adds is the translation: the rule ids those verifiers name -> the public rule ids and
|
||||
// or sample by the dataset module, a presentation of a credential by the identity verifier, a device bundle by the device verifier. What it adds is the translation: the rule ids those verifiers name -> the public rule ids and
|
||||
// the level of each (reguli.mjs), and the composition (a receipt or a timeline that carries an AIP-23 envelope gets that envelope
|
||||
// judged too, so one verdict covers the artifact).
|
||||
//
|
||||
@@ -14,7 +14,7 @@
|
||||
// verdict says so (PARTIAL: claim-not-checked). With --online the envelope goes to the reference verifier with the chain's endpoint.
|
||||
// Exit: 0 VALID, 1 INVALID, 2 PARTIAL, 3 the artifact could not be judged at all (not a verdict).
|
||||
import fs from 'node:fs'; import os from 'node:os'; import path from 'node:path'; import { spawn } from 'node:child_process';
|
||||
import { VERIFICATOARE, FINALITY_SITES, VERIFY_PROOF, NEJUDECATE_IDENTITY, incarca } from './reguli.mjs';
|
||||
import { VERIFICATOARE, FINALITY_SITES, VERIFY_PROOF, NEJUDECATE_IDENTITY, NEJUDECATE_DEVICE, incarca } from './reguli.mjs';
|
||||
import { acumulator, pica, trece, nemasurat, verdictUnic } from './verdict.mjs';
|
||||
|
||||
const RPC = { 2800: process.env.AERE_CONFORMANCE_RPC_2800 || 'https://rpc.aere.network', 28001: process.env.AERE_CONFORMANCE_RPC_28001 || 'https://testnet-rpc.aere.network' };
|
||||
@@ -126,6 +126,27 @@ async function judeca(artifact, input, online) {
|
||||
const NEJ = NEJUDECATE_IDENTITY; if (M.NEJUDECATE.some((c) => !(c in NEJ))) throw new Error('the identity verifier declares a cause of not judging that this suite does not map');
|
||||
for (const c of r.unjudged) { if (!(c in NEJ)) throw new Error('the identity verifier left unjudged for a cause this suite does not map: ' + c); if (NEJ[c]) nemasurat(acc, NEJ[c][0], NEJ[c][1], r.rows.filter((x) => x.unjudged === c).map((x) => x.name + ': ' + x.detail).join('; ')); }
|
||||
for (const l of ['anchoring', 'finality']) nemasurat(acc, l, 'not-judged', 'a credential or a delegation is anchored by notarizing its AIP-23 envelope, judged as the artifact `envelope`');
|
||||
} else if (artifact === 'device-bundle') {
|
||||
// a device bundle, judged by the device verifier with what THIS verifier brings: its clock (required), its nonce and audience, the
|
||||
// manufacturers it trusts, the recall lists, the firmware policies and the status records it read, a Proof of Software attestation,
|
||||
// its own readings of the notarized envelope. The verifier makes every check it can reach and names every rule that refused.
|
||||
const M = await incarca('device'); const R = VERIFICATOARE.device.reguli;
|
||||
if (typeof input.now !== 'string') throw new Error('a device bundle is judged on the verifier\'s clock: input.now (an RFC 3339 time) is required');
|
||||
const o = { now: input.now }; for (const k of ['nonce', 'audience', 'trustedManufacturers', 'statusLists', 'firmwarePolicies', 'statusRecords', 'softwareAttestation', 'anchors', 'maxAgeS']) if (input[k] !== undefined) o[k] = input[k];
|
||||
const r = M.verifyDevice(input.bundle, o);
|
||||
if (r.valid !== (r.rules.length === 0)) throw new Error('the device verifier refused without naming a rule');
|
||||
for (const s of r.rules) { if (!R[s]) throw new Error('the device verifier named a rule this suite does not map: ' + s); pica(acc, R[s][1], R[s][0], r.rows.filter((x) => x.pass === false && x.rule === s).map((x) => x.name + ': ' + x.detail).join('; ')); }
|
||||
const oprit = r.rules.find((s) => M.OPRIRI.includes(s));
|
||||
if (!r.rules.some((s) => R[s][1] === 'integrity')) { trece(acc, 'integrity', 'no integrity rule of the device verifier refused (' + r.rows.filter((x) => x.pass === true).length + ' checks held)');
|
||||
// what the verifier NAMES without changing the verdict (a record of a previous owner, a record not in effect yet, a record ignored): said here, in the reason
|
||||
const notate = r.rows.filter((x) => x.pass === null && NEJUDECATE_DEVICE[x.unjudged] === null); if (notate.length) trece(acc, 'integrity', 'named by the verifier, the verdict stands: ' + notate.map((x) => x.unjudged + ' (' + x.name + ': ' + x.detail + ')').join('; ')); }
|
||||
if (!r.rules.some((s) => R[s][1] === 'authenticity')) { if (oprit) nemasurat(acc, 'authenticity', 'not-reached', 'the verifier stopped a link at ' + R[oprit][0] + ' before every signature was looked at'); else trece(acc, 'authenticity', 'the ids are derived from the keys; every link brought is signed (Ed25519 and ML-DSA-65, both; the attestation with the device\'s ML-DSA-65 key)'); }
|
||||
// what the verifier did not judge: the causes the module declares as keeping the verdict from VALID are exactly the ones mapped here
|
||||
const NEJ = NEJUDECATE_DEVICE; if (M.NEJUDECATE.some((c) => !(c in NEJ) || !!NEJ[c] !== M.PARTIALE.includes(c))) throw new Error('the device verifier declares a cause of not judging that this suite does not map the same way');
|
||||
for (const c of r.unjudged) { if (!(c in NEJ)) throw new Error('the device verifier left unjudged for a cause this suite does not map: ' + c); if (NEJ[c]) nemasurat(acc, NEJ[c][0], NEJ[c][1], r.rows.filter((x) => x.unjudged === c).map((x) => x.name + ': ' + x.detail).join('; ')); }
|
||||
for (const l of ['anchoring', 'finality']) nemasurat(acc, l, 'not-judged', 'the envelope of an attestation is anchored by notarizing it, judged as the artifact `envelope`; here the verifier brings its own reading of that');
|
||||
const v = verdictUnic(artifact, acc); if (v.verdict !== r.verdict) throw new Error('the verdict of the suite (' + v.verdict + ') is not the verdict of the device verifier (' + r.verdict + ')');
|
||||
return v;
|
||||
} else if (artifact === 'ai-trust-bundle') {
|
||||
// the trust chain of an AI result, judged by its own verifier (which runs the reference verifier on each envelope and the agents'
|
||||
// and the audit log's verifiers on theirs). Offline, a notarization claimed by the attestation, the runtime record or the audit
|
||||
|
||||
Reference in new issue
Block a user