@knowttl/tenable-axi 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +341 -2
- package/axi-credential.schema.json +28 -0
- package/bin/tenable-axi-hook.js +13 -0
- package/bin/tenable-axi.js +8 -0
- package/bin/version.js +3 -0
- package/dist/src/attack-catalogue.d.ts +176 -0
- package/dist/src/attack-catalogue.js +71 -0
- package/dist/src/attack-export-catalogue.d.ts +29 -0
- package/dist/src/attack-export-catalogue.js +58 -0
- package/dist/src/attack-export.d.ts +5 -0
- package/dist/src/attack-export.js +151 -0
- package/dist/src/attack.d.ts +3 -0
- package/dist/src/attack.js +287 -0
- package/dist/src/catalogue.d.ts +150 -0
- package/dist/src/catalogue.js +68 -0
- package/dist/src/cli.d.ts +11 -0
- package/dist/src/cli.js +61 -0
- package/dist/src/export-file.d.ts +8 -0
- package/dist/src/export-file.js +157 -0
- package/dist/src/exposure-contracts.d.ts +31 -0
- package/dist/src/exposure-contracts.js +31 -0
- package/dist/src/exposure.d.ts +4 -0
- package/dist/src/exposure.js +305 -0
- package/dist/src/hook-install.d.ts +1 -0
- package/dist/src/hook-install.js +132 -0
- package/dist/src/inventory/schema.d.ts +34 -0
- package/dist/src/inventory/schema.js +18 -0
- package/dist/src/inventory-catalogue.d.ts +55 -0
- package/dist/src/inventory-catalogue.js +61 -0
- package/dist/src/inventory-export-catalogue.d.ts +96 -0
- package/dist/src/inventory-export-catalogue.js +47 -0
- package/dist/src/inventory-export.d.ts +5 -0
- package/dist/src/inventory-export.js +162 -0
- package/dist/src/inventory.d.ts +3 -0
- package/dist/src/inventory.js +285 -0
- package/dist/src/local-commands.d.ts +2 -0
- package/dist/src/local-commands.js +44 -0
- package/dist/src/platform-tag-catalogue.d.ts +101 -0
- package/dist/src/platform-tag-catalogue.js +180 -0
- package/dist/src/platform-tag.d.ts +4 -0
- package/dist/src/platform-tag.js +312 -0
- package/dist/src/private-file.d.ts +18 -0
- package/dist/src/private-file.js +156 -0
- package/dist/src/profiles.d.ts +116 -0
- package/dist/src/profiles.js +147 -0
- package/dist/src/redact.d.ts +7 -0
- package/dist/src/redact.js +41 -0
- package/dist/src/response-catalogue.d.ts +41 -0
- package/dist/src/response-catalogue.js +134 -0
- package/dist/src/response.d.ts +4 -0
- package/dist/src/response.js +227 -0
- package/dist/src/setup.d.ts +1 -0
- package/dist/src/setup.js +39 -0
- package/dist/src/transport-core.d.ts +85 -0
- package/dist/src/transport-core.js +274 -0
- package/dist/src/transport.d.ts +4 -0
- package/dist/src/transport.js +6 -0
- package/dist/src/writes-core.d.ts +112 -0
- package/dist/src/writes-core.js +215 -0
- package/dist/src/writes.d.ts +57 -0
- package/dist/src/writes.js +5 -0
- package/docs/commands.md +1377 -0
- package/inventory/capabilities.json +3728 -0
- package/package.json +24 -4
- package/skills/tenable-axi/SKILL.md +101 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { chmodSync, closeSync, constants, existsSync, fstatSync, fsyncSync, lstatSync, mkdirSync, openSync, readFileSync, renameSync, unlinkSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { execFileSync } from "node:child_process";
|
|
3
|
+
import { randomUUID } from "node:crypto";
|
|
4
|
+
import { homedir } from "node:os";
|
|
5
|
+
import { dirname, isAbsolute, join, win32 } from "node:path";
|
|
6
|
+
import { AxiError } from "axi-sdk-js";
|
|
7
|
+
export const windowsAcl = (path, action, directory) => {
|
|
8
|
+
const quoted = `'${path.replaceAll("'", "''")}'`;
|
|
9
|
+
const script = `$ErrorActionPreference='Stop'; $p=${quoted}; $item=Get-Item -LiteralPath $p -Force; `
|
|
10
|
+
+ `if (($item.Attributes -band [IO.FileAttributes]::ReparsePoint) -ne 0) { throw 'Reparse point' }; `
|
|
11
|
+
+ `$sid=[Security.Principal.WindowsIdentity]::GetCurrent().User; $allowed=@($sid.Value,'S-1-5-18','S-1-5-32-544'); `
|
|
12
|
+
+ (action === "check" ? "" : action === "restrict"
|
|
13
|
+
? `$acl=New-Object Security.AccessControl.${directory ? "DirectorySecurity" : "FileSecurity"}; $acl.SetOwner($sid); $acl.SetAccessRuleProtection($true,$false); `
|
|
14
|
+
+ `foreach ($s in $allowed) { $id=New-Object Security.Principal.SecurityIdentifier($s); $rule=New-Object Security.AccessControl.FileSystemAccessRule($id,'FullControl','${directory ? "ContainerInherit,ObjectInherit" : "None"}','None','Allow'); $acl.AddAccessRule($rule) }; Set-Acl -LiteralPath $p -AclObject $acl`
|
|
15
|
+
: `$acl=Get-Acl -LiteralPath $p; if (!$acl.AreAccessRulesProtected -or ($acl.Owner -ne $sid.Translate([Security.Principal.NTAccount]).Value -and $acl.Owner -ne $sid.Value)) { throw 'Unprotected ACL' }; `
|
|
16
|
+
+ `$seen=@(); foreach ($r in $acl.Access) { $s=$r.IdentityReference.Translate([Security.Principal.SecurityIdentifier]).Value; if ($s -notin $allowed -or $r.IsInherited -or $r.AccessControlType -ne 'Allow' -or $r.FileSystemRights -ne [Security.AccessControl.FileSystemRights]::FullControl) { throw 'Unexpected ACL' }; $seen+=$s }; foreach ($s in $allowed) { if ($s -notin $seen) { throw 'Missing ACL' } }`);
|
|
17
|
+
execFileSync("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", script], { stdio: "pipe" });
|
|
18
|
+
};
|
|
19
|
+
export function toolDirectory(kind, env = process.env, platform = process.platform, home = homedir()) {
|
|
20
|
+
if (platform === "win32") {
|
|
21
|
+
const base = env[kind === "config" ? "APPDATA" : "LOCALAPPDATA"];
|
|
22
|
+
return win32.join(base && win32.isAbsolute(base) ? base : win32.join(home, "AppData", kind === "config" ? "Roaming" : "Local"), "tenable-axi");
|
|
23
|
+
}
|
|
24
|
+
const xdg = env[kind === "config" ? "XDG_CONFIG_HOME" : "XDG_STATE_HOME"];
|
|
25
|
+
return join(xdg && isAbsolute(xdg) ? xdg : join(home, kind === "config" ? ".config" : ".local/state"), "tenable-axi");
|
|
26
|
+
}
|
|
27
|
+
export function privateFiles(options = {}) {
|
|
28
|
+
const platform = options.platform ?? process.platform;
|
|
29
|
+
const acl = options.acl ?? windowsAcl;
|
|
30
|
+
const insecure = (path) => {
|
|
31
|
+
throw new AxiError(`Insecure private file: ${path}`, "CONFIG_INSECURE", [
|
|
32
|
+
platform === "win32" ? `Apply a protected DACL granting only the current user, SYSTEM and Administrators to ${path}` : `chmod 600 '${path.replaceAll("'", "'\\''")}'`,
|
|
33
|
+
]);
|
|
34
|
+
};
|
|
35
|
+
function validate(stat, path, secret) {
|
|
36
|
+
if (!stat.isFile() || stat.isSymbolicLink())
|
|
37
|
+
insecure(path);
|
|
38
|
+
if (platform !== "win32" && (stat.uid !== (options.uid ?? process.getuid()) || (stat.mode & (secret ? 0o077 : 0o022)) !== 0))
|
|
39
|
+
insecure(path);
|
|
40
|
+
}
|
|
41
|
+
function check(path, secret = false, verifyAcl = false) {
|
|
42
|
+
validate(lstatSync(path), path, secret);
|
|
43
|
+
if (platform === "win32") {
|
|
44
|
+
try {
|
|
45
|
+
acl(path, verifyAcl ? "verify" : "check", false);
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
insecure(path);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function read(path, secret = false, verifyAcl = false) {
|
|
53
|
+
check(path, secret, verifyAcl);
|
|
54
|
+
const fd = openSync(path, constants.O_RDONLY | (platform === "win32" ? 0 : constants.O_NOFOLLOW));
|
|
55
|
+
try {
|
|
56
|
+
validate(fstatSync(fd), path, secret);
|
|
57
|
+
return readFileSync(fd, "utf8");
|
|
58
|
+
}
|
|
59
|
+
finally {
|
|
60
|
+
closeSync(fd);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function flushDirectory(path) {
|
|
64
|
+
if (platform === "win32")
|
|
65
|
+
return;
|
|
66
|
+
const fd = openSync(path, "r");
|
|
67
|
+
try {
|
|
68
|
+
fsyncSync(fd);
|
|
69
|
+
}
|
|
70
|
+
finally {
|
|
71
|
+
closeSync(fd);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function directory(path) {
|
|
75
|
+
const first = mkdirSync(path, { recursive: true, ...(platform === "win32" ? {} : { mode: 0o700 }) });
|
|
76
|
+
let current = path;
|
|
77
|
+
for (;;) {
|
|
78
|
+
const stat = lstatSync(current);
|
|
79
|
+
if (stat.isSymbolicLink() || !stat.isDirectory() || (platform !== "win32" && stat.uid !== (options.uid ?? process.getuid())))
|
|
80
|
+
insecure(current);
|
|
81
|
+
try {
|
|
82
|
+
if (platform === "win32")
|
|
83
|
+
acl(current, "restrict", true);
|
|
84
|
+
else
|
|
85
|
+
chmodSync(current, 0o700);
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
insecure(current);
|
|
89
|
+
}
|
|
90
|
+
if (first)
|
|
91
|
+
flushDirectory(current);
|
|
92
|
+
if (!first || current === first)
|
|
93
|
+
break;
|
|
94
|
+
current = dirname(current);
|
|
95
|
+
}
|
|
96
|
+
if (first)
|
|
97
|
+
flushDirectory(dirname(first));
|
|
98
|
+
}
|
|
99
|
+
function write(path, content) {
|
|
100
|
+
directory(dirname(path));
|
|
101
|
+
if (existsSync(path))
|
|
102
|
+
check(path, true);
|
|
103
|
+
const temporary = join(dirname(path), `.${randomUUID()}.tmp`);
|
|
104
|
+
let fd;
|
|
105
|
+
try {
|
|
106
|
+
fd = openSync(temporary, "wx", platform === "win32" ? undefined : 0o600);
|
|
107
|
+
if (platform === "win32") {
|
|
108
|
+
try {
|
|
109
|
+
acl(temporary, "restrict", false);
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
insecure(temporary);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
writeFileSync(fd, content, "utf8");
|
|
116
|
+
fsyncSync(fd);
|
|
117
|
+
closeSync(fd);
|
|
118
|
+
fd = undefined;
|
|
119
|
+
for (let attempt = 0;; attempt++) {
|
|
120
|
+
try {
|
|
121
|
+
(options.rename ?? renameSync)(temporary, path);
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
if (platform !== "win32" || !["EPERM", "EBUSY", "EACCES"].includes(error.code ?? "") || attempt === 5)
|
|
126
|
+
throw error;
|
|
127
|
+
(options.wait ?? ((ms) => { Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms); }))(25 * 2 ** attempt);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
flushDirectory(dirname(path));
|
|
131
|
+
}
|
|
132
|
+
finally {
|
|
133
|
+
if (fd !== undefined)
|
|
134
|
+
closeSync(fd);
|
|
135
|
+
if (existsSync(temporary))
|
|
136
|
+
unlinkSync(temporary);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
function lock(path) {
|
|
140
|
+
directory(dirname(path));
|
|
141
|
+
const fd = openSync(path, "wx", platform === "win32" ? undefined : 0o600);
|
|
142
|
+
try {
|
|
143
|
+
if (platform === "win32")
|
|
144
|
+
acl(path, "restrict", false);
|
|
145
|
+
fsyncSync(fd);
|
|
146
|
+
flushDirectory(dirname(path));
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
closeSync(fd);
|
|
150
|
+
unlinkSync(path);
|
|
151
|
+
throw error;
|
|
152
|
+
}
|
|
153
|
+
return () => { closeSync(fd); unlinkSync(path); flushDirectory(dirname(path)); };
|
|
154
|
+
}
|
|
155
|
+
return { check, read, directory, write, lock };
|
|
156
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type PrivateFileOptions } from "./private-file.js";
|
|
3
|
+
import { SecretRedactor } from "./redact.js";
|
|
4
|
+
export declare const ORIGIN = "https://cloud.tenable.com";
|
|
5
|
+
export type CredentialContext = PrivateFileOptions & {
|
|
6
|
+
env?: NodeJS.ProcessEnv;
|
|
7
|
+
home?: string;
|
|
8
|
+
};
|
|
9
|
+
declare function schemas(platform: NodeJS.Platform): z.ZodObject<{
|
|
10
|
+
version: z.ZodLiteral<1>;
|
|
11
|
+
defaultProfile: z.ZodOptional<z.ZodString>;
|
|
12
|
+
profiles: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
13
|
+
origin: z.ZodDefault<z.ZodLiteral<"https://cloud.tenable.com">>;
|
|
14
|
+
accessKey: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
15
|
+
env: z.ZodString;
|
|
16
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
17
|
+
file: z.ZodString;
|
|
18
|
+
}, z.core.$strict>]>>;
|
|
19
|
+
secretKey: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
20
|
+
env: z.ZodString;
|
|
21
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
22
|
+
file: z.ZodString;
|
|
23
|
+
}, z.core.$strict>]>>;
|
|
24
|
+
writes: z.ZodDefault<z.ZodObject<{
|
|
25
|
+
allowWrites: z.ZodBoolean;
|
|
26
|
+
operations: z.ZodArray<z.ZodString>;
|
|
27
|
+
}, z.core.$strict>>;
|
|
28
|
+
}, z.core.$strict>>;
|
|
29
|
+
}, z.core.$strict>;
|
|
30
|
+
export type Profile = z.infer<ReturnType<typeof schemas>>["profiles"][string];
|
|
31
|
+
export type SelectedProfile = Profile & {
|
|
32
|
+
name: string;
|
|
33
|
+
source: "flag" | "env" | "env-profile" | "config-default" | "sole";
|
|
34
|
+
};
|
|
35
|
+
export declare function credentialStore(options?: CredentialContext, redactor?: SecretRedactor): {
|
|
36
|
+
configPath: (explicit?: string) => string;
|
|
37
|
+
statePath: () => string;
|
|
38
|
+
readOnly: () => boolean;
|
|
39
|
+
load: (explicit?: string, verifyAcl?: boolean) => {
|
|
40
|
+
path: string;
|
|
41
|
+
config: {
|
|
42
|
+
version: 1;
|
|
43
|
+
profiles: Record<string, {
|
|
44
|
+
origin: "https://cloud.tenable.com";
|
|
45
|
+
accessKey: {
|
|
46
|
+
env: string;
|
|
47
|
+
} | {
|
|
48
|
+
file: string;
|
|
49
|
+
};
|
|
50
|
+
secretKey: {
|
|
51
|
+
env: string;
|
|
52
|
+
} | {
|
|
53
|
+
file: string;
|
|
54
|
+
};
|
|
55
|
+
writes: {
|
|
56
|
+
allowWrites: boolean;
|
|
57
|
+
operations: string[];
|
|
58
|
+
};
|
|
59
|
+
}>;
|
|
60
|
+
defaultProfile?: string | undefined;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
select: (config: ReturnType<(explicit?: string, verifyAcl?: boolean) => {
|
|
64
|
+
path: string;
|
|
65
|
+
config: {
|
|
66
|
+
version: 1;
|
|
67
|
+
profiles: Record<string, {
|
|
68
|
+
origin: "https://cloud.tenable.com";
|
|
69
|
+
accessKey: {
|
|
70
|
+
env: string;
|
|
71
|
+
} | {
|
|
72
|
+
file: string;
|
|
73
|
+
};
|
|
74
|
+
secretKey: {
|
|
75
|
+
env: string;
|
|
76
|
+
} | {
|
|
77
|
+
file: string;
|
|
78
|
+
};
|
|
79
|
+
writes: {
|
|
80
|
+
allowWrites: boolean;
|
|
81
|
+
operations: string[];
|
|
82
|
+
};
|
|
83
|
+
}>;
|
|
84
|
+
defaultProfile?: string | undefined;
|
|
85
|
+
};
|
|
86
|
+
}>["config"], flag?: string) => SelectedProfile;
|
|
87
|
+
credentials: (profile: SelectedProfile, verifyAcl?: boolean) => Record<"accessKey" | "secretKey", string>;
|
|
88
|
+
status: (explicit?: string, flag?: string) => {
|
|
89
|
+
profile: string;
|
|
90
|
+
source: "env" | "flag" | "env-profile" | "config-default" | "sole";
|
|
91
|
+
origin: "https://cloud.tenable.com";
|
|
92
|
+
config: string;
|
|
93
|
+
accessKey: {
|
|
94
|
+
env: string;
|
|
95
|
+
} | {
|
|
96
|
+
file: string;
|
|
97
|
+
};
|
|
98
|
+
secretKey: {
|
|
99
|
+
env: string;
|
|
100
|
+
} | {
|
|
101
|
+
file: string;
|
|
102
|
+
};
|
|
103
|
+
readOnly: boolean;
|
|
104
|
+
};
|
|
105
|
+
list: (explicit?: string) => {
|
|
106
|
+
profiles: {
|
|
107
|
+
name: string;
|
|
108
|
+
origin: "https://cloud.tenable.com";
|
|
109
|
+
default: boolean;
|
|
110
|
+
}[];
|
|
111
|
+
count: number;
|
|
112
|
+
config: string;
|
|
113
|
+
};
|
|
114
|
+
redactor: SecretRedactor;
|
|
115
|
+
};
|
|
116
|
+
export {};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { AxiError } from "axi-sdk-js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { homedir } from "node:os";
|
|
4
|
+
import { isAbsolute, join, resolve, win32 } from "node:path";
|
|
5
|
+
import { privateFiles, toolDirectory } from "./private-file.js";
|
|
6
|
+
import { SecretRedactor } from "./redact.js";
|
|
7
|
+
export const ORIGIN = "https://cloud.tenable.com";
|
|
8
|
+
const profileName = z.string().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/);
|
|
9
|
+
const envName = z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/);
|
|
10
|
+
function schemas(platform) {
|
|
11
|
+
const secretRef = z.union([
|
|
12
|
+
z.strictObject({ env: envName }),
|
|
13
|
+
z.strictObject({ file: z.string().refine((path) => platform === "win32" ? /^[A-Za-z]:[\\/]/.test(path) : isAbsolute(path)) }),
|
|
14
|
+
]);
|
|
15
|
+
const profile = z.strictObject({
|
|
16
|
+
origin: z.literal(ORIGIN).default(ORIGIN),
|
|
17
|
+
accessKey: secretRef.default({ env: "TENABLE_AXI_ACCESS_KEY" }),
|
|
18
|
+
secretKey: secretRef.default({ env: "TENABLE_AXI_SECRET_KEY" }),
|
|
19
|
+
writes: z.strictObject({ allowWrites: z.boolean(), operations: z.array(z.string().regex(/^[A-Za-z0-9][A-Za-z0-9_-]*$/)) })
|
|
20
|
+
.default({ allowWrites: false, operations: [] }),
|
|
21
|
+
});
|
|
22
|
+
return z.strictObject({ version: z.literal(1), defaultProfile: profileName.optional(), profiles: z.record(profileName, profile) })
|
|
23
|
+
.refine((config) => config.defaultProfile === undefined || Object.hasOwn(config.profiles, config.defaultProfile));
|
|
24
|
+
}
|
|
25
|
+
export function credentialStore(options = {}, redactor = new SecretRedactor()) {
|
|
26
|
+
const env = options.env ?? process.env;
|
|
27
|
+
const platform = options.platform ?? process.platform;
|
|
28
|
+
const home = options.home ?? homedir();
|
|
29
|
+
const files = privateFiles(options);
|
|
30
|
+
const invalid = (message) => {
|
|
31
|
+
throw new AxiError(message, "CONFIG_INVALID", [
|
|
32
|
+
"Use version: 1, named profiles, exact origin https://cloud.tenable.com and accessKey/secretKey SecretRefs; run tenable-axi auth status --help",
|
|
33
|
+
]);
|
|
34
|
+
};
|
|
35
|
+
for (const name of ["TENABLE_AXI_ACCESS_KEY", "TENABLE_AXI_SECRET_KEY"])
|
|
36
|
+
redactor.add(env[name]);
|
|
37
|
+
function configPath(explicit) {
|
|
38
|
+
const selected = explicit ?? env.TENABLE_AXI_CONFIG;
|
|
39
|
+
if (selected !== undefined && !selected.trim())
|
|
40
|
+
invalid("Config path must not be blank");
|
|
41
|
+
if (selected !== undefined)
|
|
42
|
+
return resolve(selected);
|
|
43
|
+
return (platform === "win32" ? win32.join : join)(toolDirectory("config", env, platform, home), "config.json");
|
|
44
|
+
}
|
|
45
|
+
function readOnly() {
|
|
46
|
+
const value = env.TENABLE_AXI_READ_ONLY?.toLowerCase();
|
|
47
|
+
if (value === undefined || value === "0" || value === "false")
|
|
48
|
+
return false;
|
|
49
|
+
if (value === "1" || value === "true")
|
|
50
|
+
return true;
|
|
51
|
+
return invalid("TENABLE_AXI_READ_ONLY must be 1, true, 0 or false");
|
|
52
|
+
}
|
|
53
|
+
function load(explicit, verifyAcl = false) {
|
|
54
|
+
const path = configPath(explicit);
|
|
55
|
+
let raw;
|
|
56
|
+
try {
|
|
57
|
+
raw = JSON.parse(files.read(path, false, verifyAcl));
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
if (error instanceof AxiError)
|
|
61
|
+
throw error;
|
|
62
|
+
if (explicit === undefined && env.TENABLE_AXI_CONFIG === undefined && error.code === "ENOENT") {
|
|
63
|
+
return { path, config: { version: 1, profiles: {}, defaultProfile: undefined } };
|
|
64
|
+
}
|
|
65
|
+
return invalid("Cannot read profile configuration as JSON; check its path and syntax");
|
|
66
|
+
}
|
|
67
|
+
// Register known secrets before validation so malformed metadata cannot echo them.
|
|
68
|
+
if (raw && typeof raw === "object" && "profiles" in raw && raw.profiles && typeof raw.profiles === "object") {
|
|
69
|
+
for (const profile of Object.values(raw.profiles)) {
|
|
70
|
+
if (!profile || typeof profile !== "object")
|
|
71
|
+
continue;
|
|
72
|
+
for (const field of ["accessKey", "secretKey"]) {
|
|
73
|
+
if (!(field in profile))
|
|
74
|
+
continue;
|
|
75
|
+
const ref = profile[field];
|
|
76
|
+
if (typeof ref === "string")
|
|
77
|
+
redactor.add(ref);
|
|
78
|
+
if (ref && typeof ref === "object" && "env" in ref && typeof ref.env === "string")
|
|
79
|
+
redactor.add(env[ref.env]);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const parsed = schemas(platform).safeParse(raw);
|
|
84
|
+
if (!parsed.success)
|
|
85
|
+
return invalid("Invalid configuration: check profile names, defaultProfile, unknown fields and accessKey/secretKey SecretRefs");
|
|
86
|
+
return { path, config: parsed.data };
|
|
87
|
+
}
|
|
88
|
+
function select(config, flag) {
|
|
89
|
+
const selected = flag ?? env.TENABLE_AXI_PROFILE;
|
|
90
|
+
if (selected !== undefined && !profileName.safeParse(selected).success)
|
|
91
|
+
invalid("Invalid selected profile name");
|
|
92
|
+
if (selected === undefined && ["TENABLE_AXI_ACCESS_KEY", "TENABLE_AXI_SECRET_KEY", "TENABLE_AXI_ORIGIN"].some((name) => env[name] !== undefined)) {
|
|
93
|
+
if (!env.TENABLE_AXI_ACCESS_KEY?.trim() || !env.TENABLE_AXI_SECRET_KEY?.trim() || (env.TENABLE_AXI_ORIGIN !== undefined && env.TENABLE_AXI_ORIGIN !== ORIGIN)) {
|
|
94
|
+
return invalid("Incomplete or invalid TENABLE_AXI env profile; set both ACCESS_KEY and SECRET_KEY and use the allowed ORIGIN");
|
|
95
|
+
}
|
|
96
|
+
return { origin: ORIGIN, accessKey: { env: "TENABLE_AXI_ACCESS_KEY" }, secretKey: { env: "TENABLE_AXI_SECRET_KEY" },
|
|
97
|
+
writes: { allowWrites: false, operations: [] }, name: "env", source: "env-profile" };
|
|
98
|
+
}
|
|
99
|
+
const names = Object.keys(config.profiles);
|
|
100
|
+
const name = selected ?? config.defaultProfile ?? (names.length === 1 ? names[0] : undefined);
|
|
101
|
+
if (name === undefined)
|
|
102
|
+
throw new AxiError(names.length ? "Select one of the configured profiles" : "No profiles are configured", names.length ? "PROFILE_AMBIGUOUS" : "PROFILE_REQUIRED", ["Pass --profile <name>, set TENABLE_AXI_PROFILE, or configure defaultProfile; run tenable-axi config path"]);
|
|
103
|
+
if (!Object.hasOwn(config.profiles, name))
|
|
104
|
+
throw new AxiError("Selected profile is not configured", "PROFILE_NOT_FOUND", ["Run tenable-axi profile list"]);
|
|
105
|
+
return { ...config.profiles[name], name, source: flag !== undefined ? "flag" : env.TENABLE_AXI_PROFILE !== undefined ? "env" : config.defaultProfile !== undefined ? "config-default" : "sole" };
|
|
106
|
+
}
|
|
107
|
+
function credentials(profile, verifyAcl = false) {
|
|
108
|
+
const values = {};
|
|
109
|
+
for (const field of ["accessKey", "secretKey"]) {
|
|
110
|
+
const ref = profile[field];
|
|
111
|
+
let value;
|
|
112
|
+
try {
|
|
113
|
+
value = "env" in ref ? env[ref.env] : files.read(ref.file, true, verifyAcl).replace(/^\uFEFF/, "").trimEnd();
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
if (error instanceof AxiError)
|
|
117
|
+
throw error;
|
|
118
|
+
throw new AxiError(`Cannot read ${field} SecretRef file`, "AUTH_REQUIRED", ["Check the SecretRef file exists and is readable"]);
|
|
119
|
+
}
|
|
120
|
+
redactor.add(value);
|
|
121
|
+
if (!value?.trim())
|
|
122
|
+
throw new AxiError(`${field} is required`, "AUTH_REQUIRED", ["Set the selected accessKey and secretKey SecretRef sources; run tenable-axi auth status --help"]);
|
|
123
|
+
if (/[;=\s\p{Cc}]/u.test(value))
|
|
124
|
+
invalid(`${field} contains a header delimiter or control character`);
|
|
125
|
+
values[field] = value;
|
|
126
|
+
}
|
|
127
|
+
// Mirror the sink's exact header spacing for redaction only; never send it here.
|
|
128
|
+
redactor.add(`accessKey=${values.accessKey}; secretKey=${values.secretKey}`);
|
|
129
|
+
return values;
|
|
130
|
+
}
|
|
131
|
+
function status(explicit, flag) {
|
|
132
|
+
const forced = readOnly();
|
|
133
|
+
const loaded = load(explicit, true);
|
|
134
|
+
const profile = select(loaded.config, flag);
|
|
135
|
+
credentials(profile, true);
|
|
136
|
+
return { profile: profile.name, source: profile.source, origin: profile.origin, config: loaded.path,
|
|
137
|
+
accessKey: profile.accessKey, secretKey: profile.secretKey,
|
|
138
|
+
readOnly: forced || !profile.writes.allowWrites || profile.writes.operations.length === 0 };
|
|
139
|
+
}
|
|
140
|
+
function list(explicit) {
|
|
141
|
+
readOnly();
|
|
142
|
+
const loaded = load(explicit);
|
|
143
|
+
return { profiles: Object.entries(loaded.config.profiles).map(([name, profile]) => ({ name, origin: profile.origin, default: name === loaded.config.defaultProfile })),
|
|
144
|
+
count: Object.keys(loaded.config.profiles).length, config: loaded.path };
|
|
145
|
+
}
|
|
146
|
+
return { configPath, statePath: () => toolDirectory("state", env, platform, home), readOnly, load, select, credentials, status, list, redactor };
|
|
147
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const REDACTED = "***redacted***";
|
|
2
|
+
// A registry belongs to one invocation and is shared with the sink and journal.
|
|
3
|
+
export class SecretRedactor {
|
|
4
|
+
secrets = new Set();
|
|
5
|
+
add(secret) {
|
|
6
|
+
if (!secret)
|
|
7
|
+
return;
|
|
8
|
+
this.secrets.add(secret);
|
|
9
|
+
this.secrets.add(JSON.stringify(secret).slice(1, -1));
|
|
10
|
+
if (secret.isWellFormed())
|
|
11
|
+
this.secrets.add(encodeURIComponent(secret));
|
|
12
|
+
}
|
|
13
|
+
text(value) {
|
|
14
|
+
for (const secret of [...this.secrets].sort((a, b) => b.length - a.length))
|
|
15
|
+
value = value.split(secret).join(REDACTED);
|
|
16
|
+
return value;
|
|
17
|
+
}
|
|
18
|
+
value(value) {
|
|
19
|
+
if (typeof value === "string")
|
|
20
|
+
return this.text(value);
|
|
21
|
+
if (Array.isArray(value))
|
|
22
|
+
return value.map((child) => this.value(child));
|
|
23
|
+
if (value && typeof value === "object")
|
|
24
|
+
return Object.fromEntries(Object.entries(value).map(([key, child]) => [this.text(key), this.value(child)]));
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
payload(value) {
|
|
28
|
+
if (typeof value === "string")
|
|
29
|
+
return this.text(value)
|
|
30
|
+
.replace(/-----BEGIN (?:[A-Z]+ )*PRIVATE KEY-----[\s\S]*?-----END (?:[A-Z]+ )*PRIVATE KEY-----/g, REDACTED)
|
|
31
|
+
.replace(/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/g, REDACTED)
|
|
32
|
+
.replace(/(\bAccountKey=)[^;\s]+/gi, `$1${REDACTED}`)
|
|
33
|
+
.replace(/([?&]sig=)[^&\s]+/gi, `$1${REDACTED}`);
|
|
34
|
+
if (Array.isArray(value))
|
|
35
|
+
return value.map((child) => this.payload(child));
|
|
36
|
+
if (value && typeof value === "object")
|
|
37
|
+
return Object.fromEntries(Object.entries(value).map(([key, child]) => [this.text(key),
|
|
38
|
+
/^(?:password|secret|access[_-]?key|secret[_-]?key|x-apikeys|client[_-]?secret|token|access[_-]?token|refresh[_-]?token|authorization|private[_-]?key|accountkey|sas[_-]?token)$/i.test(key) ? REDACTED : this.payload(child)]));
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type OperationBinding } from "./transport-core.js";
|
|
3
|
+
import type { MutationOperation } from "./writes-core.js";
|
|
4
|
+
type Query = {
|
|
5
|
+
property: string;
|
|
6
|
+
operator: string;
|
|
7
|
+
value?: string | number | boolean | (string | number)[];
|
|
8
|
+
} | {
|
|
9
|
+
and: Query[];
|
|
10
|
+
} | {
|
|
11
|
+
or: Query[];
|
|
12
|
+
};
|
|
13
|
+
export declare const responseBodies: {
|
|
14
|
+
combination: z.ZodObject<{
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
description: z.ZodOptional<z.ZodString>;
|
|
17
|
+
is_public: z.ZodBoolean;
|
|
18
|
+
query: z.ZodType<Query, unknown, z.core.$ZodTypeInternals<Query, unknown>>;
|
|
19
|
+
}, z.core.$strict>;
|
|
20
|
+
initiative: z.ZodObject<{
|
|
21
|
+
name: z.ZodString;
|
|
22
|
+
description: z.ZodOptional<z.ZodString>;
|
|
23
|
+
owner: z.ZodString;
|
|
24
|
+
sla_in_days: z.ZodNumber;
|
|
25
|
+
scope: z.ZodArray<z.ZodString>;
|
|
26
|
+
combination_ids: z.ZodArray<z.ZodString>;
|
|
27
|
+
tenable_ids: z.ZodArray<z.ZodString>;
|
|
28
|
+
}, z.core.$strict>;
|
|
29
|
+
};
|
|
30
|
+
export type ResponseKind = keyof typeof responseBodies;
|
|
31
|
+
export declare const responseBindings: Record<string, OperationBinding>;
|
|
32
|
+
export declare const responseMutations: Record<string, MutationOperation>;
|
|
33
|
+
export declare const responseCatalogue: Record<string, {
|
|
34
|
+
description: string;
|
|
35
|
+
operationId: string;
|
|
36
|
+
flags: Record<string, string>;
|
|
37
|
+
defaultFields: string[];
|
|
38
|
+
examples: string[];
|
|
39
|
+
evidence: string;
|
|
40
|
+
}>;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { TransportError } from "./transport-core.js";
|
|
3
|
+
const uuid = z.string().uuid();
|
|
4
|
+
const query = z.lazy(() => z.union([
|
|
5
|
+
z.strictObject({ property: z.string().min(1), operator: z.string().min(1),
|
|
6
|
+
value: z.union([z.string(), z.number(), z.boolean(), z.array(z.union([z.string(), z.number()]))]).optional() })
|
|
7
|
+
.refine((value) => ["exists", "nexists"].includes(value.operator) || value.value !== undefined),
|
|
8
|
+
z.strictObject({ and: z.array(query).min(1).max(6) }), z.strictObject({ or: z.array(query).min(1).max(6) }),
|
|
9
|
+
]));
|
|
10
|
+
function queryCount(value) {
|
|
11
|
+
if (!value || typeof value !== "object")
|
|
12
|
+
return Infinity;
|
|
13
|
+
const row = value;
|
|
14
|
+
if (typeof row.property === "string")
|
|
15
|
+
return 1;
|
|
16
|
+
const children = row.and ?? row.or;
|
|
17
|
+
return Array.isArray(children) && children.length ? children.reduce((sum, child) => sum + queryCount(child), 0) : Infinity;
|
|
18
|
+
}
|
|
19
|
+
export const responseBodies = {
|
|
20
|
+
combination: z.strictObject({ name: z.string().min(1).max(128), description: z.string().max(1024).optional(),
|
|
21
|
+
is_public: z.boolean(), query: query.refine((value) => queryCount(value) <= 6) }),
|
|
22
|
+
initiative: z.strictObject({ name: z.string().min(1).max(128), description: z.string().max(1024).optional(), owner: uuid,
|
|
23
|
+
sla_in_days: z.number().int().min(-2147483648).max(2147483647), scope: z.array(uuid).max(10),
|
|
24
|
+
combination_ids: z.array(uuid).max(10), tenable_ids: z.array(uuid).max(10) }),
|
|
25
|
+
};
|
|
26
|
+
const record = z.object({ id: uuid, name: z.string() }).passthrough();
|
|
27
|
+
const filter = z.object({ name: z.string(), operators: z.array(z.string()) }).passthrough();
|
|
28
|
+
export const responseBindings = {};
|
|
29
|
+
export const responseMutations = {};
|
|
30
|
+
export const responseCatalogue = {};
|
|
31
|
+
const common = { config: "Config path; default credential precedence", profile: "Profile name; default credential precedence",
|
|
32
|
+
fields: "Comma-separated fields; default compact view", full: "Full text; default false", help: "Show help" };
|
|
33
|
+
const paging = { limit: "Output rows; default 100, maximum 10000", all: "Up to 10000 rows; excludes --limit", cursor: "Re-fetch and resume an unchanged unpaged collection; requires original selectors" };
|
|
34
|
+
const write = { execute: "Send once; default preview", "dry-run": "Preview only; excludes --execute", confirm: "Exact preview confirmation; required to execute" };
|
|
35
|
+
const fail = (code, message, operation) => { throw new TransportError({ code, message, operation }); };
|
|
36
|
+
const canonical = (value) => JSON.stringify(value && typeof value === "object"
|
|
37
|
+
? Array.isArray(value) ? value.map((item) => JSON.parse(canonical(item)))
|
|
38
|
+
: Object.fromEntries(Object.entries(value).sort(([a], [b]) => a.localeCompare(b)).map(([key, child]) => [key, JSON.parse(canonical(child))])) : value);
|
|
39
|
+
for (const kind of ["initiative", "combination"]) {
|
|
40
|
+
const normalize = (value) => kind === "initiative"
|
|
41
|
+
? Object.fromEntries(Object.entries(value).map(([key, child]) => [key,
|
|
42
|
+
["scope", "combination_ids", "tenable_ids"].includes(key) && Array.isArray(child) ? [...child].sort() : child])) : value;
|
|
43
|
+
const plural = `${kind}s`;
|
|
44
|
+
const path = `/exposure-response/${plural}`;
|
|
45
|
+
for (const verb of ["list", "show", "create", "update", "delete"]) {
|
|
46
|
+
const operation = `${plural}-${verb === "show" ? "details" : verb}`;
|
|
47
|
+
const mutating = ["create", "update", "delete"].includes(verb);
|
|
48
|
+
const selected = ["show", "update", "delete"].includes(verb);
|
|
49
|
+
const permission = mutating ? verb === "create" ? "CREATE" : verb === "delete" ? "DELETE" : "EDIT" : "READ";
|
|
50
|
+
responseBindings[operation] = { method: verb === "create" ? "POST" : verb === "update" ? "PUT" : verb === "delete" ? "DELETE" : "GET",
|
|
51
|
+
path: selected ? `${path}/{${kind}_id}` : path, effect: mutating ? "write" : "read",
|
|
52
|
+
query: verb === "list" && kind === "combination" ? ["type"] : [],
|
|
53
|
+
decoder: verb === "list" ? z.object({ [plural]: z.array(record) }) : verb === "delete" ? z.object({}).passthrough()
|
|
54
|
+
: verb === "create" ? z.object({ id: uuid }) : record,
|
|
55
|
+
permissionHelp: `Requires EXPOSURE_MANAGEMENT.EM_ER.EM_ER.${permission} or VM.VM_ER.VM_ER.${permission}; check the selected user's role and ownership`,
|
|
56
|
+
validationHelp: `Run tenable-axi ${kind} ${verb} --help; combination queries use combination filters, with six queries per combination and seventeen per initiative` };
|
|
57
|
+
responseCatalogue[`${kind} ${verb}`] = { description: `${mutating ? "Preview or " : ""}${verb} ${kind}${verb === "list" ? "s" : ""}`,
|
|
58
|
+
operationId: operation, flags: { ...common, ...(verb === "list" ? { ...paging, ...(kind === "combination" ? { type: "private, shared or tenable; default all accessible" } : {}) } : {}),
|
|
59
|
+
...(selected ? { id: "Required exact UUID" } : {}), ...(mutating ? write : {}),
|
|
60
|
+
...(["create", "update"].includes(verb) ? { "body-file": "Required strict JSON, at most 1 MiB; '-' reads stdin" } : {}) },
|
|
61
|
+
defaultFields: mutating ? ["id"] : verb === "show" ? kind === "initiative"
|
|
62
|
+
? ["id", "name", "description", "owner", "slaInDays", "scope", "combination_ids", "tenable_ids"]
|
|
63
|
+
: ["id", "name", "description", "type", "query"] : kind === "initiative" ? ["id", "name", "owner", "slaInDays"] : ["id", "name", "type"],
|
|
64
|
+
examples: [`tenable-axi ${kind} ${verb}${selected ? " --id <id>" : ""}${["create", "update"].includes(verb) ? " --body-file body.json" : ""}`,
|
|
65
|
+
`tenable-axi ${kind} ${verb} --help`], evidence: "specs/vulnerability-management.json" };
|
|
66
|
+
if (!mutating)
|
|
67
|
+
continue;
|
|
68
|
+
const input = z.strictObject({ ...(selected ? { id: uuid } : {}), ...(verb === "delete" ? {} : { body: responseBodies[kind] }) });
|
|
69
|
+
responseMutations[operation] = { input,
|
|
70
|
+
prepare(raw) {
|
|
71
|
+
const { id, body } = raw;
|
|
72
|
+
return { target: id ? { kind, id } : { kind, name: body.name }, request: { ...(id ? { pathParams: { [`${kind}_id`]: id } } : {}), ...(body ? { body } : {}) } };
|
|
73
|
+
},
|
|
74
|
+
async current(transport, raw) {
|
|
75
|
+
const { id, body } = raw;
|
|
76
|
+
let existing;
|
|
77
|
+
// A list verifies absence; a detail 404 alone never establishes a no-op.
|
|
78
|
+
if (verb !== "update") {
|
|
79
|
+
const listed = (await transport.request(`${plural}-list`)).body;
|
|
80
|
+
const matches = listed[plural].filter((row) => id ? row.id === id : row.name === body.name);
|
|
81
|
+
if (matches.length > 1)
|
|
82
|
+
fail("RESPONSE_INVALID", "Multiple resources matched the exact target", operation);
|
|
83
|
+
existing = matches[0];
|
|
84
|
+
}
|
|
85
|
+
if (verb === "update" || existing) {
|
|
86
|
+
const targetId = id ?? existing.id;
|
|
87
|
+
existing = (await transport.request(`${plural}-details`, { pathParams: { [`${kind}_id`]: targetId } })).body;
|
|
88
|
+
if (existing.id !== targetId)
|
|
89
|
+
fail("RESPONSE_INVALID", "Details returned a different target", operation);
|
|
90
|
+
if (kind === "combination" && (verb !== "delete" || existing.query !== undefined)
|
|
91
|
+
&& !responseBodies.combination.shape.query.safeParse(existing.query).success)
|
|
92
|
+
fail("RESPONSE_INVALID", "Existing combination has an invalid query", operation);
|
|
93
|
+
existing = normalize(existing);
|
|
94
|
+
}
|
|
95
|
+
const combinations = [];
|
|
96
|
+
if (kind === "initiative" && body) {
|
|
97
|
+
let count = 0;
|
|
98
|
+
const ids = [...new Set([...body.combination_ids, ...body.tenable_ids])].sort();
|
|
99
|
+
// One unpaged read keeps even large valid selections inside the shared request budget on both state reads.
|
|
100
|
+
if (ids.length) {
|
|
101
|
+
const listed = (await transport.request("combinations-list")).body;
|
|
102
|
+
for (const combinationId of ids) {
|
|
103
|
+
const matches = listed.combinations.filter((row) => row.id === combinationId);
|
|
104
|
+
if (!matches.length)
|
|
105
|
+
fail("NOT_FOUND", "A selected combination is unavailable; check explicit IDs and read privileges", operation);
|
|
106
|
+
if (matches.length !== 1 || !responseBodies.combination.shape.query.safeParse(matches[0].query).success)
|
|
107
|
+
fail("RESPONSE_INVALID", "Selected combination has an invalid or ambiguous query", operation);
|
|
108
|
+
count += queryCount(matches[0].query);
|
|
109
|
+
combinations.push(matches[0]);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (count > 17)
|
|
113
|
+
fail("VALIDATION_ERROR", "Initiatives support at most seventeen queries across all selected combinations", operation);
|
|
114
|
+
}
|
|
115
|
+
let identical = false;
|
|
116
|
+
if (existing && body) {
|
|
117
|
+
const proposed = normalize({ description: "", ...body });
|
|
118
|
+
const current = Object.fromEntries(Object.keys(proposed).map((key) => [key, key === "description" ? existing[key] ?? "" : existing[key]]));
|
|
119
|
+
identical = Object.values(current).every((value) => value !== undefined) && canonical(current) === canonical(proposed);
|
|
120
|
+
if (verb === "create" && !identical)
|
|
121
|
+
fail("CONFLICT", "The proposed name already exists with different or unverified state", operation);
|
|
122
|
+
}
|
|
123
|
+
return { state: { existing: existing ?? null, combinations }, noop: verb === "delete" ? !existing : identical };
|
|
124
|
+
},
|
|
125
|
+
effect: kind === "combination" ? `${verb} a combination; is_public=true shares it across the organization, false keeps it private; existing initiatives may change`
|
|
126
|
+
: `${verb} an initiative with the explicit owner, asset scope, combinations and SLA; owner assignment remains subject to upstream permissions`,
|
|
127
|
+
readBackHelp: [`Run tenable-axi ${kind} list or ${kind} show --id <known-id> before retrying; an interrupted mutation may have succeeded`], };
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
responseBindings["combinations-filters-list"] = { method: "GET", path: "/exposure-response/combinations/allowed/filters", effect: "read", query: [],
|
|
131
|
+
decoder: z.object({ filters: z.array(filter) }), permissionHelp: "Check Exposure Response read privileges",
|
|
132
|
+
validationHelp: "Run tenable-axi combination filters" };
|
|
133
|
+
responseCatalogue["combination filters"] = { description: "List allowed combination query properties and operators", operationId: "combinations-filters-list",
|
|
134
|
+
flags: { ...common, ...paging }, defaultFields: ["property", "operators"], examples: ["tenable-axi combination filters", "tenable-axi combination filters --fields property,operators,type"], evidence: "specs/vulnerability-management.json" };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { credentialStore } from "./profiles.js";
|
|
2
|
+
import type { TransportFactory } from "./exposure.js";
|
|
3
|
+
import type { WriteCoordinatorFactory } from "./inventory-export.js";
|
|
4
|
+
export declare function responseCommand(argv: string[], store: ReturnType<typeof credentialStore>, factory?: TransportFactory, writeFactory?: WriteCoordinatorFactory): Promise<Record<string, unknown>>;
|