axstack 0.67.0 → 0.68.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/README.md +2 -2
- package/docs/host-operations.md +3 -6
- package/docs/installation.md +8 -8
- package/docs/workflows.md +5 -9
- package/package.json +2 -2
- package/skills/axstack/references/automations.md +3 -14
- package/skills/axstack/references/autopilot.md +1 -0
- package/skills/axstack/references/capture-receipts.md +22 -0
- package/skills/axstack/references/lifecycle.md +1 -1
- package/skills/axstack/references/live-run.md +59 -0
- package/skills/axstack/references/pr-shape.md +13 -16
- package/skills/axstack/references/review-manager-prompt.md +21 -19
- package/skills/axstack/references/run-record.md +2 -2
- package/skills/axstack/references/test-audit-weekly.md +1 -2
- package/skills/axstack/references/ui-verification.md +5 -3
- package/skills/axstack/references/workspace-hygiene.md +3 -0
- package/skills/axstack/sandbox/Dockerfile +28 -0
- package/skills/axstack/sandbox/host-execution.md +14 -0
- package/skills/axstack/sandbox/inventory.json +503 -0
- package/skills/axstack/sandbox/launcher-capture.js +63 -0
- package/skills/axstack/sandbox/launcher-contract.schema.json +341 -0
- package/skills/axstack/sandbox/launcher-contracts.js +35 -0
- package/skills/axstack/sandbox/launcher-docker.js +75 -0
- package/skills/axstack/sandbox/launcher-host-budget.json +10 -0
- package/skills/axstack/sandbox/launcher-host.js +165 -0
- package/skills/axstack/sandbox/launcher-host.json +5 -0
- package/skills/axstack/sandbox/launcher-image.json +4 -0
- package/skills/axstack/sandbox/launcher-interface.md +7 -0
- package/skills/axstack/sandbox/launcher-policy.js +135 -0
- package/skills/axstack/sandbox/launcher-policy.json +121 -0
- package/skills/axstack/sandbox/launcher-runtime.js +157 -0
- package/skills/axstack/sandbox/launcher-source.js +72 -0
- package/skills/axstack/sandbox/launcher.js +106 -0
- package/skills/axstack/sandbox/network-address.js +39 -0
- package/skills/axstack/sandbox/network-firewall.js +81 -0
- package/skills/axstack/sandbox/network-rules.js +86 -0
- package/skills/axstack/sandbox/network-runtime.js +109 -0
- package/skills/axstack/sandbox/network.js +49 -0
- package/skills/axstack/sandbox/probes-android-platform.xml +17 -0
- package/skills/axstack/sandbox/probes-check.js +185 -0
- package/skills/axstack/sandbox/probes-exec.js +20 -0
- package/skills/axstack/sandbox/probes-image-build.js +129 -0
- package/skills/axstack/sandbox/probes-image-pins.json +370 -0
- package/skills/axstack/sandbox/probes-link-local.js +25 -0
- package/skills/axstack/sandbox/probes-storage.js +33 -0
- package/skills/axstack/sandbox/probes-udp.js +44 -0
- package/skills/axstack/sandbox/probes.js +239 -0
- package/skills/axstack/sandbox/proxy-command.js +6 -0
- package/skills/axstack/sandbox/proxy-config.json +9 -0
- package/skills/axstack/sandbox/proxy-dns.js +114 -0
- package/skills/axstack/sandbox/proxy-policy.js +22 -0
- package/skills/axstack/sandbox/proxy.js +119 -0
- package/skills/axstack/sandbox/reap.md +7 -0
- package/skills/axstack/sandbox/sidecars.json +153 -0
- package/skills/axstack/sandbox/storage-checks.js +39 -0
- package/skills/axstack/sandbox/storage-cleanup.js +49 -0
- package/skills/axstack/sandbox/storage-execution.js +110 -0
- package/skills/axstack/sandbox/storage-plan.js +78 -0
- package/skills/axstack/sandbox/storage-support.js +91 -0
- package/skills/axstack/sandbox/storage.js +75 -0
- package/skills/axstack/scripts/archive-evidence.js +2 -2
- package/skills/axstack/scripts/capture-identity.js +122 -0
- package/skills/axstack/scripts/check-run.js +248 -0
- package/skills/axstack/scripts/check-staged-file-tokens.js +6 -3
- package/skills/axstack/scripts/command-capture.js +81 -0
- package/skills/axstack/scripts/evidence-inspector.js +182 -0
- package/skills/axstack/scripts/git-argv.js +6 -0
- package/skills/axstack/scripts/image-evidence.js +183 -0
- package/skills/axstack/scripts/pr-shape.js +54 -29
- package/skills/axstack/scripts/readiness-run.js +3 -75
- package/skills/axstack/scripts/readiness.js +2 -2
- package/skills/axstack/scripts/run-init.js +13 -11
- package/skills/axstack/scripts/schedule-drift.js +5 -3
- package/skills/axstack-audit/references/record.md +1 -1
- package/skills/axstack-explain/references/inline-pages.md +8 -4
- package/skills/axstack-implement/SKILL.md +6 -5
- package/skills/axstack-review/references/candidate-brief.md +12 -21
- package/skills/axstack-review/references/codebase-brief.md +1 -0
- package/skills/axstack-review/references/codebase-mode.md +4 -1
- package/skills/axstack-review/references/codebase-report.md +2 -1
- package/skills/axstack-review/references/review-candidate.md +2 -2
- package/skills/axstack-review/references/review-receipt.md +8 -3
- package/skills/axstack-verify/SKILL.md +10 -4
- package/skills/axstack-watch/references/proven-verification.md +3 -2
- package/skills/axstack-watch/references/readiness.md +56 -61
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { execute, hold } from './probes-exec.js';
|
|
2
|
+
|
|
3
|
+
const helper = `${import.meta.dir}/probes-check.js`;
|
|
4
|
+
const required = ['addresses', 'listeners', 'docker-networks', 'docker-containers', 'tailnet'];
|
|
5
|
+
const validRun = (runId) => { if (typeof runId !== 'string' || !/^[a-zA-Z0-9][\w.-]{0,100}$/.test(runId)) throw Error('invalid run identity'); };
|
|
6
|
+
const strip = (address) => address.replace(/\/\d+$/, '').replace(/%[^%]+$/, '');
|
|
7
|
+
|
|
8
|
+
/** Injectable command boundary; defaults execute only trusted host observers/probes. */
|
|
9
|
+
export function createProbeTools({ runner = execute } = {}) {
|
|
10
|
+
/** @param {{runId:string,networks:import('./launcher-contracts.js').Network[]}} input */
|
|
11
|
+
async function enumerateTargets({ runId, networks }) {
|
|
12
|
+
validRun(runId);
|
|
13
|
+
if (!Array.isArray(networks)) throw Error('networks must be an array');
|
|
14
|
+
const terms = [], targets = [];
|
|
15
|
+
const add = (kind, address, port, protocol, evidence, prefix = kind) => {
|
|
16
|
+
if (typeof address !== 'string' || !address || (/\s/.test(address) || address.includes(String.fromCharCode(0)))) throw Error('invalid observed address');
|
|
17
|
+
if (port !== null && (!Number.isInteger(port) || port < 1 || port > 65535)) throw Error('invalid observed port');
|
|
18
|
+
const id = `${prefix}:${address}:${port ?? '-'}:${protocol}`;
|
|
19
|
+
if (!targets.some((t) => t.id === id)) targets.push({ id, kind, address, port, protocol, evidence: [evidence] });
|
|
20
|
+
};
|
|
21
|
+
async function observe(id, argv, parse) {
|
|
22
|
+
try {
|
|
23
|
+
const result = await runner(argv);
|
|
24
|
+
if (result.exitCode !== 0 || result.timedOut || result.truncated) throw Error(`observer exit ${result.exitCode}`);
|
|
25
|
+
await parse(result.stdout);
|
|
26
|
+
terms.push({ id, status: 'pass', evidence: [JSON.stringify(argv), result.stdout] });
|
|
27
|
+
} catch (error) { terms.push({ id, status: 'unknown', evidence: [JSON.stringify(argv), String(error)] }); }
|
|
28
|
+
}
|
|
29
|
+
let addresses = [];
|
|
30
|
+
const hostZones = new Map();
|
|
31
|
+
await observe('addresses', ['ip', '-j', 'address', 'show'], (out) => {
|
|
32
|
+
const rows = JSON.parse(out);
|
|
33
|
+
if (!Array.isArray(rows) || !rows.length) throw Error('missing host interfaces');
|
|
34
|
+
addresses = rows.flatMap((row) => {
|
|
35
|
+
if (row.ifname) { hostZones.set(String(row.ifindex), row.ifname); hostZones.set(row.ifname, row.ifname); }
|
|
36
|
+
if (!Array.isArray(row.addr_info)) throw Error('missing interface addresses');
|
|
37
|
+
return row.addr_info.filter((a) => ['inet', 'inet6'].includes(a.family)).map((a) => {
|
|
38
|
+
if (a.family === 'inet6' && a.scope === 'link' && !row.ifname) throw Error('host link-local zone missing');
|
|
39
|
+
return strip(a.local) + (a.family === 'inet6' && a.scope === 'link' ? `%${row.ifname}` : '');
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
if (!addresses.length) throw Error('missing host addresses');
|
|
43
|
+
for (const address of addresses) add('host-address', address, null, 'icmp', JSON.stringify({ observer: 'ip address show', address }));
|
|
44
|
+
});
|
|
45
|
+
await observe('listeners', ['ss', '-H', '-lntu'], (out) => {
|
|
46
|
+
for (const row of out.trim().split('\n').filter(Boolean)) {
|
|
47
|
+
const fields = row.trim().split(/\s+/), protocol = fields[0];
|
|
48
|
+
const local = fields[4]?.match(/^(.*):(\d+)$/);
|
|
49
|
+
if (!['tcp', 'udp'].includes(protocol) || !local) throw Error(`unparsed listener: ${row}`);
|
|
50
|
+
const raw = local[1].replace(/^\[|\]$/g, ''), zone = raw.split('%')[1];
|
|
51
|
+
if (zone && !hostZones.has(zone)) throw Error('listener zone unknown');
|
|
52
|
+
const address = strip(raw) + (zone ? `%${hostZones.get(zone)}` : ''), port = Number(local[2]);
|
|
53
|
+
const wildcard = ['*', '0.0.0.0', '::'].includes(address);
|
|
54
|
+
const bound = wildcard ? addresses : [address];
|
|
55
|
+
if (!bound.length) throw Error('wildcard listener without addresses');
|
|
56
|
+
for (const host of bound) add('host-listener', host, port, protocol, row);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
let ids = [], inspected = [], containerIds = [];
|
|
60
|
+
await observe('docker-networks', ['docker', 'network', 'ls', '--no-trunc', '--format', '{{.ID}}'], async (out) => {
|
|
61
|
+
ids = out.trim().split(/\s+/).filter(Boolean).sort();
|
|
62
|
+
if (!ids.length || ids.some((id) => !/^[a-f0-9]{12,64}$/.test(id))) throw Error('missing/invalid Docker networks');
|
|
63
|
+
const result = await runner(['docker', 'network', 'inspect', ...ids]);
|
|
64
|
+
if (result.exitCode !== 0 || result.timedOut || result.truncated) throw Error('network inspect failed');
|
|
65
|
+
inspected = JSON.parse(result.stdout);
|
|
66
|
+
if (inspected.length !== ids.length || new Set(inspected.map((n) => n.Id)).size !== ids.length) throw Error('incomplete network inspect');
|
|
67
|
+
for (const net of inspected) {
|
|
68
|
+
const addressless = (net.Driver === 'host' && net.Name === 'host' || net.Driver === 'null' && net.Name === 'none') && net.IPAM?.Config === null;
|
|
69
|
+
if (!ids.includes(net.Id) || !net.IPAM || !addressless && !Array.isArray(net.IPAM.Config) || !net.Containers) throw Error('incomplete Docker network');
|
|
70
|
+
for (const config of net.IPAM.Config ?? []) if (config.Gateway) add('gateway', strip(config.Gateway), null, 'icmp', JSON.stringify({ networkId: net.Id, name: net.Name, ...config }));
|
|
71
|
+
const own = networks.some((n) => n.id === net.Id || n.name === net.Name);
|
|
72
|
+
for (const [id, container] of Object.entries(net.Containers)) {
|
|
73
|
+
containerIds.push(id);
|
|
74
|
+
for (const field of ['IPv4Address', 'IPv6Address']) if (container[field]) {
|
|
75
|
+
add(own ? 'fixed' : 'other-container', strip(container[field]), null, 'icmp', JSON.stringify({ networkId: net.Id, name: net.Name, containerId: id, ...container }), own ? `container|${container.Name}` : 'other-container');
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (networks.some((n) => !inspected.some((live) => n.id === live.Id || n.name === live.Name))) throw Error('run network missing');
|
|
80
|
+
const after = await runner(['docker', 'network', 'ls', '--no-trunc', '--format', '{{.ID}}']);
|
|
81
|
+
if (after.exitCode !== 0 || after.timedOut || after.truncated || JSON.stringify(after.stdout.trim().split(/\s+/).filter(Boolean).sort()) !== JSON.stringify(ids)) throw Error('Docker networks changed during enumeration');
|
|
82
|
+
});
|
|
83
|
+
containerIds = [...new Set(containerIds)].sort();
|
|
84
|
+
const sidecars = await Bun.file(new URL('./sidecars.json', import.meta.url)).json();
|
|
85
|
+
await observe('docker-containers', ['docker', 'ps', '--no-trunc', '--format', '{{.ID}}'], async (out) => {
|
|
86
|
+
const running = out.trim().split(/\s+/).filter(Boolean).sort();
|
|
87
|
+
if (running.some((id) => !/^[a-f0-9]{12,64}$/.test(id))) throw Error('invalid running container identity');
|
|
88
|
+
const requested = [...new Set([...containerIds, ...running])].sort();
|
|
89
|
+
if (!requested.length) return;
|
|
90
|
+
const result = await runner(['docker', 'inspect', '--type', 'container', ...requested]);
|
|
91
|
+
if (result.exitCode !== 0 || result.timedOut || result.truncated) throw Error('container inspect failed');
|
|
92
|
+
const rows = JSON.parse(result.stdout);
|
|
93
|
+
if (rows.length !== requested.length || new Set(rows.map((c) => c.Id)).size !== requested.length) throw Error('incomplete container inspect');
|
|
94
|
+
for (const c of rows) {
|
|
95
|
+
if (!requested.includes(c.Id) || !c.NetworkSettings?.Networks || !c.Config) throw Error('incomplete container facts');
|
|
96
|
+
if (!Object.keys(c.NetworkSettings.Networks).length && !['none', 'host'].includes(c.HostConfig?.NetworkMode)) throw Error('container network mode unknown');
|
|
97
|
+
for (const [name, net] of Object.entries(c.NetworkSettings.Networks)) {
|
|
98
|
+
const snapshot = inspected.find((n) => n.Name === name);
|
|
99
|
+
if (!snapshot?.Containers[c.Id]) throw Error('container membership changed');
|
|
100
|
+
for (const [key, value] of [['IPAddress', 'IPv4Address'], ['GlobalIPv6Address', 'IPv6Address']]) {
|
|
101
|
+
if ((net[key] || '') !== strip(snapshot.Containers[c.Id][value] || '')) throw Error('container address changed');
|
|
102
|
+
}
|
|
103
|
+
if (!networks.some((n) => n.profile === 'service' && n.name === name)) continue;
|
|
104
|
+
if (!sidecars.images.some((image) => image.image === c.Config.Image)) continue;
|
|
105
|
+
if (!c.State?.Running || !Number.isInteger(c.State.Pid) || c.State.Pid < 2) throw Error('sidecar not running');
|
|
106
|
+
const sockets = await runner(['nsenter', '--target', String(c.State.Pid), '--net', '--', 'ss', '-H', '-lntu']);
|
|
107
|
+
if (sockets.exitCode !== 0 || sockets.timedOut || sockets.truncated) throw Error('sidecar listener enumeration unavailable');
|
|
108
|
+
let found = false;
|
|
109
|
+
for (const line of sockets.stdout.trim().split('\n').filter(Boolean)) {
|
|
110
|
+
const fields = line.trim().split(/\s+/), local = fields[4]?.match(/^(.*):(\d+)$/);
|
|
111
|
+
if (!local || !['tcp', 'udp'].includes(fields[0])) throw Error('unparsed sidecar listener');
|
|
112
|
+
// Inventoried sidecars provide TCP services. UDP UNCONN rows here
|
|
113
|
+
// include outbound DNS/telemetry clients, not declared UDP services.
|
|
114
|
+
if (fields[0] === 'udp') continue;
|
|
115
|
+
const bind = strip(local[1].replace(/^\[|\]$/g, ''));
|
|
116
|
+
for (const address of [net.IPAddress, net.GlobalIPv6Address].filter(Boolean)) {
|
|
117
|
+
if (bind !== address && bind !== '*' && bind !== (address.includes(':') ? '::' : '0.0.0.0')) continue;
|
|
118
|
+
add('fixed', address, Number(local[2]), fields[0], sockets.stdout, `service|${c.Name.replace(/^\//, '')}`);
|
|
119
|
+
found = true;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (!found) throw Error(`sidecar has no reachable listener: ${c.Name}`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
await observe('tailnet', ['tailscale', 'status', '--json'], (out) => {
|
|
127
|
+
const data = JSON.parse(out);
|
|
128
|
+
if (data.BackendState !== 'Running' || !data.Self?.DNSName || !data.Peer || data.Health?.length) throw Error('incomplete/unhealthy tailnet');
|
|
129
|
+
for (const peer of [data.Self, ...Object.values(data.Peer)]) {
|
|
130
|
+
if (!Array.isArray(peer.TailscaleIPs) || !peer.TailscaleIPs.length) throw Error('peer without addresses');
|
|
131
|
+
for (const address of peer.TailscaleIPs) add('tailnet', address, null, 'icmp', JSON.stringify({ dnsName: peer.DNSName, address }));
|
|
132
|
+
}
|
|
133
|
+
for (const protocol of ['tcp', 'udp']) {
|
|
134
|
+
add('dns', data.Self.DNSName, 53, protocol, JSON.stringify({ dnsName: data.Self.DNSName, resolver: '100.100.100.100' }), 'tailnet-dns');
|
|
135
|
+
add('dns', data.Self.DNSName, 53, protocol, JSON.stringify({ dnsName: data.Self.DNSName, resolver: '127.0.0.11' }), 'tailnet-dns-stub');
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
for (const address of ['1.1.1.1', '2606:4700:4700::1111', '169.254.169.254', 'fd00:ec2::254', '127.0.0.1', '::1', '10.0.0.1', '172.16.0.1', '192.168.0.1', '100.64.0.1', 'fc00::1', 'fe80::1']) add('fixed', address, 443, 'tcp', 'W3-4 fixed destinations', 'direct');
|
|
139
|
+
add('fixed', 'example.com', 443, 'tcp', 'W3-4 arbitrary HTTPS', 'arbitrary-https');
|
|
140
|
+
add('fixed', 'dl.google.com', 443, 'tcp', 'Inventoried allowed root redirects to www.google.com outside the frozen allowlist', 'redirect');
|
|
141
|
+
for (const protocol of ['tcp', 'udp']) {
|
|
142
|
+
add('dns', 'example.com', 53, protocol, 'W3-4 external DNS', 'external-dns');
|
|
143
|
+
add('dns', 'example.com', 53, protocol, 'W3-4 embedded DNS', 'external-dns-stub');
|
|
144
|
+
}
|
|
145
|
+
for (const address of ['169.254.169.254', 'fd00:ec2::254']) add('fixed', address, 80, 'tcp', 'W3-4 metadata HTTP', 'direct');
|
|
146
|
+
const inventory = await Bun.file(new URL('./inventory.json', import.meta.url)).json();
|
|
147
|
+
for (const address of inventory.registryAllowlist) add('fixed', address, 443, 'tcp', 'inventory.json#/registryAllowlist', 'registry');
|
|
148
|
+
return { runId, terms, targets: targets.sort((a, b) => a.id.localeCompare(b.id)) };
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Synchronous wire-data expansion: no command or observer is executed here.
|
|
152
|
+
function planProbes({ runId, containers, networks, enumeration, storage }) {
|
|
153
|
+
validRun(runId);
|
|
154
|
+
if (enumeration?.runId !== runId) throw Error('stale enumeration run identity');
|
|
155
|
+
if (!containers.length || new Set(containers.map((c) => c.id)).size !== containers.length) throw Error('missing/duplicate containers');
|
|
156
|
+
const probes = [], proxy = containers.find((c) => c.role === 'proxy');
|
|
157
|
+
const add = (container, position, expected, targetIds, args) => probes.push({ id: String(probes.length), containerId: container.id, position, expected, targetIds, argv: [process.execPath, helper, ...args] });
|
|
158
|
+
for (const c of containers) {
|
|
159
|
+
if (c.networkIds.some((id) => !networks.some((n) => n.id === id))) throw Error('unknown container network');
|
|
160
|
+
const position = c.role === 'proxy' ? 'proxy-bypassed' : c.networkIds.length === 0 ? 'none' : c.networkIds.some((id) => networks.find((n) => n.id === id)?.profile === 'service') ? 'service' : 'fetch';
|
|
161
|
+
add(c, position, 'non-root-empty-caps', [], ['identity', c.id]);
|
|
162
|
+
for (const target of enumeration.targets) {
|
|
163
|
+
if (target.id.startsWith('container|')) continue;
|
|
164
|
+
if (target.id.startsWith('redirect:') && position !== 'fetch') continue;
|
|
165
|
+
const registry = target.id.startsWith('registry:'), service = target.id.startsWith('service|');
|
|
166
|
+
const publicTarget = ['1.1.1.1', '2606:4700:4700::1111', 'example.com'].includes(target.address) || registry;
|
|
167
|
+
const allowed = (registry && position === 'fetch') || (service && position === 'service') || (position === 'proxy-bypassed' && publicTarget && !target.id.startsWith('tailnet-dns'));
|
|
168
|
+
const redirect = target.id.startsWith('redirect:');
|
|
169
|
+
const viaProxy = position === 'fetch' && (registry || redirect || target.id.startsWith('arbitrary-https:'));
|
|
170
|
+
if (viaProxy && !proxy) throw Error('fetch proxy missing');
|
|
171
|
+
const endpoint = [target.kind, target.address, target.port, target.protocol, ...(target.kind === 'dns' ? [target.id] : redirect ? [null, true] : service ? [null, false, true] : [])];
|
|
172
|
+
const args = ['network', c.id, allowed ? 'allow' : 'deny', JSON.stringify(endpoint), ...(viaProxy ? [proxy.id] : [])];
|
|
173
|
+
add(c, position, allowed ? 'allow' : 'deny', [target.id], args);
|
|
174
|
+
}
|
|
175
|
+
const mounting = storage.volumeName && c.argv?.some(arg => arg.split(',').some(part => part === `source=${storage.volumeName}` || part === `src=${storage.volumeName}`));
|
|
176
|
+
const templates = storage.checks.filter(step => step.containerId === null);
|
|
177
|
+
const checks = storage.checks.filter(step => step.containerId === c.id);
|
|
178
|
+
if (mounting && templates.length) {
|
|
179
|
+
if (!['non-root', 'filesystem', 'total-size'].every(id => templates.some(step => step.id === id))) throw Error(`missing capped filesystem check for ${c.id}`);
|
|
180
|
+
checks.push({ argv: [process.execPath, `${import.meta.dir}/probes-storage.js`, JSON.stringify(storage), c.id] });
|
|
181
|
+
}
|
|
182
|
+
if (mounting && !checks.length) throw Error(`missing capped filesystem check for ${c.id}`);
|
|
183
|
+
for (const check of checks) {
|
|
184
|
+
// D owns exact type/total-size verification and its non-root container argv.
|
|
185
|
+
probes.push({ id: String(probes.length), containerId: c.id, position, expected: 'capped-filesystem', targetIds: [], argv: [...check.argv] });
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return probes;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/** @param {{plan:import('./launcher-contracts.js').Plan,onPlan?:(plan:import('./launcher-contracts.js').Plan)=>Promise<void>}} input
|
|
192
|
+
* The trusted launcher callback persists the final fresh target set before probes.
|
|
193
|
+
* Failed persistence or any failed/unknown observation throws a sandbox hold.
|
|
194
|
+
*/
|
|
195
|
+
async function runProbes({ plan, onPlan }) {
|
|
196
|
+
validRun(plan.runId);
|
|
197
|
+
const original = planProbes(plan);
|
|
198
|
+
if (!original.length || JSON.stringify(original) !== JSON.stringify(plan.probes)) throw hold('probe plan incomplete or changed', []);
|
|
199
|
+
const fresh = await enumerateTargets({ runId: plan.runId, networks: plan.networks });
|
|
200
|
+
const incomplete = required.some((id) => !fresh.terms.some((t) => t.id === id && t.status === 'pass'));
|
|
201
|
+
if (incomplete || fresh.terms.some((t) => t.status !== 'pass')) throw hold('incomplete target enumeration', fresh.terms);
|
|
202
|
+
const identity = (e) => JSON.stringify(e.targets.map(({ evidence: _e, ...t }) => t).sort((a, b) => a.id.localeCompare(b.id)));
|
|
203
|
+
if (plan.enumeration?.runId !== plan.runId || !onPlan && identity(fresh) !== identity(plan.enumeration)) throw hold('target enumeration changed; replan this run', fresh.terms);
|
|
204
|
+
const canonical = planProbes({ ...plan, enumeration: fresh });
|
|
205
|
+
// The launcher persists this exact fresh target set before any socket probe.
|
|
206
|
+
// Standalone callers without that binding still hold on changed targets.
|
|
207
|
+
if (onPlan) { plan.enumeration = fresh; plan.probes = canonical; await onPlan(plan); }
|
|
208
|
+
const results = new Array(canonical.length), serial = [], parallel = [];
|
|
209
|
+
const targets = new Map(fresh.targets.map(t => [t.id, t]));
|
|
210
|
+
canonical.forEach((probe, i) => {
|
|
211
|
+
const target = targets.get(probe.targetIds[0]);
|
|
212
|
+
// All reserved-source-port UDP proofs share one lane, including containers
|
|
213
|
+
// that share a bridge. Other trusted clients use at most fifteen lanes.
|
|
214
|
+
(probe.expected === 'deny' && target?.protocol === 'udp' && target.kind !== 'dns' ? serial : parallel).push(i);
|
|
215
|
+
});
|
|
216
|
+
let failed;
|
|
217
|
+
async function probeAt(i) {
|
|
218
|
+
const probe = canonical[i];
|
|
219
|
+
let term;
|
|
220
|
+
try {
|
|
221
|
+
const r = await runner(probe.argv);
|
|
222
|
+
const reported = probe.expected === 'capped-filesystem' ? (r.exitCode === 0 ? 'pass' : 'fail') : JSON.parse(r.stdout).status;
|
|
223
|
+
const status = r.timedOut || r.truncated ? 'unknown' : reported === 'unknown' ? 'unknown' : r.exitCode !== 0 ? 'fail' : reported;
|
|
224
|
+
term = { id: probe.id, status: ['pass', 'fail', 'unknown'].includes(status) ? status : 'unknown', evidence: [JSON.stringify(r)] };
|
|
225
|
+
} catch (error) { term = { id: probe.id, status: 'unknown', evidence: [String(error)] }; }
|
|
226
|
+
results[i] = term;
|
|
227
|
+
if (term.status !== 'pass' && !failed) failed = term;
|
|
228
|
+
}
|
|
229
|
+
async function lane(queue) {
|
|
230
|
+
while (!failed && queue.length) await probeAt(queue.shift());
|
|
231
|
+
}
|
|
232
|
+
await Promise.all([lane(serial), ...Array.from({ length: Math.min(15, parallel.length) }, () => lane(parallel))]);
|
|
233
|
+
if (failed) throw hold(`probe ${failed.id} ${failed.status}`, [...results.filter(t => t && t !== failed), failed]);
|
|
234
|
+
return results;
|
|
235
|
+
}
|
|
236
|
+
return { enumerateTargets, planProbes, runProbes };
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export const { enumerateTargets, planProbes, runProbes } = createProbeTools();
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Build trusted assets once at module load, without writing an image or a file.
|
|
2
|
+
// The synchronous planner can then record the exact executable bytes in argv.
|
|
3
|
+
const build = await Bun.build({ entrypoints: [`${import.meta.dir}/proxy.js`], target: 'bun' });
|
|
4
|
+
if (!build.success || build.outputs.length !== 1) throw Error('Trusted proxy bundle failed');
|
|
5
|
+
const source = await build.outputs[0].text();
|
|
6
|
+
export function proxyArgv() { return ['bun', '--eval', source]; }
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"image": "oven/bun@sha256:e10577f0db68676a7024391c6e5cb4b879ebd17188ab750cf10024a6d700e5c4",
|
|
4
|
+
"allowlistFile": "inventory.json",
|
|
5
|
+
"allowlistPointer": "/registryAllowlist",
|
|
6
|
+
"resolverIpv4": "1.1.1.1",
|
|
7
|
+
"resolverIpv6": "2606:4700:4700::1111",
|
|
8
|
+
"port": 3128
|
|
9
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import config from './proxy-config.json';
|
|
2
|
+
|
|
3
|
+
function question(hostname, type, id) {
|
|
4
|
+
const labels = hostname.split('.');
|
|
5
|
+
if (hostname.length > 253 || labels.some(label => !/^[a-z0-9-]{1,63}$/.test(label))) throw Error('Invalid DNS name');
|
|
6
|
+
const bytes = Buffer.from(labels.flatMap(label => [label.length, ...Buffer.from(label)]));
|
|
7
|
+
const packet = Buffer.alloc(12 + bytes.length + 5);
|
|
8
|
+
packet.writeUInt16BE(id, 0); packet.writeUInt16BE(0x100, 2); packet.writeUInt16BE(1, 4);
|
|
9
|
+
bytes.copy(packet, 12); packet.writeUInt16BE(type, packet.length - 4); packet.writeUInt16BE(1, packet.length - 2);
|
|
10
|
+
return packet;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Follow compression pointers only to earlier packet positions; bounds and cycles fail closed.
|
|
14
|
+
function nameAt(packet, start) {
|
|
15
|
+
const labels = [];
|
|
16
|
+
let cursor = start;
|
|
17
|
+
let end;
|
|
18
|
+
for (let count = 0; count < 128; count++) {
|
|
19
|
+
if (cursor >= packet.length) throw Error('Truncated DNS name');
|
|
20
|
+
const length = packet[cursor++];
|
|
21
|
+
if (length === 0) return { name: labels.join('.').toLowerCase(), end: end ?? cursor };
|
|
22
|
+
if ((length & 0xc0) === 0xc0) {
|
|
23
|
+
if (cursor >= packet.length) throw Error('Truncated DNS pointer');
|
|
24
|
+
const pointer = ((length & 0x3f) << 8) | packet[cursor++];
|
|
25
|
+
if (pointer >= cursor - 2) throw Error('Invalid DNS pointer');
|
|
26
|
+
end ??= cursor; cursor = pointer;
|
|
27
|
+
} else {
|
|
28
|
+
if (length > 63 || cursor + length > packet.length) throw Error('Invalid DNS label');
|
|
29
|
+
labels.push(packet.subarray(cursor, cursor + length).toString('ascii')); cursor += length;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
throw Error('DNS compression loop');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function parseDnsAnswer(packet, query) {
|
|
36
|
+
if (packet.length < 12 || packet.readUInt16BE(0) !== query.readUInt16BE(0)) throw Error('Wrong DNS transaction');
|
|
37
|
+
const flags = packet.readUInt16BE(2);
|
|
38
|
+
if ((flags & 0xfa0f) !== 0x8000 || packet.readUInt16BE(4) !== 1) throw Error('DNS error or truncated response');
|
|
39
|
+
const expected = nameAt(query, 12);
|
|
40
|
+
const questionName = nameAt(packet, 12);
|
|
41
|
+
if (questionName.name !== expected.name || !packet.subarray(questionName.end, questionName.end + 4).equals(query.subarray(expected.end, expected.end + 4))) throw Error('Wrong DNS question');
|
|
42
|
+
const type = query.readUInt16BE(expected.end);
|
|
43
|
+
let offset = questionName.end + 4;
|
|
44
|
+
const records = [];
|
|
45
|
+
const answers = packet.readUInt16BE(6), authorities = packet.readUInt16BE(8);
|
|
46
|
+
const count = answers + authorities;
|
|
47
|
+
const zones = [];
|
|
48
|
+
if (count > 256) throw Error('Oversized DNS answer');
|
|
49
|
+
for (let i = 0; i < count; i++) {
|
|
50
|
+
const owner = nameAt(packet, offset); offset = owner.end;
|
|
51
|
+
if (offset + 10 > packet.length) throw Error('Truncated DNS record');
|
|
52
|
+
const kind = packet.readUInt16BE(offset), klass = packet.readUInt16BE(offset + 2), size = packet.readUInt16BE(offset + 8);
|
|
53
|
+
offset += 10;
|
|
54
|
+
if (offset + size > packet.length || klass !== 1) throw Error('Invalid DNS record');
|
|
55
|
+
if (i >= answers && kind === 6) {
|
|
56
|
+
const primary = nameAt(packet, offset), contact = nameAt(packet, primary.end);
|
|
57
|
+
if (contact.end + 20 !== offset + size) throw Error('Invalid DNS SOA');
|
|
58
|
+
zones.push(owner.name);
|
|
59
|
+
}
|
|
60
|
+
if ((kind === 1 && size !== 4) || (kind === 28 && size !== 16)) throw Error('Invalid DNS address length');
|
|
61
|
+
let address;
|
|
62
|
+
if (kind === 1 && size === 4) address = [...packet.subarray(offset, offset + size)].join('.');
|
|
63
|
+
else if (kind === 28 && size === 16) address = Array.from({ length: 8 }, (_, i) => packet.readUInt16BE(offset + i * 2).toString(16)).join(':');
|
|
64
|
+
else if (kind === 5) {
|
|
65
|
+
const cname = nameAt(packet, offset);
|
|
66
|
+
if (cname.end !== offset + size) throw Error('Invalid DNS CNAME');
|
|
67
|
+
records.push({ owner: owner.name, cname: cname.name });
|
|
68
|
+
}
|
|
69
|
+
if (i < answers && kind === type && address) records.push({ owner: owner.name, address });
|
|
70
|
+
offset += size;
|
|
71
|
+
}
|
|
72
|
+
const reachable = new Set([expected.name]);
|
|
73
|
+
for (let i = 0; i <= records.length; i++) for (const record of records) if (record.cname && reachable.has(record.owner)) reachable.add(record.cname);
|
|
74
|
+
const addresses = records.filter(record => record.address && reachable.has(record.owner)).map(record => record.address);
|
|
75
|
+
if (!addresses.length) {
|
|
76
|
+
let terminal = expected.name;
|
|
77
|
+
const seen = new Set();
|
|
78
|
+
while (records.some(record => record.owner === terminal && record.cname)) {
|
|
79
|
+
if (seen.has(terminal)) throw Error('DNS alias cycle');
|
|
80
|
+
seen.add(terminal);
|
|
81
|
+
const aliases = records.filter(record => record.owner === terminal && record.cname);
|
|
82
|
+
if (aliases.length !== 1) throw Error('Ambiguous DNS alias');
|
|
83
|
+
terminal = aliases[0].cname;
|
|
84
|
+
}
|
|
85
|
+
if (!zones.some(zone => terminal === zone || terminal.endsWith(`.${zone}`))) throw Error('Incomplete DNS NODATA answer');
|
|
86
|
+
}
|
|
87
|
+
return addresses;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
async function udpExchange(packet, resolver) {
|
|
91
|
+
return new Promise((resolve, reject) => {
|
|
92
|
+
let socket;
|
|
93
|
+
let done = false;
|
|
94
|
+
const finish = (error, response) => { if (done) return; done = true; clearTimeout(timer); socket?.close(); if (error) reject(error); else resolve(response); };
|
|
95
|
+
const timer = setTimeout(() => finish(Error('Fixed public DNS timed out')), 3000);
|
|
96
|
+
Bun.udpSocket({ connect: { hostname: resolver, port: 53 }, socket: {
|
|
97
|
+
data: (_socket, bytes) => finish(null, Buffer.from(bytes)),
|
|
98
|
+
error: (_socket, error) => finish(error),
|
|
99
|
+
} }).then(opened => { socket = opened; if (done) socket.close(); else if (!socket.send(packet)) finish(Error('DNS send failed')); }, error => finish(error));
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export async function resolveRegistry(hostname, { exchange = udpExchange } = {}) {
|
|
104
|
+
// Both families must be known. Never fall back to libc, Docker DNS or tailnet DNS.
|
|
105
|
+
const answers = await Promise.all([1, 28].map(async type => {
|
|
106
|
+
const query = question(hostname, type, crypto.getRandomValues(new Uint16Array(1))[0]);
|
|
107
|
+
let lastError;
|
|
108
|
+
for (const resolver of [config.resolverIpv4, config.resolverIpv6]) {
|
|
109
|
+
try { return parseDnsAnswer(await exchange(query, resolver), query); } catch (error) { lastError = error; }
|
|
110
|
+
}
|
|
111
|
+
throw lastError;
|
|
112
|
+
}));
|
|
113
|
+
return answers.flat();
|
|
114
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import inventory from './inventory.json';
|
|
2
|
+
import config from './proxy-config.json';
|
|
3
|
+
import { ipAddress, publicDestination } from './network-address.js';
|
|
4
|
+
|
|
5
|
+
export async function authorizeTunnel({ authority, resolve, hostAddresses }) {
|
|
6
|
+
if (typeof authority !== 'string' || !/^[a-z0-9.-]+:443$/.test(authority)) throw Error('Denied CONNECT authority');
|
|
7
|
+
const hostname = authority.slice(0, -4);
|
|
8
|
+
if (!inventory.registryAllowlist.includes(hostname)) throw Error('Registry not allowlisted');
|
|
9
|
+
const addresses = await resolve(hostname);
|
|
10
|
+
if (!Array.isArray(addresses) || !addresses.length || addresses.some(address => !publicDestination(address, hostAddresses))) throw Error('Non-public or host destination denied');
|
|
11
|
+
return { hostname, addresses: [...new Set(addresses.map(address => ipAddress(address).text))] };
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function proxyEnvironment(environment) {
|
|
15
|
+
const allowlist = JSON.parse(environment.AXSTACK_PROXY_ALLOWLIST);
|
|
16
|
+
const resolvers = JSON.parse(environment.AXSTACK_PROXY_RESOLVERS);
|
|
17
|
+
const hostAddresses = JSON.parse(environment.AXSTACK_PROXY_HOST_ADDRESSES);
|
|
18
|
+
if (JSON.stringify(allowlist) !== JSON.stringify(inventory.registryAllowlist) || JSON.stringify(resolvers) !== JSON.stringify([config.resolverIpv4, config.resolverIpv6]) || environment.AXSTACK_PROXY_PORT !== String(config.port)) throw Error('Changed fixed proxy environment');
|
|
19
|
+
if (!Array.isArray(hostAddresses) || !hostAddresses.length) throw Error('Missing host address facts');
|
|
20
|
+
hostAddresses.forEach(ipAddress);
|
|
21
|
+
return { resolvers, hostAddresses, port: config.port };
|
|
22
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { authorizeTunnel, proxyEnvironment } from './proxy-policy.js';
|
|
2
|
+
import { resolveRegistry } from './proxy-dns.js';
|
|
3
|
+
|
|
4
|
+
// B owns argv/caps. proxy-command.js bundles only these trusted package assets.
|
|
5
|
+
export function startProxy({ port, hostAddresses, resolve = resolveRegistry, connect = Bun.connect, listen = Bun.listen }) {
|
|
6
|
+
const sessions = new Set();
|
|
7
|
+
// Retain at most 1 MiB per direction, with peer reads paused on pressure.
|
|
8
|
+
const maxBufferedBytes = 1048576;
|
|
9
|
+
function close(session) {
|
|
10
|
+
if (session.closed) return;
|
|
11
|
+
session.closed = true;
|
|
12
|
+
session.client?.terminate(); session.upstream?.terminate(); sessions.delete(session);
|
|
13
|
+
}
|
|
14
|
+
function finish(socket) {
|
|
15
|
+
if (!socket || socket.data.session.closed || socket.data.finished) return;
|
|
16
|
+
socket.data.ending = true;
|
|
17
|
+
if (!socket.data.pending.length) { socket.data.finished = true; socket.end(); }
|
|
18
|
+
}
|
|
19
|
+
function ended(socket) {
|
|
20
|
+
const session = socket.data.session;
|
|
21
|
+
socket.data.readEnded = true;
|
|
22
|
+
finish(socket === session.client ? session.upstream : session.client);
|
|
23
|
+
}
|
|
24
|
+
function disconnected(socket) {
|
|
25
|
+
const session = socket.data.session;
|
|
26
|
+
socket.data.disconnected = true;
|
|
27
|
+
if (!session.upstream) { close(session); return; }
|
|
28
|
+
ended(socket);
|
|
29
|
+
if (session.client.data.disconnected && session.upstream.data.disconnected) sessions.delete(session);
|
|
30
|
+
}
|
|
31
|
+
function flush(socket, bytes = Buffer.alloc(0), source) {
|
|
32
|
+
const state = socket.data;
|
|
33
|
+
if (state.session.closed || state.finished) return;
|
|
34
|
+
if (source) state.source = source;
|
|
35
|
+
const pending = state.pending.length ? Buffer.concat([state.pending, bytes]) : bytes;
|
|
36
|
+
const sent = socket.write(pending);
|
|
37
|
+
if (sent < 0) { close(state.session); return; }
|
|
38
|
+
state.pending = pending.subarray(sent);
|
|
39
|
+
if (state.pending.length > maxBufferedBytes) { close(state.session); return; }
|
|
40
|
+
// Stop reading the peer while its destination is backpressured.
|
|
41
|
+
// The fixed pending cap still rejects oversized/in-flight bursts.
|
|
42
|
+
if (state.pending.length) state.source?.pause();
|
|
43
|
+
else if (state.ending) finish(socket);
|
|
44
|
+
else state.source?.resume();
|
|
45
|
+
}
|
|
46
|
+
function deny(session) {
|
|
47
|
+
if (session.closed) return;
|
|
48
|
+
session.client.end('HTTP/1.1 403 Forbidden\r\nConnection: close\r\nContent-Length: 0\r\n\r\n');
|
|
49
|
+
}
|
|
50
|
+
async function establish(session, header) {
|
|
51
|
+
try {
|
|
52
|
+
const lines = header.split('\r\n');
|
|
53
|
+
const request = /^CONNECT ([^ ]+) HTTP\/1\.[01]$/.exec(lines.shift());
|
|
54
|
+
if (!request) throw Error('HTTPS CONNECT required');
|
|
55
|
+
const hosts = [];
|
|
56
|
+
for (const line of lines.filter(Boolean)) {
|
|
57
|
+
const match = /^([A-Za-z0-9-]+):[ \t]*([^\r\n]*)$/.exec(line);
|
|
58
|
+
if (!match) throw Error('Malformed proxy header');
|
|
59
|
+
const name = match[1].toLowerCase(), value = match[2].trim();
|
|
60
|
+
if (name === 'host') hosts.push(value);
|
|
61
|
+
if (name === 'transfer-encoding' || (name === 'content-length' && value !== '0')) throw Error('Unexpected CONNECT body');
|
|
62
|
+
}
|
|
63
|
+
if (hosts.length > 1 || (hosts.length === 1 && hosts[0] !== request[1])) throw Error('Mismatched CONNECT host');
|
|
64
|
+
const target = await authorizeTunnel({ authority: request[1], resolve, hostAddresses });
|
|
65
|
+
if (session.closed) return;
|
|
66
|
+
// Connect to the validated numeric address. No second DNS lookup or fallback.
|
|
67
|
+
const upstream = await connect({ allowHalfOpen: true, hostname: target.addresses[0], port: 443, data: { session, pending: Buffer.alloc(0) }, socket: {
|
|
68
|
+
data: (socket, bytes) => flush(session.client, Buffer.from(bytes), socket),
|
|
69
|
+
drain: socket => flush(socket),
|
|
70
|
+
end: ended, close: disconnected, error: () => close(session), timeout: () => close(session),
|
|
71
|
+
} });
|
|
72
|
+
if (session.closed) { upstream.terminate(); return; }
|
|
73
|
+
session.upstream = upstream; upstream.timeout(30);
|
|
74
|
+
session.client.timeout(30);
|
|
75
|
+
flush(session.client, Buffer.from('HTTP/1.1 200 Connection Established\r\n\r\n'));
|
|
76
|
+
if (session.waiting.length) flush(upstream, session.waiting, session.client);
|
|
77
|
+
session.waiting = Buffer.alloc(0);
|
|
78
|
+
if (session.client.data.readEnded) finish(upstream);
|
|
79
|
+
} catch (error) { console.error('proxy tunnel denied:', String(error.message).slice(0, 256)); deny(session); }
|
|
80
|
+
}
|
|
81
|
+
const listener = listen({ allowHalfOpen: true, hostname: '::', port, data: undefined, socket: {
|
|
82
|
+
open(client) {
|
|
83
|
+
const session = { client, upstream: null, waiting: Buffer.alloc(0), header: Buffer.alloc(0), connecting: false, closed: false };
|
|
84
|
+
client.data = { session, pending: Buffer.alloc(0) };
|
|
85
|
+
sessions.add(session); client.timeout(5);
|
|
86
|
+
if (sessions.size > 128) close(session);
|
|
87
|
+
},
|
|
88
|
+
data(client, bytes) {
|
|
89
|
+
const session = client.data.session;
|
|
90
|
+
if (session.closed) return;
|
|
91
|
+
if (session.upstream) { flush(session.upstream, Buffer.from(bytes), client); return; }
|
|
92
|
+
if (session.connecting) {
|
|
93
|
+
session.waiting = Buffer.concat([session.waiting, bytes]);
|
|
94
|
+
if (session.waiting.length > maxBufferedBytes) close(session);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
session.header = Buffer.concat([session.header, bytes]);
|
|
98
|
+
const end = session.header.indexOf('\r\n\r\n');
|
|
99
|
+
if (session.header.length > 16384) { deny(session); return; }
|
|
100
|
+
if (end < 0) return;
|
|
101
|
+
session.connecting = true;
|
|
102
|
+
session.waiting = session.header.subarray(end + 4);
|
|
103
|
+
const header = session.header.subarray(0, end).toString('ascii');
|
|
104
|
+
session.header = Buffer.alloc(0);
|
|
105
|
+
void establish(session, header);
|
|
106
|
+
},
|
|
107
|
+
drain: socket => flush(socket),
|
|
108
|
+
end: ended, close: disconnected, error: socket => close(socket.data.session), timeout: socket => close(socket.data.session),
|
|
109
|
+
} });
|
|
110
|
+
return { port: listener.port, stop() { for (const session of sessions) close(session); listener.stop(true); } };
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (import.meta.main) {
|
|
114
|
+
if (process.argv.includes('--help')) console.log('Usage: proxy.js [--help]\nSide effects: binds TCP 3128; sends A/AAAA DNS only to fixed public resolvers; opens HTTPS tunnels only to inventory registry names after checking every answer. No files, credentials, host resolver or redirects followed. HTTP/direct-IP/non-443 destinations are denied; redirected clients must pass a new allowlist check. Limits: 128 tunnels, 16 KiB headers, 1 MiB pending per direction, 5s handshake/30s idle. Exit: 1 invalid fixed environment.');
|
|
115
|
+
else {
|
|
116
|
+
try { startProxy(proxyEnvironment(process.env)); }
|
|
117
|
+
catch (error) { console.error(error.message); process.exitCode = 1; }
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Review-manager reap
|
|
2
|
+
|
|
3
|
+
Use installed [launcher](launcher.js) from trusted cwd `/`:
|
|
4
|
+
`bun --no-env-file <resolved-launcher> reap`.
|
|
5
|
+
If reap fails or Docker is missing, run full pass, record stdout/stderr,
|
|
6
|
+
exit and limitation in pass evidence and continuity, and continue.
|
|
7
|
+
Uncertain cleanup holds sandbox execution; review code and CI.
|