@vigilbase/cli 0.1.4 → 0.2.1
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/CLOUDFLARE.md +3 -4
- package/COMMANDS.md +158 -83
- package/LOCAL.md +721 -0
- package/ONE.md +2 -4
- package/README.md +341 -123
- package/SECURITY.md +2 -2
- package/dist/auth/device-auth.d.ts +0 -1
- package/dist/auth/device-auth.js +13 -8
- package/dist/auth/index.d.ts +4 -2
- package/dist/auth/index.js +3 -2
- package/dist/auth/provider.d.ts +18 -0
- package/dist/auth/provider.js +71 -0
- package/dist/auth/refresh.d.ts +29 -0
- package/dist/auth/refresh.js +199 -0
- package/dist/auth/store.d.ts +103 -4
- package/dist/auth/store.js +400 -74
- package/dist/auth/token-metadata.d.ts +9 -0
- package/dist/auth/token-metadata.js +21 -0
- package/dist/auth/types.d.ts +8 -2
- package/dist/auth/types.js +0 -1
- package/dist/bin.d.ts +0 -1
- package/dist/bin.js +0 -1
- package/dist/cli.d.ts +4 -2
- package/dist/cli.js +45 -15
- package/dist/commands/account.d.ts +0 -1
- package/dist/commands/account.js +0 -1
- package/dist/commands/auth.d.ts +0 -1
- package/dist/commands/auth.js +82 -22
- package/dist/commands/billing.d.ts +0 -1
- package/dist/commands/billing.js +0 -1
- package/dist/commands/cloudflare.d.ts +1 -2
- package/dist/commands/cloudflare.js +6 -6
- package/dist/commands/helpers.d.ts +15 -1
- package/dist/commands/helpers.js +2 -3
- package/dist/commands/index.d.ts +3 -2
- package/dist/commands/index.js +6 -2
- package/dist/commands/legacy-validation.d.ts +0 -1
- package/dist/commands/legacy-validation.js +0 -1
- package/dist/commands/local.d.ts +35 -0
- package/dist/commands/local.js +1543 -0
- package/dist/commands/one.d.ts +0 -1
- package/dist/commands/one.js +6 -7
- package/dist/commands/public-tools.d.ts +0 -1
- package/dist/commands/public-tools.js +55 -17
- package/dist/commands/runs.d.ts +0 -1
- package/dist/commands/runs.js +0 -1
- package/dist/commands/security.d.ts +1 -2
- package/dist/commands/security.js +1 -2
- package/dist/commands/watchdog.d.ts +0 -1
- package/dist/commands/watchdog.js +0 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -2
- package/dist/lib/banner.d.ts +0 -1
- package/dist/lib/banner.js +0 -1
- package/dist/lib/client.d.ts +4 -2
- package/dist/lib/client.js +42 -18
- package/dist/lib/cloudflare-client.d.ts +0 -1
- package/dist/lib/cloudflare-client.js +0 -1
- package/dist/lib/config.d.ts +31 -3
- package/dist/lib/config.js +72 -13
- package/dist/lib/format.d.ts +2 -1
- package/dist/lib/format.js +27 -7
- package/dist/lib/help.d.ts +1 -2
- package/dist/lib/help.js +37 -17
- package/dist/lib/network.d.ts +10 -1
- package/dist/lib/network.js +33 -5
- package/dist/lib/one-client.d.ts +5 -3
- package/dist/lib/one-client.js +49 -3
- package/dist/lib/one-operations.d.ts +0 -1
- package/dist/lib/one-operations.js +0 -1
- package/dist/lib/open-url.d.ts +0 -1
- package/dist/lib/open-url.js +0 -1
- package/dist/lib/platform.d.ts +2 -0
- package/dist/lib/platform.js +4 -0
- package/dist/lib/progress.d.ts +0 -1
- package/dist/lib/progress.js +0 -1
- package/dist/lib/security-client.d.ts +1 -2
- package/dist/lib/security-client.js +0 -1
- package/dist/lib/skill-fetch.d.ts +0 -1
- package/dist/lib/skill-fetch.js +0 -1
- package/dist/lib/system-trust.d.ts +0 -1
- package/dist/lib/system-trust.js +0 -1
- package/dist/lib/tui.d.ts +308 -0
- package/dist/lib/tui.js +846 -0
- package/dist/local/cloudflare-checkup/cf/allowlist.d.ts +94 -0
- package/dist/local/cloudflare-checkup/cf/allowlist.js +183 -0
- package/dist/local/cloudflare-checkup/cf/auth-lifecycle.d.ts +112 -0
- package/dist/local/cloudflare-checkup/cf/auth-lifecycle.js +312 -0
- package/dist/local/cloudflare-checkup/cf/child-env.d.ts +31 -0
- package/dist/local/cloudflare-checkup/cf/child-env.js +80 -0
- package/dist/local/cloudflare-checkup/cf/install.d.ts +105 -0
- package/dist/local/cloudflare-checkup/cf/install.js +308 -0
- package/dist/local/cloudflare-checkup/cf/locate.d.ts +43 -0
- package/dist/local/cloudflare-checkup/cf/locate.js +227 -0
- package/dist/local/cloudflare-checkup/cf/run-cf.d.ts +88 -0
- package/dist/local/cloudflare-checkup/cf/run-cf.js +274 -0
- package/dist/local/cloudflare-checkup/collector.d.ts +47 -0
- package/dist/local/cloudflare-checkup/collector.js +295 -0
- package/dist/local/cloudflare-checkup/contract.d.ts +2804 -0
- package/dist/local/cloudflare-checkup/contract.js +1620 -0
- package/dist/local/cloudflare-checkup/email-verification.d.ts +124 -0
- package/dist/local/cloudflare-checkup/email-verification.js +211 -0
- package/dist/local/cloudflare-checkup/errors.d.ts +29 -0
- package/dist/local/cloudflare-checkup/errors.js +103 -0
- package/dist/local/cloudflare-checkup/output.d.ts +23 -0
- package/dist/local/cloudflare-checkup/output.js +88 -0
- package/dist/local/cloudflare-checkup/prompts.d.ts +40 -0
- package/dist/local/cloudflare-checkup/prompts.js +139 -0
- package/dist/local/cloudflare-checkup/rate-budget.d.ts +41 -0
- package/dist/local/cloudflare-checkup/rate-budget.js +79 -0
- package/dist/local/cloudflare-checkup/snapshot-file.d.ts +52 -0
- package/dist/local/cloudflare-checkup/snapshot-file.js +185 -0
- package/dist/local/cloudflare-checkup/submit-client.d.ts +112 -0
- package/dist/local/cloudflare-checkup/submit-client.js +395 -0
- package/dist/local/cloudflare-checkup/terminal-ui.d.ts +170 -0
- package/dist/local/cloudflare-checkup/terminal-ui.js +403 -0
- package/dist/types.d.ts +25 -3
- package/dist/types.js +16 -1
- package/dist/version.d.ts +0 -1
- package/dist/version.js +0 -1
- package/package.json +12 -12
- package/dist/auth/device-auth.d.ts.map +0 -1
- package/dist/auth/device-auth.js.map +0 -1
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/store.d.ts.map +0 -1
- package/dist/auth/store.js.map +0 -1
- package/dist/auth/types.d.ts.map +0 -1
- package/dist/auth/types.js.map +0 -1
- package/dist/bin.d.ts.map +0 -1
- package/dist/bin.js.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/commands/account.d.ts.map +0 -1
- package/dist/commands/account.js.map +0 -1
- package/dist/commands/auth.d.ts.map +0 -1
- package/dist/commands/auth.js.map +0 -1
- package/dist/commands/billing.d.ts.map +0 -1
- package/dist/commands/billing.js.map +0 -1
- package/dist/commands/cloudflare.d.ts.map +0 -1
- package/dist/commands/cloudflare.js.map +0 -1
- package/dist/commands/helpers.d.ts.map +0 -1
- package/dist/commands/helpers.js.map +0 -1
- package/dist/commands/index.d.ts.map +0 -1
- package/dist/commands/index.js.map +0 -1
- package/dist/commands/legacy-validation.d.ts.map +0 -1
- package/dist/commands/legacy-validation.js.map +0 -1
- package/dist/commands/one.d.ts.map +0 -1
- package/dist/commands/one.js.map +0 -1
- package/dist/commands/public-tools.d.ts.map +0 -1
- package/dist/commands/public-tools.js.map +0 -1
- package/dist/commands/runs.d.ts.map +0 -1
- package/dist/commands/runs.js.map +0 -1
- package/dist/commands/security.d.ts.map +0 -1
- package/dist/commands/security.js.map +0 -1
- package/dist/commands/watchdog.d.ts.map +0 -1
- package/dist/commands/watchdog.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/banner.d.ts.map +0 -1
- package/dist/lib/banner.js.map +0 -1
- package/dist/lib/client.d.ts.map +0 -1
- package/dist/lib/client.js.map +0 -1
- package/dist/lib/cloudflare-client.d.ts.map +0 -1
- package/dist/lib/cloudflare-client.js.map +0 -1
- package/dist/lib/config.d.ts.map +0 -1
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/format.d.ts.map +0 -1
- package/dist/lib/format.js.map +0 -1
- package/dist/lib/help.d.ts.map +0 -1
- package/dist/lib/help.js.map +0 -1
- package/dist/lib/network.d.ts.map +0 -1
- package/dist/lib/network.js.map +0 -1
- package/dist/lib/one-client.d.ts.map +0 -1
- package/dist/lib/one-client.js.map +0 -1
- package/dist/lib/one-operations.d.ts.map +0 -1
- package/dist/lib/one-operations.js.map +0 -1
- package/dist/lib/open-url.d.ts.map +0 -1
- package/dist/lib/open-url.js.map +0 -1
- package/dist/lib/progress.d.ts.map +0 -1
- package/dist/lib/progress.js.map +0 -1
- package/dist/lib/security-client.d.ts.map +0 -1
- package/dist/lib/security-client.js.map +0 -1
- package/dist/lib/skill-fetch.d.ts.map +0 -1
- package/dist/lib/skill-fetch.js.map +0 -1
- package/dist/lib/system-trust.d.ts.map +0 -1
- package/dist/lib/system-trust.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js.map +0 -1
package/ONE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Vigilbase One CLI reference
|
|
2
2
|
|
|
3
|
-
Log in with `vigilbase login
|
|
3
|
+
Log in with `vigilbase login` (signing in isn't supported on Windows yet). These command groups use the configured One origin (`--one-url`, `VIGILBASE_ONE_URL`, default `https://one.vigilbase.com`) and your saved sign-in. Every operation in this reference sends GET. Customer, organization, role, and integration access remains enforced by One; selecting an ID never grants access.
|
|
4
4
|
|
|
5
5
|
Use `--json` to retain the complete API response and pagination metadata. Plain/pretty output shows all fields as an indented tree, including null/unknown metrics, degraded status, totals, and cursors. `--timeout <milliseconds>` controls request timeouts. No command automatically follows pagination. Only documented flags are accepted; unrelated flags fail before authentication or network requests.
|
|
6
6
|
|
|
@@ -94,6 +94,4 @@ vigilbase support tickets [--all] [--limit 1..100] [--json]
|
|
|
94
94
|
|
|
95
95
|
## Related commands and validation
|
|
96
96
|
|
|
97
|
-
See [README.md](README.md) for
|
|
98
|
-
|
|
99
|
-
The test suite validates argument rejection, auth failures, tenant ID encoding, API errors, response rendering, and read transport. `pnpm --filter @vigilbase/cli smoke:commands` builds the actual binary and exercises each named operation against independently authored local HTTP fixtures in `scripts/fixtures/one.mjs`. This verifies the binary, argument parser, credential store, HTTP request, and JSON/text output without writing production data. These fixtures do not assert deployed provider availability or that a particular production user has permissions.
|
|
97
|
+
See [README.md](https://app.unpkg.com/@vigilbase/cli@0.2.1/files/README.md) for sign-in and configuration, [COMMANDS.md](https://app.unpkg.com/@vigilbase/cli@0.2.1/files/COMMANDS.md) for account, billing, public scanners, run history and Watchdog, [CLOUDFLARE.md](https://app.unpkg.com/@vigilbase/cli@0.2.1/files/CLOUDFLARE.md) for `cf`/`cloudflare`, and [SECURITY.md](https://app.unpkg.com/@vigilbase/cli@0.2.1/files/SECURITY.md) for security commands. The read operations above do not replace the existing explicitly confirmed write commands.
|
package/README.md
CHANGED
|
@@ -1,44 +1,45 @@
|
|
|
1
1
|
# @vigilbase/cli
|
|
2
2
|
|
|
3
|
-
Vigilbase public scanners and Vigilbase One
|
|
4
|
-
monitoring, organization
|
|
3
|
+
Vigilbase public security scanners, the Cloudflare Checkup, and Vigilbase One
|
|
4
|
+
customer, security, Cloudflare, monitoring, organization and support operations
|
|
5
|
+
from the terminal.
|
|
5
6
|
|
|
6
|
-
## Install
|
|
7
|
+
## Install
|
|
7
8
|
|
|
8
|
-
Node 20
|
|
9
|
-
|
|
9
|
+
Node.js 20 or newer is required. `cloudflare-checkup` needs Node.js 22.18 or
|
|
10
|
+
newer, because it runs Cloudflare's `cf` under the same Node. Node 22.19+ and
|
|
11
|
+
24.5+ also trust your operating system's certificates automatically (see
|
|
12
|
+
[Troubleshooting](#troubleshooting)).
|
|
10
13
|
|
|
11
14
|
```bash
|
|
12
|
-
npm install -g @vigilbase/cli
|
|
13
|
-
# or: pnpm add -g @vigilbase/cli
|
|
15
|
+
npm install -g @vigilbase/cli # or: pnpm add -g @vigilbase/cli
|
|
14
16
|
vigilbase help
|
|
15
|
-
vigilbase login
|
|
16
|
-
vigilbase whoami
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
Without
|
|
20
|
-
`
|
|
21
|
-
|
|
19
|
+
Without installing: `npx @vigilbase/cli help`. If you see
|
|
20
|
+
`Unknown command "cloudflare-checkup"`, an older global install is answering
|
|
21
|
+
instead (see [Troubleshooting](#troubleshooting)).
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
Public tools and the Cloudflare Checkup work without signing in. Vigilbase One
|
|
24
|
+
commands need `vigilbase login` (see [Sign-in](#sign-in)). Signing in isn't
|
|
25
|
+
supported on Windows yet; public tools and `cloudflare-checkup` still work there.
|
|
26
26
|
|
|
27
|
-
##
|
|
27
|
+
## Documentation
|
|
28
28
|
|
|
29
|
-
| Reference |
|
|
29
|
+
| Reference | Covers |
|
|
30
30
|
| --- | --- |
|
|
31
|
-
| [COMMANDS.md](
|
|
32
|
-
| [CLOUDFLARE.md](
|
|
33
|
-
| [SECURITY.md](
|
|
34
|
-
| [ONE.md](
|
|
31
|
+
| [COMMANDS.md](https://app.unpkg.com/@vigilbase/cli@0.2.1/files/COMMANDS.md) | Core commands, aliases, global options, API mapping, sign-in, output |
|
|
32
|
+
| [CLOUDFLARE.md](https://app.unpkg.com/@vigilbase/cli@0.2.1/files/CLOUDFLARE.md) | Accounts, zones, DNS, WAF, analytics, Zero Trust, Workers/Pages, audit, checkups |
|
|
33
|
+
| [SECURITY.md](https://app.unpkg.com/@vigilbase/cli@0.2.1/files/SECURITY.md) | Incidents, logs, intelligence, analytics, assets, connections, policies, notifications, reports |
|
|
34
|
+
| [ONE.md](https://app.unpkg.com/@vigilbase/cli@0.2.1/files/ONE.md) | Customer records, billing, reports, investigations, organizations, monitoring, support |
|
|
35
|
+
| [LOCAL.md](https://app.unpkg.com/@vigilbase/cli@0.2.1/files/LOCAL.md) | `cloudflare-checkup`: verifies your work email, collects your Cloudflare configuration on your machine with Cloudflare's `cf` and uploads it after you confirm |
|
|
35
36
|
|
|
36
|
-
These
|
|
37
|
-
|
|
37
|
+
These files ship with the package. Built-in help: `vigilbase <command> --help`
|
|
38
|
+
or `vigilbase help <command>`.
|
|
38
39
|
|
|
39
40
|
## Examples
|
|
40
41
|
|
|
41
|
-
Public tools
|
|
42
|
+
Public tools, no sign-in:
|
|
42
43
|
|
|
43
44
|
```bash
|
|
44
45
|
vigilbase list
|
|
@@ -48,10 +49,12 @@ vigilbase describe security-headers
|
|
|
48
49
|
vigilbase badge vigilbase.com --style compact
|
|
49
50
|
```
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
The public scanners are `security-headers` and `email-security`.
|
|
53
|
+
`website-security`, `react2shell` and `fortibleed-check` run through Vigilbase
|
|
54
|
+
One and need a sign-in:
|
|
53
55
|
|
|
54
56
|
```bash
|
|
57
|
+
vigilbase login
|
|
55
58
|
vigilbase run website-security example.com --json
|
|
56
59
|
vigilbase account
|
|
57
60
|
vigilbase customers list --json
|
|
@@ -62,7 +65,7 @@ vigilbase support tickets
|
|
|
62
65
|
vigilbase runs list
|
|
63
66
|
```
|
|
64
67
|
|
|
65
|
-
Cloudflare IDs come from the
|
|
68
|
+
Cloudflare IDs come from the inventory you can access:
|
|
66
69
|
|
|
67
70
|
```bash
|
|
68
71
|
vigilbase cf accounts
|
|
@@ -90,134 +93,349 @@ vigilbase security notifications
|
|
|
90
93
|
vigilbase security audit --limit 50
|
|
91
94
|
```
|
|
92
95
|
|
|
93
|
-
Customer users inherit their organization scope. Internal operators
|
|
94
|
-
`--customer-id <customer-uuid>` for security views
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
Customer users inherit their organization's scope. Internal operators add
|
|
97
|
+
`--customer-id <customer-uuid>` for security views; Cloudflare analytics needs
|
|
98
|
+
it too. Other customer-specific commands take the customer UUID as an argument.
|
|
99
|
+
Flags select records; One still decides whether your session can see them.
|
|
97
100
|
|
|
98
|
-
After reviewing an incident,
|
|
101
|
+
After reviewing an incident, you can update its status explicitly:
|
|
99
102
|
|
|
100
103
|
```bash
|
|
101
104
|
vigilbase security incidents update <incident-uuid> acknowledged \
|
|
102
105
|
--note 'Investigating with the customer' --confirm
|
|
103
106
|
```
|
|
104
107
|
|
|
105
|
-
Other
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
Other statuses are `mitigating`, `resolved` and `false_positive`. `--confirm`
|
|
109
|
+
states your intent; it does not grant permission or approve provider
|
|
110
|
+
remediation. API changes are never retried automatically. The references list
|
|
111
|
+
the other explicit actions (sending invitations, opening a billing portal
|
|
112
|
+
session, running scans and starting checkups).
|
|
113
|
+
|
|
114
|
+
## Cloudflare Checkup on your machine
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
npx @vigilbase/cli cloudflare-checkup
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
This one command (also `vigilbase cloudflare-checkup` or
|
|
121
|
+
`vigilbase local cloudflare-checkup`) runs the Vigilbase Cloudflare Checkup
|
|
122
|
+
on your machine with Cloudflare's own `cf` CLI. It needs no Vigilbase sign-in.
|
|
123
|
+
It asks for your work email and vigilbase.com emails you a 6-digit code to
|
|
124
|
+
enter. It then installs cf if needed (it asks first), signs in to Cloudflare
|
|
125
|
+
read-only, lets you choose the account, collects, and uploads the snapshot only
|
|
126
|
+
after you confirm. It prints the results link and opens it in your browser on
|
|
127
|
+
macOS and Linux; the results also go to your verified email.
|
|
128
|
+
|
|
129
|
+
cf owns your Cloudflare login: this CLI never reads, prints, stores or uploads
|
|
130
|
+
it. Your email address goes to vigilbase.com only so it can send the code; the
|
|
131
|
+
CLI never prints, logs or stores it and shows only the masked `j***@acme.com`.
|
|
132
|
+
In a terminal the steps show as an interactive timeline; pipes, CI,
|
|
133
|
+
`TERM=dumb` and `--json` get plain lines.
|
|
134
|
+
|
|
135
|
+
Local checkups work while vigilbase.com has them switched on. The CLI checks
|
|
136
|
+
before it asks for your email. When they are off, it stops with
|
|
137
|
+
`Local checkups aren't available right now.` and points you to the checkup in
|
|
138
|
+
your browser, <https://vigilbase.com/tools/cloudflare-checkup>, which uses a
|
|
139
|
+
read-only Cloudflare API token instead. When you are done:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
npx @vigilbase/cli cloudflare-checkup logout # removes the read-only cf login and the cf it installed
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
See [LOCAL.md](https://app.unpkg.com/@vigilbase/cli@0.2.1/files/LOCAL.md) for
|
|
146
|
+
every step, what is uploaded and the error codes.
|
|
147
|
+
|
|
148
|
+
## Public tools and sign-in
|
|
149
|
+
|
|
150
|
+
- **Public scans never depend on your sign-in.** `headers`, `email` and
|
|
151
|
+
`run security-headers|email-security` call the public API anonymously and
|
|
152
|
+
never read your saved sign-in, so an expired, broken or unreachable sign-in
|
|
153
|
+
cannot make them fail. `--public` and `--via public` force the public API for
|
|
154
|
+
any tool.
|
|
155
|
+
- **One-only scans need a sign-in.** `website-security`, `react2shell`,
|
|
156
|
+
`fortibleed-check` and any run with `--via one` go through Vigilbase One.
|
|
157
|
+
Without a usable sign-in they stop with
|
|
158
|
+
``This tool needs a Vigilbase One sign-in: run `vigilbase login`.``
|
|
159
|
+
- **`list`** reads your saved sign-in from disk only (no refresh, no network,
|
|
160
|
+
no waiting for another command) to show which tools you can run. If it can't
|
|
161
|
+
use it, it lists the tools as signed out and prints one line on stderr:
|
|
162
|
+
``Couldn't use your saved sign-in (<reason>); running anonymously. Run `vigilbase login` to fix.``
|
|
163
|
+
When the reason is an unsafe config path or credentials file, the line ends
|
|
164
|
+
with its fix instead (see [Directory checks](#directory-checks)).
|
|
165
|
+
- **`doctor`** reports a sign-in problem as its own failed `signIn` check.
|
|
110
166
|
|
|
111
167
|
## Automation and output
|
|
112
168
|
|
|
113
|
-
Every command supports `-j` / `--json`. JSON goes to stdout; progress and
|
|
114
|
-
instructions go to stderr. Progress animations are
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
identifiers.
|
|
118
|
-
bidirectional overrides
|
|
119
|
-
JSON
|
|
120
|
-
|
|
121
|
-
|
|
169
|
+
Every command supports `-j` / `--json`. JSON goes to stdout; progress and
|
|
170
|
+
browser instructions go to stderr. Progress animations are off for JSON, CI and
|
|
171
|
+
output that isn't a terminal. List commands never fetch every page on their
|
|
172
|
+
own: keep the JSON pagination fields to fetch the next page. Text output shows
|
|
173
|
+
complete identifiers. Human-readable output removes terminal control sequences
|
|
174
|
+
and bidirectional overrides from everything it prints, including names, tool
|
|
175
|
+
results, skills and errors. JSON keeps successful response data, with control
|
|
176
|
+
characters escaped.
|
|
177
|
+
|
|
178
|
+
`vigilbase --version` prints the banner in a terminal and only the version
|
|
179
|
+
number when stdout is a pipe or a file, so `v=$(vigilbase --version)` works in
|
|
180
|
+
scripts. With `--json` it prints `{"name":"@vigilbase/cli","version":"…"}`.
|
|
122
181
|
|
|
123
182
|
| Exit code | Meaning |
|
|
124
183
|
| --- | --- |
|
|
125
184
|
| `0` | Success (including a signed-out `whoami`) |
|
|
126
|
-
| `1` | Validation, API, network, or unsuccessful scan result |
|
|
185
|
+
| `1` | Validation, API, network or sign-in error, or an unsuccessful scan result |
|
|
127
186
|
| `2` | Rate limited (`HTTP 429`) |
|
|
128
187
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
`
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
`whoami`
|
|
188
|
+
Errors keep a safe status, error code and retry delay. When a public scan
|
|
189
|
+
fails and vigilbase.com explains why, the CLI shows that reason:
|
|
190
|
+
`Error: <message> (<code>)` in text, and `error` plus `code` in JSON. The
|
|
191
|
+
reason is shown only when vigilbase.com sends it as a known error code, and it
|
|
192
|
+
is cleaned to one line of at most 300 characters. Anything else, and every
|
|
193
|
+
Vigilbase One error, prints only `Request failed (HTTP <status>).` without the
|
|
194
|
+
server's text. Hints (`Hint: …`, `hint` in JSON) are always written by the CLI.
|
|
195
|
+
|
|
196
|
+
Commands use named One APIs and One's own authorization. They never take
|
|
197
|
+
Cloudflare or other provider secrets, delegated identity claims or an arbitrary
|
|
198
|
+
upstream URL. Billing records are fetched on demand and never stored by the
|
|
199
|
+
CLI.
|
|
200
|
+
|
|
201
|
+
## Sign-in
|
|
202
|
+
|
|
203
|
+
### Logging in
|
|
204
|
+
|
|
205
|
+
`vigilbase login` opens a browser and waits for you to approve the device code.
|
|
206
|
+
On a remote terminal, run `vigilbase login --no-open` and open the printed URL
|
|
207
|
+
in a signed-in browser.
|
|
208
|
+
|
|
209
|
+
The CLI reads One's protected-resource metadata to choose the sign-in:
|
|
210
|
+
|
|
211
|
+
- **Vigilbase Identity** (one.vigilbase.com uses it). You approve at
|
|
212
|
+
<https://auth.vigilbase.com/device> and choose the organization the sign-in
|
|
213
|
+
is for. `whoami` and `doctor` check the session at Identity.
|
|
214
|
+
- **Legacy One sign-in**, for a One that doesn't advertise Identity. You
|
|
215
|
+
approve at that One's `/device` page.
|
|
216
|
+
|
|
217
|
+
The CLI builds the approval URL itself from the issuer (or One) origin; it
|
|
218
|
+
never opens a URL the server sends.
|
|
219
|
+
|
|
220
|
+
To save an existing One session token instead, pipe it from your secret
|
|
221
|
+
manager into `vigilbase login --token-stdin`. The input must hold one token and
|
|
222
|
+
is never echoed. `--token <bearer>` and `VIGILBASE_ONE_TOKEN` also work, but
|
|
223
|
+
command arguments can show up in process listings and shell history; neither
|
|
224
|
+
combines with `--token-stdin`. Login checks the token with One before saving
|
|
225
|
+
it.
|
|
226
|
+
|
|
227
|
+
### Where credentials are stored
|
|
228
|
+
|
|
229
|
+
Credentials live in the config directory: `VIGILBASE_CONFIG_DIR` if set,
|
|
230
|
+
otherwise `$XDG_CONFIG_HOME/vigilbase`, otherwise `~/.config/vigilbase`.
|
|
231
|
+
`VIGILBASE_CONFIG_DIR` must be an absolute path; a relative `XDG_CONFIG_HOME`
|
|
232
|
+
is ignored.
|
|
233
|
+
|
|
234
|
+
| File | Holds |
|
|
235
|
+
| --- | --- |
|
|
236
|
+
| `identity-credentials.json` | Your Vigilbase Identity sign-in: issuer, client, One origin, organization and the rotating refresh token. CLI 0.1.x never reads it. |
|
|
237
|
+
| `credentials.json` | A legacy One session (version 1), shared with CLI 0.1.x: written by `--token`, `--token-stdin`, `VIGILBASE_ONE_TOKEN` and legacy device sign-in. |
|
|
238
|
+
| `credentials.json.lock` | One lock for both files, also used by CLI 0.2.0. |
|
|
239
|
+
|
|
240
|
+
Files are written atomically with mode `0600`. A saved session is only sent to
|
|
241
|
+
the One origin it was issued for (a legacy file without an origin counts as
|
|
242
|
+
production). With both files present, the Identity sign-in is used, and a
|
|
243
|
+
`credentials.json` that can't be parsed is ignored. Logging in replaces a file
|
|
244
|
+
that passes the [directory checks](#directory-checks) but can't be parsed.
|
|
245
|
+
|
|
246
|
+
### Using CLI 0.1.x or 0.2.0 too
|
|
247
|
+
|
|
248
|
+
- CLI 0.2.0 kept its Identity sign-in in `credentials.json`, which CLI 0.1.x
|
|
249
|
+
cannot read. The first 0.2.1 command that reads your sign-in moves it to
|
|
250
|
+
`identity-credentials.json` (under the lock), unless that file already
|
|
251
|
+
exists. From then on `credentials.json` is either absent or a legacy session
|
|
252
|
+
that 0.1.x can use.
|
|
253
|
+
- If 0.2.0 later saves a new `credentials.json` while
|
|
254
|
+
`identity-credentials.json` exists, 0.2.1 ignores it. `whoami` notes it
|
|
255
|
+
(`legacyIdentityFileIgnored` in JSON), and `vigilbase logout` revokes and
|
|
256
|
+
removes it.
|
|
257
|
+
- An Identity login leaves a legacy `credentials.json` alone. A token login or
|
|
258
|
+
a legacy device login first revokes and removes any Identity sign-in, so the
|
|
259
|
+
new session is the one in use; if that revocation fails, login stops and
|
|
260
|
+
nothing changes.
|
|
261
|
+
- Logging in again with Identity first revokes and removes the sign-in it
|
|
262
|
+
replaces, before asking for a new device code, so cancelling that login
|
|
263
|
+
leaves you signed out. If the revocation fails, the CLI warns that the old
|
|
264
|
+
sign-in will expire on its own and carries on. A sign-in whose last refresh
|
|
265
|
+
had an uncertain result isn't revoked: Identity may have replaced its token
|
|
266
|
+
already, and presenting that token again can end every CLI sign-in of yours.
|
|
267
|
+
It expires on its own.
|
|
268
|
+
- Sign out with 0.2.1 or later: CLI 0.1.x's `logout` only deletes
|
|
269
|
+
`credentials.json` and does not touch your Identity sign-in.
|
|
270
|
+
|
|
271
|
+
### Logging out
|
|
272
|
+
|
|
273
|
+
`vigilbase logout`:
|
|
274
|
+
|
|
275
|
+
1. Revokes every saved Identity refresh token, in `identity-credentials.json`
|
|
276
|
+
and in a `credentials.json` left by CLI 0.2.0. A sign-in Identity has
|
|
277
|
+
already ended (after a browser sign-out, for example) counts as revoked. If
|
|
278
|
+
revocation fails otherwise, it keeps every file and stops with
|
|
279
|
+
`Identity revocation failed, so your saved sign-in was kept. Try again later.`
|
|
280
|
+
2. Signs a legacy session out at the One that issued it. If that fails, it
|
|
281
|
+
warns and goes on; the session expires on its own.
|
|
282
|
+
3. Deletes the credential files. A file that passes the
|
|
283
|
+
[directory checks](#directory-checks) but can't be parsed is removed with a
|
|
284
|
+
warning, without being revoked; an unsafe file stops logout and stays in
|
|
285
|
+
place.
|
|
286
|
+
|
|
287
|
+
Saved Identity credentials belong to one issuer, client and One. If you signed
|
|
288
|
+
in with `--auth-url`, `--one-url` or `--client-id`, log out with the same
|
|
289
|
+
options; otherwise logout stops, before revoking anything, with
|
|
290
|
+
`Saved credentials belong to a different issuer, resource, or client. Use the matching configuration to log out.`
|
|
291
|
+
|
|
292
|
+
### Refresh and the credentials lock
|
|
293
|
+
|
|
294
|
+
Identity access tokens last five minutes. The CLI refreshes within 60 seconds
|
|
295
|
+
of expiry, or once after a 401. The lock coordinates CLI processes, and each
|
|
296
|
+
holder rereads the file before rotating the refresh token. If a refresh may
|
|
297
|
+
have been used but its answer was lost, the CLI marks it and asks you to run
|
|
298
|
+
`vigilbase login` again rather than retrying it. A command waits up to 15
|
|
299
|
+
seconds (or `--timeout`, if shorter) for the lock, then stops with
|
|
300
|
+
`Credentials are locked by another command. …`. `login` and `logout` may
|
|
301
|
+
remove a lock left by a process that has exited, but never one held by a
|
|
302
|
+
running process. If a damaged lock can't be recovered, stop every `vigilbase`
|
|
303
|
+
process, delete `credentials.json.lock` and log in again. Never reuse a refresh
|
|
304
|
+
token by hand.
|
|
305
|
+
|
|
306
|
+
### Directory checks
|
|
307
|
+
|
|
308
|
+
Commands that read or write credentials (`login`, `logout`, `whoami`, every One
|
|
309
|
+
command, `--via one` and the One-only scans) check the whole config path first:
|
|
310
|
+
|
|
311
|
+
- no component of the path may be a symbolic link;
|
|
312
|
+
- every parent directory must be owned by you or root, and not writable by its
|
|
313
|
+
group or by others unless it has the sticky bit;
|
|
314
|
+
- the config directory must be owned by you with mode `0700`;
|
|
315
|
+
- credential files must be regular files owned by you, with one hard link and
|
|
316
|
+
mode `0600`.
|
|
317
|
+
|
|
318
|
+
Each error names the path that failed and how to fix it, for example:
|
|
319
|
+
|
|
320
|
+
```
|
|
321
|
+
Error: /tmp is a symbolic link. Set VIGILBASE_CONFIG_DIR to a private directory without symbolic links in its path.
|
|
322
|
+
Error: /Users/jane/.config/vigilbase must have mode 0700. Run chmod 700 /Users/jane/.config/vigilbase, or set VIGILBASE_CONFIG_DIR to another directory.
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
On macOS `/tmp` and `/var` are symbolic links, and dotfiles managers often make
|
|
326
|
+
`~/.config` one. Fix the mode with the `chmod` the error names, or point
|
|
327
|
+
`VIGILBASE_CONFIG_DIR` at a private directory of its own, for example:
|
|
328
|
+
|
|
329
|
+
```bash
|
|
330
|
+
export VIGILBASE_CONFIG_DIR="$(cd ~ && pwd -P)/.vigilbase"
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
Don't use a directory inside a dotfiles repository or a synced folder (resolving
|
|
334
|
+
a symlinked `~/.config` with `pwd -P` usually leads there): the credential
|
|
335
|
+
files hold your refresh token.
|
|
336
|
+
|
|
337
|
+
Public commands don't need these checks: public scans, `describe`, `skill` and
|
|
338
|
+
`badge` never open the config directory, and work even when
|
|
339
|
+
`VIGILBASE_CONFIG_DIR` isn't absolute. `list` and `doctor` never create or open
|
|
340
|
+
anything in a directory that fails them, and only treat it as a problem when a
|
|
341
|
+
credentials file may be there: `list` then shows you as signed out with one
|
|
342
|
+
warning, and `doctor` reports it in its `signIn` check. With no saved sign-in,
|
|
343
|
+
both carry on as usual.
|
|
344
|
+
|
|
345
|
+
### Windows
|
|
346
|
+
|
|
347
|
+
Signing in isn't supported on Windows yet, because the CLI can't yet protect
|
|
348
|
+
credential files there. `login`, `logout`, `whoami`, the One commands,
|
|
349
|
+
`--via one` and the One-only scans stop with
|
|
350
|
+
`Signing in isn't supported on Windows yet; public tools and cloudflare-checkup still work.`
|
|
351
|
+
(code `SIGN_IN_UNSUPPORTED`) before touching the disk or the network. Public
|
|
352
|
+
tools, `list`, `doctor`, `describe`, `skill`, `badge` and `cloudflare-checkup`
|
|
353
|
+
work and ignore any saved credentials.
|
|
354
|
+
|
|
355
|
+
## Configuration
|
|
155
356
|
|
|
156
357
|
| Option | Environment variable | Default |
|
|
157
358
|
| --- | --- | --- |
|
|
158
359
|
| `--base-url <origin>` | `VIGILBASE_BASE_URL` | `https://vigilbase.com` |
|
|
159
360
|
| `--one-url <origin>` | `VIGILBASE_ONE_URL` | `https://one.vigilbase.com` |
|
|
361
|
+
| `--auth-url <origin>` | `VIGILBASE_AUTH_URL` | `https://auth.vigilbase.com` |
|
|
160
362
|
| `--client-id <id>` | `VIGILBASE_CLIENT_ID` | `vigilbase-cli` |
|
|
161
363
|
| `--timeout <ms>` | — | `60000` per request |
|
|
162
364
|
|
|
163
|
-
Origins
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
`
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
365
|
+
Origins are HTTP(S) URLs without credentials, paths, queries or fragments. One
|
|
366
|
+
needs HTTPS; HTTP is allowed only for loopback development (`localhost`,
|
|
367
|
+
`127.0.0.0/8` or `[::1]`). This applies to device sign-in, tokens and saved
|
|
368
|
+
sessions. `VIGILBASE_API_URL` and `VIGILBASE_PUBLIC_URL` are older names for
|
|
369
|
+
the public origin, used after `VIGILBASE_BASE_URL` when no flag is given.
|
|
370
|
+
`VIGILBASE_CLI_NO_OPEN=1` stops the CLI from opening a browser, and
|
|
371
|
+
`VIGILBASE_CLI_NO_BANNER=1` hides the banner.
|
|
372
|
+
|
|
373
|
+
**Identity issuer.** The CLI trusts one Identity issuer: `--auth-url` /
|
|
374
|
+
`VIGILBASE_AUTH_URL` when set, otherwise `https://auth.vigilbase.com`. The
|
|
375
|
+
issuer One names must be exactly that origin, or sign-in stops before any
|
|
376
|
+
request to it. `--auth-url` accepts `https://auth.vigilbase.com`,
|
|
377
|
+
`https://identity-staging.vigilbase.com`, or a loopback origin when `--one-url`
|
|
378
|
+
is loopback too; staging is trusted only when you pass it. Saved Identity
|
|
379
|
+
credentials from another issuer count as signed out.
|
|
380
|
+
|
|
381
|
+
Billing portal URLs must use HTTPS on `billing.stripe.com`. Skill downloads are
|
|
382
|
+
limited to HTTPS `vigilbase.com/agent-skills/<name>.md` (or
|
|
383
|
+
`www.vigilbase.com`), whatever origin you configure. Every DNS answer must be a
|
|
384
|
+
public address, the TLS connection is pinned to a checked address, and
|
|
385
|
+
redirects are refused. Skill documents are limited to 256 KiB and API responses
|
|
386
|
+
to 8 MiB; timeouts cover reading the body.
|
|
181
387
|
|
|
182
388
|
## Troubleshooting
|
|
183
389
|
|
|
184
|
-
`vigilbase doctor
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
390
|
+
**Check connectivity.** `vigilbase doctor` (add `--json` for details) runs
|
|
391
|
+
three checks on their own and exits 1 if any fails:
|
|
392
|
+
|
|
393
|
+
- `publicApi`: `GET https://vigilbase.com/api/agent/tools`.
|
|
394
|
+
- `one`: your session. Signed out or with a legacy session,
|
|
395
|
+
`GET https://one.vigilbase.com/api/auth/get-session`; a signed-out answer
|
|
396
|
+
counts as reachable. With an Identity sign-in, the issuer's
|
|
397
|
+
`/.well-known/openid-configuration` and then the userinfo endpoint it names
|
|
398
|
+
(`https://auth.vigilbase.com/api/auth/oauth2/userinfo`).
|
|
399
|
+
- `signIn`: whether your saved sign-in works, including a refresh if one is
|
|
400
|
+
due.
|
|
401
|
+
|
|
402
|
+
DNS, TLS, connection and timeout failures name the endpoint and the cause.
|
|
403
|
+
Use `--base-url`, `--one-url`, `--auth-url` and `--timeout` to check other
|
|
404
|
+
environments.
|
|
405
|
+
|
|
406
|
+
**`Unknown command "cloudflare-checkup"`.** An older global install (0.1.x)
|
|
407
|
+
takes priority over a bare `npx @vigilbase/cli`. Update it with
|
|
408
|
+
`npm install -g @vigilbase/cli@latest`, or run the latest release once with
|
|
409
|
+
`npx @vigilbase/cli@latest cloudflare-checkup`. `vigilbase --version` shows
|
|
410
|
+
which version answers.
|
|
411
|
+
|
|
412
|
+
**`Device sign-in isn't available at <origin> right now.`** Login got a 404
|
|
413
|
+
from that origin. If you set `--one-url` or `--auth-url`, check it; otherwise
|
|
414
|
+
try again later or email help@vigilbase.com. Public tools work without signing
|
|
415
|
+
in.
|
|
416
|
+
|
|
417
|
+
**`… is a symbolic link`, `… must have mode 0700` and similar.** See
|
|
418
|
+
[Directory checks](#directory-checks).
|
|
419
|
+
|
|
420
|
+
**`A previous refresh has an uncertain result.`** Run `vigilbase login` again.
|
|
421
|
+
|
|
422
|
+
**Certificates.** On Node 22.19+ and 24.5+ the CLI adds your operating
|
|
423
|
+
system's trusted certificates, keeping Node's bundled roots and
|
|
424
|
+
`NODE_EXTRA_CA_CERTS`. This covers private CAs trusted in the macOS Keychain or
|
|
425
|
+
the system trust store. See
|
|
192
426
|
[Node's TLS documentation](https://nodejs.org/docs/latest-v22.x/api/tls.html#tlssetdefaultcacertificatescerts).
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
a recent Node 22 runtime supports this workaround:
|
|
427
|
+
On an older Node 22, `fetch failed` or `SELF_SIGNED_CERT_IN_CHAIN` can be
|
|
428
|
+
worked around with:
|
|
196
429
|
|
|
197
430
|
```bash
|
|
198
431
|
NODE_OPTIONS="${NODE_OPTIONS:+$NODE_OPTIONS }--use-system-ca" vigilbase login
|
|
199
432
|
```
|
|
200
433
|
|
|
201
|
-
For a private CA outside the system store,
|
|
202
|
-
`NODE_EXTRA_CA_CERTS=/path/to/trusted-ca.pem` before
|
|
203
|
-
|
|
204
|
-
have a longer server budget than the default CLI timeout.
|
|
205
|
-
|
|
206
|
-
## Development and verification
|
|
434
|
+
For a private CA outside the system store, set
|
|
435
|
+
`NODE_EXTRA_CA_CERTS=/path/to/trusted-ca.pem` before starting the CLI.
|
|
436
|
+
Certificate checks always stay on.
|
|
207
437
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
pnpm --filter @vigilbase/cli smoke:commands
|
|
211
|
-
```
|
|
438
|
+
**Timeouts.** Use `--timeout` for slower queries; some security analytics APIs
|
|
439
|
+
take longer than the default.
|
|
212
440
|
|
|
213
|
-
|
|
214
|
-
suite, the compiled-command HTTP suite, and security subprocess regressions. Fixtures cover every supported
|
|
215
|
-
operation in both JSON and text, with exact methods, paths, query filters, bearer
|
|
216
|
-
headers, bodies, error exits, and included documentation. Fixtures use temporary
|
|
217
|
-
credentials and a loopback server; simulated mutations never touch production.
|
|
218
|
-
|
|
219
|
-
The separate `smoke:e2e` script runs real public scanners. Configure
|
|
220
|
-
`VIGILBASE_BASE_URL` and `VIGILBASE_SMOKE_ARTIFACTS` as shown in COMMANDS.md.
|
|
221
|
-
Authenticated production verification requires a valid One session and appropriate
|
|
222
|
-
permissions. A passing local fixture does not establish provider availability or
|
|
223
|
-
production customer-data health.
|
|
441
|
+
**Help.** Email help@vigilbase.com or visit <https://vigilbase.com/help>.
|
package/SECURITY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Security command reference
|
|
2
2
|
|
|
3
|
-
All commands start with `vigilbase security`. Sign in with `vigilbase login` first. Commands use the configured One origin and its authenticated `/api/flarehawk` boundary. One independently checks permissions and maps the current organization to its security tenant. Internal operators can supply `--customer-id <One customer UUID>` for validated View-as access; this never supplies an upstream organization identity.
|
|
3
|
+
All commands start with `vigilbase security`. Sign in with `vigilbase login` first (signing in isn't supported on Windows yet). Commands use the configured One origin and its authenticated `/api/flarehawk` boundary. One independently checks permissions and maps the current organization to its security tenant. Internal operators can supply `--customer-id <One customer UUID>` for validated View-as access; this never supplies an upstream organization identity.
|
|
4
4
|
|
|
5
5
|
Every operation below is **GET/read-only**, except `incidents update`, which is **PATCH/write** and requires `--confirm` plus server service-write permission. Reads require server service-read permission. No command directly accesses the retained service, runs archived chat, changes remediation authority, or approves provider effects.
|
|
6
6
|
|
|
@@ -131,4 +131,4 @@ vigilbase security connections logpush-status <connection-uuid> <job-uuid>
|
|
|
131
131
|
vigilbase security intel ip 1.1.1.1
|
|
132
132
|
```
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
Binary log downloads and routes without a verified JSON consumer are not exposed.
|