@cantinasecurity/apex-cli 0.1.35 → 0.1.36
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/.claude/skills/apex-cli/SKILL.md +33 -0
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.mcp.claude.json +1 -1
- package/.mcp.codex.json +1 -1
- package/MARKETPLACE.md +1 -1
- package/README.md +44 -9
- package/dist/apex.js +6 -0
- package/dist/cvss.js +49 -0
- package/dist/help.js +2 -0
- package/package.json +1 -1
- package/skills/apex-cli/SKILL.md +33 -0
|
@@ -120,3 +120,36 @@ If the Apex MCP server is not configured, fall back to the local CLI:
|
|
|
120
120
|
- Use `apex-finding-tickets` to read existing links. CLI fallback: `apex findings link-ticket <finding-ref> <linear|jira> <issue-key|url> --json`, then `apex findings tickets <finding-ref> --json`.
|
|
121
121
|
- Hosted MCP uses `findingId` (UUID) instead of `findingRef`, with no `cwd` or `scanId`. Linking requires explicit `findings:write`; listing requires `findings:read`. Default service-key scopes remain scans:create, scans:read, findings:read. Do not infer write permission from read access.
|
|
122
122
|
- Apex verifies the ticket through the connected integration and records the frontend link; it does not create or modify a provider ticket. Repeating the same association is safe. A different existing link or in-progress export is a conflict: do not replace it or create another ticket as a fallback. For ambiguous Jira sites, use the full issue URL.
|
|
123
|
+
|
|
124
|
+
### Workspace CVSS configuration
|
|
125
|
+
|
|
126
|
+
Use `apex workspace use <workspace>` to bind the intended existing workspace, then
|
|
127
|
+
`apex cvss get` to read its configuration and CVSS 3.1 policy template. To update it,
|
|
128
|
+
write a JSON file containing exactly `enabled` (boolean) and `policy` (the edited
|
|
129
|
+
template), then run `apex cvss set --file <configuration.json>`. Both commands emit
|
|
130
|
+
JSON and require an existing device-login account; they never initiate login,
|
|
131
|
+
create a workspace, or start a scan. Guest sessions are denied. `enabled: false`
|
|
132
|
+
disables CVSS scoring while preserving the supplied policy. This configures future
|
|
133
|
+
synthesis; it does not rescore historical findings.
|
|
134
|
+
|
|
135
|
+
CVSS administration is intentionally scripted CLI only for this release. No shell,
|
|
136
|
+
local MCP, hosted MCP, or organization service-key tool is added. Agents can invoke
|
|
137
|
+
these explicit terminal commands. Server deployment requires Bedrock CVSS API support for CLI bearer authentication.
|
|
138
|
+
|
|
139
|
+
Example (jq is used only to prepare the JSON file):
|
|
140
|
+
|
|
141
|
+
```sh
|
|
142
|
+
apex login
|
|
143
|
+
apex workspace use "<workspace name or prefix>"
|
|
144
|
+
apex cvss get > cvss-current.json
|
|
145
|
+
jq '.configuration // {enabled: true, policy: .template}' cvss-current.json > cvss.json
|
|
146
|
+
# Edit cvss.json, then save and verify:
|
|
147
|
+
apex cvss set --file cvss.json
|
|
148
|
+
apex cvss get
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Keep `policy.version` at `3.1`. Supply a name, instructions, and all eight metrics
|
|
152
|
+
(AV, AC, PR, UI, S, C, I, A). Each metric has an `options` map with at least one
|
|
153
|
+
allowed value and nonempty guidance for each allowed value. Omit disallowed
|
|
154
|
+
values. If Audit Setup or another workspace update is active, wait for it to
|
|
155
|
+
finish before saving again.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Cantina agent plugins for security review workflows.",
|
|
9
|
-
"version": "0.1.
|
|
9
|
+
"version": "0.1.36"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"source": {
|
|
15
15
|
"source": "npm",
|
|
16
16
|
"package": "@cantinasecurity/apex-cli",
|
|
17
|
-
"version": "0.1.
|
|
17
|
+
"version": "0.1.36"
|
|
18
18
|
},
|
|
19
19
|
"description": "Run Apex security scans and review findings from Claude Code.",
|
|
20
|
-
"version": "0.1.
|
|
20
|
+
"version": "0.1.36",
|
|
21
21
|
"author": {
|
|
22
22
|
"name": "Cantina",
|
|
23
23
|
"email": "support@cantina.xyz"
|
package/.mcp.claude.json
CHANGED
package/.mcp.codex.json
CHANGED
package/MARKETPLACE.md
CHANGED
|
@@ -13,7 +13,7 @@ This package is prepared as both a Claude Code plugin and a Codex plugin. The pu
|
|
|
13
13
|
The plugin MCP configs launch the pinned npm CLI package with:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npx -y -p @cantinasecurity/apex-cli@0.1.
|
|
16
|
+
npx -y -p @cantinasecurity/apex-cli@0.1.36 apex-mcp
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
That keeps marketplace installs independent of a user's global `apex` install.
|
package/README.md
CHANGED
|
@@ -158,30 +158,30 @@ unclaimed local trial proof so `apex claim` can still use it.
|
|
|
158
158
|
Agent-safe copy/paste prompt (substitute the issued code):
|
|
159
159
|
|
|
160
160
|
```text
|
|
161
|
-
Install and run Cantina Apex CLI 0.1.
|
|
161
|
+
Install and run Cantina Apex CLI 0.1.36 to start one free standard security scan of this repository immediately.
|
|
162
162
|
|
|
163
163
|
Use this trial code only where <TRIAL_CODE> appears below: SPBT-DEVREL-XXXXXXXX
|
|
164
164
|
|
|
165
165
|
Run the commands yourself from the repository root; do not stop after setup or only explain the steps. Use terminal CLI commands only. Do not use an Apex MCP tool or run `apex setup`, `apex mcp`, `apex login`, `apex-auth-start`, or `apex-auth-wait`. Never use `--replace` or `--force`.
|
|
166
166
|
|
|
167
167
|
Use this exact command prefix for every Apex command:
|
|
168
|
-
npx -y -p @cantinasecurity/apex-cli@0.1.
|
|
168
|
+
npx -y -p @cantinasecurity/apex-cli@0.1.36 apex
|
|
169
169
|
|
|
170
170
|
1. Before redeeming, confirm every command will use the same persistent, user-accessible machine or container, HOME, filesystem, and repository root. Confirm Node.js 20+ and npx are available. If `APEX_BASE_URL` is set, continue only when its origin is `https://ai.cantina.xyz`. Run the exact prefix with `--help` and continue only if help lists both `redeem` and `claim`. If any check fails, STOP before sending the code; do not install system packages.
|
|
171
171
|
2. Redeem, with at most one response-loss recovery retry:
|
|
172
|
-
npx -y -p @cantinasecurity/apex-cli@0.1.
|
|
172
|
+
npx -y -p @cantinasecurity/apex-cli@0.1.36 apex redeem <TRIAL_CODE> --json
|
|
173
173
|
This terminal command is the only allowed tool call containing the code. Never echo or restate the code, store it in a file or environment variable, put it in a URL or MCP call, or include it in your response. Parse the JSON from stdout only; do not merge stderr into stdout, because npm may write warnings to stderr. Continue when the command exits 0 and stdout is JSON with `redeemed: true` and `outcome` equal to `redeemed` or `idempotent`. `idempotent` means the existing guest session resumed and it may already own a workspace. If and only if the first attempt ends with an ambiguous transport/connection failure or an interrupted/missing response and no typed server error code, retry this exact same command once on the same machine, HOME, and repository root. Never retry a typed server rejection and never make more than one recovery retry. If the allowed retry does not return a successful JSON outcome, STOP.
|
|
174
174
|
3. Immediately start exactly one scan; do not wait for another instruction:
|
|
175
|
-
npx -y -p @cantinasecurity/apex-cli@0.1.
|
|
175
|
+
npx -y -p @cantinasecurity/apex-cli@0.1.36 apex scan --mode standard --non-interactive --no-open --json
|
|
176
176
|
The CLI validates the complete guest local archive before it reserves a workspace. An unbound renamed checkout may recover only the sole empty guest workspace when no explicit workspace name was supplied. On any error or nonzero exit, STOP. After a successful scan JSON response, inspect `localPersistence.workspaceBindingSaved`. If it is `false`, the server scan already started: capture and report `binding.lastScanId`, then STOP; do not run status or findings until local repository permissions are repaired. Otherwise capture `binding.lastScanId` from the JSON as <SCAN_ID>; if it is absent, STOP.
|
|
177
177
|
4. About every 60 seconds, poll that exact scan:
|
|
178
|
-
npx -y -p @cantinasecurity/apex-cli@0.1.
|
|
178
|
+
npx -y -p @cantinasecurity/apex-cli@0.1.36 apex status --scan <SCAN_ID> --json
|
|
179
179
|
Read `progress.progress.status`. Wait while it is `created`, `pending`, `queued`, `starting`, `running`, `in_progress`, or `processing`. Continue on `completed`. STOP on `failed`, `cancelled`, a missing or unknown status, or a command failure.
|
|
180
180
|
5. Fetch that exact scan's findings:
|
|
181
|
-
npx -y -p @cantinasecurity/apex-cli@0.1.
|
|
181
|
+
npx -y -p @cantinasecurity/apex-cli@0.1.36 apex findings --scan <SCAN_ID> --json
|
|
182
182
|
On success, summarize findings by severity, most severe first, including identifier, title, status, and confidence. This command does not return file locations, so do not invent them. On failure, STOP.
|
|
183
183
|
6. Do not claim automatically. Tell me the claim deadline from step 2 and remind me to run this exact command myself from the same repository root, machine, and HOME:
|
|
184
|
-
npx -y -p @cantinasecurity/apex-cli@0.1.
|
|
184
|
+
npx -y -p @cantinasecurity/apex-cli@0.1.36 apex claim
|
|
185
185
|
It may open a browser so I can create or sign in to a Cantina account and keep the results. Claim moves the trial into the currently selected Cantina workspace when I can run scans there, or into my existing personal workspace. If the selected workspace cannot run scans, tell me to switch to one that can and retry before the claim deadline.
|
|
186
186
|
|
|
187
187
|
Never paste raw command transcripts. For any failure, report only the step, exit code, and sanitized error. Redact the trial code and every `apex_at_`, `apex_rt_`, or `apex_ct_` value from all reports.
|
|
@@ -266,6 +266,8 @@ Supported shell commands:
|
|
|
266
266
|
- `apex workspaces`
|
|
267
267
|
- `apex workspace`
|
|
268
268
|
- `apex workspace use <workspace-name|workspace-prefix|workspace-id>`
|
|
269
|
+
- `apex cvss get`
|
|
270
|
+
- `apex cvss set --file <configuration.json>`
|
|
269
271
|
- `apex cancel-scan [scan-id]`
|
|
270
272
|
- `apex status [--scan <scan-id>]`
|
|
271
273
|
- `apex doctor`
|
|
@@ -667,7 +669,7 @@ Telemetry event posts do not include bearer tokens. The telemetry endpoint is `P
|
|
|
667
669
|
{
|
|
668
670
|
"schemaVersion": 1,
|
|
669
671
|
"event": "apex.invocation.completed",
|
|
670
|
-
"cliVersion": "0.1.
|
|
672
|
+
"cliVersion": "0.1.36",
|
|
671
673
|
"invocation": {
|
|
672
674
|
"surface": "mcp",
|
|
673
675
|
"command": "apex-scan",
|
|
@@ -698,7 +700,7 @@ The npm package also includes marketplace-ready plugin artifacts:
|
|
|
698
700
|
- `.claude-plugin/plugin.json` and `.mcp.claude.json` for Claude Code plugin installs
|
|
699
701
|
- `.claude-plugin/marketplace.json` for a Claude marketplace entry backed by the public npm package
|
|
700
702
|
|
|
701
|
-
These plugin installs launch the pinned npm package with `npx -y -p @cantinasecurity/apex-cli@0.1.
|
|
703
|
+
These plugin installs launch the pinned npm package with `npx -y -p @cantinasecurity/apex-cli@0.1.36 apex-mcp`, so users do not need to install `apex` globally before enabling the plugin.
|
|
702
704
|
|
|
703
705
|
The repository also includes `.agents/plugins/marketplace.json` for local Codex marketplace testing from a checkout.
|
|
704
706
|
|
|
@@ -735,3 +737,36 @@ To move between existing Apex workspaces from the CLI:
|
|
|
735
737
|
3. If the workspace name contains spaces, quote it, for example `apex workspace use "Core Platform"`.
|
|
736
738
|
4. Use `apex scans`, `apex status --scan <scan-id>`, `apex findings`, and `apex export findings` against that binding.
|
|
737
739
|
5. Use `apex findings --workspace --company <handle> --workspace-ref <ref> --finding-state open` for the workspace browser's cross-scan findings that still need review, without changing the local binding.
|
|
740
|
+
|
|
741
|
+
### Workspace CVSS configuration
|
|
742
|
+
|
|
743
|
+
Use `apex workspace use <workspace>` to bind the intended existing workspace, then
|
|
744
|
+
`apex cvss get` to read its configuration and CVSS 3.1 policy template. To update it,
|
|
745
|
+
write a JSON file containing exactly `enabled` (boolean) and `policy` (the edited
|
|
746
|
+
template), then run `apex cvss set --file <configuration.json>`. Both commands emit
|
|
747
|
+
JSON and require an existing device-login account; they never initiate login,
|
|
748
|
+
create a workspace, or start a scan. Guest sessions are denied. `enabled: false`
|
|
749
|
+
disables CVSS scoring while preserving the supplied policy. This configures future
|
|
750
|
+
synthesis; it does not rescore historical findings.
|
|
751
|
+
|
|
752
|
+
CVSS administration is intentionally scripted CLI only for this release. No shell,
|
|
753
|
+
local MCP, hosted MCP, or organization service-key tool is added. Agents can invoke
|
|
754
|
+
these explicit terminal commands. Server deployment requires Bedrock CVSS API support for CLI bearer authentication.
|
|
755
|
+
|
|
756
|
+
Example (jq is used only to prepare the JSON file):
|
|
757
|
+
|
|
758
|
+
```sh
|
|
759
|
+
apex login
|
|
760
|
+
apex workspace use "<workspace name or prefix>"
|
|
761
|
+
apex cvss get > cvss-current.json
|
|
762
|
+
jq '.configuration // {enabled: true, policy: .template}' cvss-current.json > cvss.json
|
|
763
|
+
# Edit cvss.json, then save and verify:
|
|
764
|
+
apex cvss set --file cvss.json
|
|
765
|
+
apex cvss get
|
|
766
|
+
```
|
|
767
|
+
|
|
768
|
+
Keep `policy.version` at `3.1`. Supply a name, instructions, and all eight metrics
|
|
769
|
+
(AV, AC, PR, UI, S, C, I, A). Each metric has an `options` map with at least one
|
|
770
|
+
allowed value and nonempty guidance for each allowed value. Omit disallowed
|
|
771
|
+
values. If Audit Setup or another workspace update is active, wait for it to
|
|
772
|
+
finish before saving again.
|
package/dist/apex.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { commandCvss } from "./cvss.js";
|
|
1
2
|
import { commandStartThreatModel, commandThreatModel, hasAuditSetupBeta, threatModelExitCode, terminalText } from "./threat-model.js";
|
|
2
3
|
import { getMe } from "./auth.js";
|
|
3
4
|
import { ApexApiClient, formatApiError } from "./api-client.js";
|
|
@@ -94,6 +95,11 @@ async function dispatch(parsed) {
|
|
|
94
95
|
case "workspaces":
|
|
95
96
|
await commandWorkspaces(client, cwd, parsed.flags);
|
|
96
97
|
return;
|
|
98
|
+
case "cvss":
|
|
99
|
+
if (parsed.args.length)
|
|
100
|
+
throw new Error("Unexpected CVSS arguments");
|
|
101
|
+
await commandCvss(client, cwd, parsed.flags, parsed.subcommand);
|
|
102
|
+
return;
|
|
97
103
|
case "workspace":
|
|
98
104
|
if (parsed.subcommand === "use") {
|
|
99
105
|
const workspaceRef = parsed.args.join(" ");
|
package/dist/cvss.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { getMe } from "./auth.js";
|
|
5
|
+
import { getFlagString } from "./args.js";
|
|
6
|
+
import { printJson } from "./output.js";
|
|
7
|
+
import { loadWorkspaceBinding } from "./workspace-binding.js";
|
|
8
|
+
const inputSchema = z
|
|
9
|
+
.object({
|
|
10
|
+
enabled: z.boolean(),
|
|
11
|
+
policy: z.record(z.string(), z.unknown()),
|
|
12
|
+
})
|
|
13
|
+
.strict();
|
|
14
|
+
export async function commandCvss(client, cwd, flags, action) {
|
|
15
|
+
const file = getFlagString(flags, "file");
|
|
16
|
+
if (!["get", "set"].includes(action ?? "") ||
|
|
17
|
+
(action === "set" ? !file : file))
|
|
18
|
+
throw new Error("Usage: apex cvss get | apex cvss set --file <configuration.json>");
|
|
19
|
+
if (flags.company || flags["workspace-name"] || flags["workspace-ref"])
|
|
20
|
+
throw new Error("CVSS uses the bound workspace. Run `apex workspace use <workspace>` first.");
|
|
21
|
+
const binding = await loadWorkspaceBinding(cwd);
|
|
22
|
+
if (!binding)
|
|
23
|
+
throw new Error("Run `apex workspace use <workspace>` before configuring CVSS.");
|
|
24
|
+
let input;
|
|
25
|
+
if (action === "set") {
|
|
26
|
+
const raw = await readFile(path.resolve(cwd, file), "utf8");
|
|
27
|
+
if (Buffer.byteLength(raw) > 128 * 1024)
|
|
28
|
+
throw new Error("CVSS configuration is too large.");
|
|
29
|
+
input = inputSchema.parse(JSON.parse(raw));
|
|
30
|
+
}
|
|
31
|
+
const me = await getMe(client);
|
|
32
|
+
if (!me)
|
|
33
|
+
throw new Error("Run `apex login` before configuring CVSS.");
|
|
34
|
+
if ((await client.getCredentials())?.guest ||
|
|
35
|
+
me.user.role?.trim().toLowerCase() === "guest")
|
|
36
|
+
throw new Error("CVSS configuration requires a signed-in account.");
|
|
37
|
+
const response = await client.request(`/api/workspaces/${encodeURIComponent(binding.workspaceId)}/cvss`, action === "set" ? { method: "PUT", json: input } : {});
|
|
38
|
+
const payload = {
|
|
39
|
+
configuration: response.configuration
|
|
40
|
+
? {
|
|
41
|
+
enabled: response.configuration.enabled,
|
|
42
|
+
policy: response.configuration.policy,
|
|
43
|
+
}
|
|
44
|
+
: null,
|
|
45
|
+
template: response.template,
|
|
46
|
+
};
|
|
47
|
+
printJson(payload);
|
|
48
|
+
return payload;
|
|
49
|
+
}
|
package/dist/help.js
CHANGED
|
@@ -18,6 +18,8 @@ export const CLI_HELP_TEXT = `Usage:
|
|
|
18
18
|
Start a fix review scan for a Fix PR or current repository
|
|
19
19
|
apex export findings Export findings for the latest or selected scan
|
|
20
20
|
apex workspaces List accessible workspaces for the active company
|
|
21
|
+
apex cvss get Read workspace CVSS configuration and template (JSON)
|
|
22
|
+
apex cvss set --file <json> Update the bound workspace CVSS 3.1 rubric
|
|
21
23
|
apex workspace Show the workspace currently bound to this directory
|
|
22
24
|
apex workspace use <workspace-name|workspace-prefix|workspace-id>
|
|
23
25
|
Bind this directory to an existing Apex workspace
|
package/package.json
CHANGED
package/skills/apex-cli/SKILL.md
CHANGED
|
@@ -120,3 +120,36 @@ verify `apex-credits` without printing the credential.
|
|
|
120
120
|
- Use `apex-finding-tickets` to read existing links. CLI fallback: `apex findings link-ticket <finding-ref> <linear|jira> <issue-key|url> --json`, then `apex findings tickets <finding-ref> --json`.
|
|
121
121
|
- Hosted MCP uses `findingId` (UUID) instead of `findingRef`, with no `cwd` or `scanId`. Linking requires explicit `findings:write`; listing requires `findings:read`. Default service-key scopes remain scans:create, scans:read, findings:read. Do not infer write permission from read access.
|
|
122
122
|
- Apex verifies the ticket through the connected integration and records the frontend link; it does not create or modify a provider ticket. Repeating the same association is safe. A different existing link or in-progress export is a conflict: do not replace it or create another ticket as a fallback. For ambiguous Jira sites, use the full issue URL.
|
|
123
|
+
|
|
124
|
+
### Workspace CVSS configuration
|
|
125
|
+
|
|
126
|
+
Use `apex workspace use <workspace>` to bind the intended existing workspace, then
|
|
127
|
+
`apex cvss get` to read its configuration and CVSS 3.1 policy template. To update it,
|
|
128
|
+
write a JSON file containing exactly `enabled` (boolean) and `policy` (the edited
|
|
129
|
+
template), then run `apex cvss set --file <configuration.json>`. Both commands emit
|
|
130
|
+
JSON and require an existing device-login account; they never initiate login,
|
|
131
|
+
create a workspace, or start a scan. Guest sessions are denied. `enabled: false`
|
|
132
|
+
disables CVSS scoring while preserving the supplied policy. This configures future
|
|
133
|
+
synthesis; it does not rescore historical findings.
|
|
134
|
+
|
|
135
|
+
CVSS administration is intentionally scripted CLI only for this release. No shell,
|
|
136
|
+
local MCP, hosted MCP, or organization service-key tool is added. Agents can invoke
|
|
137
|
+
these explicit terminal commands. Server deployment requires Bedrock CVSS API support for CLI bearer authentication.
|
|
138
|
+
|
|
139
|
+
Example (jq is used only to prepare the JSON file):
|
|
140
|
+
|
|
141
|
+
```sh
|
|
142
|
+
apex login
|
|
143
|
+
apex workspace use "<workspace name or prefix>"
|
|
144
|
+
apex cvss get > cvss-current.json
|
|
145
|
+
jq '.configuration // {enabled: true, policy: .template}' cvss-current.json > cvss.json
|
|
146
|
+
# Edit cvss.json, then save and verify:
|
|
147
|
+
apex cvss set --file cvss.json
|
|
148
|
+
apex cvss get
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Keep `policy.version` at `3.1`. Supply a name, instructions, and all eight metrics
|
|
152
|
+
(AV, AC, PR, UI, S, C, I, A). Each metric has an `options` map with at least one
|
|
153
|
+
allowed value and nonempty guidance for each allowed value. Omit disallowed
|
|
154
|
+
values. If Audit Setup or another workspace update is active, wait for it to
|
|
155
|
+
finish before saving again.
|