@decionis/agentsafe 0.7.0 → 0.8.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 +6 -1
- package/dist/Cli.js +13 -3
- package/dist/Cli.js.map +1 -1
- package/dist/acceptance/AcceptancePlan.d.ts +109 -0
- package/dist/acceptance/AcceptancePlan.d.ts.map +1 -0
- package/dist/acceptance/AcceptancePlan.js +128 -0
- package/dist/acceptance/AcceptancePlan.js.map +1 -0
- package/dist/acceptance/AcceptanceReport.d.ts +596 -0
- package/dist/acceptance/AcceptanceReport.d.ts.map +1 -0
- package/dist/acceptance/AcceptanceReport.js +361 -0
- package/dist/acceptance/AcceptanceReport.js.map +1 -0
- package/dist/acceptance/AcceptanceRun.d.ts +118 -0
- package/dist/acceptance/AcceptanceRun.d.ts.map +1 -0
- package/dist/acceptance/AcceptanceRun.js +419 -0
- package/dist/acceptance/AcceptanceRun.js.map +1 -0
- package/dist/acceptance/Coverage.d.ts +12 -0
- package/dist/acceptance/Coverage.d.ts.map +1 -0
- package/dist/acceptance/Coverage.js +48 -0
- package/dist/acceptance/Coverage.js.map +1 -0
- package/dist/acceptance/OutageDoubles.d.ts +34 -0
- package/dist/acceptance/OutageDoubles.d.ts.map +1 -0
- package/dist/acceptance/OutageDoubles.js +67 -0
- package/dist/acceptance/OutageDoubles.js.map +1 -0
- package/dist/acceptance/ZoneProbes.d.ts +368 -0
- package/dist/acceptance/ZoneProbes.d.ts.map +1 -0
- package/dist/acceptance/ZoneProbes.js +488 -0
- package/dist/acceptance/ZoneProbes.js.map +1 -0
- package/dist/adapters/JcsDigest.d.ts +6 -5
- package/dist/adapters/JcsDigest.d.ts.map +1 -1
- package/dist/adapters/JcsDigest.js +9 -8
- package/dist/adapters/JcsDigest.js.map +1 -1
- package/dist/cli/Accept.d.ts +9 -0
- package/dist/cli/Accept.d.ts.map +1 -0
- package/dist/cli/Accept.js +209 -0
- package/dist/cli/Accept.js.map +1 -0
- package/dist/cli/Actions.d.ts +6 -4
- package/dist/cli/Actions.d.ts.map +1 -1
- package/dist/cli/Actions.js +33 -7
- package/dist/cli/Actions.js.map +1 -1
- package/dist/cli/Commands.d.ts +1 -1
- package/dist/cli/Commands.d.ts.map +1 -1
- package/dist/cli/Commands.js +5 -0
- package/dist/cli/Commands.js.map +1 -1
- package/dist/cli/ConfigCommand.d.ts.map +1 -1
- package/dist/cli/ConfigCommand.js +5 -0
- package/dist/cli/ConfigCommand.js.map +1 -1
- package/dist/cli/Doctor.d.ts.map +1 -1
- package/dist/cli/Doctor.js +67 -1
- package/dist/cli/Doctor.js.map +1 -1
- package/dist/cli/Help.d.ts.map +1 -1
- package/dist/cli/Help.js +6 -1
- package/dist/cli/Help.js.map +1 -1
- package/dist/cli/Identity.d.ts +13 -1
- package/dist/cli/Identity.d.ts.map +1 -1
- package/dist/cli/Identity.js +25 -2
- package/dist/cli/Identity.js.map +1 -1
- package/dist/cli/Status.d.ts +23 -0
- package/dist/cli/Status.d.ts.map +1 -1
- package/dist/cli/Status.js +80 -18
- package/dist/cli/Status.js.map +1 -1
- package/dist/cli/VerifyAcceptance.d.ts +38 -0
- package/dist/cli/VerifyAcceptance.d.ts.map +1 -0
- package/dist/cli/VerifyAcceptance.js +143 -0
- package/dist/cli/VerifyAcceptance.js.map +1 -0
- package/dist/config/ExecutorConfig.d.ts +6 -1
- package/dist/config/ExecutorConfig.d.ts.map +1 -1
- package/dist/config/ExecutorConfig.js.map +1 -1
- package/dist/egress/ZoneHttpClient.d.ts +3 -0
- package/dist/egress/ZoneHttpClient.d.ts.map +1 -0
- package/dist/egress/ZoneHttpClient.js +72 -0
- package/dist/egress/ZoneHttpClient.js.map +1 -0
- package/dist/exposure/DecionisExposureLedger.d.ts +44 -0
- package/dist/exposure/DecionisExposureLedger.d.ts.map +1 -0
- package/dist/exposure/DecionisExposureLedger.js +175 -0
- package/dist/exposure/DecionisExposureLedger.js.map +1 -0
- package/dist/exposure/ExposureDeclaration.d.ts +68 -0
- package/dist/exposure/ExposureDeclaration.d.ts.map +1 -0
- package/dist/exposure/ExposureDeclaration.js +83 -0
- package/dist/exposure/ExposureDeclaration.js.map +1 -0
- package/dist/exposure/ExposureFacts.d.ts +61 -0
- package/dist/exposure/ExposureFacts.d.ts.map +1 -0
- package/dist/exposure/ExposureFacts.js +201 -0
- package/dist/exposure/ExposureFacts.js.map +1 -0
- package/dist/exposure/ExposureGate.d.ts +144 -0
- package/dist/exposure/ExposureGate.d.ts.map +1 -0
- package/dist/exposure/ExposureGate.js +446 -0
- package/dist/exposure/ExposureGate.js.map +1 -0
- package/dist/exposure/ExposureLedger.d.ts +93 -0
- package/dist/exposure/ExposureLedger.d.ts.map +1 -0
- package/dist/exposure/ExposureLedger.js +24 -0
- package/dist/exposure/ExposureLedger.js.map +1 -0
- package/dist/gateway/AttemptStore.d.ts +83 -0
- package/dist/gateway/AttemptStore.d.ts.map +1 -0
- package/dist/gateway/AttemptStore.js +229 -0
- package/dist/gateway/AttemptStore.js.map +1 -0
- package/dist/gateway/ForwardHandler.d.ts +29 -3
- package/dist/gateway/ForwardHandler.d.ts.map +1 -1
- package/dist/gateway/ForwardHandler.js +32 -5
- package/dist/gateway/ForwardHandler.js.map +1 -1
- package/dist/gateway/Gateway.d.ts +229 -17
- package/dist/gateway/Gateway.d.ts.map +1 -1
- package/dist/gateway/Gateway.js +1045 -81
- package/dist/gateway/Gateway.js.map +1 -1
- package/dist/gateway/GatewayConfig.d.ts +186 -0
- package/dist/gateway/GatewayConfig.d.ts.map +1 -1
- package/dist/gateway/GatewayConfig.js +219 -5
- package/dist/gateway/GatewayConfig.js.map +1 -1
- package/dist/gateway/GatewayManifest.d.ts +18 -0
- package/dist/gateway/GatewayManifest.d.ts.map +1 -0
- package/dist/gateway/GatewayManifest.js +42 -0
- package/dist/gateway/GatewayManifest.js.map +1 -0
- package/dist/gateway/GatewayMetrics.d.ts +12 -4
- package/dist/gateway/GatewayMetrics.d.ts.map +1 -1
- package/dist/gateway/GatewayMetrics.js +5 -0
- package/dist/gateway/GatewayMetrics.js.map +1 -1
- package/dist/gateway/GatewayReport.d.ts +34 -1
- package/dist/gateway/GatewayReport.d.ts.map +1 -1
- package/dist/gateway/GatewayReport.js +11 -0
- package/dist/gateway/GatewayReport.js.map +1 -1
- package/dist/gateway/HoldStore.d.ts +89 -0
- package/dist/gateway/HoldStore.d.ts.map +1 -0
- package/dist/gateway/HoldStore.js +280 -0
- package/dist/gateway/HoldStore.js.map +1 -0
- package/dist/gateway/InterceptedRequest.d.ts +10 -0
- package/dist/gateway/InterceptedRequest.d.ts.map +1 -1
- package/dist/gateway/InterceptedRequest.js +20 -0
- package/dist/gateway/InterceptedRequest.js.map +1 -1
- package/dist/gateway/RouteTable.d.ts +33 -5
- package/dist/gateway/RouteTable.d.ts.map +1 -1
- package/dist/gateway/RouteTable.js +76 -1
- package/dist/gateway/RouteTable.js.map +1 -1
- package/dist/gateway/ShadowLedger.d.ts +11 -0
- package/dist/gateway/ShadowLedger.d.ts.map +1 -1
- package/dist/gateway/ShadowLedger.js +11 -0
- package/dist/gateway/ShadowLedger.js.map +1 -1
- package/dist/gateway/TargetEffect.d.ts +74 -0
- package/dist/gateway/TargetEffect.d.ts.map +1 -0
- package/dist/gateway/TargetEffect.js +95 -0
- package/dist/gateway/TargetEffect.js.map +1 -0
- package/dist/gateway/TargetReader.d.ts +70 -0
- package/dist/gateway/TargetReader.d.ts.map +1 -0
- package/dist/gateway/TargetReader.js +106 -0
- package/dist/gateway/TargetReader.js.map +1 -0
- package/dist/gateway/Upstream.d.ts +15 -0
- package/dist/gateway/Upstream.d.ts.map +1 -1
- package/dist/gateway/Upstream.js +24 -2
- package/dist/gateway/Upstream.js.map +1 -1
- package/dist/hosted/TenantHost.d.ts +3 -2
- package/dist/hosted/TenantHost.d.ts.map +1 -1
- package/dist/hosted/TenantHost.js +7 -1
- package/dist/hosted/TenantHost.js.map +1 -1
- package/dist/hosted/TenantRegistry.d.ts +8 -0
- package/dist/hosted/TenantRegistry.d.ts.map +1 -1
- package/dist/hosted/TenantRegistry.js +14 -1
- package/dist/hosted/TenantRegistry.js.map +1 -1
- package/dist/http/GatewayHttpServer.d.ts +7 -0
- package/dist/http/GatewayHttpServer.d.ts.map +1 -1
- package/dist/http/GatewayHttpServer.js +57 -1
- package/dist/http/GatewayHttpServer.js.map +1 -1
- package/dist/outcomes/OutcomeEvidence.d.ts +4 -4
- package/dist/posture/ActionSpaceDrift.d.ts +40 -0
- package/dist/posture/ActionSpaceDrift.d.ts.map +1 -0
- package/dist/posture/ActionSpaceDrift.js +67 -0
- package/dist/posture/ActionSpaceDrift.js.map +1 -0
- package/dist/posture/DeploymentFingerprint.d.ts +88 -0
- package/dist/posture/DeploymentFingerprint.d.ts.map +1 -0
- package/dist/posture/DeploymentFingerprint.js +78 -0
- package/dist/posture/DeploymentFingerprint.js.map +1 -0
- package/dist/secrets/SecretStore.d.ts +6 -1
- package/dist/secrets/SecretStore.d.ts.map +1 -1
- package/dist/secrets/SecretStore.js.map +1 -1
- package/dist/service/EscalationResolver.d.ts +6 -6
- package/dist/service/EscalationResolver.d.ts.map +1 -1
- package/dist/service/EscalationResolver.js +8 -4
- package/dist/service/EscalationResolver.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type ContainmentVerdict } from "../containment/ContainmentProbe.js";
|
|
3
|
+
import type { DialOutcome } from "../egress/TcpProbe.js";
|
|
4
|
+
/**
|
|
5
|
+
* The acceptance run's "other routes" case, as the agent's zone observes it
|
|
6
|
+
* (ADR 0009). The tool runs these from the zone because only the zone can see
|
|
7
|
+
* them: whether an origin answers a read sent around the gateway, whether a
|
|
8
|
+
* verifying provider refuses a write the executor did not sign, which MCP
|
|
9
|
+
* servers answer a dial, which credentials the zone holds, and whether the
|
|
10
|
+
* cloud metadata endpoint answers.
|
|
11
|
+
*
|
|
12
|
+
* Every finding here is the zone's word. The gateway puts them in the signed
|
|
13
|
+
* report marked as reported by the zone, and its signature does not vouch for
|
|
14
|
+
* them: a compromised caller can report whatever it likes. They are read the
|
|
15
|
+
* way the containment probe's findings are read:
|
|
16
|
+
*
|
|
17
|
+
* - `REACHABLE` is proof of a hole. Something off the zone answered.
|
|
18
|
+
* - `CONTAINED` is consistent with enforcement and never establishes it. A
|
|
19
|
+
* drop looks like an outage. For an origin it also needs the same read to
|
|
20
|
+
* have succeeded through the gateway, which rules out the origin being down.
|
|
21
|
+
* - `INCONCLUSIVE` is anything else: a name that did not resolve, a control
|
|
22
|
+
* read that failed, a status that says neither yes nor no.
|
|
23
|
+
*
|
|
24
|
+
* Nothing here holds or sends a credential of the operator's. The direct read
|
|
25
|
+
* carries no header the module sets; the provider's write is sent with no
|
|
26
|
+
* signature, then with a key generated for the one request and discarded. A
|
|
27
|
+
* finding holds statuses, codes, names and kinds: never a header value, a
|
|
28
|
+
* body, or any part of a credential's value.
|
|
29
|
+
*/
|
|
30
|
+
export type ZoneVerdict = ContainmentVerdict;
|
|
31
|
+
/** Bounds on what the zone may report, which `zoneFindingsSchema` enforces. */
|
|
32
|
+
export declare const ZONE_LIMITS: Readonly<{
|
|
33
|
+
/** Origins, providers and MCP servers, each. */
|
|
34
|
+
targets: 64;
|
|
35
|
+
credentials: 512;
|
|
36
|
+
/** A plan label. */
|
|
37
|
+
name: 256;
|
|
38
|
+
/** A host and port, IPv6 brackets included. */
|
|
39
|
+
address: 300;
|
|
40
|
+
/** An environment variable's name, or a file's. */
|
|
41
|
+
credentialName: 1024;
|
|
42
|
+
}>;
|
|
43
|
+
/** A dial, as `egress/TcpProbe.ts` makes one. */
|
|
44
|
+
export type ZoneDial = (host: string, port: number, timeoutMs: number) => Promise<DialOutcome>;
|
|
45
|
+
/** One request the zone sends. */
|
|
46
|
+
export interface ZoneRequest {
|
|
47
|
+
readonly method: string;
|
|
48
|
+
readonly url: string;
|
|
49
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
50
|
+
readonly body: string | null;
|
|
51
|
+
readonly timeoutMs: number;
|
|
52
|
+
/** The most of the response body the probe reads. Zero reads none of it. */
|
|
53
|
+
readonly maxBodyBytes: number;
|
|
54
|
+
}
|
|
55
|
+
export interface ZoneResponse {
|
|
56
|
+
readonly status: number;
|
|
57
|
+
/** At most `maxBodyBytes` of the body, as UTF-8. */
|
|
58
|
+
readonly body: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The zone's HTTP client. Sockets open only under `src/http` and
|
|
62
|
+
* `src/egress`, so the client is handed in, as the containment probe is handed
|
|
63
|
+
* its dial. It must connect to the URL's own host, never through a proxy the
|
|
64
|
+
* environment names (`HTTP_PROXY`, `HTTPS_PROXY`, `NODE_USE_ENV_PROXY`); follow
|
|
65
|
+
* no redirect; send no header but the ones given and the ones HTTP framing
|
|
66
|
+
* needs; and reject with an error whose `code` names the failure, `ETIMEDOUT`
|
|
67
|
+
* when `timeoutMs` passes, as `node:http` does.
|
|
68
|
+
*/
|
|
69
|
+
export type ZoneHttp = (request: ZoneRequest) => Promise<ZoneResponse>;
|
|
70
|
+
export interface ZoneProbeOptions {
|
|
71
|
+
readonly dial: ZoneDial;
|
|
72
|
+
readonly http: ZoneHttp;
|
|
73
|
+
/** Per dial and per request. */
|
|
74
|
+
readonly timeoutMs?: number;
|
|
75
|
+
readonly clock?: () => Date;
|
|
76
|
+
}
|
|
77
|
+
export interface OriginProbeOptions extends ZoneProbeOptions {
|
|
78
|
+
/** The deployed gateway's base URL. The control read goes there, with the origin read's path and query. */
|
|
79
|
+
readonly gateway: string;
|
|
80
|
+
/** Sent on the control read only, such as a tenant key and the run's tag. Never on the direct read. */
|
|
81
|
+
readonly gatewayHeaders?: Readonly<Record<string, string>>;
|
|
82
|
+
}
|
|
83
|
+
export type McpProbeOptions = Omit<ZoneProbeOptions, "http">;
|
|
84
|
+
export interface MetadataProbeOptions extends ZoneProbeOptions {
|
|
85
|
+
/** The metadata endpoint, `http://169.254.169.254/` unless a test names another. */
|
|
86
|
+
readonly url?: string;
|
|
87
|
+
}
|
|
88
|
+
/** A target as the plan names it. */
|
|
89
|
+
export interface ZoneTarget {
|
|
90
|
+
readonly name: string;
|
|
91
|
+
readonly url: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* A verifying provider and the one write the plan names at its canary
|
|
95
|
+
* resource. `body` is the JSON text the write sends, or null for none.
|
|
96
|
+
*/
|
|
97
|
+
export interface ProviderTarget extends ZoneTarget {
|
|
98
|
+
readonly write: {
|
|
99
|
+
readonly method: string;
|
|
100
|
+
readonly path: string;
|
|
101
|
+
readonly body: string | null;
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
/** What one request came back with. */
|
|
105
|
+
export interface ZoneExchange {
|
|
106
|
+
/** The HTTP status, or null when no HTTP answer came back. */
|
|
107
|
+
readonly status: number | null;
|
|
108
|
+
/** `ANSWERED` when a status came back; otherwise why not, as a code. Never a message off the network. */
|
|
109
|
+
readonly detail: string;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* One origin's read, sent around the gateway and through it. `REACHABLE`
|
|
113
|
+
* when the direct dial was answered, an RST included, whatever the read then
|
|
114
|
+
* did; `CONTAINED` only when the direct dial met silence and the control read
|
|
115
|
+
* answered `2xx`; `INCONCLUSIVE` otherwise.
|
|
116
|
+
*/
|
|
117
|
+
export interface OriginFinding {
|
|
118
|
+
readonly name: string;
|
|
119
|
+
/** The origin's host and port. No path, query or header. */
|
|
120
|
+
readonly address: string;
|
|
121
|
+
/** The read sent straight to the origin, with no credential and no proxy. */
|
|
122
|
+
readonly direct: ZoneExchange;
|
|
123
|
+
/** The same read through the gateway: the control that tells a drop from an outage. */
|
|
124
|
+
readonly control: ZoneExchange;
|
|
125
|
+
readonly verdict: ZoneVerdict;
|
|
126
|
+
readonly at: string;
|
|
127
|
+
}
|
|
128
|
+
/** One write sent to a provider. */
|
|
129
|
+
export interface ProviderAttempt extends ZoneExchange {
|
|
130
|
+
/** The refusal's `reason_code`, when the body was JSON naming one as a code. The body is not kept. */
|
|
131
|
+
readonly reason_code: string | null;
|
|
132
|
+
}
|
|
133
|
+
/** The write signed with a key the provider cannot know. */
|
|
134
|
+
export interface ProviderSignedAttempt extends ProviderAttempt {
|
|
135
|
+
/** The `keyid` the signature named: generated for this request, held by nobody afterwards. */
|
|
136
|
+
readonly key_id: string;
|
|
137
|
+
}
|
|
138
|
+
/** `ACCEPTED` is a failure: a write the executor did not sign landed on the operator's canary. */
|
|
139
|
+
export type ProviderProbeVerdict = "REFUSED" | "ACCEPTED" | "INCONCLUSIVE";
|
|
140
|
+
/**
|
|
141
|
+
* A verifying provider's answer to writes it must refuse. `REFUSED` when both
|
|
142
|
+
* answered `4xx`; `ACCEPTED` when either answered `2xx`; `INCONCLUSIVE`
|
|
143
|
+
* otherwise. The signed write is not sent once the unattested one was
|
|
144
|
+
* accepted, since the finding is already a failure and a second write would
|
|
145
|
+
* only change the canary again: `signed` is then null.
|
|
146
|
+
*/
|
|
147
|
+
export interface ProviderFinding {
|
|
148
|
+
readonly name: string;
|
|
149
|
+
readonly unattested: ProviderAttempt;
|
|
150
|
+
readonly signed: ProviderSignedAttempt | null;
|
|
151
|
+
readonly verdict: ProviderProbeVerdict;
|
|
152
|
+
readonly at: string;
|
|
153
|
+
}
|
|
154
|
+
/** An MCP server's host and port, dialled and nothing more: no MCP message is sent. */
|
|
155
|
+
export interface McpFinding {
|
|
156
|
+
readonly name: string;
|
|
157
|
+
readonly address: string;
|
|
158
|
+
readonly verdict: ZoneVerdict;
|
|
159
|
+
/** Why, as a code. */
|
|
160
|
+
readonly detail: string;
|
|
161
|
+
readonly at: string;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* The cloud metadata endpoint, read with a bare `GET /`. `REACHABLE` when the
|
|
165
|
+
* dial was answered; otherwise the containment probe's verdict for the dial.
|
|
166
|
+
* There is no gateway path to compare with, so `CONTAINED` here has no
|
|
167
|
+
* control behind it.
|
|
168
|
+
*/
|
|
169
|
+
export interface MetadataFinding {
|
|
170
|
+
readonly address: string;
|
|
171
|
+
readonly status: number | null;
|
|
172
|
+
readonly detail: string;
|
|
173
|
+
readonly verdict: ZoneVerdict;
|
|
174
|
+
readonly at: string;
|
|
175
|
+
}
|
|
176
|
+
/** What a finding says a credential is. A fixed word, never derived from the value's text. */
|
|
177
|
+
export declare const CREDENTIAL_KINDS: readonly ["jwt", "pem-private-key", "url-with-userinfo", "aws-access-key", "aws-secret-key", "aws-session-token", "azure-client-secret", "github-token", "credential-file-path", "secret-like", "service-account-token", "web-identity-token", "aws-credentials", "gcp-credentials", "azure-cli-credentials", "kubeconfig", "docker-config", "netrc", "npmrc"];
|
|
178
|
+
export type CredentialKind = (typeof CREDENTIAL_KINDS)[number];
|
|
179
|
+
/**
|
|
180
|
+
* A credential the zone holds, by name and kind. `name` is the environment
|
|
181
|
+
* variable's name, a well-known file's path (`~/` for the home directory), or
|
|
182
|
+
* `$VARIABLE` for the file a variable names. `own` marks the run's own
|
|
183
|
+
* credentials, which are reported like any other.
|
|
184
|
+
*/
|
|
185
|
+
export interface CredentialFinding {
|
|
186
|
+
readonly source: "environment" | "file";
|
|
187
|
+
readonly name: string;
|
|
188
|
+
readonly kind: CredentialKind;
|
|
189
|
+
readonly own: boolean;
|
|
190
|
+
}
|
|
191
|
+
/** Everything the zone reports, as the tool sends it to the gateway when the run closes. */
|
|
192
|
+
export interface ZoneFindings {
|
|
193
|
+
readonly origins: readonly OriginFinding[];
|
|
194
|
+
readonly providers: readonly ProviderFinding[];
|
|
195
|
+
readonly mcp: readonly McpFinding[];
|
|
196
|
+
readonly credentials: readonly CredentialFinding[];
|
|
197
|
+
/** Null when the plan did not name the metadata endpoint. */
|
|
198
|
+
readonly metadata: MetadataFinding | null;
|
|
199
|
+
}
|
|
200
|
+
export declare const METADATA_URL = "http://169.254.169.254/";
|
|
201
|
+
/**
|
|
202
|
+
* Read one origin directly and through the gateway. The direct read is a
|
|
203
|
+
* `GET` of the plan's read URL with no header the probe sets, after a dial to
|
|
204
|
+
* its host and port; the control is the same path and query through the
|
|
205
|
+
* gateway, with the gateway's headers. Both are sent whatever the first one
|
|
206
|
+
* did, so the report shows the gateway path working beside every verdict.
|
|
207
|
+
*
|
|
208
|
+
* It establishes that an origin answered from the zone (`REACHABLE`). It
|
|
209
|
+
* never establishes that the origin is unreachable: `CONTAINED` says only that
|
|
210
|
+
* the zone met silence while the gateway's path worked.
|
|
211
|
+
*/
|
|
212
|
+
export declare function probeOrigin(origin: ZoneTarget, options: OriginProbeOptions): Promise<OriginFinding>;
|
|
213
|
+
/**
|
|
214
|
+
* Send the plan's write to a verifying provider twice, from the zone: first
|
|
215
|
+
* with no signature, then signed with a key the provider cannot know. A
|
|
216
|
+
* provider that holds the boundary refuses both with a `4xx`.
|
|
217
|
+
*
|
|
218
|
+
* It establishes how this provider answered these two requests. It does not
|
|
219
|
+
* establish that the provider refuses a grant replayed or altered after
|
|
220
|
+
* issuance: the zone holds no grant to try, and those refusals are the
|
|
221
|
+
* build's to show (the provider conformance vectors).
|
|
222
|
+
*/
|
|
223
|
+
export declare function probeProvider(provider: ProviderTarget, options: ZoneProbeOptions): Promise<ProviderFinding>;
|
|
224
|
+
/**
|
|
225
|
+
* Dial every MCP server's host and port once, in order. No MCP message is
|
|
226
|
+
* sent, so a finding says a server answered the zone, never that it would
|
|
227
|
+
* serve a tool call.
|
|
228
|
+
*/
|
|
229
|
+
export declare function probeMcp(servers: readonly ZoneTarget[], options: McpProbeOptions): Promise<McpFinding[]>;
|
|
230
|
+
/**
|
|
231
|
+
* Read the cloud metadata endpoint with a bare `GET /`: no header, no token,
|
|
232
|
+
* no path, and a short timeout. Run only when the plan names it. A metadata
|
|
233
|
+
* service that answers at all is reported as `REACHABLE`, since the headers
|
|
234
|
+
* it would need to hand out credentials are the zone's to send.
|
|
235
|
+
*/
|
|
236
|
+
export declare function probeMetadata(options: MetadataProbeOptions): Promise<MetadataFinding>;
|
|
237
|
+
export interface CredentialScanOptions {
|
|
238
|
+
readonly env: Readonly<Record<string, string | undefined>>;
|
|
239
|
+
/** The home directory the `~/` paths are read under. */
|
|
240
|
+
readonly home: string;
|
|
241
|
+
/** Whether a path exists. Files are never opened. */
|
|
242
|
+
readonly exists?: (path: string) => boolean;
|
|
243
|
+
/** The run's own credentials, by finding name: an environment variable, a file, or `$VARIABLE`. */
|
|
244
|
+
readonly own?: readonly string[];
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* List the credentials the zone holds, by name and kind, environment first in
|
|
248
|
+
* name order, then files in a fixed order.
|
|
249
|
+
*
|
|
250
|
+
* An environment variable is reported when its value is shaped like a JWT, a
|
|
251
|
+
* PEM private key, an AWS access key id or a URL with userinfo, when its name
|
|
252
|
+
* is one whose meaning is known, when its name reads as a credential's, or
|
|
253
|
+
* when the caller names it as the run's own. A variable with an empty value is
|
|
254
|
+
* not. The kind is the value's shape when it has one, then the known name's,
|
|
255
|
+
* then `secret-like`.
|
|
256
|
+
*
|
|
257
|
+
* A file is reported when it exists at a path where a credential is kept: the
|
|
258
|
+
* Kubernetes service-account token, the AWS, gcloud and Azure CLI stores,
|
|
259
|
+
* `~/.kube/config`, `~/.docker/config.json`, `~/.netrc`, `~/.npmrc`, and the
|
|
260
|
+
* files `GOOGLE_APPLICATION_CREDENTIALS` and its kin name. Files are never
|
|
261
|
+
* opened, so a file that holds no credential is reported too; and a variable
|
|
262
|
+
* that names a file is reported as `$VARIABLE`, since its value could be the
|
|
263
|
+
* credential itself rather than a path.
|
|
264
|
+
*
|
|
265
|
+
* It establishes what the zone holds at those names. It does not establish
|
|
266
|
+
* that the zone holds nothing else: a credential under an ordinary name, in an
|
|
267
|
+
* ordinary file, or in a process's memory is not seen.
|
|
268
|
+
*/
|
|
269
|
+
export declare function scanCredentials(options: CredentialScanOptions): CredentialFinding[];
|
|
270
|
+
/**
|
|
271
|
+
* The zone's findings, as the gateway parses them when a run closes. Closed
|
|
272
|
+
* at every level, bounded in every array and string, and with no field that
|
|
273
|
+
* can carry a credential's value: a kind is one of `CREDENTIAL_KINDS`, a
|
|
274
|
+
* detail and a reason are codes. It checks the form of what the zone said,
|
|
275
|
+
* not its truth.
|
|
276
|
+
*/
|
|
277
|
+
export declare const zoneFindingsSchema: z.ZodObject<{
|
|
278
|
+
origins: z.ZodArray<z.ZodObject<{
|
|
279
|
+
name: z.ZodString;
|
|
280
|
+
address: z.ZodString;
|
|
281
|
+
direct: z.ZodObject<{
|
|
282
|
+
status: z.ZodNullable<z.ZodInt>;
|
|
283
|
+
detail: z.ZodString;
|
|
284
|
+
}, z.core.$strict>;
|
|
285
|
+
control: z.ZodObject<{
|
|
286
|
+
status: z.ZodNullable<z.ZodInt>;
|
|
287
|
+
detail: z.ZodString;
|
|
288
|
+
}, z.core.$strict>;
|
|
289
|
+
verdict: z.ZodEnum<{
|
|
290
|
+
REACHABLE: "REACHABLE";
|
|
291
|
+
CONTAINED: "CONTAINED";
|
|
292
|
+
INCONCLUSIVE: "INCONCLUSIVE";
|
|
293
|
+
}>;
|
|
294
|
+
at: z.ZodISODateTime;
|
|
295
|
+
}, z.core.$strict>>;
|
|
296
|
+
providers: z.ZodArray<z.ZodObject<{
|
|
297
|
+
name: z.ZodString;
|
|
298
|
+
unattested: z.ZodObject<{
|
|
299
|
+
status: z.ZodNullable<z.ZodInt>;
|
|
300
|
+
reason_code: z.ZodNullable<z.ZodString>;
|
|
301
|
+
detail: z.ZodString;
|
|
302
|
+
}, z.core.$strict>;
|
|
303
|
+
signed: z.ZodNullable<z.ZodObject<{
|
|
304
|
+
key_id: z.ZodString;
|
|
305
|
+
status: z.ZodNullable<z.ZodInt>;
|
|
306
|
+
reason_code: z.ZodNullable<z.ZodString>;
|
|
307
|
+
detail: z.ZodString;
|
|
308
|
+
}, z.core.$strict>>;
|
|
309
|
+
verdict: z.ZodEnum<{
|
|
310
|
+
REFUSED: "REFUSED";
|
|
311
|
+
INCONCLUSIVE: "INCONCLUSIVE";
|
|
312
|
+
ACCEPTED: "ACCEPTED";
|
|
313
|
+
}>;
|
|
314
|
+
at: z.ZodISODateTime;
|
|
315
|
+
}, z.core.$strict>>;
|
|
316
|
+
mcp: z.ZodArray<z.ZodObject<{
|
|
317
|
+
name: z.ZodString;
|
|
318
|
+
address: z.ZodString;
|
|
319
|
+
verdict: z.ZodEnum<{
|
|
320
|
+
REACHABLE: "REACHABLE";
|
|
321
|
+
CONTAINED: "CONTAINED";
|
|
322
|
+
INCONCLUSIVE: "INCONCLUSIVE";
|
|
323
|
+
}>;
|
|
324
|
+
detail: z.ZodString;
|
|
325
|
+
at: z.ZodISODateTime;
|
|
326
|
+
}, z.core.$strict>>;
|
|
327
|
+
credentials: z.ZodArray<z.ZodObject<{
|
|
328
|
+
source: z.ZodEnum<{
|
|
329
|
+
file: "file";
|
|
330
|
+
environment: "environment";
|
|
331
|
+
}>;
|
|
332
|
+
name: z.ZodString;
|
|
333
|
+
kind: z.ZodEnum<{
|
|
334
|
+
jwt: "jwt";
|
|
335
|
+
"pem-private-key": "pem-private-key";
|
|
336
|
+
"url-with-userinfo": "url-with-userinfo";
|
|
337
|
+
"aws-access-key": "aws-access-key";
|
|
338
|
+
"aws-secret-key": "aws-secret-key";
|
|
339
|
+
"aws-session-token": "aws-session-token";
|
|
340
|
+
"azure-client-secret": "azure-client-secret";
|
|
341
|
+
"github-token": "github-token";
|
|
342
|
+
"credential-file-path": "credential-file-path";
|
|
343
|
+
"secret-like": "secret-like";
|
|
344
|
+
"service-account-token": "service-account-token";
|
|
345
|
+
"web-identity-token": "web-identity-token";
|
|
346
|
+
"aws-credentials": "aws-credentials";
|
|
347
|
+
"gcp-credentials": "gcp-credentials";
|
|
348
|
+
"azure-cli-credentials": "azure-cli-credentials";
|
|
349
|
+
kubeconfig: "kubeconfig";
|
|
350
|
+
"docker-config": "docker-config";
|
|
351
|
+
netrc: "netrc";
|
|
352
|
+
npmrc: "npmrc";
|
|
353
|
+
}>;
|
|
354
|
+
own: z.ZodBoolean;
|
|
355
|
+
}, z.core.$strict>>;
|
|
356
|
+
metadata: z.ZodNullable<z.ZodObject<{
|
|
357
|
+
address: z.ZodString;
|
|
358
|
+
status: z.ZodNullable<z.ZodInt>;
|
|
359
|
+
detail: z.ZodString;
|
|
360
|
+
verdict: z.ZodEnum<{
|
|
361
|
+
REACHABLE: "REACHABLE";
|
|
362
|
+
CONTAINED: "CONTAINED";
|
|
363
|
+
INCONCLUSIVE: "INCONCLUSIVE";
|
|
364
|
+
}>;
|
|
365
|
+
at: z.ZodISODateTime;
|
|
366
|
+
}, z.core.$strict>>;
|
|
367
|
+
}, z.core.$strict>;
|
|
368
|
+
//# sourceMappingURL=ZoneProbes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZoneProbes.d.ts","sourceRoot":"","sources":["../../src/acceptance/ZoneProbes.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAc,KAAK,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAGzF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGzD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,MAAM,WAAW,GAAG,kBAAkB,CAAC;AAE7C,+EAA+E;AAC/E,eAAO,MAAM,WAAW;IACtB,gDAAgD;;;IAGhD,oBAAoB;;IAEpB,+CAA+C;;IAE/C,mDAAmD;;EAEnD,CAAC;AAEH,iDAAiD;AACjD,MAAM,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;AAE/F,kCAAkC;AAClC,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,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