@slicedearth/whoisleuth-cli 2.2.0 → 2.3.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/README.md +2 -1
- package/cli/arguments.mjs +389 -1745
- package/cli/artifact-validation/case-response.mjs +55 -30
- package/cli/artifact-validation/signed-review.mjs +30 -12
- package/cli/bulk-checkpoint.mjs +34 -3
- package/cli/case-pack.mjs +39 -92
- package/cli/command-argument-grammar.mjs +211 -0
- package/cli/command-reference.mjs +200 -213
- package/cli/completion.mjs +5 -1
- package/cli/discovery-observation-snapshot.mjs +16 -3
- package/cli/discovery-scan-command-runner.mjs +19 -0
- package/cli/discovery-scan.mjs +6 -0
- package/cli/domain-control-observations.mjs +1 -1
- package/cli/inline-command-families.mjs +1 -0
- package/cli/input.mjs +116 -0
- package/cli/interchange-report.mjs +14 -0
- package/cli/lookalike-calibration.mjs +7 -2
- package/cli/lookup-brief.mjs +4 -2
- package/cli/lookup-browser-view.mjs +1 -1
- package/cli/mail-header-review.mjs +467 -0
- package/cli/review-command-runner.mjs +25 -0
- package/cli/risk-calibration.mjs +19 -17
- package/cli/runner.mjs +7 -1
- package/docs/cli-reference.md +8 -1
- package/docs/cli.md +12 -1
- package/lib/bounded-json.mjs +9 -6
- package/lib/dns-convergence-review.mjs +1 -0
- package/lib/dns-intelligence.mjs +37 -3
- package/lib/dnssec-chain-validation.mjs +6 -0
- package/lib/domain-change-packet.mjs +42 -14
- package/lib/domain-control-flight-recorder.mjs +4 -1
- package/lib/domain-control-manifest.mjs +16 -16
- package/lib/domain-posture-parsers.mjs +114 -3
- package/lib/domain-posture.mjs +34 -3
- package/lib/evidence-export.mjs +60 -11
- package/lib/evidence-report.mjs +2 -2
- package/lib/html-signals.mjs +39 -33
- package/lib/local-geoip-evidence.mjs +19 -3
- package/lib/lookup-response.mjs +5 -4
- package/lib/lookup-source-progress.mjs +27 -4
- package/lib/nameserver-preflight-review.mjs +1 -0
- package/lib/rdap-capabilities.mjs +1 -1
- package/lib/registry-insights.mjs +35 -22
- package/lib/risk-calibration-summary.mjs +1 -3
- package/lib/security-txt.mjs +33 -1
- package/lib/static-html-analysis.mjs +69 -13
- package/lib/website-technology.mjs +79 -11
- package/lib/zone-intent-review.mjs +16 -6
- package/package.json +1 -1
- package/packages/cases/case-migration-model.mjs +71 -22
- package/packages/cases/case-record-contracts.mjs +5 -20
- package/packages/cases/case-record-core.mjs +10 -21
- package/packages/cases/case-record-decisions.mjs +72 -0
- package/packages/cases/case-record-model.mjs +1 -0
- package/packages/cases/case-record-operations.mjs +6 -4
- package/packages/cases/case-record-projection.mjs +218 -0
- package/packages/cases/case-report.mjs +11 -6
- package/packages/cases/case-response-model.mjs +43 -6
- package/packages/cases/case-response-packet.mjs +78 -27
- package/packages/cases/case-storage-model.mjs +6 -2
- package/packages/comparison/comparison-ledger-bulk.mjs +9 -10
- package/packages/comparison/page-similarity.mjs +3 -1
- package/packages/contracts/case-portability.mjs +171 -51
- package/packages/contracts/cli-command-semantics.mjs +93 -0
- package/packages/contracts/risk-calibration.mjs +15 -10
- package/packages/contracts/workspace-portability.mjs +44 -7
- package/packages/evidence/domain-control-runtime.mjs +46 -6
- package/packages/interchange/external-findings-import.mjs +3 -2
- package/packages/investigation/lookup-asset-graph.mjs +35 -27
- package/packages/workspace/brand-profile-model.mjs +118 -2
- package/packages/workspace/bulk-review-model.mjs +13 -7
- package/packages/workspace/bulk-session-model.mjs +5 -4
- package/packages/workspace/detection-rule-model.mjs +70 -22
- package/packages/workspace/relationship-observation-model.mjs +4 -1
- package/packages/workspace/website-snapshot-model.mjs +106 -8
- package/packages/workspace/workspace-archive.mjs +2 -0
- package/cli/evidence-command-arguments.mjs +0 -156
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { CliUsageError } from "./errors.mjs";
|
|
2
|
-
export function parseInspectArchiveArguments(argv) {
|
|
3
|
-
let source = null;
|
|
4
|
-
let passphraseSource = null;
|
|
5
|
-
let search = null;
|
|
6
|
-
let reveal = false;
|
|
7
|
-
let requireMatch = false;
|
|
8
|
-
let expectedContentDigest = null;
|
|
9
|
-
let output = 'terminal';
|
|
10
|
-
let quiet = false;
|
|
11
|
-
let color = true;
|
|
12
|
-
for (let index = 0; index < argv.length; index++) {
|
|
13
|
-
const argument = argv[index];
|
|
14
|
-
if (argument === undefined)
|
|
15
|
-
break;
|
|
16
|
-
if (argument === '--json') {
|
|
17
|
-
if (output !== 'terminal')
|
|
18
|
-
throw new CliUsageError('--json may be supplied only once.');
|
|
19
|
-
output = 'json';
|
|
20
|
-
}
|
|
21
|
-
else if (argument === '--passphrase-file') {
|
|
22
|
-
if (passphraseSource !== null)
|
|
23
|
-
throw new CliUsageError('--passphrase-file may be supplied only once.');
|
|
24
|
-
const value = argv[++index];
|
|
25
|
-
if (!value || value.startsWith('-'))
|
|
26
|
-
throw new CliUsageError('--passphrase-file requires one bounded UTF-8 file.');
|
|
27
|
-
passphraseSource = value;
|
|
28
|
-
}
|
|
29
|
-
else if (argument === '--search') {
|
|
30
|
-
if (search !== null)
|
|
31
|
-
throw new CliUsageError('--search may be supplied only once.');
|
|
32
|
-
const value = argv[++index];
|
|
33
|
-
if (!value || value.startsWith('-'))
|
|
34
|
-
throw new CliUsageError('--search requires one exact bounded value.');
|
|
35
|
-
search = value;
|
|
36
|
-
}
|
|
37
|
-
else if (argument === '--reveal') {
|
|
38
|
-
if (reveal)
|
|
39
|
-
throw new CliUsageError('--reveal may be supplied only once.');
|
|
40
|
-
reveal = true;
|
|
41
|
-
}
|
|
42
|
-
else if (argument === '--require-match') {
|
|
43
|
-
if (requireMatch)
|
|
44
|
-
throw new CliUsageError('--require-match may be supplied only once.');
|
|
45
|
-
requireMatch = true;
|
|
46
|
-
}
|
|
47
|
-
else if (argument === '--expect-content-digest') {
|
|
48
|
-
if (expectedContentDigest !== null)
|
|
49
|
-
throw new CliUsageError('--expect-content-digest may be supplied only once.');
|
|
50
|
-
const value = argv[++index];
|
|
51
|
-
if (!value || !/^sha256:[a-f0-9]{64}$/u.test(value)) {
|
|
52
|
-
throw new CliUsageError('--expect-content-digest requires sha256 followed by 64 lowercase hexadecimal characters.');
|
|
53
|
-
}
|
|
54
|
-
expectedContentDigest = value;
|
|
55
|
-
}
|
|
56
|
-
else if (argument === '--quiet')
|
|
57
|
-
quiet = true;
|
|
58
|
-
else if (argument === '--no-color')
|
|
59
|
-
color = false;
|
|
60
|
-
else if (argument.startsWith('-'))
|
|
61
|
-
throw new CliUsageError(`Unknown option "${argument}".`);
|
|
62
|
-
else if (source === null)
|
|
63
|
-
source = argument;
|
|
64
|
-
else
|
|
65
|
-
throw new CliUsageError('inspect-archive accepts one optional JSON file. Otherwise pipe one archive on stdin.');
|
|
66
|
-
}
|
|
67
|
-
if (reveal && search === null)
|
|
68
|
-
throw new CliUsageError('--reveal requires --search.');
|
|
69
|
-
if (requireMatch && search === null)
|
|
70
|
-
throw new CliUsageError('--require-match requires --search.');
|
|
71
|
-
if (quiet && output !== 'terminal')
|
|
72
|
-
throw new CliUsageError('--quiet cannot be combined with machine-readable output.');
|
|
73
|
-
return {
|
|
74
|
-
action: 'inspect-archive',
|
|
75
|
-
source,
|
|
76
|
-
passphraseSource,
|
|
77
|
-
search,
|
|
78
|
-
reveal,
|
|
79
|
-
requireMatch,
|
|
80
|
-
expectedContentDigest,
|
|
81
|
-
output,
|
|
82
|
-
quiet,
|
|
83
|
-
color,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
export function parseSignArtifactArguments(argv) {
|
|
87
|
-
let source = null;
|
|
88
|
-
let privateKeySource = null;
|
|
89
|
-
for (let index = 0; index < argv.length; index++) {
|
|
90
|
-
const argument = argv[index];
|
|
91
|
-
if (argument === undefined)
|
|
92
|
-
break;
|
|
93
|
-
if (argument === '--private-key-file') {
|
|
94
|
-
if (privateKeySource !== null)
|
|
95
|
-
throw new CliUsageError('--private-key-file may be supplied only once.');
|
|
96
|
-
const value = argv[++index];
|
|
97
|
-
if (!value || value.startsWith('-'))
|
|
98
|
-
throw new CliUsageError('--private-key-file requires one bounded PEM file.');
|
|
99
|
-
privateKeySource = value;
|
|
100
|
-
}
|
|
101
|
-
else if (argument.startsWith('-'))
|
|
102
|
-
throw new CliUsageError(`Unknown option "${argument}".`);
|
|
103
|
-
else if (source === null)
|
|
104
|
-
source = argument;
|
|
105
|
-
else
|
|
106
|
-
throw new CliUsageError('sign-artifact accepts one optional JSON file. Otherwise pipe one artefact on stdin.');
|
|
107
|
-
}
|
|
108
|
-
if (!privateKeySource)
|
|
109
|
-
throw new CliUsageError('sign-artifact requires --private-key-file.');
|
|
110
|
-
return { action: 'sign-artifact', source, privateKeySource };
|
|
111
|
-
}
|
|
112
|
-
export function parseVerifySignatureArguments(argv) {
|
|
113
|
-
let source = null;
|
|
114
|
-
let publicKeySource = null;
|
|
115
|
-
let output = 'terminal';
|
|
116
|
-
let quiet = false;
|
|
117
|
-
let color = true;
|
|
118
|
-
for (let index = 0; index < argv.length; index++) {
|
|
119
|
-
const argument = argv[index];
|
|
120
|
-
if (argument === undefined)
|
|
121
|
-
break;
|
|
122
|
-
if (argument === '--json') {
|
|
123
|
-
if (output !== 'terminal')
|
|
124
|
-
throw new CliUsageError('--json may be supplied only once.');
|
|
125
|
-
output = 'json';
|
|
126
|
-
}
|
|
127
|
-
else if (argument === '--public-key-file') {
|
|
128
|
-
if (publicKeySource !== null)
|
|
129
|
-
throw new CliUsageError('--public-key-file may be supplied only once.');
|
|
130
|
-
const value = argv[++index];
|
|
131
|
-
if (!value || value.startsWith('-'))
|
|
132
|
-
throw new CliUsageError('--public-key-file requires one bounded PEM file.');
|
|
133
|
-
publicKeySource = value;
|
|
134
|
-
}
|
|
135
|
-
else if (argument === '--quiet')
|
|
136
|
-
quiet = true;
|
|
137
|
-
else if (argument === '--no-color')
|
|
138
|
-
color = false;
|
|
139
|
-
else if (argument.startsWith('-'))
|
|
140
|
-
throw new CliUsageError(`Unknown option "${argument}".`);
|
|
141
|
-
else if (source === null)
|
|
142
|
-
source = argument;
|
|
143
|
-
else
|
|
144
|
-
throw new CliUsageError('verify-signature accepts one optional JSON file. Otherwise pipe one package on stdin.');
|
|
145
|
-
}
|
|
146
|
-
if (quiet && output !== 'terminal')
|
|
147
|
-
throw new CliUsageError('--quiet cannot be combined with machine-readable output.');
|
|
148
|
-
return {
|
|
149
|
-
action: 'verify-signature',
|
|
150
|
-
source,
|
|
151
|
-
publicKeySource,
|
|
152
|
-
output,
|
|
153
|
-
quiet,
|
|
154
|
-
color,
|
|
155
|
-
};
|
|
156
|
-
}
|