@knowttl/checkpoint-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 +457 -2
- package/axi-credential.schema.json +35 -0
- package/bin/checkpoint-axi-hook.js +9 -0
- package/bin/checkpoint-axi.js +8 -0
- package/bin/version.js +3 -0
- package/dist/src/catalogue.d.ts +317 -0
- package/dist/src/catalogue.js +103 -0
- package/dist/src/cli.d.ts +9 -0
- package/dist/src/cli.js +22 -0
- package/dist/src/doctor.d.ts +3 -0
- package/dist/src/doctor.js +37 -0
- package/dist/src/downloads.d.ts +3 -0
- package/dist/src/downloads.js +52 -0
- package/dist/src/exceptions.d.ts +37 -0
- package/dist/src/exceptions.js +81 -0
- package/dist/src/local-commands.d.ts +3 -0
- package/dist/src/local-commands.js +123 -0
- package/dist/src/private-file.d.ts +10 -0
- package/dist/src/private-file.js +65 -0
- package/dist/src/profiles.d.ts +122 -0
- package/dist/src/profiles.js +137 -0
- package/dist/src/reads.d.ts +3 -0
- package/dist/src/reads.js +169 -0
- package/dist/src/redact.d.ts +6 -0
- package/dist/src/redact.js +25 -0
- package/dist/src/regions.d.ts +9 -0
- package/dist/src/regions.js +10 -0
- package/dist/src/transport.d.ts +86 -0
- package/dist/src/transport.js +306 -0
- package/dist/src/write-exceptions.d.ts +4 -0
- package/dist/src/write-exceptions.js +97 -0
- package/dist/src/write-sectools.d.ts +5 -0
- package/dist/src/write-sectools.js +107 -0
- package/dist/src/writes.d.ts +30 -0
- package/dist/src/writes.js +295 -0
- package/docs/commands.md +461 -0
- package/inventory/capabilities.json +217 -0
- package/inventory/specs.json +12 -0
- package/package.json +54 -4
- package/skills/checkpoint-axi/SKILL.md +102 -0
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
export declare const DESCRIPTION = "Inspect Check Point Email Security through compact, guarded AXI commands";
|
|
2
|
+
export declare const SETUP_GUIDANCE = "Run checkpoint-axi config path; configure a region, clientId and clientSecret env/file SecretRef";
|
|
3
|
+
export declare const catalogue: {
|
|
4
|
+
readonly "email download": {
|
|
5
|
+
readonly description: "Download an email to a new private file with profile opt-in, a 50 MiB cap and mandatory SHA-256 verification; scopes and email hash availability are unverified (guide pages 131-132)";
|
|
6
|
+
readonly flags: {
|
|
7
|
+
readonly config: string;
|
|
8
|
+
readonly profile: string;
|
|
9
|
+
readonly help: string;
|
|
10
|
+
readonly out: "Required absolute new output file; mode 0600, never stdout or overwrite";
|
|
11
|
+
readonly original: "Download original email without processing modifications; default false";
|
|
12
|
+
};
|
|
13
|
+
readonly examples: readonly ["checkpoint-axi email download <entity-id> --out /absolute/message", "checkpoint-axi email download <entity-id> --original --out /absolute/original"];
|
|
14
|
+
};
|
|
15
|
+
readonly "attachment download": {
|
|
16
|
+
readonly description: "Download one attachment to a new private file with profile opt-in, a 50 MiB cap and verified x-av-sha256; scope behavior is unverified (guide pages 133-135)";
|
|
17
|
+
readonly flags: {
|
|
18
|
+
readonly config: string;
|
|
19
|
+
readonly profile: string;
|
|
20
|
+
readonly help: string;
|
|
21
|
+
readonly out: "Required absolute new output file; mode 0600, never stdout or overwrite";
|
|
22
|
+
readonly scope: "Optional authorized scope query; default profile scope when configured; live behavior unverified";
|
|
23
|
+
};
|
|
24
|
+
readonly examples: readonly ["checkpoint-axi attachment download <entity-id> <attachment-id> --out /absolute/attachment", "checkpoint-axi attachment download <entity-id> <attachment-id> --scope <scope> --out /absolute/attachment"];
|
|
25
|
+
};
|
|
26
|
+
readonly "attachment download-all": {
|
|
27
|
+
readonly description: "Download available attachments as a ZIP to a new private file with opt-in, a 50 MiB cap and mandatory SHA-256 verification; ZIP hash availability and scopes are unverified; HTTP 200 may contain only some attachments (guide pages 135-137)";
|
|
28
|
+
readonly flags: {
|
|
29
|
+
readonly config: string;
|
|
30
|
+
readonly profile: string;
|
|
31
|
+
readonly help: string;
|
|
32
|
+
readonly out: "Required absolute new output file; mode 0600, never stdout or overwrite";
|
|
33
|
+
readonly scope: "Optional authorized scope query; default profile scope when configured; live behavior unverified";
|
|
34
|
+
};
|
|
35
|
+
readonly examples: readonly ["checkpoint-axi attachment download-all <entity-id> --out /absolute/attachments", "checkpoint-axi attachment download-all <entity-id> --scope <scope> --out /absolute/attachments"];
|
|
36
|
+
};
|
|
37
|
+
readonly "exception create": {
|
|
38
|
+
readonly description: "Preview or create one exception of any kind; anomaly/click-time/malware/url/dlp response identities are unverified (guide pages 61-64, 75-78, 84-85, 91-93, 102-105, 113-116, 123-126)";
|
|
39
|
+
readonly flags: {
|
|
40
|
+
readonly input: "Required absolute private JSON file containing documented requestData fields directly; fields depend on kind; update sends a replacement PUT";
|
|
41
|
+
readonly specific: "Malware/url/dlp only: use the documented create-specific /exceptions route; default false; included in confirmation digest";
|
|
42
|
+
readonly execute: string;
|
|
43
|
+
readonly "dry-run": string;
|
|
44
|
+
readonly confirm: string;
|
|
45
|
+
readonly config: string;
|
|
46
|
+
readonly profile: string;
|
|
47
|
+
readonly fields: string;
|
|
48
|
+
readonly full: string;
|
|
49
|
+
readonly help: string;
|
|
50
|
+
};
|
|
51
|
+
readonly examples: readonly ["checkpoint-axi exception create phishing-allow --input /absolute/rule.json", "checkpoint-axi exception create spam-allow --input /absolute/rule.json --execute --confirm 'exception.spam-allow.create sha256:<preview-digest>'"];
|
|
52
|
+
};
|
|
53
|
+
readonly "exception update": {
|
|
54
|
+
readonly description: "Preview or replace one exception; phishing/spam/click-time require an ID; malware/url/dlp identify it in --input without an ID; anomaly unsupported (guide pages 64-67, 78-81, 94-96, 105-107, 116-117, 126-127)";
|
|
55
|
+
readonly flags: {
|
|
56
|
+
readonly input: "Required absolute private JSON file containing documented requestData fields directly; fields depend on kind; update sends a replacement PUT";
|
|
57
|
+
readonly execute: string;
|
|
58
|
+
readonly "dry-run": string;
|
|
59
|
+
readonly confirm: string;
|
|
60
|
+
readonly config: string;
|
|
61
|
+
readonly profile: string;
|
|
62
|
+
readonly fields: string;
|
|
63
|
+
readonly full: string;
|
|
64
|
+
readonly help: string;
|
|
65
|
+
};
|
|
66
|
+
readonly examples: readonly ["checkpoint-axi exception update phishing-block <id> --input /absolute/rule.json", "checkpoint-axi exception update spam-allow <id> --input /absolute/rule.json --execute --confirm 'exception.spam-allow.update <id>'"];
|
|
67
|
+
};
|
|
68
|
+
readonly "exception remove": {
|
|
69
|
+
readonly description: "Preview or remove one phishing/spam/anomaly/click-time exception by ID; malware/url/dlp refuse ENDPOINT_UNVERIFIED before authentication (guide pages 67-69, 81-82, 85-87, 98-99, 108-110, 119-120, 129-131)";
|
|
70
|
+
readonly flags: {
|
|
71
|
+
execute: string;
|
|
72
|
+
"dry-run": string;
|
|
73
|
+
confirm: string;
|
|
74
|
+
config: string;
|
|
75
|
+
profile: string;
|
|
76
|
+
fields: string;
|
|
77
|
+
full: string;
|
|
78
|
+
help: string;
|
|
79
|
+
};
|
|
80
|
+
readonly examples: readonly ["checkpoint-axi exception remove phishing-allow <id>", "checkpoint-axi exception remove spam-allow <id> --execute --confirm 'exception.spam-allow.remove <id>'"];
|
|
81
|
+
};
|
|
82
|
+
readonly "exception remove-items": {
|
|
83
|
+
readonly description: "Preview or remove 1-20 click-time items by caller-supplied IDs; existence is unverified (guide pages 97-98)";
|
|
84
|
+
readonly flags: {
|
|
85
|
+
readonly ids: "Required 1-20 unique comma-separated click-time item IDs";
|
|
86
|
+
readonly execute: string;
|
|
87
|
+
readonly "dry-run": string;
|
|
88
|
+
readonly confirm: string;
|
|
89
|
+
readonly config: string;
|
|
90
|
+
readonly profile: string;
|
|
91
|
+
readonly fields: string;
|
|
92
|
+
readonly full: string;
|
|
93
|
+
readonly help: string;
|
|
94
|
+
};
|
|
95
|
+
readonly examples: readonly ["checkpoint-axi exception remove-items click-time --ids <id1>,<id2>", "checkpoint-axi exception remove-items click-time --ids <id1>,<id2> --execute --confirm 'exception.click-time.remove-items <id1>,<id2>'"];
|
|
96
|
+
};
|
|
97
|
+
readonly "exception clear": {
|
|
98
|
+
readonly description: "Refuse click-time/malware/url/dlp clear with ENDPOINT_UNVERIFIED until commissioning establishes counts and delete contracts (guide pages 87-88, 96-97, 107-110, 117-120, 128-131)";
|
|
99
|
+
readonly flags: {
|
|
100
|
+
execute: string;
|
|
101
|
+
"dry-run": string;
|
|
102
|
+
confirm: string;
|
|
103
|
+
config: string;
|
|
104
|
+
profile: string;
|
|
105
|
+
fields: string;
|
|
106
|
+
full: string;
|
|
107
|
+
help: string;
|
|
108
|
+
};
|
|
109
|
+
readonly examples: readonly ["checkpoint-axi exception clear click-time", "checkpoint-axi exception clear click-time --dry-run"];
|
|
110
|
+
};
|
|
111
|
+
readonly "event action": {
|
|
112
|
+
readonly description: "Preview or request a name-only event action; parameterized actions refuse ENDPOINT_UNVERIFIED pending commissioning (guide pages 35-37, 42-45)";
|
|
113
|
+
readonly flags: {
|
|
114
|
+
readonly ids: "Required comma-separated unique event IDs; maximum 20";
|
|
115
|
+
readonly name: "Required available action name; nonempty action parameters are unverified";
|
|
116
|
+
readonly execute: string;
|
|
117
|
+
readonly "dry-run": string;
|
|
118
|
+
readonly confirm: string;
|
|
119
|
+
readonly config: string;
|
|
120
|
+
readonly profile: string;
|
|
121
|
+
readonly fields: string;
|
|
122
|
+
readonly full: string;
|
|
123
|
+
readonly help: string;
|
|
124
|
+
};
|
|
125
|
+
readonly examples: readonly ["checkpoint-axi event action --ids <id> --name dismiss", "checkpoint-axi event action --ids <id> --name dismiss --execute --confirm 'event.action.dismiss <id>'"];
|
|
126
|
+
};
|
|
127
|
+
readonly "email quarantine": {
|
|
128
|
+
readonly description: "Preview or request asynchronous email quarantine through the gated write coordinator (guide pages 28-30)";
|
|
129
|
+
readonly flags: {
|
|
130
|
+
ids: string;
|
|
131
|
+
execute: string;
|
|
132
|
+
"dry-run": string;
|
|
133
|
+
confirm: string;
|
|
134
|
+
config: string;
|
|
135
|
+
profile: string;
|
|
136
|
+
fields: string;
|
|
137
|
+
full: string;
|
|
138
|
+
help: string;
|
|
139
|
+
};
|
|
140
|
+
readonly examples: readonly ["checkpoint-axi email quarantine --ids <id>", "checkpoint-axi email quarantine --ids <id> --execute --confirm 'email.quarantine <id>'"];
|
|
141
|
+
};
|
|
142
|
+
readonly "email restore": {
|
|
143
|
+
readonly description: "Preview or request asynchronous email restore through the gated write coordinator (guide pages 28-30)";
|
|
144
|
+
readonly flags: {
|
|
145
|
+
ids: string;
|
|
146
|
+
execute: string;
|
|
147
|
+
"dry-run": string;
|
|
148
|
+
confirm: string;
|
|
149
|
+
config: string;
|
|
150
|
+
profile: string;
|
|
151
|
+
fields: string;
|
|
152
|
+
full: string;
|
|
153
|
+
help: string;
|
|
154
|
+
};
|
|
155
|
+
readonly examples: readonly ["checkpoint-axi email restore --ids <id>", "checkpoint-axi email restore --ids <id> --execute --confirm 'email.restore <id>'"];
|
|
156
|
+
};
|
|
157
|
+
readonly "exception list": {
|
|
158
|
+
readonly description: "List bounded exceptions for phishing-allow, phishing-block, spam-allow, anomaly, click-time, malware, url or dlp (guide pages 49-123)";
|
|
159
|
+
readonly flags: {
|
|
160
|
+
readonly type: string;
|
|
161
|
+
readonly items: "Click-time item routes instead of list routes; default false";
|
|
162
|
+
readonly limit: string;
|
|
163
|
+
readonly all: "Return up to 1000 rows within transport budgets; no server continuation parameter is documented";
|
|
164
|
+
readonly config: string;
|
|
165
|
+
readonly profile: string;
|
|
166
|
+
readonly fields: string;
|
|
167
|
+
readonly full: string;
|
|
168
|
+
readonly help: string;
|
|
169
|
+
};
|
|
170
|
+
readonly examples: readonly ["checkpoint-axi exception list phishing-allow", "checkpoint-axi exception list malware --type hash", "checkpoint-axi exception list click-time --items --all"];
|
|
171
|
+
};
|
|
172
|
+
readonly "exception show": {
|
|
173
|
+
readonly description: "Show an exception by kind and ID/value; anomaly refuses ENDPOINT_UNVERIFIED pending commissioning (guide pages 52-123)";
|
|
174
|
+
readonly flags: {
|
|
175
|
+
readonly type: string;
|
|
176
|
+
readonly items: "Click-time item route instead of list route; default false";
|
|
177
|
+
readonly config: string;
|
|
178
|
+
readonly profile: string;
|
|
179
|
+
readonly fields: string;
|
|
180
|
+
readonly full: string;
|
|
181
|
+
readonly help: string;
|
|
182
|
+
};
|
|
183
|
+
readonly examples: readonly ["checkpoint-axi exception show phishing-block <id>", "checkpoint-axi exception show url <value> --type allow-url", "checkpoint-axi exception show click-time <id> --items --full"];
|
|
184
|
+
};
|
|
185
|
+
readonly "event list": {
|
|
186
|
+
readonly description: "List security events with bounded scroll continuation (API guide pages 37-42)";
|
|
187
|
+
readonly flags: {
|
|
188
|
+
readonly saas: "Comma-separated SaaS overrides; default selected profile saas or office365_emails";
|
|
189
|
+
readonly "event-types": "Comma-separated event types; default unfiltered";
|
|
190
|
+
readonly "event-states": "Comma-separated event states; default unfiltered";
|
|
191
|
+
readonly severities: "Comma-separated severities; default unfiltered";
|
|
192
|
+
readonly "event-ids": "Comma-separated event IDs; default unfiltered";
|
|
193
|
+
readonly "confidence-indicator": "Confidence indicator selector; default unfiltered";
|
|
194
|
+
readonly description: "Description selector; default unfiltered";
|
|
195
|
+
readonly "start-date": string;
|
|
196
|
+
readonly "end-date": string;
|
|
197
|
+
readonly limit: string;
|
|
198
|
+
readonly all: string;
|
|
199
|
+
readonly cursor: string;
|
|
200
|
+
readonly config: string;
|
|
201
|
+
readonly profile: string;
|
|
202
|
+
readonly fields: string;
|
|
203
|
+
readonly full: string;
|
|
204
|
+
readonly help: string;
|
|
205
|
+
};
|
|
206
|
+
readonly examples: readonly ["checkpoint-axi event list", "checkpoint-axi event list --all --event-types phishing", "checkpoint-axi event list --cursor <cursor>"];
|
|
207
|
+
};
|
|
208
|
+
readonly "event show": {
|
|
209
|
+
readonly description: "Show one event, actions taken and available actions (API guide pages 34-37)";
|
|
210
|
+
readonly flags: {
|
|
211
|
+
config: string;
|
|
212
|
+
profile: string;
|
|
213
|
+
fields: string;
|
|
214
|
+
full: string;
|
|
215
|
+
help: string;
|
|
216
|
+
};
|
|
217
|
+
readonly examples: readonly ["checkpoint-axi event show <id>", "checkpoint-axi event show <id> --full"];
|
|
218
|
+
};
|
|
219
|
+
readonly "task show": {
|
|
220
|
+
readonly description: "Show asynchronous task status and per-action details (API guide pages 30-33)";
|
|
221
|
+
readonly flags: {
|
|
222
|
+
config: string;
|
|
223
|
+
profile: string;
|
|
224
|
+
fields: string;
|
|
225
|
+
full: string;
|
|
226
|
+
help: string;
|
|
227
|
+
};
|
|
228
|
+
readonly examples: readonly ["checkpoint-axi task show <id>", "checkpoint-axi task show <id> --full"];
|
|
229
|
+
};
|
|
230
|
+
readonly "email search": {
|
|
231
|
+
readonly description: "Search emails with a bounded date window and scroll continuation (API guide pages 18-27)";
|
|
232
|
+
readonly flags: {
|
|
233
|
+
readonly filter: "JSON array of {saasAttrName, saasAttrOp, saasAttrValue} filters (guide pages 19-20)";
|
|
234
|
+
readonly "start-date": string;
|
|
235
|
+
readonly "end-date": string;
|
|
236
|
+
readonly limit: string;
|
|
237
|
+
readonly all: string;
|
|
238
|
+
readonly cursor: string;
|
|
239
|
+
readonly saas: "SaaS override; default selected profile saas or office365_emails";
|
|
240
|
+
readonly "saas-entity": "Optional SaaS entity type selector";
|
|
241
|
+
readonly config: string;
|
|
242
|
+
readonly profile: string;
|
|
243
|
+
readonly fields: string;
|
|
244
|
+
readonly full: string;
|
|
245
|
+
readonly help: string;
|
|
246
|
+
};
|
|
247
|
+
readonly examples: readonly ["checkpoint-axi email search", "checkpoint-axi email search --all --saas office365_emails", "checkpoint-axi email search --cursor <cursor>"];
|
|
248
|
+
};
|
|
249
|
+
readonly "email show": {
|
|
250
|
+
readonly description: "Show one email with verdicts, actions and available actions (API guide pages 10-18)";
|
|
251
|
+
readonly flags: {
|
|
252
|
+
config: string;
|
|
253
|
+
profile: string;
|
|
254
|
+
fields: string;
|
|
255
|
+
full: string;
|
|
256
|
+
help: string;
|
|
257
|
+
};
|
|
258
|
+
readonly examples: readonly ["checkpoint-axi email show <id>", "checkpoint-axi email show <id> --full"];
|
|
259
|
+
};
|
|
260
|
+
readonly doctor: {
|
|
261
|
+
readonly description: "Check regional API authentication and one bounded email search without printing tenant data";
|
|
262
|
+
readonly flags: {
|
|
263
|
+
readonly saas: "SaaS override; default selected profile saas or office365_emails";
|
|
264
|
+
readonly config: string;
|
|
265
|
+
readonly profile: string;
|
|
266
|
+
readonly fields: string;
|
|
267
|
+
readonly full: string;
|
|
268
|
+
readonly help: string;
|
|
269
|
+
};
|
|
270
|
+
readonly examples: readonly ["checkpoint-axi doctor", "checkpoint-axi doctor --profile example --saas office365_emails"];
|
|
271
|
+
};
|
|
272
|
+
readonly home: {
|
|
273
|
+
readonly description: "Show local profile context without resolving secrets or making API calls";
|
|
274
|
+
readonly flags: {
|
|
275
|
+
config: string;
|
|
276
|
+
profile: string;
|
|
277
|
+
fields: string;
|
|
278
|
+
full: string;
|
|
279
|
+
help: string;
|
|
280
|
+
};
|
|
281
|
+
readonly examples: readonly ["checkpoint-axi", "checkpoint-axi home --profile example"];
|
|
282
|
+
};
|
|
283
|
+
readonly "auth status": {
|
|
284
|
+
readonly description: "Validate the selected local profile and secret source without API calls";
|
|
285
|
+
readonly flags: {
|
|
286
|
+
config: string;
|
|
287
|
+
profile: string;
|
|
288
|
+
fields: string;
|
|
289
|
+
full: string;
|
|
290
|
+
help: string;
|
|
291
|
+
};
|
|
292
|
+
readonly examples: readonly ["checkpoint-axi auth status", "checkpoint-axi auth status --profile example"];
|
|
293
|
+
};
|
|
294
|
+
readonly "profile list": {
|
|
295
|
+
readonly description: "List file profiles without resolving secrets; --profile does not filter this list";
|
|
296
|
+
readonly flags: {
|
|
297
|
+
config: string;
|
|
298
|
+
profile: string;
|
|
299
|
+
fields: string;
|
|
300
|
+
full: string;
|
|
301
|
+
help: string;
|
|
302
|
+
};
|
|
303
|
+
readonly examples: readonly ["checkpoint-axi profile list", "checkpoint-axi profile list --config /example/config.json"];
|
|
304
|
+
};
|
|
305
|
+
readonly "config path": {
|
|
306
|
+
readonly description: "Show config and state paths without reading files; --profile does not affect paths";
|
|
307
|
+
readonly flags: {
|
|
308
|
+
config: string;
|
|
309
|
+
profile: string;
|
|
310
|
+
fields: string;
|
|
311
|
+
full: string;
|
|
312
|
+
help: string;
|
|
313
|
+
};
|
|
314
|
+
readonly examples: readonly ["checkpoint-axi config path", "checkpoint-axi config path --fields config"];
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
export declare function help(): Record<string, unknown>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { exceptionFamilies } from "./exceptions.js";
|
|
2
|
+
export const DESCRIPTION = "Inspect Check Point Email Security through compact, guarded AXI commands";
|
|
3
|
+
export const SETUP_GUIDANCE = "Run checkpoint-axi config path; configure a region, clientId and clientSecret env/file SecretRef";
|
|
4
|
+
const common = {
|
|
5
|
+
config: "Config path; default CHECKPOINT_AXI_CONFIG or platform path",
|
|
6
|
+
profile: "Profile name; default CHECKPOINT_AXI_PROFILE, env profile, config default, or sole profile",
|
|
7
|
+
fields: "Comma-separated output fields; default all",
|
|
8
|
+
full: "Show full strings instead of 500-character previews; default false",
|
|
9
|
+
help: "Show concise command help; default false",
|
|
10
|
+
};
|
|
11
|
+
const paging = {
|
|
12
|
+
"start-date": "ISO timestamp with timezone; default 24 hours before end-date; maximum window 31 days",
|
|
13
|
+
"end-date": "ISO timestamp with timezone; default now",
|
|
14
|
+
limit: "Maximum rows; default 50, range 1-1000; cannot combine with --all",
|
|
15
|
+
all: "Read up to 1000 rows / 10 HTTP requests / 60 seconds / 8 MiB; default false",
|
|
16
|
+
cursor: "Opaque continuation bound to profile, region, operation and selectors; repeat original selectors",
|
|
17
|
+
};
|
|
18
|
+
const exceptionType = `Required for ${["malware", "url", "dlp"].map((kind) => `${kind}: ${exceptionFamilies[kind].types.join(",")}`).join("; ")}`;
|
|
19
|
+
const writeFlags = { ...common,
|
|
20
|
+
ids: "Required comma-separated unique entity IDs; maximum 20",
|
|
21
|
+
execute: "Send once after all write gates; default false (preview)",
|
|
22
|
+
"dry-run": "Explicit preview; cannot combine with --execute",
|
|
23
|
+
confirm: "Exact operation followed by a space and the comma-separated IDs in supplied order",
|
|
24
|
+
};
|
|
25
|
+
const exceptionWriteFlags = { ...common, execute: writeFlags.execute, "dry-run": writeFlags["dry-run"],
|
|
26
|
+
confirm: "Exact operation followed by a space and every target from preview (payload sha256 for create and malware/url/dlp update, exception ID or comma-separated item IDs otherwise)" };
|
|
27
|
+
const input = "Required absolute private JSON file containing documented requestData fields directly; fields depend on kind; update sends a replacement PUT";
|
|
28
|
+
// Only shipped commands belong here. Inventory records are evidence, never dispatch.
|
|
29
|
+
export const catalogue = {
|
|
30
|
+
"email download": { description: "Download an email to a new private file with profile opt-in, a 50 MiB cap and mandatory SHA-256 verification; scopes and email hash availability are unverified (guide pages 131-132)",
|
|
31
|
+
flags: { config: common.config, profile: common.profile, help: common.help, out: "Required absolute new output file; mode 0600, never stdout or overwrite", original: "Download original email without processing modifications; default false" },
|
|
32
|
+
examples: ["checkpoint-axi email download <entity-id> --out /absolute/message", "checkpoint-axi email download <entity-id> --original --out /absolute/original"] },
|
|
33
|
+
"attachment download": { description: "Download one attachment to a new private file with profile opt-in, a 50 MiB cap and verified x-av-sha256; scope behavior is unverified (guide pages 133-135)",
|
|
34
|
+
flags: { config: common.config, profile: common.profile, help: common.help, out: "Required absolute new output file; mode 0600, never stdout or overwrite", scope: "Optional authorized scope query; default profile scope when configured; live behavior unverified" },
|
|
35
|
+
examples: ["checkpoint-axi attachment download <entity-id> <attachment-id> --out /absolute/attachment", "checkpoint-axi attachment download <entity-id> <attachment-id> --scope <scope> --out /absolute/attachment"] },
|
|
36
|
+
"attachment download-all": { description: "Download available attachments as a ZIP to a new private file with opt-in, a 50 MiB cap and mandatory SHA-256 verification; ZIP hash availability and scopes are unverified; HTTP 200 may contain only some attachments (guide pages 135-137)",
|
|
37
|
+
flags: { config: common.config, profile: common.profile, help: common.help, out: "Required absolute new output file; mode 0600, never stdout or overwrite", scope: "Optional authorized scope query; default profile scope when configured; live behavior unverified" },
|
|
38
|
+
examples: ["checkpoint-axi attachment download-all <entity-id> --out /absolute/attachments", "checkpoint-axi attachment download-all <entity-id> --scope <scope> --out /absolute/attachments"] },
|
|
39
|
+
"exception create": { description: "Preview or create one exception of any kind; anomaly/click-time/malware/url/dlp response identities are unverified (guide pages 61-64, 75-78, 84-85, 91-93, 102-105, 113-116, 123-126)",
|
|
40
|
+
flags: { ...exceptionWriteFlags, input, specific: "Malware/url/dlp only: use the documented create-specific /exceptions route; default false; included in confirmation digest" },
|
|
41
|
+
examples: ["checkpoint-axi exception create phishing-allow --input /absolute/rule.json", "checkpoint-axi exception create spam-allow --input /absolute/rule.json --execute --confirm 'exception.spam-allow.create sha256:<preview-digest>'"] },
|
|
42
|
+
"exception update": { description: "Preview or replace one exception; phishing/spam/click-time require an ID; malware/url/dlp identify it in --input without an ID; anomaly unsupported (guide pages 64-67, 78-81, 94-96, 105-107, 116-117, 126-127)",
|
|
43
|
+
flags: { ...exceptionWriteFlags, input },
|
|
44
|
+
examples: ["checkpoint-axi exception update phishing-block <id> --input /absolute/rule.json", "checkpoint-axi exception update spam-allow <id> --input /absolute/rule.json --execute --confirm 'exception.spam-allow.update <id>'"] },
|
|
45
|
+
"exception remove": { description: "Preview or remove one phishing/spam/anomaly/click-time exception by ID; malware/url/dlp refuse ENDPOINT_UNVERIFIED before authentication (guide pages 67-69, 81-82, 85-87, 98-99, 108-110, 119-120, 129-131)",
|
|
46
|
+
flags: exceptionWriteFlags,
|
|
47
|
+
examples: ["checkpoint-axi exception remove phishing-allow <id>", "checkpoint-axi exception remove spam-allow <id> --execute --confirm 'exception.spam-allow.remove <id>'"] },
|
|
48
|
+
"exception remove-items": { description: "Preview or remove 1-20 click-time items by caller-supplied IDs; existence is unverified (guide pages 97-98)",
|
|
49
|
+
flags: { ...exceptionWriteFlags, ids: "Required 1-20 unique comma-separated click-time item IDs" },
|
|
50
|
+
examples: ["checkpoint-axi exception remove-items click-time --ids <id1>,<id2>", "checkpoint-axi exception remove-items click-time --ids <id1>,<id2> --execute --confirm 'exception.click-time.remove-items <id1>,<id2>'"] },
|
|
51
|
+
"exception clear": { description: "Refuse click-time/malware/url/dlp clear with ENDPOINT_UNVERIFIED until commissioning establishes counts and delete contracts (guide pages 87-88, 96-97, 107-110, 117-120, 128-131)",
|
|
52
|
+
flags: exceptionWriteFlags,
|
|
53
|
+
examples: ["checkpoint-axi exception clear click-time", "checkpoint-axi exception clear click-time --dry-run"] },
|
|
54
|
+
"event action": { description: "Preview or request a name-only event action; parameterized actions refuse ENDPOINT_UNVERIFIED pending commissioning (guide pages 35-37, 42-45)",
|
|
55
|
+
flags: { ...writeFlags, ids: "Required comma-separated unique event IDs; maximum 20", name: "Required available action name; nonempty action parameters are unverified" },
|
|
56
|
+
examples: ["checkpoint-axi event action --ids <id> --name dismiss", "checkpoint-axi event action --ids <id> --name dismiss --execute --confirm 'event.action.dismiss <id>'"] },
|
|
57
|
+
"email quarantine": { description: "Preview or request asynchronous email quarantine through the gated write coordinator (guide pages 28-30)", flags: writeFlags,
|
|
58
|
+
examples: ["checkpoint-axi email quarantine --ids <id>", "checkpoint-axi email quarantine --ids <id> --execute --confirm 'email.quarantine <id>'"] },
|
|
59
|
+
"email restore": { description: "Preview or request asynchronous email restore through the gated write coordinator (guide pages 28-30)", flags: writeFlags,
|
|
60
|
+
examples: ["checkpoint-axi email restore --ids <id>", "checkpoint-axi email restore --ids <id> --execute --confirm 'email.restore <id>'"] },
|
|
61
|
+
"exception list": { description: "List bounded exceptions for phishing-allow, phishing-block, spam-allow, anomaly, click-time, malware, url or dlp (guide pages 49-123)",
|
|
62
|
+
flags: { ...common, type: exceptionType,
|
|
63
|
+
items: "Click-time item routes instead of list routes; default false", limit: paging.limit, all: "Return up to 1000 rows within transport budgets; no server continuation parameter is documented" },
|
|
64
|
+
examples: ["checkpoint-axi exception list phishing-allow", "checkpoint-axi exception list malware --type hash", "checkpoint-axi exception list click-time --items --all"] },
|
|
65
|
+
"exception show": { description: "Show an exception by kind and ID/value; anomaly refuses ENDPOINT_UNVERIFIED pending commissioning (guide pages 52-123)",
|
|
66
|
+
flags: { ...common, type: exceptionType, items: "Click-time item route instead of list route; default false" },
|
|
67
|
+
examples: ["checkpoint-axi exception show phishing-block <id>", "checkpoint-axi exception show url <value> --type allow-url", "checkpoint-axi exception show click-time <id> --items --full"] },
|
|
68
|
+
"event list": { description: "List security events with bounded scroll continuation (API guide pages 37-42)", flags: { ...common, ...paging,
|
|
69
|
+
saas: "Comma-separated SaaS overrides; default selected profile saas or office365_emails",
|
|
70
|
+
"event-types": "Comma-separated event types; default unfiltered",
|
|
71
|
+
"event-states": "Comma-separated event states; default unfiltered",
|
|
72
|
+
severities: "Comma-separated severities; default unfiltered",
|
|
73
|
+
"event-ids": "Comma-separated event IDs; default unfiltered",
|
|
74
|
+
"confidence-indicator": "Confidence indicator selector; default unfiltered",
|
|
75
|
+
description: "Description selector; default unfiltered",
|
|
76
|
+
}, examples: ["checkpoint-axi event list", "checkpoint-axi event list --all --event-types phishing", "checkpoint-axi event list --cursor <cursor>"] },
|
|
77
|
+
"event show": { description: "Show one event, actions taken and available actions (API guide pages 34-37)", flags: common,
|
|
78
|
+
examples: ["checkpoint-axi event show <id>", "checkpoint-axi event show <id> --full"] },
|
|
79
|
+
"task show": { description: "Show asynchronous task status and per-action details (API guide pages 30-33)", flags: common,
|
|
80
|
+
examples: ["checkpoint-axi task show <id>", "checkpoint-axi task show <id> --full"] },
|
|
81
|
+
"email search": { description: "Search emails with a bounded date window and scroll continuation (API guide pages 18-27)", flags: { ...common,
|
|
82
|
+
saas: "SaaS override; default selected profile saas or office365_emails",
|
|
83
|
+
"saas-entity": "Optional SaaS entity type selector",
|
|
84
|
+
...paging,
|
|
85
|
+
filter: "JSON array of {saasAttrName, saasAttrOp, saasAttrValue} filters (guide pages 19-20)",
|
|
86
|
+
}, examples: ["checkpoint-axi email search", "checkpoint-axi email search --all --saas office365_emails", "checkpoint-axi email search --cursor <cursor>"] },
|
|
87
|
+
"email show": { description: "Show one email with verdicts, actions and available actions (API guide pages 10-18)", flags: common,
|
|
88
|
+
examples: ["checkpoint-axi email show <id>", "checkpoint-axi email show <id> --full"] },
|
|
89
|
+
doctor: { description: "Check regional API authentication and one bounded email search without printing tenant data", flags: { ...common, saas: "SaaS override; default selected profile saas or office365_emails" },
|
|
90
|
+
examples: ["checkpoint-axi doctor", "checkpoint-axi doctor --profile example --saas office365_emails"] },
|
|
91
|
+
home: { description: "Show local profile context without resolving secrets or making API calls", flags: common,
|
|
92
|
+
examples: ["checkpoint-axi", "checkpoint-axi home --profile example"] },
|
|
93
|
+
"auth status": { description: "Validate the selected local profile and secret source without API calls", flags: common,
|
|
94
|
+
examples: ["checkpoint-axi auth status", "checkpoint-axi auth status --profile example"] },
|
|
95
|
+
"profile list": { description: "List file profiles without resolving secrets; --profile does not filter this list", flags: common,
|
|
96
|
+
examples: ["checkpoint-axi profile list", "checkpoint-axi profile list --config /example/config.json"] },
|
|
97
|
+
"config path": { description: "Show config and state paths without reading files; --profile does not affect paths", flags: common,
|
|
98
|
+
examples: ["checkpoint-axi config path", "checkpoint-axi config path --fields config"] },
|
|
99
|
+
};
|
|
100
|
+
export function help() {
|
|
101
|
+
return { description: DESCRIPTION, commands: Object.fromEntries(Object.entries(catalogue).map(([name, entry]) => [name, entry.description])),
|
|
102
|
+
flags: common, version: "-v, -V, --version: print the bare version", examples: catalogue.home.examples };
|
|
103
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type CredentialContext } from "./profiles.js";
|
|
2
|
+
import type { gateway } from "./transport.js";
|
|
3
|
+
export declare function main(argv?: string[], options?: {
|
|
4
|
+
credentials?: CredentialContext;
|
|
5
|
+
transport?: Parameters<typeof gateway>[3];
|
|
6
|
+
stdout?: {
|
|
7
|
+
write: (chunk: string) => unknown;
|
|
8
|
+
};
|
|
9
|
+
}): Promise<void>;
|
package/dist/src/cli.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AxiError, runAxiCli } from "axi-sdk-js";
|
|
2
|
+
import { encode } from "@toon-format/toon";
|
|
3
|
+
import { DESCRIPTION } from "./catalogue.js";
|
|
4
|
+
import { credentialStore } from "./profiles.js";
|
|
5
|
+
import { localCommand } from "./local-commands.js";
|
|
6
|
+
export async function main(argv = process.argv.slice(2), options = {}) {
|
|
7
|
+
const store = credentialStore(options.credentials);
|
|
8
|
+
await runAxiCli({
|
|
9
|
+
description: DESCRIPTION,
|
|
10
|
+
argv: ["local"],
|
|
11
|
+
topLevelHelp: "",
|
|
12
|
+
home: () => localCommand([], store),
|
|
13
|
+
stdout: { write: (chunk) => (options.stdout ?? process.stdout).write(store.redactor.text(chunk)) },
|
|
14
|
+
formatError: (error) => ({
|
|
15
|
+
output: `${encode(store.redactor.value(error instanceof AxiError
|
|
16
|
+
? { error: { code: error.code, message: error.message }, help: error.suggestions }
|
|
17
|
+
: { error: { code: "CONFIG_INVALID", message: "Command could not complete" }, help: ["Check local configuration; run checkpoint-axi config path"] }))}\n`,
|
|
18
|
+
exitCode: error instanceof AxiError && error.code === "VALIDATION_ERROR" ? 2 : 1,
|
|
19
|
+
}),
|
|
20
|
+
commands: { local: async () => store.redactor.value(await localCommand(argv, store, options.transport)) },
|
|
21
|
+
});
|
|
22
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { credentialStore } from "./profiles.js";
|
|
2
|
+
import { gateway } from "./transport.js";
|
|
3
|
+
export declare function doctor(store: ReturnType<typeof credentialStore>, config?: string, selected?: string, override?: string, transport?: Parameters<typeof gateway>[3]): Promise<Record<string, unknown>>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { AxiError } from "axi-sdk-js";
|
|
2
|
+
import { gateway } from "./transport.js";
|
|
3
|
+
export async function doctor(store, config, selected, override, transport) {
|
|
4
|
+
store.readOnly();
|
|
5
|
+
const profile = store.select(store.load(config, true).config, selected);
|
|
6
|
+
const saas = override?.trim() ?? profile.saas;
|
|
7
|
+
if (!saas)
|
|
8
|
+
throw new AxiError("--saas must not be blank", "VALIDATION_ERROR", ["Run checkpoint-axi doctor --help"]);
|
|
9
|
+
const api = gateway(profile, store.credentials(profile, true), store.redactor, transport);
|
|
10
|
+
const checks = [];
|
|
11
|
+
for (const check of ["auth", "read"]) {
|
|
12
|
+
try {
|
|
13
|
+
if (check === "auth")
|
|
14
|
+
await api.authenticate();
|
|
15
|
+
else {
|
|
16
|
+
const end = new Date();
|
|
17
|
+
// One page of the default 24-hour window, not an --all scan (guide pages 18-21).
|
|
18
|
+
await api.read({ path: "/search/query", body: { entityFilter: { saas,
|
|
19
|
+
startDate: new Date(end.getTime() - 86_400_000).toISOString(), endDate: end.toISOString() } } });
|
|
20
|
+
}
|
|
21
|
+
checks.push({ check, pass: true });
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
checks.push({ check, pass: false, code: error instanceof AxiError ? error.code : "API_ERROR" });
|
|
25
|
+
if (check === "auth")
|
|
26
|
+
checks.push({ check: "read", pass: false, code: "AUTH_NOT_PASSED" });
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const pass = checks.every((check) => check.pass);
|
|
31
|
+
if (!pass)
|
|
32
|
+
process.exitCode = 1;
|
|
33
|
+
return { region: profile.region, saas, checks, pass, ...(!pass ? { help: [
|
|
34
|
+
"Check the regional credentials and API access; AUTH_SHAPE_UNVERIFIED requires owner commissioning of the undocumented token response (guide page 8)",
|
|
35
|
+
"Run checkpoint-axi auth status to check local credential readiness; never share credentials or raw API responses",
|
|
36
|
+
] } : {}) };
|
|
37
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { credentialStore } from "./profiles.js";
|
|
2
|
+
import { gateway } from "./transport.js";
|
|
3
|
+
export declare function downloadCommand(name: string, entityId: string | undefined, attachmentId: string | undefined, flags: Map<string, string>, store: ReturnType<typeof credentialStore>, transport?: Parameters<typeof gateway>[3]): Promise<Record<string, unknown>>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { AxiError } from "axi-sdk-js";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
import { closeSync, constants, fchmodSync, fsyncSync, openSync, unlinkSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { isAbsolute, resolve } from "node:path";
|
|
5
|
+
import { protectWindowsFile } from "./private-file.js";
|
|
6
|
+
import { gateway } from "./transport.js";
|
|
7
|
+
export async function downloadCommand(name, entityId, attachmentId, flags, store, transport) {
|
|
8
|
+
const out = flags.get("--out");
|
|
9
|
+
if (!entityId || !/^[A-Za-z0-9_-]{1,256}$/.test(entityId) || name === "attachment download" && (!attachmentId || !/^[A-Za-z0-9_-]{1,256}$/.test(attachmentId))
|
|
10
|
+
|| !out || !isAbsolute(out) || out === "-" || out.includes("\0")) {
|
|
11
|
+
throw new AxiError("Supply download IDs and an absolute new --out file path", "VALIDATION_ERROR", ["Run checkpoint-axi " + name + " --help"]);
|
|
12
|
+
}
|
|
13
|
+
store.readOnly();
|
|
14
|
+
const profile = store.select(store.load(flags.get("--config"), true).config, flags.get("--profile"));
|
|
15
|
+
if (!profile.downloads.allow)
|
|
16
|
+
throw new AxiError("Downloads are disabled", "DOWNLOADS_DISABLED", ["Enable downloads.allow in the selected file profile"]);
|
|
17
|
+
const path = resolve(out);
|
|
18
|
+
let fd;
|
|
19
|
+
try {
|
|
20
|
+
fd = openSync(path, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | (process.platform === "win32" ? 0 : constants.O_NOFOLLOW), 0o600);
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
throw new AxiError("Cannot create a new output file", "DOWNLOAD_OUTPUT_INVALID", ["Choose a new --out path in an existing directory; existing files are never overwritten"]);
|
|
24
|
+
}
|
|
25
|
+
let complete = false;
|
|
26
|
+
try {
|
|
27
|
+
if (process.platform === "win32")
|
|
28
|
+
protectWindowsFile(path);
|
|
29
|
+
else
|
|
30
|
+
fchmodSync(fd, 0o600);
|
|
31
|
+
const api = gateway(profile, store.credentials(profile, true), store.redactor, transport);
|
|
32
|
+
const result = await api.download({ entityId, attachmentId, all: name === "attachment download-all", original: name === "email download" ? flags.has("--original") : undefined,
|
|
33
|
+
scope: flags.get("--scope") ?? (name === "email download" ? undefined : profile.scope) });
|
|
34
|
+
const sha256 = createHash("sha256").update(result.content).digest("hex");
|
|
35
|
+
if (sha256 !== result.sha256)
|
|
36
|
+
throw new AxiError("Download SHA-256 does not match", "DOWNLOAD_HASH_MISMATCH", ["Discard the failed download and investigate before trying again"]);
|
|
37
|
+
writeFileSync(fd, result.content);
|
|
38
|
+
fsyncSync(fd);
|
|
39
|
+
complete = true;
|
|
40
|
+
return { path, size: result.content.length, sha256 };
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
if (error instanceof AxiError)
|
|
44
|
+
throw error;
|
|
45
|
+
throw new AxiError("Download could not complete", "DOWNLOAD_FAILED", ["Check the output directory and selected profile"]);
|
|
46
|
+
}
|
|
47
|
+
finally {
|
|
48
|
+
closeSync(fd);
|
|
49
|
+
if (!complete)
|
|
50
|
+
unlinkSync(path);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { credentialStore } from "./profiles.js";
|
|
2
|
+
import { gateway } from "./transport.js";
|
|
3
|
+
export declare const exceptionFamilies: {
|
|
4
|
+
readonly "phishing-allow": {
|
|
5
|
+
readonly path: "/exceptions/whitelist";
|
|
6
|
+
readonly types: readonly [];
|
|
7
|
+
};
|
|
8
|
+
readonly "phishing-block": {
|
|
9
|
+
readonly path: "/exceptions/blacklist";
|
|
10
|
+
readonly types: readonly [];
|
|
11
|
+
};
|
|
12
|
+
readonly "spam-allow": {
|
|
13
|
+
readonly path: "/exceptions/spam_whitelist";
|
|
14
|
+
readonly types: readonly [];
|
|
15
|
+
};
|
|
16
|
+
readonly anomaly: {
|
|
17
|
+
readonly path: "/sectools/anomaly/exceptions";
|
|
18
|
+
readonly types: readonly [];
|
|
19
|
+
};
|
|
20
|
+
readonly "click-time": {
|
|
21
|
+
readonly path: "/sectools/click_time_protection/exceptions";
|
|
22
|
+
readonly types: readonly [];
|
|
23
|
+
};
|
|
24
|
+
readonly malware: {
|
|
25
|
+
readonly path: "/sectool-exceptions/checkpoint2/exceptions";
|
|
26
|
+
readonly types: readonly ["hash", "micro_hash", "file_type", "ppat_sender_name", "allow_file_type", "sender_email"];
|
|
27
|
+
};
|
|
28
|
+
readonly url: {
|
|
29
|
+
readonly path: "/sectool-exceptions/avanan_url/exceptions";
|
|
30
|
+
readonly types: readonly ["allow-url", "allow-domain", "block-url", "block-domain"];
|
|
31
|
+
};
|
|
32
|
+
readonly dlp: {
|
|
33
|
+
readonly path: "/sectool-exceptions/avanan_dlp/exceptions";
|
|
34
|
+
readonly types: readonly ["hash", "text_content", "sender_email", "recipient_email"];
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export declare function exceptionCommand(name: "exception list" | "exception show", kind: string | undefined, value: string | undefined, flags: Map<string, string>, store: ReturnType<typeof credentialStore>, transport?: Parameters<typeof gateway>[3]): Promise<Record<string, unknown>>;
|