@knowttl/tenable-axi 0.1.6 → 0.1.8

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 CHANGED
@@ -71,6 +71,7 @@ The [generated command reference](https://github.com/knowttl/tenable-axi/blob/ma
71
71
  | `tag category/value/assignment/exclusion/asset-filter` | Inspect and manage platform tags | Read/write | [Platform tags](https://github.com/knowttl/tenable-axi/blob/main/docs/behavior.md#platform-tags) |
72
72
  | `initiative`, `combination` | Manage Exposure Response workflows | Read/write | [Exposure Response](https://github.com/knowttl/tenable-axi/blob/main/docs/behavior.md#exposure-response) |
73
73
  | `export` | Create jobs, check status and download results | Read/write | [Exports](https://github.com/knowttl/tenable-axi/blob/main/docs/behavior.md#inventory-exports) |
74
+ | `raw` | Read API paths and send guarded writes | Read/write | [Raw API](https://github.com/knowttl/tenable-axi/blob/main/docs/behavior.md#raw-api) |
74
75
  | `auth`, `profile`, `config`, `doctor` | Inspect setup and module access | Local/read | [Doctor](https://github.com/knowttl/tenable-axi/blob/main/docs/commands.md#doctor) |
75
76
  | `setup hooks`, `hook` | Install integrations and read local context | Local | [Integration](https://github.com/knowttl/tenable-axi/blob/main/docs/agent-integration.md) |
76
77
 
@@ -83,7 +84,7 @@ Preview first, then pass `--execute --confirm '<exact preview confirmation>'` to
83
84
  There is no `TENABLE_AXI_ALLOW_*` environment gate; configured operation allowlists control scope.
84
85
  A durable redacted journal records intent before sending; reconcile unknown outcomes before retrying.
85
86
  Credentials use environment/file SecretRefs, never inline secrets or arguments.
86
- Credential minting, users, roles, access-control administration and arbitrary HTTP stay blocked.
87
+ Credential minting, users, roles and access-control administration stay blocked; raw HTTP is limited to validated paths on the exact origin.
87
88
  See [write safety](https://github.com/knowttl/tenable-axi/blob/main/docs/safety.md) and the [permission ledger](https://github.com/knowttl/tenable-axi/blob/main/docs/design.md#complete-operation-ledger).
88
89
 
89
90
  ## Configuration
@@ -100,6 +101,7 @@ See [write safety](https://github.com/knowttl/tenable-axi/blob/main/docs/safety.
100
101
  | `TENABLE_AXI_ORIGIN` | Environment profile origin; only the exact commercial origin is valid | `https://cloud.tenable.com` |
101
102
  | `TENABLE_AXI_READ_ONLY` | Force read-only with `1` or `true` | Unset; profile policy applies |
102
103
  | `TENABLE_AXI_WRITE_LOG` | Private journal path | State directory's `writes.log` |
104
+ | `TENABLE_AXI_CREDENTIAL_REVISION` | Host credential binding as `<credential-id>:<revision>`; bound into write confirmations | Unset; confirmations carry no credential binding |
103
105
  | `XDG_CONFIG_HOME`, `XDG_STATE_HOME` | Absolute Unix config/state bases | `~/.config`, `~/.local/state` |
104
106
  | `APPDATA`, `LOCALAPPDATA` | Absolute Windows config/state bases | `~/AppData/Roaming`, `~/AppData/Local` |
105
107
  | `CLAUDE_CONFIG_DIR`, `CODEX_HOME` | Hook configuration directories | `~/.claude`, `~/.codex` |
@@ -111,7 +113,7 @@ See [configuration](https://github.com/knowttl/tenable-axi/blob/main/docs/config
111
113
 
112
114
  ## Output and exit codes
113
115
 
114
- Stdout uses compact TOON; bare `--version`, `-v` and `-V` print the package version.
116
+ Stdout uses compact TOON except for successful raw responses; bare `--version`, `-v` and `-V` print the package version.
115
117
  `--fields` selects properties and `--full` removes text truncation without expanding row or transport bounds.
116
118
  Ordinary lists default to 100 rows; `--all` remains bounded at 10,000.
117
119
  Resume a returned `--cursor` with the same profile, filters, fields and sort.
@@ -21,11 +21,11 @@ export declare const techniqueProperties: readonly ["priority", "state", "status
21
21
  export declare function attackFilterSchema(technique: boolean): z.ZodUnion<readonly [z.ZodObject<{
22
22
  property: z.ZodEnum<{
23
23
  status: "status";
24
+ target: "target";
24
25
  name: "name";
25
26
  priority: "priority";
26
27
  summary: "summary";
27
28
  path_status: "path_status";
28
- target: "target";
29
29
  serial_id: "serial_id";
30
30
  mitre_id: "mitre_id";
31
31
  state: "state";
@@ -72,11 +72,11 @@ export declare function attackFilterSchema(technique: boolean): z.ZodUnion<reado
72
72
  value: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
73
73
  property: z.ZodEnum<{
74
74
  status: "status";
75
+ target: "target";
75
76
  name: "name";
76
77
  priority: "priority";
77
78
  summary: "summary";
78
79
  path_status: "path_status";
79
- target: "target";
80
80
  serial_id: "serial_id";
81
81
  mitre_id: "mitre_id";
82
82
  state: "state";
@@ -123,11 +123,11 @@ export declare function attackFilterSchema(technique: boolean): z.ZodUnion<reado
123
123
  value: z.ZodArray<z.ZodObject<{
124
124
  property: z.ZodEnum<{
125
125
  status: "status";
126
+ target: "target";
126
127
  name: "name";
127
128
  priority: "priority";
128
129
  summary: "summary";
129
130
  path_status: "path_status";
130
- target: "target";
131
131
  serial_id: "serial_id";
132
132
  mitre_id: "mitre_id";
133
133
  state: "state";
@@ -2,6 +2,9 @@ import type { OperationBinding } from "./transport-core.js";
2
2
  import type { MutationOperation } from "./writes-core.js";
3
3
  export declare const DESCRIPTION = "Investigate Tenable One exposure and run explicitly guarded writes";
4
4
  export declare const SETUP_GUIDANCE = "Run tenable-axi config path; configure a profile with accessKey and secretKey SecretRefs";
5
+ export declare const capabilities: {
6
+ readonly rawWrites: true;
7
+ };
5
8
  export declare const transportBindings: Readonly<Record<string, OperationBinding>>;
6
9
  export declare const mutationOperations: Readonly<Record<string, MutationOperation>>;
7
10
  export declare const catalogue: {
@@ -94,6 +97,35 @@ export declare const catalogue: {
94
97
  };
95
98
  examples: string[];
96
99
  };
100
+ readonly "raw get": {
101
+ readonly description: "Read any Tenable API path on the exact origin with the selected profile keys";
102
+ readonly flags: {
103
+ readonly config: "Config path; default platform path";
104
+ readonly profile: "Profile name; default credential precedence";
105
+ readonly path: "Required absolute API path such as /api/v1/t1/tags/properties";
106
+ readonly query: "URL query such as limit=10&offset=0";
107
+ readonly out: "Save response bytes to a new file";
108
+ readonly help: "Show help; default false";
109
+ };
110
+ readonly examples: readonly ["tenable-axi raw get --path /api/v1/t1/tags/properties", "tenable-axi raw get --path /api/v1/t1/tags/search --query limit=5"];
111
+ };
112
+ readonly "raw write": {
113
+ readonly description: "Send one raw write when the profile allows writes and the operation list includes raw-write";
114
+ readonly flags: {
115
+ readonly config: "Config path; default platform path";
116
+ readonly profile: "Profile name; default credential precedence";
117
+ readonly method: "Required POST, PUT, PATCH or DELETE";
118
+ readonly path: "Required absolute API path such as /api/v1/...";
119
+ readonly query: "URL query such as key=value";
120
+ readonly "body-file": "JSON body file or - for stdin";
121
+ readonly execute: "Send after exact confirmation; default preview only";
122
+ readonly "dry-run": "Preview only; incompatible with --execute";
123
+ readonly confirm: "Exact preview confirmation";
124
+ readonly "intent-id": "Optional durable intent identifier";
125
+ readonly help: "Show help; default false";
126
+ };
127
+ readonly examples: readonly ["tenable-axi raw write --method PATCH --path /api/v1/example --body-file body.json", "tenable-axi raw write --method PATCH --path /api/v1/example --body-file body.json --execute --confirm <preview confirm>"];
128
+ };
97
129
  readonly "setup hooks": {
98
130
  readonly description: "Explicitly install or repair local agent session integrations";
99
131
  readonly flags: {
@@ -7,6 +7,7 @@ import { platformTagBindings, platformTagCatalogue, platformTagMutations } from
7
7
  import { responseBindings, responseCatalogue, responseMutations } from "./response-catalogue.js";
8
8
  export const DESCRIPTION = "Investigate Tenable One exposure and run explicitly guarded writes";
9
9
  export const SETUP_GUIDANCE = "Run tenable-axi config path; configure a profile with accessKey and secretKey SecretRefs";
10
+ export const capabilities = { rawWrites: true };
10
11
  // Endpoint slices add reviewed executable bindings alongside their commands.
11
12
  export const transportBindings = Object.freeze({ ...inventoryBindings, ...exposureBindings, ...attackBindings, ...inventoryExportBindings, ...attackExportBindings, ...platformTagBindings, ...responseBindings });
12
13
  export const mutationOperations = Object.freeze({ ...inventoryExportMutations, ...attackExportMutations, ...platformTagMutations, ...responseMutations });
@@ -18,6 +19,16 @@ export const catalogue = {
18
19
  ...attackExportCatalogue,
19
20
  ...platformTagCatalogue,
20
21
  ...responseCatalogue,
22
+ "raw get": {
23
+ description: "Read any Tenable API path on the exact origin with the selected profile keys",
24
+ flags: { config: "Config path; default platform path", profile: "Profile name; default credential precedence", path: "Required absolute API path such as /api/v1/t1/tags/properties", query: "URL query such as limit=10&offset=0", out: "Save response bytes to a new file", help: "Show help; default false" },
25
+ examples: ["tenable-axi raw get --path /api/v1/t1/tags/properties", "tenable-axi raw get --path /api/v1/t1/tags/search --query limit=5"],
26
+ },
27
+ "raw write": {
28
+ description: "Send one raw write when the profile allows writes and the operation list includes raw-write",
29
+ flags: { config: "Config path; default platform path", profile: "Profile name; default credential precedence", method: "Required POST, PUT, PATCH or DELETE", path: "Required absolute API path such as /api/v1/...", query: "URL query such as key=value", "body-file": "JSON body file or - for stdin", execute: "Send after exact confirmation; default preview only", "dry-run": "Preview only; incompatible with --execute", confirm: "Exact preview confirmation", "intent-id": "Optional durable intent identifier", help: "Show help; default false" },
30
+ examples: ["tenable-axi raw write --method PATCH --path /api/v1/example --body-file body.json", "tenable-axi raw write --method PATCH --path /api/v1/example --body-file body.json --execute --confirm <preview confirm>"],
31
+ },
21
32
  "setup hooks": {
22
33
  description: "Explicitly install or repair local agent session integrations",
23
34
  flags: { scope: "user or project; default user; project targets the current directory", help: "Show help; default false" },
@@ -61,6 +72,7 @@ export function help() {
61
72
  return {
62
73
  description: DESCRIPTION,
63
74
  commands: Object.fromEntries(Object.entries(catalogue).map(([name, entry]) => [name, entry.description])),
75
+ capabilities,
64
76
  flags: Object.fromEntries(Object.entries(catalogue.home.flags).map(([name, description]) => [`--${name}`, description])),
65
77
  version: "-v, -V, --version: print the bare version",
66
78
  examples: catalogue.home.examples,
package/dist/src/cli.d.ts CHANGED
@@ -6,6 +6,10 @@ export declare function main(argv?: string[], options?: {
6
6
  stdout?: {
7
7
  write: (chunk: string) => unknown;
8
8
  };
9
+ rawOutput?: (chunk: Uint8Array) => void | Promise<void>;
10
+ stderr?: {
11
+ write: (chunk: string) => unknown;
12
+ };
9
13
  transportFactory?: TransportFactory;
10
14
  writeCoordinatorFactory?: WriteCoordinatorFactory;
11
15
  }): Promise<void>;
package/dist/src/cli.js CHANGED
@@ -9,19 +9,24 @@ import { TransportError } from "./transport.js";
9
9
  import { attackCommand } from "./attack.js";
10
10
  import { attackExportCommand } from "./attack-export.js";
11
11
  import { inventoryExportCommand } from "./inventory-export.js";
12
+ import { rawCommand } from "./raw.js";
12
13
  import { createWriteCoordinator } from "./writes.js";
13
14
  import { platformTagCommand } from "./platform-tag.js";
14
15
  import { responseCommand } from "./response.js";
15
16
  import { setupHooks } from "./setup.js";
16
17
  export async function main(argv = process.argv.slice(2), options = {}) {
17
18
  const store = credentialStore(options.credentials);
19
+ let rawStream = false;
20
+ let rawStreamError = false;
21
+ let abortedStdout = false;
18
22
  await runAxiCli({
19
23
  description: DESCRIPTION,
20
24
  argv: ["scaffold"],
21
25
  topLevelHelp: "",
22
26
  home: async () => store.redactor.payload(await exposureCommand([], store, options.transportFactory)),
23
- stdout: { write: (chunk) => (options.stdout ?? process.stdout).write(store.redactor.text(chunk)) },
24
- formatError: (error) => ({
27
+ stdout: { write: (chunk) => rawStreamError ? (options.stderr ?? process.stderr).write(store.redactor.text(chunk))
28
+ : rawStream ? undefined : (options.stdout ?? process.stdout).write(store.redactor.text(chunk)) },
29
+ formatError: (error) => (rawStreamError = rawStream, {
25
30
  output: `${encode(store.redactor.value({
26
31
  ...((!argv.length || argv[0] === "home" || argv[0]?.startsWith("--") && argv[0] !== "--help")
27
32
  && !(error instanceof AxiError && error.code === "VALIDATION_ERROR") ? homeIdentity() : {}),
@@ -36,6 +41,29 @@ export async function main(argv = process.argv.slice(2), options = {}) {
36
41
  return setupHooks(argv);
37
42
  if (argv[0] === "tag" && !["list", "properties"].includes(argv[1] ?? ""))
38
43
  return store.redactor.payload(await platformTagCommand(argv, store, options.transportFactory, options.writeCoordinatorFactory ?? ((flags) => createWriteCoordinator(flags, options.credentials))));
44
+ if (argv[0] === "raw")
45
+ return store.redactor.payload(await rawCommand(argv, store, options.transportFactory, options.writeCoordinatorFactory ?? ((flags) => createWriteCoordinator(flags, options.credentials)), (chunk, contentType, signal) => {
46
+ if (!rawStream)
47
+ (options.stderr ?? process.stderr).write(`Content-Type: ${contentType ?? "application/octet-stream"}\n`);
48
+ rawStream = true;
49
+ return (options.rawOutput ?? ((bytes) => new Promise((resolve, reject) => {
50
+ const onError = (error) => reject(error);
51
+ const onAbort = () => { abortedStdout = true; process.stdout.destroy(); };
52
+ process.stdout.once("error", onError);
53
+ signal.addEventListener("abort", onAbort, { once: true });
54
+ if (signal.aborted)
55
+ onAbort();
56
+ process.stdout.write(bytes, (error) => {
57
+ signal.removeEventListener("abort", onAbort);
58
+ if (error)
59
+ reject(error);
60
+ else {
61
+ process.stdout.off("error", onError);
62
+ resolve();
63
+ }
64
+ });
65
+ })))(chunk);
66
+ }));
39
67
  if (["initiative", "combination"].includes(argv[0] ?? "")) {
40
68
  const result = await responseCommand(argv, store, options.transportFactory, options.writeCoordinatorFactory ?? ((flags) => createWriteCoordinator(flags, options.credentials)));
41
69
  if (result.error)
@@ -66,4 +94,6 @@ export async function main(argv = process.argv.slice(2), options = {}) {
66
94
  },
67
95
  },
68
96
  });
97
+ if (abortedStdout)
98
+ process.stderr.write("", () => process.exit(process.exitCode));
69
99
  }
@@ -2,4 +2,5 @@ import type { credentialStore } from "./profiles.js";
2
2
  import type { TransportFactory } from "./exposure.js";
3
3
  import { createWriteCoordinator, type WriteCoordinatorOptions } from "./writes.js";
4
4
  export type WriteCoordinatorFactory = (options: WriteCoordinatorOptions) => ReturnType<typeof createWriteCoordinator>;
5
+ export declare function bodyFile(path: string): unknown;
5
6
  export declare function inventoryExportCommand(argv: string[], store: ReturnType<typeof credentialStore>, factory?: TransportFactory, writeFactory?: WriteCoordinatorFactory): Promise<Record<string, unknown>>;
@@ -6,7 +6,7 @@ import { exportOutputPath, saveExport } from "./export-file.js";
6
6
  import { exportStatus } from "./export-wait.js";
7
7
  import { createTransport, TransportError } from "./transport.js";
8
8
  import { createWriteCoordinator } from "./writes.js";
9
- function bodyFile(path) {
9
+ export function bodyFile(path) {
10
10
  const fd = path === "-" ? 0 : openSync(path, "r");
11
11
  try {
12
12
  const chunks = [];
@@ -36,6 +36,10 @@ export declare function credentialStore(options?: CredentialContext, redactor?:
36
36
  configPath: (explicit?: string) => string;
37
37
  statePath: () => string;
38
38
  readOnly: () => boolean;
39
+ credentialBinding: () => {
40
+ id: string;
41
+ revision: number;
42
+ } | undefined;
39
43
  load: (explicit?: string, verifyAcl?: boolean) => {
40
44
  path: string;
41
45
  config: {
@@ -50,6 +50,15 @@ export function credentialStore(options = {}, redactor = new SecretRedactor()) {
50
50
  return true;
51
51
  return invalid("Read-only override must be 1, true, 0 or false");
52
52
  }
53
+ function credentialBinding() {
54
+ const value = env.TENABLE_AXI_CREDENTIAL_REVISION;
55
+ if (value === undefined)
56
+ return undefined;
57
+ const match = /^([^:\s]{1,128}):([1-9][0-9]{0,14})$/.exec(value);
58
+ if (!match)
59
+ return invalid("Credential revision must be <credential-id>:<revision> with a positive integer revision");
60
+ return { id: match[1], revision: Number(match[2]) };
61
+ }
53
62
  function load(explicit, verifyAcl = false) {
54
63
  const path = configPath(explicit);
55
64
  let raw;
@@ -144,5 +153,5 @@ export function credentialStore(options = {}, redactor = new SecretRedactor()) {
144
153
  return { profiles: Object.entries(loaded.config.profiles).map(([name, profile]) => ({ name, origin: profile.origin, default: name === loaded.config.defaultProfile })),
145
154
  count: Object.keys(loaded.config.profiles).length, config: loaded.path };
146
155
  }
147
- return { configPath, statePath: () => toolDirectory("state", env, platform, home), readOnly, load, select, credentials, status, list, redactor };
156
+ return { configPath, statePath: () => toolDirectory("state", env, platform, home), readOnly, credentialBinding, load, select, credentials, status, list, redactor };
148
157
  }
@@ -0,0 +1,4 @@
1
+ import type { TransportFactory } from "./exposure.js";
2
+ import { type WriteCoordinatorFactory } from "./inventory-export.js";
3
+ import type { credentialStore } from "./profiles.js";
4
+ export declare function rawCommand(argv: string[], store: ReturnType<typeof credentialStore>, factory?: TransportFactory, writeFactory?: WriteCoordinatorFactory, output?: (chunk: Uint8Array, contentType: string | null, signal: AbortSignal) => void | Promise<void>): Promise<Record<string, unknown>>;
@@ -0,0 +1,85 @@
1
+ import { AxiError } from "axi-sdk-js";
2
+ import { closeSync, openSync, unlinkSync, writeFileSync } from "node:fs";
3
+ import { z } from "zod";
4
+ import { catalogue } from "./catalogue.js";
5
+ import { bodyFile } from "./inventory-export.js";
6
+ import { createTransport } from "./transport.js";
7
+ import { createWriteCoordinator } from "./writes.js";
8
+ const accessControlRoute = /(?:^|\/)(?:users?|(?:access-)?groups?|roles?|permissions?|access-control|credentials?|share|(?:[a-z0-9._~]+-)*keys?|apikeys?)(?:\/|$)/i;
9
+ const apiPath = z.string()
10
+ .regex(/^\/[A-Za-z0-9._~/-]+$/)
11
+ .refine((path) => !/(?:^|\/)\.{1,2}(?:\/|$)|\/\//.test(path))
12
+ .refine((path) => !accessControlRoute.test(path));
13
+ const writeMethod = z.enum(["POST", "PUT", "PATCH", "DELETE"]);
14
+ export async function rawCommand(argv, store, factory = createTransport, writeFactory = createWriteCoordinator, output = () => { }) {
15
+ const name = argv.slice(0, 2).join(" ");
16
+ const entry = catalogue[name];
17
+ const usage = (message) => {
18
+ throw new AxiError(message, "VALIDATION_ERROR", [entry
19
+ ? `Valid flags for ${name}: ${Object.keys(entry.flags).map((flag) => `--${flag}`).join(", ")}`
20
+ : "Valid commands: raw get, raw write"]);
21
+ };
22
+ if (!entry)
23
+ usage("Unknown raw command");
24
+ const flags = new Map();
25
+ for (let index = 2; index < argv.length; index++) {
26
+ const flag = argv[index];
27
+ if (!flag.startsWith("--") || !Object.hasOwn(entry.flags, flag.slice(2)) || flags.has(flag))
28
+ usage(`Unknown argument, flag, or duplicate flag: ${flag}`);
29
+ const value = ["--help", "--execute", "--dry-run"].includes(flag) ? "true" : argv[++index];
30
+ if (!value || value.startsWith("--"))
31
+ usage(`Missing value for ${flag}`);
32
+ flags.set(flag, value);
33
+ }
34
+ const get = (key) => flags.get(`--${key}`);
35
+ if (get("help"))
36
+ return { command: name, ...entry };
37
+ const path = apiPath.safeParse(get("path")).data ?? usage("--path must be an absolute Tenable API path of letters, digits, dots, dashes, underscores, tildes and slashes, without dot segments or access-control routes");
38
+ const params = new URLSearchParams(get("query") ?? "");
39
+ const query = Object.fromEntries([...new Set(params.keys())].map((key) => [key, params.getAll(key)]));
40
+ if (argv[1] === "get") {
41
+ const profile = store.select(store.load(get("config")).config, get("profile"));
42
+ const transport = factory({ keys: store.credentials(profile), origin: profile.origin });
43
+ const out = get("out");
44
+ let fd;
45
+ let completed = false;
46
+ try {
47
+ const response = await transport.request("raw-get", { raw: { method: "GET", path }, query, rawOutput: async (contentType, signal) => {
48
+ if (out)
49
+ fd = openSync(out, "wx", 0o600);
50
+ if (!out)
51
+ await output(new Uint8Array(), contentType, signal);
52
+ return (chunk) => { if (fd !== undefined)
53
+ writeFileSync(fd, chunk);
54
+ else
55
+ return output(chunk, contentType, signal); };
56
+ } });
57
+ completed = true;
58
+ return out ? { status: response.status, contentType: response.contentType, output: out } : {};
59
+ }
60
+ finally {
61
+ if (fd !== undefined) {
62
+ closeSync(fd);
63
+ if (!completed)
64
+ unlinkSync(out);
65
+ }
66
+ }
67
+ }
68
+ const method = writeMethod.safeParse(get("method")).data ?? usage("--method must be POST, PUT, PATCH or DELETE");
69
+ let body;
70
+ if (get("body-file")) {
71
+ try {
72
+ body = bodyFile(get("body-file"));
73
+ }
74
+ catch {
75
+ usage("Cannot read --body-file as JSON within the 1 MiB limit");
76
+ }
77
+ }
78
+ const result = await writeFactory({ config: get("config"), profile: get("profile") }).run("raw-write", { query, body }, { execute: get("execute") === "true", dryRun: get("dry-run") === "true", confirm: get("confirm"), intentId: get("intent-id") }, { method, path }, async (contentType, signal) => {
79
+ await output(new Uint8Array(), contentType, signal);
80
+ return (chunk) => output(chunk, contentType, signal);
81
+ });
82
+ if (result.kind !== "success")
83
+ return result;
84
+ return {};
85
+ }
@@ -1,4 +1,4 @@
1
- import type { z } from "zod";
1
+ import { z } from "zod";
2
2
  export declare const TENABLE_ORIGIN = "https://cloud.tenable.com";
3
3
  export type ApiKeys = Readonly<{
4
4
  accessKey: string;
@@ -15,6 +15,10 @@ export type OperationBinding = Readonly<{
15
15
  permissionHelp: string;
16
16
  validationHelp: string;
17
17
  }>;
18
+ export type RawRoute = Readonly<{
19
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
20
+ path: string;
21
+ }>;
18
22
  export type RequestOptions = {
19
23
  pathParams?: Readonly<Record<string, string>>;
20
24
  query?: Readonly<Record<string, string | number | boolean | readonly string[]>>;
@@ -23,12 +27,15 @@ export type RequestOptions = {
23
27
  signal?: AbortSignal;
24
28
  authorization?: unknown;
25
29
  retry?: false;
30
+ raw?: RawRoute;
31
+ rawOutput?: (contentType: string | null, signal: AbortSignal) => ((chunk: Uint8Array) => void | Promise<void>) | undefined | Promise<((chunk: Uint8Array) => void | Promise<void>) | undefined>;
26
32
  };
27
33
  export type Transport = {
28
34
  prepare(operation: string, options?: RequestOptions): PreparedRequest;
29
35
  request(operation: string, options?: RequestOptions): Promise<{
30
36
  status: number;
31
37
  body: unknown;
38
+ contentType?: string | null;
32
39
  }>;
33
40
  };
34
41
  export type PreparedRequest = Readonly<{
@@ -1,3 +1,4 @@
1
+ import { z } from "zod";
1
2
  import { ResponseDiagnostics } from "./response-diagnostics.js";
2
3
  export const TENABLE_ORIGIN = "https://cloud.tenable.com";
3
4
  export class TransportError extends Error {
@@ -88,17 +89,26 @@ export function constructTransport(options, dependencies) {
88
89
  }
89
90
  return url;
90
91
  }
91
- function prepare(operation, input = {}) {
92
+ function resolve(operation, input) {
93
+ if (input.raw) {
94
+ return { method: input.raw.method, path: input.raw.path, effect: input.raw.method === "GET" ? "read" : "write",
95
+ query: Object.keys(input.query ?? {}), decoder: z.unknown(), permissionHelp: "Check that the key has the permission for this route",
96
+ validationHelp: "Check the path, query and body against the Tenable API reference" };
97
+ }
92
98
  const binding = Object.hasOwn(bindings, operation) ? bindings[operation] : undefined;
93
99
  if (!binding)
94
100
  fail("OPERATION_BLOCKED", "Operation has no executable catalogue binding");
101
+ return binding;
102
+ }
103
+ function prepare(operation, input = {}) {
104
+ const binding = resolve(operation, input);
95
105
  const url = destination(operation, binding, input).href;
96
106
  const body = input.body === undefined ? undefined : JSON.stringify(input.body);
97
107
  return Object.freeze({ operation, method: binding.method, url, body, effect: binding.effect });
98
108
  }
99
109
  async function request(operation, input = {}) {
100
110
  const { url, body } = prepare(operation, input);
101
- const record = bindings[operation];
111
+ const record = resolve(operation, input);
102
112
  const canonical = new URL(url);
103
113
  canonical.searchParams.sort();
104
114
  const identity = JSON.stringify([operation, canonical.href, body]);
@@ -127,19 +137,39 @@ export function constructTransport(options, dependencies) {
127
137
  let response;
128
138
  let text;
129
139
  let file;
140
+ let contents;
141
+ let streamed = false;
142
+ const waitForOutput = async (value) => {
143
+ let cancel;
144
+ const aborted = new Promise((_, reject) => {
145
+ cancel = () => reject(new Error("Request aborted"));
146
+ controller.signal.addEventListener("abort", cancel, { once: true });
147
+ if (controller.signal.aborted)
148
+ cancel();
149
+ });
150
+ try {
151
+ return await Promise.race([value, aborted]);
152
+ }
153
+ finally {
154
+ controller.signal.removeEventListener("abort", cancel);
155
+ }
156
+ };
130
157
  try {
131
158
  response = await dependencies.fetch(url, {
132
159
  method: record.method, redirect: "error", signal: controller.signal,
133
- headers: { "X-ApiKeys": header, Accept: record.responseMode === "file" ? "application/octet-stream" : "application/json", ...(body === undefined ? {} : { "Content-Type": "application/json" }) },
160
+ headers: { "X-ApiKeys": header, Accept: input.raw ? "*/*" : record.responseMode === "file" ? "application/octet-stream" : "application/json", ...(body === undefined ? {} : { "Content-Type": "application/json" }) },
134
161
  ...(body === undefined ? {} : { body }),
135
162
  });
136
163
  if (response.status >= 300 && response.status < 400) {
137
164
  await response.body?.cancel();
138
165
  fail("DESTINATION_DENIED", "Tenable redirects are refused", operation, [], { status: response.status });
139
166
  }
140
- const reader = response.body?.getReader();
141
167
  const chunks = [];
142
- const downloading = record.responseMode === "file" && response.status >= 200 && response.status < 300;
168
+ const output = input.raw && response.status >= 200 && response.status < 300
169
+ ? await waitForOutput(input.rawOutput?.(response.headers.get("content-type"), controller.signal)) : undefined;
170
+ streamed = output !== undefined;
171
+ const reader = response.body?.getReader();
172
+ const downloading = (record.responseMode === "file" || !!input.raw) && response.status >= 200 && response.status < 300;
143
173
  const ceiling = downloading ? 128 * 1024 * 1024 : 20 * 1024 * 1024;
144
174
  if (downloading && Number(response.headers.get("content-length")) > ceiling) {
145
175
  await reader?.cancel();
@@ -155,16 +185,19 @@ export function constructTransport(options, dependencies) {
155
185
  controller.abort();
156
186
  fail("BYTE_BUDGET_EXCEEDED", "Invocation decoded response byte budget exceeded", operation);
157
187
  }
158
- chunks.push(chunk.value);
188
+ if (output)
189
+ await waitForOutput(output(chunk.value));
190
+ else
191
+ chunks.push(chunk.value);
159
192
  }
160
193
  }
161
194
  finally {
162
195
  await reader?.cancel().catch(() => { });
163
196
  }
164
- const contents = Buffer.concat(chunks);
165
- if (downloading)
197
+ contents = Buffer.concat(chunks);
198
+ if (record.responseMode === "file" && downloading)
166
199
  file = contents;
167
- text = downloading ? "" : contents.toString("utf8");
200
+ text = record.responseMode === "file" && downloading ? "" : contents.toString("utf8");
168
201
  }
169
202
  catch (error) {
170
203
  if (error instanceof TransportError)
@@ -183,6 +216,9 @@ export function constructTransport(options, dependencies) {
183
216
  if (now() >= deadline)
184
217
  fail(record.effect === "write" ? "OUTCOME_UNKNOWN" : "DEADLINE_EXCEEDED", "Invocation deadline exceeded", operation);
185
218
  if (response.status >= 200 && response.status < 300) {
219
+ const contentType = response.headers.get("content-type");
220
+ if (input.raw)
221
+ return { status: response.status, body: streamed ? undefined : contents, contentType };
186
222
  if (record.responseMode === "file") {
187
223
  if (response.status === 204)
188
224
  fail("EXPORT_NOT_READY", "Export chunk is not ready; check status before downloading", operation);
@@ -37,6 +37,10 @@ export type MutationPreview = Readonly<{
37
37
  proposed: unknown;
38
38
  confirm: string;
39
39
  noop: boolean;
40
+ credential?: Readonly<{
41
+ id: string;
42
+ revision: number;
43
+ }>;
40
44
  }>;
41
45
  export type WriteCoordinatorOptions = {
42
46
  config?: string;
@@ -50,6 +54,10 @@ export type MutationOptions = {
50
54
  confirm?: string;
51
55
  intentId?: string;
52
56
  };
57
+ export type RawWriteRoute = Readonly<{
58
+ method: "POST" | "PUT" | "PATCH" | "DELETE";
59
+ path: string;
60
+ }>;
53
61
  export declare function constructWriteCoordinator(options: WriteCoordinatorOptions, dependencies: {
54
62
  operations: Readonly<Record<string, MutationOperation>>;
55
63
  bindings: Readonly<Record<string, OperationBinding>>;
@@ -63,7 +71,7 @@ export declare function constructWriteCoordinator(options: WriteCoordinatorOptio
63
71
  allowWrites: boolean;
64
72
  operations: readonly string[];
65
73
  }>;
66
- run: (operation: string, input: unknown, flags?: MutationOptions) => Promise<{
74
+ run: (operation: string, input: unknown, flags?: MutationOptions, raw?: RawWriteRoute, rawOutput?: RequestOptions["rawOutput"]) => Promise<{
67
75
  kind: "dry-run";
68
76
  preview: Readonly<{
69
77
  profile: string;
@@ -74,10 +82,15 @@ export declare function constructWriteCoordinator(options: WriteCoordinatorOptio
74
82
  proposed: unknown;
75
83
  confirm: string;
76
84
  noop: boolean;
85
+ credential?: Readonly<{
86
+ id: string;
87
+ revision: number;
88
+ }>;
77
89
  }>;
78
90
  auditId?: undefined;
79
91
  status?: undefined;
80
92
  response?: undefined;
93
+ contentType?: undefined;
81
94
  } | {
82
95
  kind: "noop";
83
96
  preview: Readonly<{
@@ -89,10 +102,15 @@ export declare function constructWriteCoordinator(options: WriteCoordinatorOptio
89
102
  proposed: unknown;
90
103
  confirm: string;
91
104
  noop: boolean;
105
+ credential?: Readonly<{
106
+ id: string;
107
+ revision: number;
108
+ }>;
92
109
  }>;
93
110
  auditId?: undefined;
94
111
  status?: undefined;
95
112
  response?: undefined;
113
+ contentType?: undefined;
96
114
  } | {
97
115
  kind: "success";
98
116
  preview: Readonly<{
@@ -104,15 +122,21 @@ export declare function constructWriteCoordinator(options: WriteCoordinatorOptio
104
122
  proposed: unknown;
105
123
  confirm: string;
106
124
  noop: boolean;
125
+ credential?: Readonly<{
126
+ id: string;
127
+ revision: number;
128
+ }>;
107
129
  }>;
108
130
  auditId: `${string}-${string}-${string}-${string}-${string}`;
109
131
  status: number;
110
132
  response: unknown;
133
+ contentType: string | null | undefined;
111
134
  }>;
112
135
  reader: {
113
136
  request: (name: string, options?: RequestOptions) => Promise<{
114
137
  status: number;
115
138
  body: unknown;
139
+ contentType?: string | null;
116
140
  }>;
117
141
  };
118
142
  };
@@ -5,6 +5,14 @@ import { z } from "zod";
5
5
  import { credentialStore } from "./profiles.js";
6
6
  import { privateFiles } from "./private-file.js";
7
7
  import { constructTransport, TransportError } from "./transport-core.js";
8
+ function rawWriteDefinition(route) {
9
+ return {
10
+ input: z.strictObject({ query: z.record(z.string(), z.union([z.string(), z.array(z.string())])).optional(), body: z.unknown().optional() }),
11
+ prepare: (input) => ({ target: { kind: `${route.method} ${route.path}`, payload: true }, request: input }),
12
+ effect: `Send ${route.method} ${route.path}`,
13
+ readBackHelp: ["Read the target through its owning Tenable API before any new intent; never replay this intent"],
14
+ };
15
+ }
8
16
  function canonical(value) {
9
17
  const normalize = (value) => {
10
18
  if (Array.isArray(value))
@@ -36,6 +44,7 @@ export function constructWriteCoordinator(options, dependencies) {
36
44
  const store = credentialStore(dependencies.credentials);
37
45
  const profile = store.select(store.load(options.config).config, options.profile);
38
46
  const forced = store.readOnly() || options.readOnly === true;
47
+ const credential = store.credentialBinding();
39
48
  const scope = Object.freeze({ profile: profile.name, origin: profile.origin,
40
49
  allowWrites: profile.source !== "env-profile" && profile.writes.allowWrites,
41
50
  operations: Object.freeze([...profile.writes.operations]) });
@@ -129,10 +138,10 @@ export function constructWriteCoordinator(options, dependencies) {
129
138
  }
130
139
  }
131
140
  }
132
- async function run(operation, input, flags = {}) {
141
+ async function run(operation, input, flags = {}, raw, rawOutput) {
133
142
  flags = { ...flags };
134
- const definition = Object.hasOwn(definitions, operation) ? definitions[operation] : undefined;
135
- if (!definition || bindings[operation]?.effect !== "write")
143
+ const definition = raw ? rawWriteDefinition(raw) : Object.hasOwn(definitions, operation) ? definitions[operation] : undefined;
144
+ if (!definition || (!raw && bindings[operation]?.effect !== "write"))
136
145
  fail("OPERATION_BLOCKED", "Operation has no reviewed write binding", operation);
137
146
  const parsed = definition.input.safeParse(input);
138
147
  if (!parsed.success)
@@ -140,7 +149,7 @@ export function constructWriteCoordinator(options, dependencies) {
140
149
  const prepared = definition.prepare(JSON.parse(canonical(parsed.data)));
141
150
  const request = JSON.parse(canonical(prepared.request));
142
151
  const target = JSON.parse(canonical(prepared.target));
143
- const securityField = (value) => !!value && typeof value === "object" && Object.entries(value).some(([key, child]) => /^(?:access_control|permissions|roles|credentials|api_keys)$/i.test(key) || securityField(child));
152
+ const securityField = (value) => !!value && typeof value === "object" && Object.entries(value).some(([key, child]) => /^(?:acl|access_control|permissions?|roles|credentials|api_keys)$/i.test(key) || securityField(child));
144
153
  if (securityField(request.body))
145
154
  fail("VALIDATION_ERROR", "Security administration payloads are blocked", operation);
146
155
  const uuid = z.string().uuid();
@@ -157,14 +166,20 @@ export function constructWriteCoordinator(options, dependencies) {
157
166
  if (!scope.operations.includes(operation))
158
167
  fail("OPERATION_NOT_WRITABLE", "Operation is outside the configured write scope", operation);
159
168
  const connection = sender();
160
- const plan = connection.prepare(operation, request);
169
+ const plan = connection.prepare(operation, { ...request, raw });
161
170
  const { effect: _effect, ...identity } = plan;
162
171
  const confirmationTarget = "payload" in target ? { kind: target.kind, digest: digest(canonical(request)) } : target;
163
- const confirm = canonical([scope.profile, operation, confirmationTarget]);
172
+ const unbound = canonical([scope.profile, operation, confirmationTarget]);
173
+ const confirm = credential ? canonical([scope.profile, operation, confirmationTarget,
174
+ `credential:${digest(`${credential.id}:${credential.revision}`)}`]) : unbound;
175
+ if (flags.execute && flags.confirm !== confirm && (flags.confirm === unbound || flags.confirm?.startsWith(`${unbound.slice(0, -1)},`))) {
176
+ fail("CREDENTIAL_CHANGED", "Credential binding differs from the previewed confirmation; preview again", operation, ["Run the command without --execute to obtain a confirmation for the current credential"]);
177
+ }
164
178
  const current = await definition.current?.(reader, parsed.data);
165
179
  const state = canonical(current?.state ?? null);
166
180
  const preview = store.redactor.payload({ profile: scope.profile, operation, target, effect: definition.effect,
167
- current: current?.state ?? null, proposed: request, confirm, noop: current?.noop === true });
181
+ current: current?.state ?? null, proposed: request, confirm, noop: current?.noop === true,
182
+ ...(credential ? { credential } : {}) });
168
183
  if (!flags.execute)
169
184
  return { kind: "dry-run", preview };
170
185
  if (preview.noop)
@@ -197,7 +212,7 @@ export function constructWriteCoordinator(options, dependencies) {
197
212
  authorizations.set(authorization, canonical(identity));
198
213
  let response;
199
214
  try {
200
- response = await connection.request(operation, { ...request, authorization });
215
+ response = await connection.request(operation, { ...request, raw, rawOutput, authorization });
201
216
  }
202
217
  catch (error) {
203
218
  authorizations.delete(authorization);
@@ -210,7 +225,8 @@ export function constructWriteCoordinator(options, dependencies) {
210
225
  throw new TransportError({ ...upstream.error, auditId }, upstream.help);
211
226
  }
212
227
  append("outcome", "SUCCESS", response.status);
213
- return { kind: "success", preview, auditId, status: response.status, response: store.redactor.payload(response.body) };
228
+ return { kind: "success", preview, auditId, status: response.status,
229
+ response: Buffer.isBuffer(response.body) && raw ? response.body : store.redactor.payload(response.body), contentType: response.contentType };
214
230
  }
215
231
  return { scope, run, reader };
216
232
  }
@@ -8,7 +8,7 @@ export declare function createWriteCoordinator(options?: WriteCoordinatorOptions
8
8
  allowWrites: boolean;
9
9
  operations: readonly string[];
10
10
  }>;
11
- run: (operation: string, input: unknown, flags?: import("./writes-core.js").MutationOptions) => Promise<{
11
+ run: (operation: string, input: unknown, flags?: import("./writes-core.js").MutationOptions, raw?: import("./writes-core.js").RawWriteRoute, rawOutput?: import("./transport-core.js").RequestOptions["rawOutput"]) => Promise<{
12
12
  kind: "dry-run";
13
13
  preview: Readonly<{
14
14
  profile: string;
@@ -19,10 +19,15 @@ export declare function createWriteCoordinator(options?: WriteCoordinatorOptions
19
19
  proposed: unknown;
20
20
  confirm: string;
21
21
  noop: boolean;
22
+ credential?: Readonly<{
23
+ id: string;
24
+ revision: number;
25
+ }>;
22
26
  }>;
23
27
  auditId?: undefined;
24
28
  status?: undefined;
25
29
  response?: undefined;
30
+ contentType?: undefined;
26
31
  } | {
27
32
  kind: "noop";
28
33
  preview: Readonly<{
@@ -34,10 +39,15 @@ export declare function createWriteCoordinator(options?: WriteCoordinatorOptions
34
39
  proposed: unknown;
35
40
  confirm: string;
36
41
  noop: boolean;
42
+ credential?: Readonly<{
43
+ id: string;
44
+ revision: number;
45
+ }>;
37
46
  }>;
38
47
  auditId?: undefined;
39
48
  status?: undefined;
40
49
  response?: undefined;
50
+ contentType?: undefined;
41
51
  } | {
42
52
  kind: "success";
43
53
  preview: Readonly<{
@@ -49,15 +59,21 @@ export declare function createWriteCoordinator(options?: WriteCoordinatorOptions
49
59
  proposed: unknown;
50
60
  confirm: string;
51
61
  noop: boolean;
62
+ credential?: Readonly<{
63
+ id: string;
64
+ revision: number;
65
+ }>;
52
66
  }>;
53
67
  auditId: `${string}-${string}-${string}-${string}-${string}`;
54
68
  status: number;
55
69
  response: unknown;
70
+ contentType: string | null | undefined;
56
71
  }>;
57
72
  reader: {
58
73
  request: (name: string, options?: import("./transport-core.js").RequestOptions) => Promise<{
59
74
  status: number;
60
75
  body: unknown;
76
+ contentType?: string | null;
61
77
  }>;
62
78
  };
63
79
  };
package/docs/commands.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- Generated by scripts/generate-docs.mjs from src/catalogue.ts. Do not hand-edit. -->
1
+ <!-- Generated by scripts/generate-docs.ts from src/catalogue.ts. Do not hand-edit. -->
2
2
 
3
3
  # Command reference
4
4
 
@@ -47,6 +47,8 @@ Investigate Tenable One exposure and run explicitly guarded writes.
47
47
  - [initiative show](#initiative-show)
48
48
  - [initiative update](#initiative-update)
49
49
  - [profile list](#profile-list)
50
+ - [raw get](#raw-get)
51
+ - [raw write](#raw-write)
50
52
  - [setup hooks](#setup-hooks)
51
53
  - [software list](#software-list)
52
54
  - [software properties](#software-properties)
@@ -114,6 +116,8 @@ Investigate Tenable One exposure and run explicitly guarded writes.
114
116
  | `tenable-axi initiative show` | show initiative |
115
117
  | `tenable-axi initiative update` | Preview or update initiative |
116
118
  | `tenable-axi profile list` | List configured profiles without resolving secrets or contacting Tenable |
119
+ | `tenable-axi raw get` | Read any Tenable API path on the exact origin with the selected profile keys |
120
+ | `tenable-axi raw write` | Send one raw write when the profile allows writes and the operation list includes raw-write |
117
121
  | `tenable-axi setup hooks` | Explicitly install or repair local agent session integrations |
118
122
  | `tenable-axi software list` | Search software; the pinned API exposes no stable software ID |
119
123
  | `tenable-axi software properties` | Discover software properties and supported operators |
@@ -1065,6 +1069,47 @@ tenable-axi profile list
1065
1069
  tenable-axi profile list --config /example/config.json
1066
1070
  ```
1067
1071
 
1072
+ ## raw get
1073
+
1074
+ Read any Tenable API path on the exact origin with the selected profile keys
1075
+
1076
+ | Flag | Meaning |
1077
+ |---|---|
1078
+ | `--config` | Config path; default platform path |
1079
+ | `--profile` | Profile name; default credential precedence |
1080
+ | `--path` | Required absolute API path such as /api/v1/t1/tags/properties |
1081
+ | `--query` | URL query such as limit=10&offset=0 |
1082
+ | `--out` | Save response bytes to a new file |
1083
+ | `--help` | Show help; default false |
1084
+
1085
+ ```sh
1086
+ tenable-axi raw get --path /api/v1/t1/tags/properties
1087
+ tenable-axi raw get --path /api/v1/t1/tags/search --query limit=5
1088
+ ```
1089
+
1090
+ ## raw write
1091
+
1092
+ Send one raw write when the profile allows writes and the operation list includes raw-write
1093
+
1094
+ | Flag | Meaning |
1095
+ |---|---|
1096
+ | `--config` | Config path; default platform path |
1097
+ | `--profile` | Profile name; default credential precedence |
1098
+ | `--method` | Required POST, PUT, PATCH or DELETE |
1099
+ | `--path` | Required absolute API path such as /api/v1/... |
1100
+ | `--query` | URL query such as key=value |
1101
+ | `--body-file` | JSON body file or - for stdin |
1102
+ | `--execute` | Send after exact confirmation; default preview only |
1103
+ | `--dry-run` | Preview only; incompatible with --execute |
1104
+ | `--confirm` | Exact preview confirmation |
1105
+ | `--intent-id` | Optional durable intent identifier |
1106
+ | `--help` | Show help; default false |
1107
+
1108
+ ```sh
1109
+ tenable-axi raw write --method PATCH --path /api/v1/example --body-file body.json
1110
+ tenable-axi raw write --method PATCH --path /api/v1/example --body-file body.json --execute --confirm <preview confirm>
1111
+ ```
1112
+
1068
1113
  ## setup hooks
1069
1114
 
1070
1115
  Explicitly install or repair local agent session integrations
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowttl/tenable-axi",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Investigate Tenable One exposure and run explicitly guarded writes",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -34,13 +34,13 @@
34
34
  "packageManager": "pnpm@10.34.6",
35
35
  "scripts": {
36
36
  "build": "tsc -p tsconfig.json",
37
- "typecheck": "tsc --noEmit -p tsconfig.json",
37
+ "typecheck": "tsc --noEmit -p tsconfig.json && tsc -p tsconfig.tooling.json",
38
38
  "lint": "pnpm run typecheck",
39
- "test": "node scripts/isolated.mjs node scripts/test-changes.mjs",
40
- "docs:generate": "node scripts/generate-docs.mjs",
41
- "docs:check": "node scripts/generate-docs.mjs --check",
42
- "spec:generate": "node scripts/specs.mjs --generate",
43
- "spec:check": "node scripts/specs.mjs --check"
39
+ "test": "node scripts/isolated.ts node scripts/test-changes.ts",
40
+ "docs:generate": "node scripts/generate-docs.ts",
41
+ "docs:check": "node scripts/generate-docs.ts --check",
42
+ "spec:generate": "node scripts/specs.ts --generate",
43
+ "spec:check": "node scripts/specs.ts --check"
44
44
  },
45
45
  "dependencies": {
46
46
  "@toon-format/toon": "2.3.1",
@@ -3,7 +3,7 @@ name: tenable-axi
3
3
  description: "Investigate Tenable One assets, findings, software, exposure and attack evidence with bounded read-only commands; diagnose failures and distinguish guarded writes."
4
4
  ---
5
5
 
6
- <!-- Generated by scripts/generate-docs.mjs from src/catalogue.ts. Do not hand-edit. -->
6
+ <!-- Generated by scripts/generate-docs.ts from src/catalogue.ts. Do not hand-edit. -->
7
7
 
8
8
  # tenable-axi investigation guide
9
9
 
@@ -86,11 +86,11 @@ Other remote reads: `home`, `card show`, `tag properties`, platform `tag categor
86
86
  Local reads: `auth status`, `profile list`, `config path`, `hook`, help and version.
87
87
  Configured home reads up to five live cards; the optional hook reads local posture only.
88
88
 
89
- Exclude all `create/update/delete/bulk-delete`, `tag assignment add/remove` and `export * start` commands from read allowlists.
89
+ Exclude all `create/update/delete/bulk-delete`, `tag assignment add/remove`, `export * start` and `raw write` commands from read allowlists.
90
90
  Writes require a file profile's `allowWrites` and exact operation allowlist even for previews, followed by `--execute` and the exact preview `--confirm` string.
91
91
  `TENABLE_AXI_READ_ONLY=true` forces read-only.
92
92
  Export downloads read remotely but create a local file at an explicit new output path; `setup hooks` changes local integration files and needs explicit installation intent.
93
- Users, roles, access control, credential minting and arbitrary HTTP are unavailable.
93
+ Users, roles, access control and credential minting are unavailable; raw HTTP is available through `raw get` and guarded `raw write` on validated paths.
94
94
 
95
95
  ## Help and failures
96
96
 
@@ -100,7 +100,7 @@ Leaf `--help` returns that command's flags, defaults, required selectors and exa
100
100
  Group-only help such as `asset --help` is unsupported and returns a usage error with valid commands.
101
101
  The [command reference](https://github.com/knowttl/tenable-axi/blob/main/docs/commands.md) lists the full surface.
102
102
 
103
- Stdout is structured TOON, including errors and actionable help.
103
+ Stdout is structured TOON, including errors and actionable help, except that successful raw responses stream bytes with the content type reported on stderr; see [raw API behavior](https://github.com/knowttl/tenable-axi/blob/main/docs/behavior.md#raw-api).
104
104
  Exit 0 means success (still inspect completeness), 1 means operation/configuration failure, and 2 means CLI usage validation failure.
105
105
 
106
106
  | Code | Adjustment |