@calltelemetry/ct-lab-mcp 0.8.104 → 0.8.106
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/README.md +13 -3
- package/assets/stig/SHA256SUMS +1 -0
- package/assets/stig/image/verify-image.sh +28 -0
- package/dist/src/generated-version.d.ts +1 -1
- package/dist/src/generated-version.js +1 -1
- package/dist/src/stig/dist.d.ts +121 -0
- package/dist/src/stig/dist.d.ts.map +1 -0
- package/dist/src/stig/dist.js +234 -0
- package/dist/src/stig/dist.js.map +1 -0
- package/dist/src/stig/distribution.d.ts +80 -0
- package/dist/src/stig/distribution.d.ts.map +1 -0
- package/dist/src/stig/distribution.js +335 -0
- package/dist/src/stig/distribution.js.map +1 -0
- package/dist/src/stig/live.d.ts +56 -4
- package/dist/src/stig/live.d.ts.map +1 -1
- package/dist/src/stig/live.js +188 -5
- package/dist/src/stig/live.js.map +1 -1
- package/dist/src/stig/model.d.ts +2 -1
- package/dist/src/stig/model.d.ts.map +1 -1
- package/dist/src/stig/model.js +7 -2
- package/dist/src/stig/model.js.map +1 -1
- package/dist/src/stig/nodes.d.ts +52 -12
- package/dist/src/stig/nodes.d.ts.map +1 -1
- package/dist/src/stig/nodes.js +90 -11
- package/dist/src/stig/nodes.js.map +1 -1
- package/dist/src/stig/ports.d.ts +64 -2
- package/dist/src/stig/ports.d.ts.map +1 -1
- package/dist/src/stig/pve.d.ts +21 -0
- package/dist/src/stig/pve.d.ts.map +1 -0
- package/dist/src/stig/pve.js +26 -0
- package/dist/src/stig/pve.js.map +1 -0
- package/dist/src/stig/runner.d.ts +30 -9
- package/dist/src/stig/runner.d.ts.map +1 -1
- package/dist/src/stig/runner.js +98 -78
- package/dist/src/stig/runner.js.map +1 -1
- package/dist/src/tools/claimed-import-qcow.d.ts.map +1 -1
- package/dist/src/tools/claimed-import-qcow.js +9 -1
- package/dist/src/tools/claimed-import-qcow.js.map +1 -1
- package/dist/src/tools/import-qcow.d.ts +14 -3
- package/dist/src/tools/import-qcow.d.ts.map +1 -1
- package/dist/src/tools/import-qcow.js +45 -15
- package/dist/src/tools/import-qcow.js.map +1 -1
- package/dist/src/tools/slot-tools.d.ts +4 -4
- package/dist/src/tools/stig-tools.d.ts +26 -8
- package/dist/src/tools/stig-tools.d.ts.map +1 -1
- package/dist/src/tools/stig-tools.js +66 -21
- package/dist/src/tools/stig-tools.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -472,9 +472,19 @@ consumer update workflow.
|
|
|
472
472
|
`confirmImageSha256`). `imageUrl` is exactly one of two identity URL shapes
|
|
473
473
|
(https only; no query string, fragment, userinfo, or port; the retired GCS
|
|
474
474
|
host is refused, ADR 0735):
|
|
475
|
-
- published, on the
|
|
476
|
-
|
|
477
|
-
`
|
|
475
|
+
- published, on the R2-backed download Worker host (REL-1785, ADR 0873/0874),
|
|
476
|
+
served at the host root (the Worker maps it to R2 key
|
|
477
|
+
`ovas/ct-<version>.qcow2`):
|
|
478
|
+
`https://download.calltelemetry.com/ct-<version>[-rc<N>].qcow2`, where
|
|
479
|
+
`<version>` has four numeric parts (the same pinned pattern as a
|
|
480
|
+
candidate). The retired DigitalOcean Spaces release host is refused. The
|
|
481
|
+
Worker answers 403 to unsigned requests, so a published import requires an
|
|
482
|
+
operator-minted, Worker-signed fetch URL in the gateway process environment
|
|
483
|
+
as `CT_IMPORT_QCOW_DOWNLOAD_URL` (ADR 0880): the unsigned URL above plus
|
|
484
|
+
exactly `expires` and `signature`. It is never a tool input, is forwarded
|
|
485
|
+
to the canonical CLI only through the child environment (as for candidates),
|
|
486
|
+
and a published request without it is refused before any claim or provider
|
|
487
|
+
call (no unsigned fallback; the message never echoes a URL).
|
|
478
488
|
- private CI candidate for an unpublished RC (ADR 0727), on Cloudflare R2
|
|
479
489
|
(REL-1785), path-style with the bucket as the first path segment:
|
|
480
490
|
`https://<32-hex-account-id>.r2.cloudflarestorage.com/ct-ci-candidates/candidates/<version>/<run_id>/ct-<version>.qcow2`,
|
package/assets/stig/SHA256SUMS
CHANGED
|
@@ -16,3 +16,4 @@ eb119e742a4791404ca298c962515ffe3492814dfc72aecac16c420ccb3b0ccc guest/keyhash.
|
|
|
16
16
|
6b3eab512392c9b68499cb3b4a753377bcc499b810e7259d8ede5e10861bf674 guest/verify-root.sh
|
|
17
17
|
770cbf1c4ea374772d6e80734b1fe4d7d7f5826c8c528a5371f4dfea196479d7 guest/verify-user.sh
|
|
18
18
|
b4a37a0425369c99dfe9b63086155b7ffaa0ef73f98b158143ecb0cd84d45d94 guest/scan-disa.sh
|
|
19
|
+
65e5a3ca041b44d496e81cd961c3fa70ac0bf6804ef9b3f48a9997fa83902d07 image/verify-image.sh
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Verify a published STIG image on the host that runs it (read-only; no secrets).
|
|
3
|
+
# Run on a Proxmox node: ssh root@<node> "STORE=/mnt/pve/ct-stig-images TPL=<template> FPR=<fingerprint> bash -s" < verify-image.sh
|
|
4
|
+
# Checks, with the pinned evidence-key fingerprint: public key fingerprint, index.json signature,
|
|
5
|
+
# template.json sha256 + signature, qcow2 sha256 + signature. Exit 0 and VERIFY_OK on success.
|
|
6
|
+
set -euo pipefail
|
|
7
|
+
: "${STORE:?}" "${TPL:?}" "${FPR:?}"
|
|
8
|
+
cd "$STORE/rhel8-stig"
|
|
9
|
+
H="$(mktemp -d /tmp/stgv.XXXXXX)"; chmod 700 "$H"
|
|
10
|
+
trap 'gpgconf --homedir "$H" --kill all >/dev/null 2>&1; rm -rf "$H"' EXIT
|
|
11
|
+
G="gpg --homedir $H --batch --no-tty --yes"
|
|
12
|
+
$G --import stig-evidence-signing.pub.asc >/dev/null 2>&1
|
|
13
|
+
$G --list-keys --with-colons 2>/dev/null | grep -q "^fpr:::::::::$FPR:" || { echo "pubkey fingerprint mismatch" >&2; exit 1; }
|
|
14
|
+
vok() { $G --status-fd 1 --verify "$2" "$1" 2>/dev/null | grep VALIDSIG | grep -q "$FPR" || { echo "BAD signature: $1" >&2; exit 1; }; }
|
|
15
|
+
vok index.json index.json.asc
|
|
16
|
+
read -r QS TS < <(python3 -I - "$TPL" <<'PY'
|
|
17
|
+
import json, sys
|
|
18
|
+
i = json.load(open("index.json"))
|
|
19
|
+
v = [x for x in i["versions"] if x["name"] == sys.argv[1]]
|
|
20
|
+
if not v: sys.exit("template not in index.json")
|
|
21
|
+
print(v[0]["qcow2_sha256"], v[0]["template_json_sha256"])
|
|
22
|
+
PY
|
|
23
|
+
)
|
|
24
|
+
[ "$(sha256sum "$TPL/template.json" | cut -d' ' -f1)" = "$TS" ] || { echo "template.json sha256 mismatch" >&2; exit 1; }
|
|
25
|
+
vok "$TPL/template.json" "$TPL/template.json.asc"
|
|
26
|
+
[ "$(sha256sum "../import/$TPL.qcow2" | cut -d' ' -f1)" = "$QS" ] || { echo "qcow2 sha256 mismatch" >&2; exit 1; }
|
|
27
|
+
vok "../import/$TPL.qcow2" "$TPL/$TPL.qcow2.asc"
|
|
28
|
+
echo "VERIFY_OK qcow2_sha256=$QS template_json_sha256=$TS"
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Auto-synced package version fallback for non-filesystem runtimes (Cloudflare Workers).
|
|
3
3
|
* Updated automatically during release publication in .github/workflows/publish.yml.
|
|
4
4
|
*/
|
|
5
|
-
export declare const PACKAGE_VERSION = "0.8.
|
|
5
|
+
export declare const PACKAGE_VERSION = "0.8.106";
|
|
6
6
|
//# sourceMappingURL=generated-version.d.ts.map
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Auto-synced package version fallback for non-filesystem runtimes (Cloudflare Workers).
|
|
3
3
|
* Updated automatically during release publication in .github/workflows/publish.yml.
|
|
4
4
|
*/
|
|
5
|
-
export const PACKAGE_VERSION = "0.8.
|
|
5
|
+
export const PACKAGE_VERSION = "0.8.106";
|
|
6
6
|
//# sourceMappingURL=generated-version.js.map
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
export declare const TEMPLATE_JSON_SCHEMA = "calltelemetry-rhel8-stig-template/v1";
|
|
2
|
+
export declare const INDEX_SCHEMA = "calltelemetry-rhel8-stig-index/v1";
|
|
3
|
+
export declare const PUBLISH_RECEIPT_SCHEMA = "calltelemetry-rhel8-stig-publish-receipt/v1";
|
|
4
|
+
export declare const SYNC_RECEIPT_SCHEMA = "calltelemetry-rhel8-stig-sync-receipt/v1";
|
|
5
|
+
export declare const EXPORT_DONE = "PUBLISH_EXPORT_DONE";
|
|
6
|
+
export declare const SYNC_DONE = "SYNC_CREATE_DONE";
|
|
7
|
+
export declare const DISK_OPTIONS = "cache=none,discard=on,iothread=1,replicate=0";
|
|
8
|
+
export declare const EFIDISK = "efitype=4m,ms-cert=2023k,pre-enrolled-keys=1";
|
|
9
|
+
export declare const TPM_NOTE = "version=v2.0 (fresh per clone)";
|
|
10
|
+
type Json = Record<string, any>;
|
|
11
|
+
export declare function assertTemplateName(name: string): string;
|
|
12
|
+
/** Python `json.dump(obj, indent=2, sort_keys=True)` plus the trailing newline the scripts add. */
|
|
13
|
+
export declare function pyJson(value: unknown): string;
|
|
14
|
+
/** Python `datetime.now(utc).strftime("%Y-%m-%dT%H:%M:%SZ")`. */
|
|
15
|
+
export declare const utcStamp: (ms: number) => string;
|
|
16
|
+
/** Python `shlex.quote`. */
|
|
17
|
+
export declare function shlexQuote(s: string): string;
|
|
18
|
+
export declare const baseLv: (vmid: number) => string;
|
|
19
|
+
/**
|
|
20
|
+
* The detached export script (publish.sh REMOTE heredoc). The base LV must be read-only; it is activated with -K only
|
|
21
|
+
* when inactive and deactivated afterwards, so it is never made writable.
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildExportScript(a: {
|
|
24
|
+
template: string;
|
|
25
|
+
vmid: number;
|
|
26
|
+
store?: string;
|
|
27
|
+
}): string;
|
|
28
|
+
/** `qm config` text to a map (key: value, split on the first ": "). */
|
|
29
|
+
export declare function parseQmConfig(text: string): Record<string, string>;
|
|
30
|
+
/** Python `urllib.parse.unquote` for the percent-encoded description Proxmox stores. */
|
|
31
|
+
export declare function pyUnquote(s: string): string;
|
|
32
|
+
export interface TemplateJsonInput {
|
|
33
|
+
template: string;
|
|
34
|
+
vmid: number;
|
|
35
|
+
qcowSha256: string;
|
|
36
|
+
qcowBytes: number;
|
|
37
|
+
virtualBytes: number;
|
|
38
|
+
qmConfig: string;
|
|
39
|
+
/** keys like result_pass, disa_result_fail */
|
|
40
|
+
scan: Record<string, number>;
|
|
41
|
+
receiptSha256: string | null;
|
|
42
|
+
manifestSha256: string | null;
|
|
43
|
+
publishedMs: number;
|
|
44
|
+
store?: string;
|
|
45
|
+
}
|
|
46
|
+
export declare function buildTemplateJson(i: TemplateJsonInput): Json;
|
|
47
|
+
/** Receipt-summary counts as the summary.txt-style keys the scripts publish (result_pass, disa_result_fail, ...). */
|
|
48
|
+
export declare function scanFromSummary(summary: {
|
|
49
|
+
counts: Record<string, number>;
|
|
50
|
+
disa?: {
|
|
51
|
+
counts: Record<string, number>;
|
|
52
|
+
};
|
|
53
|
+
} | null | undefined): Record<string, number>;
|
|
54
|
+
export interface IndexEntry {
|
|
55
|
+
name: string;
|
|
56
|
+
build_vmid: number;
|
|
57
|
+
qcow2: string;
|
|
58
|
+
qcow2_sha256: string;
|
|
59
|
+
qcow2_bytes: number;
|
|
60
|
+
qcow2_signature: string;
|
|
61
|
+
template_json: string;
|
|
62
|
+
template_json_sha256: string;
|
|
63
|
+
template_json_signature: string;
|
|
64
|
+
published: string;
|
|
65
|
+
}
|
|
66
|
+
export interface StigIndex {
|
|
67
|
+
schema: string;
|
|
68
|
+
signing_key_fpr: string;
|
|
69
|
+
latest: string;
|
|
70
|
+
retention: number;
|
|
71
|
+
versions: IndexEntry[];
|
|
72
|
+
}
|
|
73
|
+
/** The index entry for one published template is verified when it lists the template (the node-side signature check is separate). */
|
|
74
|
+
export declare function indexHas(index: Json | null, template: string): boolean;
|
|
75
|
+
export declare function parseIndex(text: string | null): Json;
|
|
76
|
+
/** Every name in an existing index.json must be a template name before it is copied or reaches `rm -rf`. */
|
|
77
|
+
export declare function assertIndexNames(index: Json): void;
|
|
78
|
+
/** The index position the template would take (0 = newest). */
|
|
79
|
+
export declare function indexRank(old: Json, template: string): number;
|
|
80
|
+
export declare function buildIndex(a: {
|
|
81
|
+
old: Json;
|
|
82
|
+
template: string;
|
|
83
|
+
vmid: number;
|
|
84
|
+
qcowSha256: string;
|
|
85
|
+
qcowBytes: number;
|
|
86
|
+
templateJsonSha256: string;
|
|
87
|
+
publishedMs: number;
|
|
88
|
+
keep?: number;
|
|
89
|
+
}): {
|
|
90
|
+
index: StigIndex;
|
|
91
|
+
dropped: string[];
|
|
92
|
+
};
|
|
93
|
+
export declare function buildPublishReceipt(a: {
|
|
94
|
+
template: Json;
|
|
95
|
+
index: StigIndex;
|
|
96
|
+
buildNode: string;
|
|
97
|
+
pruned: string[];
|
|
98
|
+
}): Json;
|
|
99
|
+
export declare function buildSyncReceipt(a: {
|
|
100
|
+
template: string;
|
|
101
|
+
node: string;
|
|
102
|
+
vmid: number;
|
|
103
|
+
claim: string;
|
|
104
|
+
mode: string;
|
|
105
|
+
qcowSha256: string;
|
|
106
|
+
thin: string;
|
|
107
|
+
lvSizeBytes: number;
|
|
108
|
+
mappedPercent: number;
|
|
109
|
+
syncedMs: number;
|
|
110
|
+
}): Json;
|
|
111
|
+
export declare function validateTemplateJson(t: unknown, template: string): Json;
|
|
112
|
+
/** The detached `qm create` + `qm template` script (sync.sh python heredoc). Bridge has no VLAN tag: the tag belongs to clones. */
|
|
113
|
+
export declare function buildQmCreateScript(a: {
|
|
114
|
+
template: Json;
|
|
115
|
+
vmid: number;
|
|
116
|
+
thin: string;
|
|
117
|
+
bridge: string;
|
|
118
|
+
store?: string;
|
|
119
|
+
}): string;
|
|
120
|
+
export {};
|
|
121
|
+
//# sourceMappingURL=dist.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dist.d.ts","sourceRoot":"","sources":["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AAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAOvN;AAID,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAcvE;AAED,mIAAmI;AACnI,wBAAgB,mBAAmB,CAAC,CAAC,EAAE;IAAE,QAAQ,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAU7H"}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STIG image distribution: pure builders for the published artifacts (export script, template.json, index.json,
|
|
3
|
+
* `qm create` script, receipts). Every output mirrors the ct-meta `rhel8-stig-template` scripts (publish.sh,
|
|
4
|
+
* sync.sh) and `tools/stig-parity.mjs dist` diffs them against those scripts. No I/O here.
|
|
5
|
+
*/
|
|
6
|
+
import { STIG_EVIDENCE_FPR, STIG_STORE, STIG_IMAGE_KEEP_VERSIONS } from "./nodes.js";
|
|
7
|
+
export const TEMPLATE_JSON_SCHEMA = "calltelemetry-rhel8-stig-template/v1";
|
|
8
|
+
export const INDEX_SCHEMA = "calltelemetry-rhel8-stig-index/v1";
|
|
9
|
+
export const PUBLISH_RECEIPT_SCHEMA = "calltelemetry-rhel8-stig-publish-receipt/v1";
|
|
10
|
+
export const SYNC_RECEIPT_SCHEMA = "calltelemetry-rhel8-stig-sync-receipt/v1";
|
|
11
|
+
export const EXPORT_DONE = "PUBLISH_EXPORT_DONE";
|
|
12
|
+
export const SYNC_DONE = "SYNC_CREATE_DONE";
|
|
13
|
+
export const DISK_OPTIONS = "cache=none,discard=on,iothread=1,replicate=0";
|
|
14
|
+
export const EFIDISK = "efitype=4m,ms-cert=2023k,pre-enrolled-keys=1";
|
|
15
|
+
export const TPM_NOTE = "version=v2.0 (fresh per clone)";
|
|
16
|
+
const TEMPLATE_NAME = /^rhel810-stig-\d{8}-\d{4}$/;
|
|
17
|
+
const SHA256 = /^[a-f0-9]{64}$/;
|
|
18
|
+
export function assertTemplateName(name) {
|
|
19
|
+
if (!TEMPLATE_NAME.test(name))
|
|
20
|
+
throw new Error("template name must look like rhel810-stig-YYYYMMDD-VMID");
|
|
21
|
+
return name;
|
|
22
|
+
}
|
|
23
|
+
/** Python `json.dump(obj, indent=2, sort_keys=True)` plus the trailing newline the scripts add. */
|
|
24
|
+
export function pyJson(value) {
|
|
25
|
+
const norm = (v) => (Array.isArray(v) ? v.map(norm) : v && typeof v === "object" ? Object.fromEntries(Object.keys(v).sort().map((k) => [k, norm(v[k])])) : v);
|
|
26
|
+
return `${JSON.stringify(norm(value), null, 2).replace(/[\u0080-\uFFFF]/g, (c) => `\\u${c.charCodeAt(0).toString(16).padStart(4, "0")}`)}\n`;
|
|
27
|
+
}
|
|
28
|
+
/** Python `datetime.now(utc).strftime("%Y-%m-%dT%H:%M:%SZ")`. */
|
|
29
|
+
export const utcStamp = (ms) => new Date(ms).toISOString().replace(/\.\d{3}Z$/, "Z");
|
|
30
|
+
/** Python `shlex.quote`. */
|
|
31
|
+
export function shlexQuote(s) {
|
|
32
|
+
if (s === "")
|
|
33
|
+
return "''";
|
|
34
|
+
return /[^A-Za-z0-9_@%+=:,./-]/.test(s) ? `'${s.replace(/'/g, `'"'"'`)}'` : s;
|
|
35
|
+
}
|
|
36
|
+
/* ------------------------------------------------------------------ export */
|
|
37
|
+
export const baseLv = (vmid) => `pve/base-${vmid}-disk-1`;
|
|
38
|
+
/**
|
|
39
|
+
* The detached export script (publish.sh REMOTE heredoc). The base LV must be read-only; it is activated with -K only
|
|
40
|
+
* when inactive and deactivated afterwards, so it is never made writable.
|
|
41
|
+
*/
|
|
42
|
+
export function buildExportScript(a) {
|
|
43
|
+
const store = a.store ?? STIG_STORE.mount;
|
|
44
|
+
const { template: tpl, vmid } = a;
|
|
45
|
+
return [
|
|
46
|
+
"set -euo pipefail",
|
|
47
|
+
`lv=${baseLv(vmid)}`,
|
|
48
|
+
`out=${store}/import/${tpl}.qcow2`,
|
|
49
|
+
`attr_before="$(lvs --noheadings -o lv_attr $lv | tr -d ' ')"`,
|
|
50
|
+
"activated=0",
|
|
51
|
+
`case "$attr_before" in ?r*) ;; *) echo "base LV is not read-only ($attr_before)"; exit 1;; esac`,
|
|
52
|
+
`if [ "$(lvs --noheadings -o lv_active $lv | tr -d ' ')" != active ]; then lvchange -ay -K $lv; activated=1; fi`,
|
|
53
|
+
`rm -f "$out.partial"`,
|
|
54
|
+
`qemu-img convert -f raw -O qcow2 -c -m 4 "/dev/$lv" "$out.partial"`,
|
|
55
|
+
`qemu-img check "$out.partial" >/dev/null`,
|
|
56
|
+
`mv "$out.partial" "$out"`,
|
|
57
|
+
`[ "$activated" = 1 ] && lvchange -an $lv`,
|
|
58
|
+
`attr_after="$(lvs --noheadings -o lv_attr $lv | tr -d ' ')"`,
|
|
59
|
+
`echo "lv_attr before=$attr_before after=$attr_after activated_by_publish=$activated"`,
|
|
60
|
+
`qemu-img info --output=json "$out" > "${store}/rhel8-stig/${tpl}.qemu-img-info.json"`,
|
|
61
|
+
`sha256sum "$out" | cut -d' ' -f1 > "${store}/rhel8-stig/${tpl}.qcow2.sha256"`,
|
|
62
|
+
`echo ${EXPORT_DONE}`,
|
|
63
|
+
"",
|
|
64
|
+
].join("\n");
|
|
65
|
+
}
|
|
66
|
+
/* ------------------------------------------------------------ template.json */
|
|
67
|
+
/** `qm config` text to a map (key: value, split on the first ": "). */
|
|
68
|
+
export function parseQmConfig(text) {
|
|
69
|
+
const cfg = {};
|
|
70
|
+
for (const line of text.split("\n")) {
|
|
71
|
+
if (line === "")
|
|
72
|
+
continue;
|
|
73
|
+
const i = line.indexOf(": ");
|
|
74
|
+
if (i < 0)
|
|
75
|
+
cfg[line] = "";
|
|
76
|
+
else
|
|
77
|
+
cfg[line.slice(0, i)] = line.slice(i + 2);
|
|
78
|
+
}
|
|
79
|
+
return cfg;
|
|
80
|
+
}
|
|
81
|
+
/** Python `urllib.parse.unquote` for the percent-encoded description Proxmox stores. */
|
|
82
|
+
export function pyUnquote(s) {
|
|
83
|
+
return s.replace(/(?:%[0-9A-Fa-f]{2})+/g, (m) => {
|
|
84
|
+
try {
|
|
85
|
+
return decodeURIComponent(m);
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
return Buffer.from(m.replace(/%/g, ""), "hex").toString("latin1");
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
const need = (cfg, key) => {
|
|
93
|
+
const v = cfg[key];
|
|
94
|
+
if (v === undefined)
|
|
95
|
+
throw new Error(`qm config of the template has no ${key}`);
|
|
96
|
+
return v;
|
|
97
|
+
};
|
|
98
|
+
const intOf = (v, what) => {
|
|
99
|
+
if (!/^\d+$/.test(v))
|
|
100
|
+
throw new Error(`${what} is not an integer`);
|
|
101
|
+
return Number.parseInt(v, 10);
|
|
102
|
+
};
|
|
103
|
+
export function buildTemplateJson(i) {
|
|
104
|
+
const cfg = parseQmConfig(i.qmConfig);
|
|
105
|
+
const hardware = {
|
|
106
|
+
bios: need(cfg, "bios"), machine: need(cfg, "machine"), cpu: need(cfg, "cpu"), cores: intOf(need(cfg, "cores"), "cores"),
|
|
107
|
+
sockets: intOf(cfg.sockets ?? "1", "sockets"), memory_mb: intOf(need(cfg, "memory"), "memory"), scsihw: need(cfg, "scsihw"),
|
|
108
|
+
ostype: need(cfg, "ostype"), agent: cfg.agent ?? "1", numa: cfg.numa ?? "0",
|
|
109
|
+
disk_bytes: i.virtualBytes, disk_options: DISK_OPTIONS, efidisk: EFIDISK, tpm: TPM_NOTE, cloudinit: "ide0",
|
|
110
|
+
tags: cfg.tags ?? "", net0_model: "virtio",
|
|
111
|
+
};
|
|
112
|
+
return {
|
|
113
|
+
schema: TEMPLATE_JSON_SCHEMA, name: i.template, build_vmid: i.vmid, published: utcStamp(i.publishedMs),
|
|
114
|
+
description: pyUnquote(cfg.description ?? ""),
|
|
115
|
+
image: { file: `${i.store ?? STIG_STORE.name}:import/${i.template}.qcow2`, format: "qcow2", compressed: true, sha256: i.qcowSha256, bytes: i.qcowBytes, virtual_bytes: i.virtualBytes },
|
|
116
|
+
hardware, scan: i.scan, receipt_sha256: i.receiptSha256, evidence_manifest_sha256: i.manifestSha256,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/** Receipt-summary counts as the summary.txt-style keys the scripts publish (result_pass, disa_result_fail, ...). */
|
|
120
|
+
export function scanFromSummary(summary) {
|
|
121
|
+
const scan = {};
|
|
122
|
+
if (!summary)
|
|
123
|
+
return scan;
|
|
124
|
+
for (const [k, v] of Object.entries(summary.counts))
|
|
125
|
+
scan[`result_${k}`] = v;
|
|
126
|
+
if (summary.disa)
|
|
127
|
+
for (const [k, v] of Object.entries(summary.disa.counts))
|
|
128
|
+
scan[`disa_result_${k}`] = v;
|
|
129
|
+
return scan;
|
|
130
|
+
}
|
|
131
|
+
/** The index entry for one published template is verified when it lists the template (the node-side signature check is separate). */
|
|
132
|
+
export function indexHas(index, template) {
|
|
133
|
+
return Array.isArray(index?.versions) && index.versions.some((v) => v?.name === template);
|
|
134
|
+
}
|
|
135
|
+
export function parseIndex(text) {
|
|
136
|
+
if (!text || !text.trim())
|
|
137
|
+
return {};
|
|
138
|
+
const parsed = JSON.parse(text);
|
|
139
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
140
|
+
throw new Error("index.json is not an object");
|
|
141
|
+
return parsed;
|
|
142
|
+
}
|
|
143
|
+
/** Every name in an existing index.json must be a template name before it is copied or reaches `rm -rf`. */
|
|
144
|
+
export function assertIndexNames(index) {
|
|
145
|
+
if (index.versions === undefined)
|
|
146
|
+
return;
|
|
147
|
+
if (!Array.isArray(index.versions))
|
|
148
|
+
throw new Error("index.json versions is not a list");
|
|
149
|
+
for (const v of index.versions) {
|
|
150
|
+
if (typeof v?.name !== "string" || !TEMPLATE_NAME.test(v.name))
|
|
151
|
+
throw new Error(`index.json lists an invalid template name (${JSON.stringify(String(v?.name)).slice(0, 60)}); refusing to rewrite it`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/** The index position the template would take (0 = newest). */
|
|
155
|
+
export function indexRank(old, template) {
|
|
156
|
+
const names = new Set([template, ...(Array.isArray(old?.versions) ? old.versions.map((v) => v.name) : [])]);
|
|
157
|
+
return [...names].sort().reverse().indexOf(template);
|
|
158
|
+
}
|
|
159
|
+
export function buildIndex(a) {
|
|
160
|
+
const keep = a.keep ?? STIG_IMAGE_KEEP_VERSIONS;
|
|
161
|
+
const old = Array.isArray(a.old?.versions) ? a.old.versions : [];
|
|
162
|
+
const entry = {
|
|
163
|
+
name: a.template, build_vmid: a.vmid, qcow2: `import/${a.template}.qcow2`, qcow2_sha256: a.qcowSha256, qcow2_bytes: a.qcowBytes,
|
|
164
|
+
qcow2_signature: `rhel8-stig/${a.template}/${a.template}.qcow2.asc`, template_json: `rhel8-stig/${a.template}/template.json`,
|
|
165
|
+
template_json_sha256: a.templateJsonSha256, template_json_signature: `rhel8-stig/${a.template}/template.json.asc`, published: utcStamp(a.publishedMs),
|
|
166
|
+
};
|
|
167
|
+
const versions = [entry, ...old.filter((v) => v.name !== a.template)];
|
|
168
|
+
versions.sort((x, y) => (x.name < y.name ? 1 : x.name > y.name ? -1 : 0)); // reverse by name, as Python's sort(reverse=True)
|
|
169
|
+
const kept = versions.slice(0, keep);
|
|
170
|
+
return {
|
|
171
|
+
index: { schema: INDEX_SCHEMA, signing_key_fpr: STIG_EVIDENCE_FPR, latest: kept[0].name, retention: keep, versions: kept },
|
|
172
|
+
dropped: versions.slice(keep).map((v) => v.name),
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
/* ----------------------------------------------------------------- receipts */
|
|
176
|
+
export function buildPublishReceipt(a) {
|
|
177
|
+
const t = a.template;
|
|
178
|
+
const i = a.index;
|
|
179
|
+
return {
|
|
180
|
+
schema: PUBLISH_RECEIPT_SCHEMA, template: t.name, build_node: a.buildNode, published: t.published,
|
|
181
|
+
qcow2_sha256: t.image.sha256, qcow2_bytes: t.image.bytes, virtual_bytes: t.image.virtual_bytes,
|
|
182
|
+
template_json_sha256: i.versions[0].name === t.name ? i.versions[0].template_json_sha256 : null,
|
|
183
|
+
signing_key_fpr: i.signing_key_fpr, latest: i.latest, versions: i.versions.map((v) => v.name), pruned: a.pruned, scan: t.scan,
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
export function buildSyncReceipt(a) {
|
|
187
|
+
return {
|
|
188
|
+
schema: SYNC_RECEIPT_SCHEMA, template: a.template, node: a.node, vmid: a.vmid, claim: a.claim, mode: a.mode, qcow2_sha256: a.qcowSha256,
|
|
189
|
+
verified: Object.fromEntries(["index_signature", "template_json_signature", "qcow2_signature", "qcow2_sha256", "template_json_sha256"].map((k) => [k, true])),
|
|
190
|
+
thin_storage: a.thin, disk_virtual_bytes: Math.trunc(a.lvSizeBytes), disk_mapped_bytes: Math.trunc(a.lvSizeBytes * a.mappedPercent / 100),
|
|
191
|
+
disk_mapped_percent: a.mappedPercent, synced: utcStamp(a.syncedMs),
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
/* ---------------------------------------------------------------- qm create */
|
|
195
|
+
export function validateTemplateJson(t, template) {
|
|
196
|
+
const bad = (m) => { throw new Error(`template.json refused: ${m}`); };
|
|
197
|
+
if (!t || typeof t !== "object")
|
|
198
|
+
return bad("not an object");
|
|
199
|
+
const j = t;
|
|
200
|
+
if (j.schema !== TEMPLATE_JSON_SCHEMA)
|
|
201
|
+
bad(`schema is not ${TEMPLATE_JSON_SCHEMA}`);
|
|
202
|
+
if (j.name !== template)
|
|
203
|
+
bad("name does not match the requested template");
|
|
204
|
+
const img = j.image;
|
|
205
|
+
if (!img || img.file !== `${STIG_STORE.name}:import/${template}.qcow2` || img.format !== "qcow2" || !SHA256.test(img.sha256))
|
|
206
|
+
bad("image block is not the published qcow2");
|
|
207
|
+
const h = j.hardware;
|
|
208
|
+
if (!h || typeof h !== "object")
|
|
209
|
+
return bad("hardware missing");
|
|
210
|
+
for (const k of ["bios", "machine", "cpu", "scsihw", "ostype", "agent", "numa", "disk_options", "efidisk"])
|
|
211
|
+
if (typeof h[k] !== "string" || h[k] === "")
|
|
212
|
+
bad(`hardware.${k} missing`);
|
|
213
|
+
for (const k of ["cores", "sockets", "memory_mb"])
|
|
214
|
+
if (!Number.isInteger(h[k]) || h[k] < 1)
|
|
215
|
+
bad(`hardware.${k} must be a positive integer`);
|
|
216
|
+
if (typeof h.tags !== "string" || typeof j.description !== "string")
|
|
217
|
+
bad("tags or description missing");
|
|
218
|
+
return j;
|
|
219
|
+
}
|
|
220
|
+
/** The detached `qm create` + `qm template` script (sync.sh python heredoc). Bridge has no VLAN tag: the tag belongs to clones. */
|
|
221
|
+
export function buildQmCreateScript(a) {
|
|
222
|
+
const t = a.template;
|
|
223
|
+
const h = t.hardware;
|
|
224
|
+
const store = a.store ?? STIG_STORE.name;
|
|
225
|
+
const img = String(t.image.file).split(":").slice(1).join(":");
|
|
226
|
+
const args = ["qm", "create", String(a.vmid), "--name", t.name, "--bios", h.bios, "--machine", h.machine, "--cpu", h.cpu,
|
|
227
|
+
"--cores", String(h.cores), "--sockets", String(h.sockets), "--memory", String(h.memory_mb),
|
|
228
|
+
"--scsihw", h.scsihw, "--ostype", h.ostype, "--agent", h.agent, "--numa", h.numa,
|
|
229
|
+
"--net0", `virtio,bridge=${a.bridge}`, "--tags", h.tags, "--description", t.description,
|
|
230
|
+
"--efidisk0", `${a.thin}:1,${h.efidisk}`, "--ide0", `${a.thin}:cloudinit`,
|
|
231
|
+
"--scsi0", `${a.thin}:0,import-from=${store}:${img},${h.disk_options}`, "--boot", "order=scsi0"];
|
|
232
|
+
return `set -euo pipefail\n${args.map(shlexQuote).join(" ")}\nqm template ${a.vmid}\necho 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G,CAAC,iBAAiB,CAAC,CAAC,IAAI,UAAU,SAAS,IAAI,CAAC;AAC5G,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type StigNodeName } from "./nodes.js";
|
|
2
|
+
import type { StigDeps } from "./ports.js";
|
|
3
|
+
export declare const SYNC_CLAIM_TTL_HOURS = 6;
|
|
4
|
+
/** The detached job outlived the poll budget; it keeps running and nothing is cleaned up. Re-apply to keep waiting. */
|
|
5
|
+
export declare class StillRunningError extends Error {
|
|
6
|
+
constructor(what: string);
|
|
7
|
+
}
|
|
8
|
+
export interface PublishPlan {
|
|
9
|
+
mode: "plan";
|
|
10
|
+
template: string;
|
|
11
|
+
vmid: number | null;
|
|
12
|
+
buildNode: StigNodeName;
|
|
13
|
+
host: string;
|
|
14
|
+
store: string;
|
|
15
|
+
keepVersions: number;
|
|
16
|
+
noop: boolean;
|
|
17
|
+
force: boolean;
|
|
18
|
+
published: boolean;
|
|
19
|
+
receiptFound: boolean;
|
|
20
|
+
steps: readonly string[];
|
|
21
|
+
planDigest: string;
|
|
22
|
+
}
|
|
23
|
+
export interface SyncPlan {
|
|
24
|
+
mode: "plan";
|
|
25
|
+
template: string;
|
|
26
|
+
node: StigNodeName;
|
|
27
|
+
host: string;
|
|
28
|
+
claim: string;
|
|
29
|
+
claimNode: string;
|
|
30
|
+
vmid: number | null;
|
|
31
|
+
thin: string;
|
|
32
|
+
bridge: string;
|
|
33
|
+
noop: boolean;
|
|
34
|
+
syncMode: "synced" | "origin" | "already-present" | "adopted" | "resume";
|
|
35
|
+
poolPercent: number | null;
|
|
36
|
+
poolMaxPercent: number;
|
|
37
|
+
blockedBy: string | null;
|
|
38
|
+
steps: readonly string[];
|
|
39
|
+
planDigest: string;
|
|
40
|
+
}
|
|
41
|
+
export declare const PUBLISH_STEPS: readonly ["verify-published", "export", "template-json", "sign", "index", "upload", "prune", "verify", "receipt"];
|
|
42
|
+
export declare const SYNC_STEPS: readonly ["claim", "verify", "qm-create", "template", "renew", "receipt"];
|
|
43
|
+
export declare class StigDistribution {
|
|
44
|
+
private readonly d;
|
|
45
|
+
constructor(d: StigDeps);
|
|
46
|
+
private log;
|
|
47
|
+
private sh;
|
|
48
|
+
private buildNode;
|
|
49
|
+
private distDir;
|
|
50
|
+
/** true when index.json lists the template and the node-side verification (fingerprint, signatures, sha256) passes. */
|
|
51
|
+
private verifiedOn;
|
|
52
|
+
planPublish(i: {
|
|
53
|
+
template: string;
|
|
54
|
+
force?: boolean;
|
|
55
|
+
}): Promise<PublishPlan>;
|
|
56
|
+
publish(i: {
|
|
57
|
+
template: string;
|
|
58
|
+
force?: boolean;
|
|
59
|
+
apply?: boolean;
|
|
60
|
+
planDigest?: string;
|
|
61
|
+
receiptPath?: string;
|
|
62
|
+
manifestPath?: string;
|
|
63
|
+
}): Promise<any>;
|
|
64
|
+
private exec;
|
|
65
|
+
/** An unreachable node counts as busy: pruning is the one irreversible step. */
|
|
66
|
+
private anyNodeImporting;
|
|
67
|
+
planSync(i: {
|
|
68
|
+
template: string;
|
|
69
|
+
node: string;
|
|
70
|
+
}): Promise<SyncPlan>;
|
|
71
|
+
sync(i: {
|
|
72
|
+
template: string;
|
|
73
|
+
node: string;
|
|
74
|
+
apply?: boolean;
|
|
75
|
+
planDigest?: string;
|
|
76
|
+
}): Promise<any>;
|
|
77
|
+
/** Destroys a half-created VM (only if it is the one this sync named) and releases the claim. Never called once the template is final. */
|
|
78
|
+
private cleanup;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=distribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"distribution.d.ts","sourceRoot":"","sources":["../../../src/stig/distribution.ts"],"names":[],"mappings":"AAUA,OAAO,EAEU,KAAK,YAAY,EACjC,MAAM,YAAY,CAAC;AAOpB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAItC,uHAAuH;AACvH,q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