securewithtrace 0.8.0 → 0.9.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 +0 -1
- package/dist/index.js +889 -55
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
<a href="https://www.npmjs.com/package/securewithtrace"><img alt="npm version" src="https://img.shields.io/npm/v/securewithtrace?color=0ea5e9&label=npm"></a>
|
|
9
|
-
<a href="https://github.com/securewithtrace/trace/actions"><img alt="build status" src="https://img.shields.io/github/actions/workflow/status/securewithtrace/trace/release-please.yml?branch=main&label=release"></a>
|
|
10
9
|
</p>
|
|
11
10
|
|
|
12
11
|
`tracecli` is the official CLI for Trace.
|
package/dist/index.js
CHANGED
|
@@ -3682,7 +3682,7 @@ function extractCommandTree(cmd) {
|
|
|
3682
3682
|
description: o.description,
|
|
3683
3683
|
takesValue: o.required || o.optional
|
|
3684
3684
|
}));
|
|
3685
|
-
const subcommands = cmd.commands.filter((
|
|
3685
|
+
const subcommands = cmd.commands.filter((c24) => !c24._hidden).map((c24) => extractCommandTree(c24));
|
|
3686
3686
|
return {
|
|
3687
3687
|
name: cmd.name(),
|
|
3688
3688
|
description: cmd.description(),
|
|
@@ -3748,7 +3748,7 @@ function generateBashCompletion(tree, binName) {
|
|
|
3748
3748
|
}
|
|
3749
3749
|
function collectBashCases(tree, prefix) {
|
|
3750
3750
|
const cases = /* @__PURE__ */ new Map();
|
|
3751
|
-
const subcommandNames = tree.subcommands.map((
|
|
3751
|
+
const subcommandNames = tree.subcommands.map((c24) => c24.name);
|
|
3752
3752
|
const optionNames = tree.options.flatMap((o) => o.short ? [o.long, o.short] : [o.long]);
|
|
3753
3753
|
const extraOptions = prefix === "" ? ["--help", "--version"] : ["--help"];
|
|
3754
3754
|
const allOptions = [.../* @__PURE__ */ new Set([...optionNames, ...extraOptions])];
|
|
@@ -4035,11 +4035,6 @@ function createCompletionCommand(program3) {
|
|
|
4035
4035
|
});
|
|
4036
4036
|
}
|
|
4037
4037
|
|
|
4038
|
-
// src/repo/commands.ts
|
|
4039
|
-
import { chmodSync, mkdtempSync, rmSync as rmSync2, writeFileSync as writeFileSync3 } from "fs";
|
|
4040
|
-
import { tmpdir } from "os";
|
|
4041
|
-
import { join as join3 } from "path";
|
|
4042
|
-
|
|
4043
4038
|
// ../../node_modules/.bun/@ts-rest+core@3.53.0-rc.1+f9199aabcde8d6a0/node_modules/@ts-rest/core/index.esm.mjs
|
|
4044
4039
|
var util;
|
|
4045
4040
|
(function(util2) {
|
|
@@ -10808,7 +10803,7 @@ var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
|
10808
10803
|
function isValidBase64URL(data) {
|
|
10809
10804
|
if (!base64url.test(data))
|
|
10810
10805
|
return false;
|
|
10811
|
-
const base643 = data.replace(/[-_]/g, (
|
|
10806
|
+
const base643 = data.replace(/[-_]/g, (c24) => c24 === "-" ? "+" : "/");
|
|
10812
10807
|
const padded = base643.padEnd(Math.ceil(base643.length / 4) * 4, "=");
|
|
10813
10808
|
return isValidBase64(padded);
|
|
10814
10809
|
}
|
|
@@ -20852,9 +20847,9 @@ var ZodDate2 = /* @__PURE__ */ $constructor("ZodDate", (inst, def) => {
|
|
|
20852
20847
|
inst._zod.processJSONSchema = (ctx, json2, params) => dateProcessor(inst, ctx, json2, params);
|
|
20853
20848
|
inst.min = (value, params) => inst.check(_gte(value, params));
|
|
20854
20849
|
inst.max = (value, params) => inst.check(_lte(value, params));
|
|
20855
|
-
const
|
|
20856
|
-
inst.minDate =
|
|
20857
|
-
inst.maxDate =
|
|
20850
|
+
const c24 = inst._zod.bag;
|
|
20851
|
+
inst.minDate = c24.minimum ? new Date(c24.minimum) : null;
|
|
20852
|
+
inst.maxDate = c24.maximum ? new Date(c24.maximum) : null;
|
|
20858
20853
|
});
|
|
20859
20854
|
function date3(params) {
|
|
20860
20855
|
return _date(ZodDate2, params);
|
|
@@ -22976,19 +22971,51 @@ var llmProviderKeyContract = c7.router({
|
|
|
22976
22971
|
});
|
|
22977
22972
|
|
|
22978
22973
|
// ../../packages/api-contracts/src/schemas/api/v1/organization.api.ts
|
|
22974
|
+
var OrgCapabilityValues = [
|
|
22975
|
+
"PENTEST",
|
|
22976
|
+
"SCAN_SAST",
|
|
22977
|
+
"SCAN_SCA",
|
|
22978
|
+
"SCAN_SECRETS",
|
|
22979
|
+
"SCAN_DAST",
|
|
22980
|
+
"AUTO_PR_SCANS",
|
|
22981
|
+
"AUTO_PUSH_SCANS"
|
|
22982
|
+
];
|
|
22979
22983
|
var UpdateOrganizationRequestSchema = external_exports.object({
|
|
22980
22984
|
name: external_exports.string().min(1).max(255).optional(),
|
|
22981
|
-
logoUrl: external_exports.string().url().max(2048).nullish()
|
|
22985
|
+
logoUrl: external_exports.string().url().max(2048).nullish(),
|
|
22986
|
+
logoS3Key: external_exports.string().max(1024).nullish(),
|
|
22987
|
+
darkModeLogoUrl: external_exports.string().url().max(2048).nullish(),
|
|
22988
|
+
darkModeLogoS3Key: external_exports.string().max(1024).nullish()
|
|
22989
|
+
});
|
|
22990
|
+
var LogoUploadRequestSchema = external_exports.object({
|
|
22991
|
+
variant: external_exports.enum(["light", "dark"]),
|
|
22992
|
+
contentType: external_exports.enum(["image/png", "image/jpeg", "image/gif", "image/svg+xml", "image/webp"]),
|
|
22993
|
+
fileName: external_exports.string().min(1).max(255)
|
|
22994
|
+
});
|
|
22995
|
+
var LogoUploadResponseSchema = external_exports.object({
|
|
22996
|
+
uploadUrl: external_exports.string(),
|
|
22997
|
+
s3Key: external_exports.string()
|
|
22998
|
+
});
|
|
22999
|
+
var PatchCapabilitiesRequestSchema = external_exports.object({
|
|
23000
|
+
capabilities: external_exports.array(external_exports.enum(OrgCapabilityValues)).min(1)
|
|
23001
|
+
});
|
|
23002
|
+
var PatchCapabilitiesResponseSchema = external_exports.object({
|
|
23003
|
+
capabilities: external_exports.array(external_exports.enum(OrgCapabilityValues))
|
|
22982
23004
|
});
|
|
22983
23005
|
var OrganizationResponseSchema = external_exports.object({
|
|
22984
23006
|
organizationId: external_exports.uuid(),
|
|
22985
23007
|
name: external_exports.string(),
|
|
22986
23008
|
slug: external_exports.string(),
|
|
22987
23009
|
logoUrl: external_exports.string().nullable(),
|
|
23010
|
+
darkModeLogoUrl: external_exports.string().nullable(),
|
|
23011
|
+
capabilities: external_exports.array(external_exports.enum(OrgCapabilityValues)),
|
|
22988
23012
|
createdAt: external_exports.date(),
|
|
22989
23013
|
updatedAt: external_exports.date()
|
|
22990
23014
|
});
|
|
22991
23015
|
var ListOrganizationsResponseSchema = external_exports.array(OrganizationResponseSchema);
|
|
23016
|
+
var LogoDeleteRequestSchema = external_exports.object({
|
|
23017
|
+
variant: external_exports.enum(["light", "dark"])
|
|
23018
|
+
});
|
|
22992
23019
|
|
|
22993
23020
|
// ../../packages/api-contracts/src/contracts/v1/organization.ts
|
|
22994
23021
|
var c8 = initContract();
|
|
@@ -23040,6 +23067,538 @@ var organizationContract = c8.router({
|
|
|
23040
23067
|
404: ErrorResponseSchema,
|
|
23041
23068
|
500: ErrorResponseSchema
|
|
23042
23069
|
}
|
|
23070
|
+
},
|
|
23071
|
+
patchCapabilities: {
|
|
23072
|
+
method: "PATCH",
|
|
23073
|
+
path: "/organizations/:organizationId/capabilities",
|
|
23074
|
+
pathParams: OrgIdParamsSchema,
|
|
23075
|
+
body: PatchCapabilitiesRequestSchema,
|
|
23076
|
+
responses: {
|
|
23077
|
+
200: PatchCapabilitiesResponseSchema,
|
|
23078
|
+
401: ErrorResponseSchema,
|
|
23079
|
+
403: ErrorResponseSchema,
|
|
23080
|
+
404: ErrorResponseSchema,
|
|
23081
|
+
500: ErrorResponseSchema
|
|
23082
|
+
}
|
|
23083
|
+
},
|
|
23084
|
+
generateLogoUploadUrl: {
|
|
23085
|
+
method: "POST",
|
|
23086
|
+
path: "/organizations/:organizationId/logo-upload-url",
|
|
23087
|
+
pathParams: OrgIdParamsSchema,
|
|
23088
|
+
body: LogoUploadRequestSchema,
|
|
23089
|
+
responses: {
|
|
23090
|
+
200: LogoUploadResponseSchema,
|
|
23091
|
+
401: ErrorResponseSchema,
|
|
23092
|
+
403: ErrorResponseSchema,
|
|
23093
|
+
404: ErrorResponseSchema,
|
|
23094
|
+
500: ErrorResponseSchema
|
|
23095
|
+
}
|
|
23096
|
+
}
|
|
23097
|
+
});
|
|
23098
|
+
|
|
23099
|
+
// ../../packages/api-contracts/src/schemas/domain/pentest.schema.ts
|
|
23100
|
+
var PentestStatusValues = ["SCOPING", "IN_PROGRESS", "REMEDIATION", "CLOSED"];
|
|
23101
|
+
var PentestStatus = external_exports.enum(PentestStatusValues);
|
|
23102
|
+
var PentestFindingStatusValues = [
|
|
23103
|
+
"OPEN",
|
|
23104
|
+
"CONTESTED",
|
|
23105
|
+
"REMEDIATED",
|
|
23106
|
+
"VERIFIED_FIXED",
|
|
23107
|
+
"VERIFIED_OPEN"
|
|
23108
|
+
];
|
|
23109
|
+
var PentestFindingStatus = external_exports.enum(PentestFindingStatusValues);
|
|
23110
|
+
var PentestFindingSeverityValues = [
|
|
23111
|
+
"INFORMATIONAL",
|
|
23112
|
+
"LOW",
|
|
23113
|
+
"MEDIUM",
|
|
23114
|
+
"HIGH",
|
|
23115
|
+
"CRITICAL"
|
|
23116
|
+
];
|
|
23117
|
+
var PentestFindingSeverity = external_exports.enum(PentestFindingSeverityValues);
|
|
23118
|
+
var ContestReasonValues = [
|
|
23119
|
+
"FALSE_POSITIVE",
|
|
23120
|
+
"ACCEPTED_RISK",
|
|
23121
|
+
"MITIGATING_CONTROLS",
|
|
23122
|
+
"OUT_OF_SCOPE",
|
|
23123
|
+
"DUPLICATE",
|
|
23124
|
+
"OTHER"
|
|
23125
|
+
];
|
|
23126
|
+
var ContestReason = external_exports.enum(ContestReasonValues);
|
|
23127
|
+
var RetestOutcomeValues = ["FIXED", "PARTIALLY_FIXED", "NOT_FIXED"];
|
|
23128
|
+
var RetestOutcome = external_exports.enum(RetestOutcomeValues);
|
|
23129
|
+
|
|
23130
|
+
// ../../packages/api-contracts/src/schemas/api/v1/pentest.api.ts
|
|
23131
|
+
var PentestIdParamsSchema = OrgIdParamsSchema.extend({
|
|
23132
|
+
pentestId: external_exports.uuid()
|
|
23133
|
+
});
|
|
23134
|
+
var PentestResponseSchema = external_exports.object({
|
|
23135
|
+
pentestId: external_exports.uuid(),
|
|
23136
|
+
organizationId: external_exports.uuid(),
|
|
23137
|
+
displayId: external_exports.number(),
|
|
23138
|
+
title: external_exports.string(),
|
|
23139
|
+
description: external_exports.string().nullable(),
|
|
23140
|
+
status: PentestStatus,
|
|
23141
|
+
scope: external_exports.string().nullable(),
|
|
23142
|
+
startedAt: external_exports.coerce.date().nullable(),
|
|
23143
|
+
endedAt: external_exports.coerce.date().nullable(),
|
|
23144
|
+
createdById: external_exports.uuid(),
|
|
23145
|
+
createdByName: external_exports.string(),
|
|
23146
|
+
createdAt: external_exports.coerce.date(),
|
|
23147
|
+
updatedAt: external_exports.coerce.date(),
|
|
23148
|
+
findingCounts: external_exports.object({
|
|
23149
|
+
total: external_exports.number(),
|
|
23150
|
+
bySeverity: external_exports.record(PentestFindingSeverity, external_exports.number()),
|
|
23151
|
+
byStatus: external_exports.record(PentestFindingStatus, external_exports.number())
|
|
23152
|
+
})
|
|
23153
|
+
});
|
|
23154
|
+
var ListPentestsResponseSchema = external_exports.array(PentestResponseSchema);
|
|
23155
|
+
var CreatePentestRequestSchema = external_exports.object({
|
|
23156
|
+
title: external_exports.string().min(1).max(500),
|
|
23157
|
+
description: external_exports.string().max(1e4).optional(),
|
|
23158
|
+
scope: external_exports.string().max(5e4).optional(),
|
|
23159
|
+
status: PentestStatus.optional(),
|
|
23160
|
+
startedAt: external_exports.coerce.date().optional(),
|
|
23161
|
+
endedAt: external_exports.coerce.date().optional()
|
|
23162
|
+
});
|
|
23163
|
+
var UpdatePentestRequestSchema = external_exports.object({
|
|
23164
|
+
title: external_exports.string().min(1).max(500).optional(),
|
|
23165
|
+
description: external_exports.string().max(1e4).nullable().optional(),
|
|
23166
|
+
status: PentestStatus.optional(),
|
|
23167
|
+
scope: external_exports.string().max(5e4).nullable().optional(),
|
|
23168
|
+
startedAt: external_exports.coerce.date().nullable().optional(),
|
|
23169
|
+
endedAt: external_exports.coerce.date().nullable().optional()
|
|
23170
|
+
});
|
|
23171
|
+
|
|
23172
|
+
// ../../packages/api-contracts/src/contracts/v1/pentest.ts
|
|
23173
|
+
var c9 = initContract();
|
|
23174
|
+
var pentestContract = c9.router({
|
|
23175
|
+
listPentests: {
|
|
23176
|
+
method: "GET",
|
|
23177
|
+
path: "/organizations/:organizationId/pentests",
|
|
23178
|
+
pathParams: OrgIdParamsSchema,
|
|
23179
|
+
responses: {
|
|
23180
|
+
200: ListPentestsResponseSchema,
|
|
23181
|
+
401: ErrorResponseSchema,
|
|
23182
|
+
403: ErrorResponseSchema,
|
|
23183
|
+
404: ErrorResponseSchema,
|
|
23184
|
+
500: ErrorResponseSchema
|
|
23185
|
+
}
|
|
23186
|
+
},
|
|
23187
|
+
createPentest: {
|
|
23188
|
+
method: "POST",
|
|
23189
|
+
path: "/organizations/:organizationId/pentests",
|
|
23190
|
+
pathParams: OrgIdParamsSchema,
|
|
23191
|
+
body: CreatePentestRequestSchema,
|
|
23192
|
+
responses: {
|
|
23193
|
+
201: PentestResponseSchema,
|
|
23194
|
+
400: ErrorResponseSchema,
|
|
23195
|
+
401: ErrorResponseSchema,
|
|
23196
|
+
403: ErrorResponseSchema,
|
|
23197
|
+
404: ErrorResponseSchema,
|
|
23198
|
+
500: ErrorResponseSchema
|
|
23199
|
+
}
|
|
23200
|
+
},
|
|
23201
|
+
getPentest: {
|
|
23202
|
+
method: "GET",
|
|
23203
|
+
path: "/organizations/:organizationId/pentests/:pentestId",
|
|
23204
|
+
pathParams: PentestIdParamsSchema,
|
|
23205
|
+
responses: {
|
|
23206
|
+
200: PentestResponseSchema,
|
|
23207
|
+
401: ErrorResponseSchema,
|
|
23208
|
+
403: ErrorResponseSchema,
|
|
23209
|
+
404: ErrorResponseSchema,
|
|
23210
|
+
500: ErrorResponseSchema
|
|
23211
|
+
}
|
|
23212
|
+
},
|
|
23213
|
+
updatePentest: {
|
|
23214
|
+
method: "PATCH",
|
|
23215
|
+
path: "/organizations/:organizationId/pentests/:pentestId",
|
|
23216
|
+
pathParams: PentestIdParamsSchema,
|
|
23217
|
+
body: UpdatePentestRequestSchema,
|
|
23218
|
+
responses: {
|
|
23219
|
+
200: PentestResponseSchema,
|
|
23220
|
+
400: ErrorResponseSchema,
|
|
23221
|
+
401: ErrorResponseSchema,
|
|
23222
|
+
403: ErrorResponseSchema,
|
|
23223
|
+
404: ErrorResponseSchema,
|
|
23224
|
+
500: ErrorResponseSchema
|
|
23225
|
+
}
|
|
23226
|
+
},
|
|
23227
|
+
deletePentest: {
|
|
23228
|
+
method: "DELETE",
|
|
23229
|
+
path: "/organizations/:organizationId/pentests/:pentestId",
|
|
23230
|
+
pathParams: PentestIdParamsSchema,
|
|
23231
|
+
responses: {
|
|
23232
|
+
204: DeleteResponseSchema,
|
|
23233
|
+
401: ErrorResponseSchema,
|
|
23234
|
+
403: ErrorResponseSchema,
|
|
23235
|
+
404: ErrorResponseSchema,
|
|
23236
|
+
500: ErrorResponseSchema
|
|
23237
|
+
}
|
|
23238
|
+
}
|
|
23239
|
+
});
|
|
23240
|
+
|
|
23241
|
+
// ../../packages/api-contracts/src/schemas/api/v1/pentest-finding.api.ts
|
|
23242
|
+
var PentestFindingParamsSchema = OrgIdParamsSchema.extend({
|
|
23243
|
+
pentestId: external_exports.uuid()
|
|
23244
|
+
});
|
|
23245
|
+
var PentestFindingIdParamsSchema = PentestFindingParamsSchema.extend({
|
|
23246
|
+
pentestFindingId: external_exports.uuid()
|
|
23247
|
+
});
|
|
23248
|
+
var PentestFindingContestIdParamsSchema = PentestFindingIdParamsSchema.extend({
|
|
23249
|
+
contestId: external_exports.uuid()
|
|
23250
|
+
});
|
|
23251
|
+
var PentestFindingRetestIdParamsSchema = PentestFindingIdParamsSchema.extend({
|
|
23252
|
+
retestId: external_exports.uuid()
|
|
23253
|
+
});
|
|
23254
|
+
var PentestFindingNoteIdParamsSchema = PentestFindingIdParamsSchema.extend({
|
|
23255
|
+
noteId: external_exports.uuid()
|
|
23256
|
+
});
|
|
23257
|
+
var PentestFindingRepositorySchema = external_exports.object({
|
|
23258
|
+
repositoryId: external_exports.uuid(),
|
|
23259
|
+
repositoryName: external_exports.string(),
|
|
23260
|
+
commitSha: external_exports.string().nullable(),
|
|
23261
|
+
filePath: external_exports.string().nullable(),
|
|
23262
|
+
startLine: external_exports.number().nullable(),
|
|
23263
|
+
endLine: external_exports.number().nullable()
|
|
23264
|
+
});
|
|
23265
|
+
var PentestFindingResponseSchema = external_exports.object({
|
|
23266
|
+
pentestFindingId: external_exports.uuid(),
|
|
23267
|
+
organizationId: external_exports.uuid(),
|
|
23268
|
+
pentestId: external_exports.uuid(),
|
|
23269
|
+
displayId: external_exports.number(),
|
|
23270
|
+
title: external_exports.string(),
|
|
23271
|
+
description: external_exports.string(),
|
|
23272
|
+
severity: PentestFindingSeverity,
|
|
23273
|
+
category: external_exports.string(),
|
|
23274
|
+
status: PentestFindingStatus,
|
|
23275
|
+
cweIds: external_exports.array(external_exports.string()),
|
|
23276
|
+
cvssVector: external_exports.string().nullable(),
|
|
23277
|
+
cvssScore: external_exports.number().nullable(),
|
|
23278
|
+
owaspCategory: external_exports.string().nullable(),
|
|
23279
|
+
publishedAt: external_exports.coerce.date().nullable(),
|
|
23280
|
+
createdById: external_exports.uuid(),
|
|
23281
|
+
createdByName: external_exports.string(),
|
|
23282
|
+
createdAt: external_exports.coerce.date(),
|
|
23283
|
+
updatedAt: external_exports.coerce.date(),
|
|
23284
|
+
repositories: external_exports.array(PentestFindingRepositorySchema)
|
|
23285
|
+
});
|
|
23286
|
+
var ListPentestFindingsResponseSchema = external_exports.array(PentestFindingResponseSchema);
|
|
23287
|
+
var CreatePentestFindingRequestSchema = external_exports.object({
|
|
23288
|
+
title: external_exports.string().min(1).max(500),
|
|
23289
|
+
description: external_exports.string().min(1).max(5e4),
|
|
23290
|
+
severity: PentestFindingSeverity,
|
|
23291
|
+
category: external_exports.string().min(1).max(200),
|
|
23292
|
+
status: PentestFindingStatus.optional(),
|
|
23293
|
+
cweIds: external_exports.array(external_exports.string()).optional(),
|
|
23294
|
+
cvssVector: external_exports.string().max(200).optional(),
|
|
23295
|
+
cvssScore: external_exports.number().min(0).max(10).optional(),
|
|
23296
|
+
owaspCategory: external_exports.string().max(200).optional(),
|
|
23297
|
+
repositories: external_exports.array(
|
|
23298
|
+
external_exports.object({
|
|
23299
|
+
repositoryId: external_exports.uuid(),
|
|
23300
|
+
commitSha: external_exports.string().optional(),
|
|
23301
|
+
filePath: external_exports.string().optional(),
|
|
23302
|
+
startLine: external_exports.number().int().optional(),
|
|
23303
|
+
endLine: external_exports.number().int().optional()
|
|
23304
|
+
})
|
|
23305
|
+
).optional()
|
|
23306
|
+
});
|
|
23307
|
+
var UpdatePentestFindingRequestSchema = external_exports.object({
|
|
23308
|
+
title: external_exports.string().min(1).max(500).optional(),
|
|
23309
|
+
description: external_exports.string().min(1).max(5e4).optional(),
|
|
23310
|
+
severity: PentestFindingSeverity.optional(),
|
|
23311
|
+
category: external_exports.string().min(1).max(200).optional(),
|
|
23312
|
+
status: PentestFindingStatus.optional(),
|
|
23313
|
+
cweIds: external_exports.array(external_exports.string()).optional(),
|
|
23314
|
+
cvssVector: external_exports.string().max(200).nullable().optional(),
|
|
23315
|
+
cvssScore: external_exports.number().min(0).max(10).nullable().optional(),
|
|
23316
|
+
owaspCategory: external_exports.string().max(200).nullable().optional(),
|
|
23317
|
+
publishedAt: external_exports.coerce.date().nullable().optional(),
|
|
23318
|
+
repositories: external_exports.array(
|
|
23319
|
+
external_exports.object({
|
|
23320
|
+
repositoryId: external_exports.uuid(),
|
|
23321
|
+
commitSha: external_exports.string().optional(),
|
|
23322
|
+
filePath: external_exports.string().optional(),
|
|
23323
|
+
startLine: external_exports.number().int().optional(),
|
|
23324
|
+
endLine: external_exports.number().int().optional()
|
|
23325
|
+
})
|
|
23326
|
+
).optional()
|
|
23327
|
+
});
|
|
23328
|
+
var PentestFindingContestResponseSchema = external_exports.object({
|
|
23329
|
+
contestId: external_exports.uuid(),
|
|
23330
|
+
pentestFindingId: external_exports.uuid(),
|
|
23331
|
+
organizationId: external_exports.uuid(),
|
|
23332
|
+
reason: ContestReason,
|
|
23333
|
+
justification: external_exports.string(),
|
|
23334
|
+
contestedById: external_exports.uuid(),
|
|
23335
|
+
contestedByName: external_exports.string(),
|
|
23336
|
+
contestedAt: external_exports.coerce.date(),
|
|
23337
|
+
resolution: external_exports.string().nullable(),
|
|
23338
|
+
resolvedById: external_exports.uuid().nullable(),
|
|
23339
|
+
resolvedByName: external_exports.string().nullable(),
|
|
23340
|
+
resolvedAt: external_exports.coerce.date().nullable()
|
|
23341
|
+
});
|
|
23342
|
+
var ListPentestFindingContestsResponseSchema = external_exports.array(
|
|
23343
|
+
PentestFindingContestResponseSchema
|
|
23344
|
+
);
|
|
23345
|
+
var CreatePentestFindingContestRequestSchema = external_exports.object({
|
|
23346
|
+
reason: ContestReason,
|
|
23347
|
+
justification: external_exports.string().min(1).max(1e4)
|
|
23348
|
+
});
|
|
23349
|
+
var ResolvePentestFindingContestRequestSchema = external_exports.object({
|
|
23350
|
+
resolution: external_exports.string().min(1).max(1e4)
|
|
23351
|
+
});
|
|
23352
|
+
var PentestFindingRetestResponseSchema = external_exports.object({
|
|
23353
|
+
retestId: external_exports.uuid(),
|
|
23354
|
+
pentestFindingId: external_exports.uuid(),
|
|
23355
|
+
organizationId: external_exports.uuid(),
|
|
23356
|
+
outcome: RetestOutcome,
|
|
23357
|
+
notes: external_exports.string().nullable(),
|
|
23358
|
+
testedById: external_exports.uuid(),
|
|
23359
|
+
testedByName: external_exports.string(),
|
|
23360
|
+
testedAt: external_exports.coerce.date()
|
|
23361
|
+
});
|
|
23362
|
+
var ListPentestFindingRetestsResponseSchema = external_exports.array(PentestFindingRetestResponseSchema);
|
|
23363
|
+
var CreatePentestFindingRetestRequestSchema = external_exports.object({
|
|
23364
|
+
outcome: RetestOutcome,
|
|
23365
|
+
notes: external_exports.string().max(1e4).optional()
|
|
23366
|
+
});
|
|
23367
|
+
var PentestFindingNoteResponseSchema = external_exports.object({
|
|
23368
|
+
noteId: external_exports.uuid(),
|
|
23369
|
+
pentestFindingId: external_exports.uuid(),
|
|
23370
|
+
organizationId: external_exports.uuid(),
|
|
23371
|
+
authorId: external_exports.uuid(),
|
|
23372
|
+
authorName: external_exports.string(),
|
|
23373
|
+
content: external_exports.string(),
|
|
23374
|
+
createdAt: external_exports.coerce.date(),
|
|
23375
|
+
updatedAt: external_exports.coerce.date()
|
|
23376
|
+
});
|
|
23377
|
+
var ListPentestFindingNotesResponseSchema = external_exports.array(PentestFindingNoteResponseSchema);
|
|
23378
|
+
var CreatePentestFindingNoteRequestSchema = external_exports.object({
|
|
23379
|
+
content: external_exports.string().min(1).max(1e4)
|
|
23380
|
+
});
|
|
23381
|
+
var UpdatePentestFindingNoteRequestSchema = external_exports.object({
|
|
23382
|
+
content: external_exports.string().min(1).max(1e4)
|
|
23383
|
+
});
|
|
23384
|
+
var ParseFindingMarkdownRequestSchema = external_exports.object({
|
|
23385
|
+
markdown: external_exports.string().min(1).max(1e5)
|
|
23386
|
+
});
|
|
23387
|
+
var ParseFindingMarkdownResponseSchema = external_exports.object({
|
|
23388
|
+
title: external_exports.string(),
|
|
23389
|
+
description: external_exports.string(),
|
|
23390
|
+
severity: PentestFindingSeverity,
|
|
23391
|
+
category: external_exports.string(),
|
|
23392
|
+
status: PentestFindingStatus,
|
|
23393
|
+
cweIds: external_exports.array(external_exports.string()),
|
|
23394
|
+
cvssVector: external_exports.string().nullable(),
|
|
23395
|
+
cvssScore: external_exports.number().nullable(),
|
|
23396
|
+
owaspCategory: external_exports.string().nullable()
|
|
23397
|
+
});
|
|
23398
|
+
|
|
23399
|
+
// ../../packages/api-contracts/src/contracts/v1/pentest-finding.ts
|
|
23400
|
+
var c10 = initContract();
|
|
23401
|
+
var pentestFindingContract = c10.router({
|
|
23402
|
+
// ─── Findings ───
|
|
23403
|
+
listFindings: {
|
|
23404
|
+
method: "GET",
|
|
23405
|
+
path: "/organizations/:organizationId/pentests/:pentestId/findings",
|
|
23406
|
+
pathParams: PentestFindingParamsSchema,
|
|
23407
|
+
responses: {
|
|
23408
|
+
200: ListPentestFindingsResponseSchema,
|
|
23409
|
+
401: ErrorResponseSchema,
|
|
23410
|
+
403: ErrorResponseSchema,
|
|
23411
|
+
404: ErrorResponseSchema,
|
|
23412
|
+
500: ErrorResponseSchema
|
|
23413
|
+
}
|
|
23414
|
+
},
|
|
23415
|
+
createFinding: {
|
|
23416
|
+
method: "POST",
|
|
23417
|
+
path: "/organizations/:organizationId/pentests/:pentestId/findings",
|
|
23418
|
+
pathParams: PentestFindingParamsSchema,
|
|
23419
|
+
body: CreatePentestFindingRequestSchema,
|
|
23420
|
+
responses: {
|
|
23421
|
+
201: PentestFindingResponseSchema,
|
|
23422
|
+
400: ErrorResponseSchema,
|
|
23423
|
+
401: ErrorResponseSchema,
|
|
23424
|
+
403: ErrorResponseSchema,
|
|
23425
|
+
404: ErrorResponseSchema,
|
|
23426
|
+
500: ErrorResponseSchema
|
|
23427
|
+
}
|
|
23428
|
+
},
|
|
23429
|
+
getFinding: {
|
|
23430
|
+
method: "GET",
|
|
23431
|
+
path: "/organizations/:organizationId/pentests/:pentestId/findings/:pentestFindingId",
|
|
23432
|
+
pathParams: PentestFindingIdParamsSchema,
|
|
23433
|
+
responses: {
|
|
23434
|
+
200: PentestFindingResponseSchema,
|
|
23435
|
+
401: ErrorResponseSchema,
|
|
23436
|
+
403: ErrorResponseSchema,
|
|
23437
|
+
404: ErrorResponseSchema,
|
|
23438
|
+
500: ErrorResponseSchema
|
|
23439
|
+
}
|
|
23440
|
+
},
|
|
23441
|
+
updateFinding: {
|
|
23442
|
+
method: "PATCH",
|
|
23443
|
+
path: "/organizations/:organizationId/pentests/:pentestId/findings/:pentestFindingId",
|
|
23444
|
+
pathParams: PentestFindingIdParamsSchema,
|
|
23445
|
+
body: UpdatePentestFindingRequestSchema,
|
|
23446
|
+
responses: {
|
|
23447
|
+
200: PentestFindingResponseSchema,
|
|
23448
|
+
400: ErrorResponseSchema,
|
|
23449
|
+
401: ErrorResponseSchema,
|
|
23450
|
+
403: ErrorResponseSchema,
|
|
23451
|
+
404: ErrorResponseSchema,
|
|
23452
|
+
500: ErrorResponseSchema
|
|
23453
|
+
}
|
|
23454
|
+
},
|
|
23455
|
+
deleteFinding: {
|
|
23456
|
+
method: "DELETE",
|
|
23457
|
+
path: "/organizations/:organizationId/pentests/:pentestId/findings/:pentestFindingId",
|
|
23458
|
+
pathParams: PentestFindingIdParamsSchema,
|
|
23459
|
+
responses: {
|
|
23460
|
+
204: DeleteResponseSchema,
|
|
23461
|
+
401: ErrorResponseSchema,
|
|
23462
|
+
403: ErrorResponseSchema,
|
|
23463
|
+
404: ErrorResponseSchema,
|
|
23464
|
+
500: ErrorResponseSchema
|
|
23465
|
+
}
|
|
23466
|
+
},
|
|
23467
|
+
// ─── Contests ───
|
|
23468
|
+
listContests: {
|
|
23469
|
+
method: "GET",
|
|
23470
|
+
path: "/organizations/:organizationId/pentests/:pentestId/findings/:pentestFindingId/contests",
|
|
23471
|
+
pathParams: PentestFindingIdParamsSchema,
|
|
23472
|
+
responses: {
|
|
23473
|
+
200: ListPentestFindingContestsResponseSchema,
|
|
23474
|
+
401: ErrorResponseSchema,
|
|
23475
|
+
403: ErrorResponseSchema,
|
|
23476
|
+
404: ErrorResponseSchema,
|
|
23477
|
+
500: ErrorResponseSchema
|
|
23478
|
+
}
|
|
23479
|
+
},
|
|
23480
|
+
createContest: {
|
|
23481
|
+
method: "POST",
|
|
23482
|
+
path: "/organizations/:organizationId/pentests/:pentestId/findings/:pentestFindingId/contests",
|
|
23483
|
+
pathParams: PentestFindingIdParamsSchema,
|
|
23484
|
+
body: CreatePentestFindingContestRequestSchema,
|
|
23485
|
+
responses: {
|
|
23486
|
+
201: PentestFindingContestResponseSchema,
|
|
23487
|
+
400: ErrorResponseSchema,
|
|
23488
|
+
401: ErrorResponseSchema,
|
|
23489
|
+
403: ErrorResponseSchema,
|
|
23490
|
+
404: ErrorResponseSchema,
|
|
23491
|
+
500: ErrorResponseSchema
|
|
23492
|
+
}
|
|
23493
|
+
},
|
|
23494
|
+
resolveContest: {
|
|
23495
|
+
method: "PATCH",
|
|
23496
|
+
path: "/organizations/:organizationId/pentests/:pentestId/findings/:pentestFindingId/contests/:contestId",
|
|
23497
|
+
pathParams: PentestFindingContestIdParamsSchema,
|
|
23498
|
+
body: ResolvePentestFindingContestRequestSchema,
|
|
23499
|
+
responses: {
|
|
23500
|
+
200: PentestFindingContestResponseSchema,
|
|
23501
|
+
400: ErrorResponseSchema,
|
|
23502
|
+
401: ErrorResponseSchema,
|
|
23503
|
+
403: ErrorResponseSchema,
|
|
23504
|
+
404: ErrorResponseSchema,
|
|
23505
|
+
500: ErrorResponseSchema
|
|
23506
|
+
}
|
|
23507
|
+
},
|
|
23508
|
+
// ─── Retests ───
|
|
23509
|
+
listRetests: {
|
|
23510
|
+
method: "GET",
|
|
23511
|
+
path: "/organizations/:organizationId/pentests/:pentestId/findings/:pentestFindingId/retests",
|
|
23512
|
+
pathParams: PentestFindingIdParamsSchema,
|
|
23513
|
+
responses: {
|
|
23514
|
+
200: ListPentestFindingRetestsResponseSchema,
|
|
23515
|
+
401: ErrorResponseSchema,
|
|
23516
|
+
403: ErrorResponseSchema,
|
|
23517
|
+
404: ErrorResponseSchema,
|
|
23518
|
+
500: ErrorResponseSchema
|
|
23519
|
+
}
|
|
23520
|
+
},
|
|
23521
|
+
createRetest: {
|
|
23522
|
+
method: "POST",
|
|
23523
|
+
path: "/organizations/:organizationId/pentests/:pentestId/findings/:pentestFindingId/retests",
|
|
23524
|
+
pathParams: PentestFindingIdParamsSchema,
|
|
23525
|
+
body: CreatePentestFindingRetestRequestSchema,
|
|
23526
|
+
responses: {
|
|
23527
|
+
201: PentestFindingRetestResponseSchema,
|
|
23528
|
+
400: ErrorResponseSchema,
|
|
23529
|
+
401: ErrorResponseSchema,
|
|
23530
|
+
403: ErrorResponseSchema,
|
|
23531
|
+
404: ErrorResponseSchema,
|
|
23532
|
+
500: ErrorResponseSchema
|
|
23533
|
+
}
|
|
23534
|
+
},
|
|
23535
|
+
// ─── Notes ───
|
|
23536
|
+
listNotes: {
|
|
23537
|
+
method: "GET",
|
|
23538
|
+
path: "/organizations/:organizationId/pentests/:pentestId/findings/:pentestFindingId/notes",
|
|
23539
|
+
pathParams: PentestFindingIdParamsSchema,
|
|
23540
|
+
responses: {
|
|
23541
|
+
200: ListPentestFindingNotesResponseSchema,
|
|
23542
|
+
401: ErrorResponseSchema,
|
|
23543
|
+
403: ErrorResponseSchema,
|
|
23544
|
+
404: ErrorResponseSchema,
|
|
23545
|
+
500: ErrorResponseSchema
|
|
23546
|
+
}
|
|
23547
|
+
},
|
|
23548
|
+
createNote: {
|
|
23549
|
+
method: "POST",
|
|
23550
|
+
path: "/organizations/:organizationId/pentests/:pentestId/findings/:pentestFindingId/notes",
|
|
23551
|
+
pathParams: PentestFindingIdParamsSchema,
|
|
23552
|
+
body: CreatePentestFindingNoteRequestSchema,
|
|
23553
|
+
responses: {
|
|
23554
|
+
201: PentestFindingNoteResponseSchema,
|
|
23555
|
+
400: ErrorResponseSchema,
|
|
23556
|
+
401: ErrorResponseSchema,
|
|
23557
|
+
403: ErrorResponseSchema,
|
|
23558
|
+
404: ErrorResponseSchema,
|
|
23559
|
+
500: ErrorResponseSchema
|
|
23560
|
+
}
|
|
23561
|
+
},
|
|
23562
|
+
updateNote: {
|
|
23563
|
+
method: "PATCH",
|
|
23564
|
+
path: "/organizations/:organizationId/pentests/:pentestId/findings/:pentestFindingId/notes/:noteId",
|
|
23565
|
+
pathParams: PentestFindingNoteIdParamsSchema,
|
|
23566
|
+
body: UpdatePentestFindingNoteRequestSchema,
|
|
23567
|
+
responses: {
|
|
23568
|
+
200: PentestFindingNoteResponseSchema,
|
|
23569
|
+
400: ErrorResponseSchema,
|
|
23570
|
+
401: ErrorResponseSchema,
|
|
23571
|
+
403: ErrorResponseSchema,
|
|
23572
|
+
404: ErrorResponseSchema,
|
|
23573
|
+
500: ErrorResponseSchema
|
|
23574
|
+
}
|
|
23575
|
+
},
|
|
23576
|
+
deleteNote: {
|
|
23577
|
+
method: "DELETE",
|
|
23578
|
+
path: "/organizations/:organizationId/pentests/:pentestId/findings/:pentestFindingId/notes/:noteId",
|
|
23579
|
+
pathParams: PentestFindingNoteIdParamsSchema,
|
|
23580
|
+
responses: {
|
|
23581
|
+
204: DeleteResponseSchema,
|
|
23582
|
+
401: ErrorResponseSchema,
|
|
23583
|
+
403: ErrorResponseSchema,
|
|
23584
|
+
404: ErrorResponseSchema,
|
|
23585
|
+
500: ErrorResponseSchema
|
|
23586
|
+
}
|
|
23587
|
+
},
|
|
23588
|
+
// ─── AI parsing ───
|
|
23589
|
+
parseFindingMarkdown: {
|
|
23590
|
+
method: "POST",
|
|
23591
|
+
path: "/organizations/:organizationId/pentests/:pentestId/findings/parse-markdown",
|
|
23592
|
+
pathParams: PentestFindingParamsSchema,
|
|
23593
|
+
body: ParseFindingMarkdownRequestSchema,
|
|
23594
|
+
responses: {
|
|
23595
|
+
200: ParseFindingMarkdownResponseSchema,
|
|
23596
|
+
400: ErrorResponseSchema,
|
|
23597
|
+
401: ErrorResponseSchema,
|
|
23598
|
+
403: ErrorResponseSchema,
|
|
23599
|
+
404: ErrorResponseSchema,
|
|
23600
|
+
500: ErrorResponseSchema
|
|
23601
|
+
}
|
|
23043
23602
|
}
|
|
23044
23603
|
});
|
|
23045
23604
|
|
|
@@ -23081,8 +23640,8 @@ var CloneTokenResponseSchema = external_exports.object({
|
|
|
23081
23640
|
});
|
|
23082
23641
|
|
|
23083
23642
|
// ../../packages/api-contracts/src/contracts/v1/repository.ts
|
|
23084
|
-
var
|
|
23085
|
-
var repositoryContract =
|
|
23643
|
+
var c11 = initContract();
|
|
23644
|
+
var repositoryContract = c11.router({
|
|
23086
23645
|
createRepository: {
|
|
23087
23646
|
method: "POST",
|
|
23088
23647
|
path: "/organizations/:organizationId/repositories",
|
|
@@ -23247,9 +23806,18 @@ var ScanResponseSchema = external_exports.object({
|
|
|
23247
23806
|
updatedAt: external_exports.date()
|
|
23248
23807
|
});
|
|
23249
23808
|
var ListScansQuerySchema = external_exports.object({
|
|
23250
|
-
status: external_exports.enum(ScanStatusValues).array().or(external_exports.enum(ScanStatusValues)).optional()
|
|
23809
|
+
status: external_exports.enum(ScanStatusValues).array().or(external_exports.enum(ScanStatusValues)).optional(),
|
|
23810
|
+
repositoryId: external_exports.uuid().optional(),
|
|
23811
|
+
page: external_exports.coerce.number().int().min(1).max(1e4).optional(),
|
|
23812
|
+
pageSize: external_exports.coerce.number().int().min(1).max(200).optional()
|
|
23251
23813
|
});
|
|
23252
|
-
var ListScansResponseSchema = external_exports.
|
|
23814
|
+
var ListScansResponseSchema = external_exports.object({
|
|
23815
|
+
scans: external_exports.array(ScanResponseSchema),
|
|
23816
|
+
total: external_exports.number(),
|
|
23817
|
+
page: external_exports.number(),
|
|
23818
|
+
pageSize: external_exports.number()
|
|
23819
|
+
});
|
|
23820
|
+
var ScanArrayResponseSchema = external_exports.array(ScanResponseSchema);
|
|
23253
23821
|
var CancelScanResponseSchema = external_exports.object({
|
|
23254
23822
|
scanId: external_exports.uuid(),
|
|
23255
23823
|
status: external_exports.literal("CANCELLED")
|
|
@@ -23271,8 +23839,8 @@ var ListScanLogsResponseSchema = external_exports.object({
|
|
|
23271
23839
|
});
|
|
23272
23840
|
|
|
23273
23841
|
// ../../packages/api-contracts/src/contracts/v1/scan.ts
|
|
23274
|
-
var
|
|
23275
|
-
var scanContract =
|
|
23842
|
+
var c12 = initContract();
|
|
23843
|
+
var scanContract = c12.router({
|
|
23276
23844
|
createScan: {
|
|
23277
23845
|
method: "POST",
|
|
23278
23846
|
path: "/organizations/:organizationId/scans",
|
|
@@ -23370,14 +23938,15 @@ var UserResponseSchema = external_exports.object({
|
|
|
23370
23938
|
lastName: external_exports.string(),
|
|
23371
23939
|
email: external_exports.string(),
|
|
23372
23940
|
profilePictureUrl: external_exports.string().nullable(),
|
|
23941
|
+
isStaff: external_exports.boolean(),
|
|
23373
23942
|
createdAt: external_exports.date(),
|
|
23374
23943
|
updatedAt: external_exports.date()
|
|
23375
23944
|
});
|
|
23376
23945
|
var ListUsersResponseSchema = external_exports.array(UserResponseSchema);
|
|
23377
23946
|
|
|
23378
23947
|
// ../../packages/api-contracts/src/contracts/v1/user.ts
|
|
23379
|
-
var
|
|
23380
|
-
var userContract =
|
|
23948
|
+
var c13 = initContract();
|
|
23949
|
+
var userContract = c13.router({
|
|
23381
23950
|
listUsers: {
|
|
23382
23951
|
method: "GET",
|
|
23383
23952
|
path: "/organizations/:organizationId/users",
|
|
@@ -23449,8 +24018,8 @@ var VantaIntegrationResponseSchema = external_exports.object({
|
|
|
23449
24018
|
});
|
|
23450
24019
|
|
|
23451
24020
|
// ../../packages/api-contracts/src/contracts/v1/vanta-integration.ts
|
|
23452
|
-
var
|
|
23453
|
-
var vantaIntegrationContract =
|
|
24021
|
+
var c14 = initContract();
|
|
24022
|
+
var vantaIntegrationContract = c14.router({
|
|
23454
24023
|
createVantaIntegration: {
|
|
23455
24024
|
method: "POST",
|
|
23456
24025
|
path: "/organizations/:organizationId/vanta-integration",
|
|
@@ -23510,7 +24079,8 @@ var VulnerabilityStatusValues = [
|
|
|
23510
24079
|
"IN_PROGRESS",
|
|
23511
24080
|
"FIXED",
|
|
23512
24081
|
"IGNORED",
|
|
23513
|
-
"FALSE_POSITIVE"
|
|
24082
|
+
"FALSE_POSITIVE",
|
|
24083
|
+
"DISMISSED"
|
|
23514
24084
|
];
|
|
23515
24085
|
var VulnerabilityStatus = external_exports.enum(VulnerabilityStatusValues);
|
|
23516
24086
|
var VulnerabilitySeverityValues = ["LOW", "MEDIUM", "HIGH", "CRITICAL"];
|
|
@@ -23523,6 +24093,8 @@ var VulnerabilityTypeValues = [
|
|
|
23523
24093
|
"MISCONFIGURATION"
|
|
23524
24094
|
];
|
|
23525
24095
|
var VulnerabilityType = external_exports.enum(VulnerabilityTypeValues);
|
|
24096
|
+
var DismissReasonValues = ["ACCEPTED_RISK", "FALSE_POSITIVE", "OTHER"];
|
|
24097
|
+
var DismissReason = external_exports.enum(DismissReasonValues);
|
|
23526
24098
|
var ScanModeValues2 = ["SAST", "DAST", "SCA", "SECRETS"];
|
|
23527
24099
|
var ScanMode2 = external_exports.enum(ScanModeValues2);
|
|
23528
24100
|
|
|
@@ -23551,7 +24123,12 @@ var VulnerabilityLatestFindingSchema = external_exports.object({
|
|
|
23551
24123
|
attackVector: external_exports.string(),
|
|
23552
24124
|
exploitScenario: external_exports.string(),
|
|
23553
24125
|
impact: external_exports.string(),
|
|
23554
|
-
confidence: external_exports.number()
|
|
24126
|
+
confidence: external_exports.number(),
|
|
24127
|
+
// Threat model fields (null for findings from scans before this feature)
|
|
24128
|
+
classification: external_exports.enum(["vulnerability", "defense_in_depth", "context_dependent"]).nullable(),
|
|
24129
|
+
prerequisiteAccess: external_exports.string().nullable(),
|
|
24130
|
+
capabilityGain: external_exports.string().nullable(),
|
|
24131
|
+
technicalSeverity: VulnerabilitySeverity.nullable()
|
|
23555
24132
|
});
|
|
23556
24133
|
var DependencyGraphSchema = external_exports.object({
|
|
23557
24134
|
vulnerablePackage: external_exports.string(),
|
|
@@ -23575,6 +24152,7 @@ var VulnerabilityResponseSchema = external_exports.object({
|
|
|
23575
24152
|
scanMode: ScanMode2.nullable(),
|
|
23576
24153
|
status: VulnerabilityStatus,
|
|
23577
24154
|
statusReason: external_exports.string().nullable(),
|
|
24155
|
+
dismissReason: DismissReason.nullable(),
|
|
23578
24156
|
cweId: external_exports.string().nullable(),
|
|
23579
24157
|
source: VulnerabilitySourceSchema,
|
|
23580
24158
|
introducedBy: VulnerabilityIntroducedBySchema,
|
|
@@ -23661,12 +24239,13 @@ var VulnerabilityAggregatedCountsResponseSchema = external_exports.object({
|
|
|
23661
24239
|
});
|
|
23662
24240
|
var UpdateVulnerabilityRequestSchema = external_exports.object({
|
|
23663
24241
|
status: VulnerabilityStatus.optional(),
|
|
23664
|
-
statusReason: external_exports.string().optional()
|
|
24242
|
+
statusReason: external_exports.string().optional(),
|
|
24243
|
+
dismissReason: DismissReason.optional()
|
|
23665
24244
|
});
|
|
23666
24245
|
|
|
23667
24246
|
// ../../packages/api-contracts/src/contracts/v1/vulnerability.ts
|
|
23668
|
-
var
|
|
23669
|
-
var vulnerabilityContract =
|
|
24247
|
+
var c15 = initContract();
|
|
24248
|
+
var vulnerabilityContract = c15.router({
|
|
23670
24249
|
filterVulnerabilities: {
|
|
23671
24250
|
method: "POST",
|
|
23672
24251
|
path: "/organizations/:organizationId/vulnerabilities/filter",
|
|
@@ -23775,7 +24354,90 @@ var vulnerabilityContract = c13.router({
|
|
|
23775
24354
|
path: "/organizations/:organizationId/vulnerabilities/:vulnerabilityId/retests",
|
|
23776
24355
|
pathParams: VulnerabilityIdParamsSchema,
|
|
23777
24356
|
responses: {
|
|
23778
|
-
200:
|
|
24357
|
+
200: ScanArrayResponseSchema,
|
|
24358
|
+
401: ErrorResponseSchema,
|
|
24359
|
+
403: ErrorResponseSchema,
|
|
24360
|
+
404: ErrorResponseSchema,
|
|
24361
|
+
500: ErrorResponseSchema
|
|
24362
|
+
}
|
|
24363
|
+
}
|
|
24364
|
+
});
|
|
24365
|
+
|
|
24366
|
+
// ../../packages/api-contracts/src/schemas/api/v1/vulnerability-note.api.ts
|
|
24367
|
+
var VulnerabilityNoteParamsSchema = OrgIdParamsSchema.extend({
|
|
24368
|
+
vulnerabilityId: external_exports.uuid()
|
|
24369
|
+
});
|
|
24370
|
+
var VulnerabilityNoteIdParamsSchema = VulnerabilityNoteParamsSchema.extend({
|
|
24371
|
+
noteId: external_exports.uuid()
|
|
24372
|
+
});
|
|
24373
|
+
var VulnerabilityNoteResponseSchema = external_exports.object({
|
|
24374
|
+
noteId: external_exports.uuid(),
|
|
24375
|
+
vulnerabilityId: external_exports.uuid(),
|
|
24376
|
+
organizationId: external_exports.uuid(),
|
|
24377
|
+
authorId: external_exports.uuid(),
|
|
24378
|
+
authorName: external_exports.string(),
|
|
24379
|
+
authorProfilePictureUrl: external_exports.string().nullable(),
|
|
24380
|
+
content: external_exports.string(),
|
|
24381
|
+
createdAt: external_exports.coerce.date(),
|
|
24382
|
+
updatedAt: external_exports.coerce.date()
|
|
24383
|
+
});
|
|
24384
|
+
var ListVulnerabilityNotesResponseSchema = external_exports.array(VulnerabilityNoteResponseSchema);
|
|
24385
|
+
var CreateVulnerabilityNoteRequestSchema = external_exports.object({
|
|
24386
|
+
content: external_exports.string().min(1).max(1e4)
|
|
24387
|
+
});
|
|
24388
|
+
var UpdateVulnerabilityNoteRequestSchema = external_exports.object({
|
|
24389
|
+
content: external_exports.string().min(1).max(1e4)
|
|
24390
|
+
});
|
|
24391
|
+
|
|
24392
|
+
// ../../packages/api-contracts/src/contracts/v1/vulnerability-note.ts
|
|
24393
|
+
var c16 = initContract();
|
|
24394
|
+
var vulnerabilityNoteContract = c16.router({
|
|
24395
|
+
listNotes: {
|
|
24396
|
+
method: "GET",
|
|
24397
|
+
path: "/organizations/:organizationId/vulnerabilities/:vulnerabilityId/notes",
|
|
24398
|
+
pathParams: VulnerabilityNoteParamsSchema,
|
|
24399
|
+
responses: {
|
|
24400
|
+
200: ListVulnerabilityNotesResponseSchema,
|
|
24401
|
+
401: ErrorResponseSchema,
|
|
24402
|
+
403: ErrorResponseSchema,
|
|
24403
|
+
404: ErrorResponseSchema,
|
|
24404
|
+
500: ErrorResponseSchema
|
|
24405
|
+
}
|
|
24406
|
+
},
|
|
24407
|
+
createNote: {
|
|
24408
|
+
method: "POST",
|
|
24409
|
+
path: "/organizations/:organizationId/vulnerabilities/:vulnerabilityId/notes",
|
|
24410
|
+
pathParams: VulnerabilityNoteParamsSchema,
|
|
24411
|
+
body: CreateVulnerabilityNoteRequestSchema,
|
|
24412
|
+
responses: {
|
|
24413
|
+
201: VulnerabilityNoteResponseSchema,
|
|
24414
|
+
400: ErrorResponseSchema,
|
|
24415
|
+
401: ErrorResponseSchema,
|
|
24416
|
+
403: ErrorResponseSchema,
|
|
24417
|
+
404: ErrorResponseSchema,
|
|
24418
|
+
500: ErrorResponseSchema
|
|
24419
|
+
}
|
|
24420
|
+
},
|
|
24421
|
+
updateNote: {
|
|
24422
|
+
method: "PATCH",
|
|
24423
|
+
path: "/organizations/:organizationId/vulnerabilities/:vulnerabilityId/notes/:noteId",
|
|
24424
|
+
pathParams: VulnerabilityNoteIdParamsSchema,
|
|
24425
|
+
body: UpdateVulnerabilityNoteRequestSchema,
|
|
24426
|
+
responses: {
|
|
24427
|
+
200: VulnerabilityNoteResponseSchema,
|
|
24428
|
+
400: ErrorResponseSchema,
|
|
24429
|
+
401: ErrorResponseSchema,
|
|
24430
|
+
403: ErrorResponseSchema,
|
|
24431
|
+
404: ErrorResponseSchema,
|
|
24432
|
+
500: ErrorResponseSchema
|
|
24433
|
+
}
|
|
24434
|
+
},
|
|
24435
|
+
deleteNote: {
|
|
24436
|
+
method: "DELETE",
|
|
24437
|
+
path: "/organizations/:organizationId/vulnerabilities/:vulnerabilityId/notes/:noteId",
|
|
24438
|
+
pathParams: VulnerabilityNoteIdParamsSchema,
|
|
24439
|
+
responses: {
|
|
24440
|
+
204: DeleteResponseSchema,
|
|
23779
24441
|
401: ErrorResponseSchema,
|
|
23780
24442
|
403: ErrorResponseSchema,
|
|
23781
24443
|
404: ErrorResponseSchema,
|
|
@@ -23801,8 +24463,8 @@ var WebApplicationResponseSchema = external_exports.object({
|
|
|
23801
24463
|
var ListWebApplicationsResponseSchema = external_exports.array(WebApplicationResponseSchema);
|
|
23802
24464
|
|
|
23803
24465
|
// ../../packages/api-contracts/src/contracts/v1/web-application.ts
|
|
23804
|
-
var
|
|
23805
|
-
var webApplicationContract =
|
|
24466
|
+
var c17 = initContract();
|
|
24467
|
+
var webApplicationContract = c17.router({
|
|
23806
24468
|
listWebApplications: {
|
|
23807
24469
|
method: "GET",
|
|
23808
24470
|
path: "/organizations/:organizationId/web-applications",
|
|
@@ -23941,8 +24603,8 @@ var ListWebhookDeliveriesResponseSchema = external_exports.object({
|
|
|
23941
24603
|
});
|
|
23942
24604
|
|
|
23943
24605
|
// ../../packages/api-contracts/src/contracts/v1/webhook-settings.ts
|
|
23944
|
-
var
|
|
23945
|
-
var webhookSettingsContract =
|
|
24606
|
+
var c18 = initContract();
|
|
24607
|
+
var webhookSettingsContract = c18.router({
|
|
23946
24608
|
listWebhookEndpoints: {
|
|
23947
24609
|
method: "GET",
|
|
23948
24610
|
path: "/organizations/:organizationId/webhook-settings/endpoints",
|
|
@@ -24080,8 +24742,8 @@ var webhookSettingsContract = c15.router({
|
|
|
24080
24742
|
});
|
|
24081
24743
|
|
|
24082
24744
|
// ../../packages/api-contracts/src/contracts/v1/index.ts
|
|
24083
|
-
var
|
|
24084
|
-
var v1Contract =
|
|
24745
|
+
var c19 = initContract();
|
|
24746
|
+
var v1Contract = c19.router(
|
|
24085
24747
|
{
|
|
24086
24748
|
admin: adminContract,
|
|
24087
24749
|
scan: scanContract,
|
|
@@ -24095,9 +24757,12 @@ var v1Contract = c16.router(
|
|
|
24095
24757
|
knowledgeBase: knowledgeBaseContract,
|
|
24096
24758
|
knowledgeDocument: knowledgeDocumentContract,
|
|
24097
24759
|
vulnerability: vulnerabilityContract,
|
|
24760
|
+
vulnerabilityNote: vulnerabilityNoteContract,
|
|
24098
24761
|
webhookSettings: webhookSettingsContract,
|
|
24099
24762
|
webApplication: webApplicationContract,
|
|
24100
|
-
chatSession: chatSessionContract
|
|
24763
|
+
chatSession: chatSessionContract,
|
|
24764
|
+
pentest: pentestContract,
|
|
24765
|
+
pentestFinding: pentestFindingContract
|
|
24101
24766
|
},
|
|
24102
24767
|
{
|
|
24103
24768
|
pathPrefix: "/v1"
|
|
@@ -24105,8 +24770,8 @@ var v1Contract = c16.router(
|
|
|
24105
24770
|
);
|
|
24106
24771
|
|
|
24107
24772
|
// ../../packages/api-contracts/src/contracts/index.ts
|
|
24108
|
-
var
|
|
24109
|
-
var contract =
|
|
24773
|
+
var c20 = initContract();
|
|
24774
|
+
var contract = c20.router({
|
|
24110
24775
|
v1: v1Contract
|
|
24111
24776
|
});
|
|
24112
24777
|
|
|
@@ -24116,8 +24781,8 @@ var GitHubWebhookResponseSchema = external_exports.object({
|
|
|
24116
24781
|
});
|
|
24117
24782
|
|
|
24118
24783
|
// ../../packages/api-contracts/src/contracts/webhooks/github.ts
|
|
24119
|
-
var
|
|
24120
|
-
var githubWebhookContract =
|
|
24784
|
+
var c21 = initContract();
|
|
24785
|
+
var githubWebhookContract = c21.router(
|
|
24121
24786
|
{
|
|
24122
24787
|
handleWebhook: {
|
|
24123
24788
|
method: "POST",
|
|
@@ -24142,8 +24807,8 @@ var HealthResponseSchema = external_exports.object({
|
|
|
24142
24807
|
});
|
|
24143
24808
|
|
|
24144
24809
|
// ../../packages/api-contracts/src/contracts/health.ts
|
|
24145
|
-
var
|
|
24146
|
-
var healthContract =
|
|
24810
|
+
var c22 = initContract();
|
|
24811
|
+
var healthContract = c22.router({
|
|
24147
24812
|
getHealth: {
|
|
24148
24813
|
method: "GET",
|
|
24149
24814
|
path: "/health",
|
|
@@ -24187,12 +24852,13 @@ var ListPrVulnerabilitiesResponseSchema = external_exports.object({
|
|
|
24187
24852
|
});
|
|
24188
24853
|
var UpdatePrVulnerabilityRequestSchema = external_exports.object({
|
|
24189
24854
|
status: VulnerabilityStatus,
|
|
24190
|
-
statusReason: external_exports.string().optional()
|
|
24855
|
+
statusReason: external_exports.string().optional(),
|
|
24856
|
+
dismissReason: DismissReason.optional()
|
|
24191
24857
|
});
|
|
24192
24858
|
|
|
24193
24859
|
// ../../packages/api-contracts/src/contracts/v1/pr-vulnerability.ts
|
|
24194
|
-
var
|
|
24195
|
-
var prVulnerabilityContract =
|
|
24860
|
+
var c23 = initContract();
|
|
24861
|
+
var prVulnerabilityContract = c23.router(
|
|
24196
24862
|
{
|
|
24197
24863
|
listPrVulnerabilities: {
|
|
24198
24864
|
method: "GET",
|
|
@@ -24378,7 +25044,180 @@ async function resolveOrganizationIdSafe(client) {
|
|
|
24378
25044
|
}
|
|
24379
25045
|
}
|
|
24380
25046
|
|
|
25047
|
+
// src/format.ts
|
|
25048
|
+
var SEVERITY_ORDER = {
|
|
25049
|
+
CRITICAL: 0,
|
|
25050
|
+
HIGH: 1,
|
|
25051
|
+
MEDIUM: 2,
|
|
25052
|
+
LOW: 3,
|
|
25053
|
+
INFORMATIONAL: 4
|
|
25054
|
+
};
|
|
25055
|
+
function formatStatus(status) {
|
|
25056
|
+
return status.toLowerCase().replace("_", " ");
|
|
25057
|
+
}
|
|
25058
|
+
|
|
25059
|
+
// src/pentest/commands.ts
|
|
25060
|
+
function formatDate(date5) {
|
|
25061
|
+
if (!date5) {
|
|
25062
|
+
return "\u2014";
|
|
25063
|
+
}
|
|
25064
|
+
const d = typeof date5 === "string" ? new Date(date5) : date5;
|
|
25065
|
+
return d.toLocaleDateString("en-US", { year: "numeric", month: "short", day: "numeric" });
|
|
25066
|
+
}
|
|
25067
|
+
function formatFindingSeverity(severity) {
|
|
25068
|
+
switch (severity) {
|
|
25069
|
+
case "CRITICAL":
|
|
25070
|
+
return "CRIT";
|
|
25071
|
+
case "HIGH":
|
|
25072
|
+
return "HIGH";
|
|
25073
|
+
case "MEDIUM":
|
|
25074
|
+
return "MED";
|
|
25075
|
+
case "LOW":
|
|
25076
|
+
return "LOW";
|
|
25077
|
+
case "INFORMATIONAL":
|
|
25078
|
+
return "INFO";
|
|
25079
|
+
default:
|
|
25080
|
+
return severity;
|
|
25081
|
+
}
|
|
25082
|
+
}
|
|
25083
|
+
var UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
25084
|
+
async function resolvePentestId(organizationId, identifier) {
|
|
25085
|
+
if (UUID_PATTERN.test(identifier)) {
|
|
25086
|
+
return identifier;
|
|
25087
|
+
}
|
|
25088
|
+
const numericMatch = identifier.match(/^(?:PT-)?(\d+)$/i);
|
|
25089
|
+
if (!numericMatch?.[1]) {
|
|
25090
|
+
console.error(
|
|
25091
|
+
`Invalid pentest identifier '${identifier}'. Use a display ID (e.g. PT-3) or UUID.`
|
|
25092
|
+
);
|
|
25093
|
+
process.exit(1);
|
|
25094
|
+
}
|
|
25095
|
+
const displayId = Number.parseInt(numericMatch[1], 10);
|
|
25096
|
+
const result = await authenticatedRequest(
|
|
25097
|
+
(client) => client.pentest.listPentests({
|
|
25098
|
+
params: { organizationId }
|
|
25099
|
+
})
|
|
25100
|
+
);
|
|
25101
|
+
if (result.status !== 200) {
|
|
25102
|
+
console.error(`Failed to list pentests (status ${result.status}).`);
|
|
25103
|
+
process.exit(1);
|
|
25104
|
+
}
|
|
25105
|
+
const pentest = result.body.find((p) => p.displayId === displayId);
|
|
25106
|
+
if (!pentest) {
|
|
25107
|
+
console.error(
|
|
25108
|
+
`Pentest with display ID ${displayId} not found.
|
|
25109
|
+
Run \`tracecli pentest list\` to see available pentests.`
|
|
25110
|
+
);
|
|
25111
|
+
process.exit(1);
|
|
25112
|
+
}
|
|
25113
|
+
return pentest.pentestId;
|
|
25114
|
+
}
|
|
25115
|
+
function createListCommand() {
|
|
25116
|
+
return new Command("list").description("List pentests for your organization").option("--json", "Output as JSON").action(async (options) => {
|
|
25117
|
+
const organizationId = await resolveOrganizationId();
|
|
25118
|
+
const result = await authenticatedRequest(
|
|
25119
|
+
(client) => client.pentest.listPentests({
|
|
25120
|
+
params: { organizationId }
|
|
25121
|
+
})
|
|
25122
|
+
);
|
|
25123
|
+
if (result.status !== 200) {
|
|
25124
|
+
console.error(`Failed to list pentests (status ${result.status}).`);
|
|
25125
|
+
process.exit(1);
|
|
25126
|
+
}
|
|
25127
|
+
const pentests = result.body;
|
|
25128
|
+
if (pentests.length === 0) {
|
|
25129
|
+
if (options.json) {
|
|
25130
|
+
console.log("[]");
|
|
25131
|
+
} else {
|
|
25132
|
+
console.log("No pentests found.");
|
|
25133
|
+
}
|
|
25134
|
+
return;
|
|
25135
|
+
}
|
|
25136
|
+
if (options.json) {
|
|
25137
|
+
console.log(JSON.stringify(pentests, null, 2));
|
|
25138
|
+
return;
|
|
25139
|
+
}
|
|
25140
|
+
console.log(`Found ${pentests.length} pentest${pentests.length === 1 ? "" : "s"}:
|
|
25141
|
+
`);
|
|
25142
|
+
for (const pt of pentests) {
|
|
25143
|
+
const status = formatStatus(pt.status);
|
|
25144
|
+
const started = formatDate(pt.startedAt);
|
|
25145
|
+
const ended = formatDate(pt.endedAt);
|
|
25146
|
+
const dateRange = pt.startedAt ? `${started} \u2013 ${ended}` : "Not started";
|
|
25147
|
+
const findings = pt.findingCounts.total;
|
|
25148
|
+
console.log(` [PT-${pt.displayId}] ${pt.title}`);
|
|
25149
|
+
console.log(` Status: ${status} | Findings: ${findings} | ${dateRange}`);
|
|
25150
|
+
if (pt.description) {
|
|
25151
|
+
console.log(` ${pt.description}`);
|
|
25152
|
+
}
|
|
25153
|
+
console.log("");
|
|
25154
|
+
}
|
|
25155
|
+
});
|
|
25156
|
+
}
|
|
25157
|
+
function createFindingsListCommand() {
|
|
25158
|
+
return new Command("list").description("List findings for a pentest").requiredOption("--pentest <id>", "Pentest display ID (e.g. PT-3) or UUID").option("--json", "Output as JSON").action(async (options) => {
|
|
25159
|
+
const organizationId = await resolveOrganizationId();
|
|
25160
|
+
const pentestId = await resolvePentestId(organizationId, options.pentest);
|
|
25161
|
+
const result = await authenticatedRequest(
|
|
25162
|
+
(client) => client.pentestFinding.listFindings({
|
|
25163
|
+
params: { organizationId, pentestId }
|
|
25164
|
+
})
|
|
25165
|
+
);
|
|
25166
|
+
if (result.status !== 200) {
|
|
25167
|
+
console.error(`Failed to list findings (status ${result.status}).`);
|
|
25168
|
+
process.exit(1);
|
|
25169
|
+
}
|
|
25170
|
+
const findings = result.body;
|
|
25171
|
+
if (findings.length === 0) {
|
|
25172
|
+
if (options.json) {
|
|
25173
|
+
console.log("[]");
|
|
25174
|
+
} else {
|
|
25175
|
+
console.log("No findings found for this pentest.");
|
|
25176
|
+
}
|
|
25177
|
+
return;
|
|
25178
|
+
}
|
|
25179
|
+
if (options.json) {
|
|
25180
|
+
console.log(JSON.stringify(findings, null, 2));
|
|
25181
|
+
return;
|
|
25182
|
+
}
|
|
25183
|
+
console.log(`Found ${findings.length} finding${findings.length === 1 ? "" : "s"}:
|
|
25184
|
+
`);
|
|
25185
|
+
const sorted = [...findings].sort(
|
|
25186
|
+
(a, b) => (SEVERITY_ORDER[a.severity] ?? 99) - (SEVERITY_ORDER[b.severity] ?? 99)
|
|
25187
|
+
);
|
|
25188
|
+
for (const finding of sorted) {
|
|
25189
|
+
const sev = formatFindingSeverity(finding.severity);
|
|
25190
|
+
const status = formatStatus(finding.status);
|
|
25191
|
+
const cwes = finding.cweIds.length > 0 ? ` | ${finding.cweIds.join(", ")}` : "";
|
|
25192
|
+
const score = finding.cvssScore != null ? ` | CVSS ${finding.cvssScore.toFixed(1)}` : "";
|
|
25193
|
+
console.log(` [${sev}] ${finding.title}`);
|
|
25194
|
+
console.log(` ${finding.category} \xB7 ${status}${cwes}${score}`);
|
|
25195
|
+
if (finding.repositories.length > 0) {
|
|
25196
|
+
for (const repo of finding.repositories) {
|
|
25197
|
+
const location = repo.filePath ? `${repo.repositoryName} \xB7 ${repo.filePath}${repo.startLine != null ? `:${repo.startLine}` : ""}` : repo.repositoryName;
|
|
25198
|
+
console.log(` ${location}`);
|
|
25199
|
+
}
|
|
25200
|
+
}
|
|
25201
|
+
console.log("");
|
|
25202
|
+
}
|
|
25203
|
+
});
|
|
25204
|
+
}
|
|
25205
|
+
function createFindingsCommand() {
|
|
25206
|
+
const findings = new Command("findings").description("Manage pentest findings");
|
|
25207
|
+
findings.addCommand(createFindingsListCommand());
|
|
25208
|
+
return findings;
|
|
25209
|
+
}
|
|
25210
|
+
function createPentestCommand() {
|
|
25211
|
+
const pentest = new Command("pentest").description("Manage pentests");
|
|
25212
|
+
pentest.addCommand(createListCommand());
|
|
25213
|
+
pentest.addCommand(createFindingsCommand());
|
|
25214
|
+
return pentest;
|
|
25215
|
+
}
|
|
25216
|
+
|
|
24381
25217
|
// src/repo/commands.ts
|
|
25218
|
+
import { chmodSync, mkdtempSync, rmSync as rmSync2, writeFileSync as writeFileSync3 } from "fs";
|
|
25219
|
+
import { tmpdir } from "os";
|
|
25220
|
+
import { join as join3 } from "path";
|
|
24382
25221
|
function stripAnsi(str) {
|
|
24383
25222
|
const ESC2 = String.fromCharCode(27);
|
|
24384
25223
|
const CSI = String.fromCharCode(155);
|
|
@@ -24432,7 +25271,7 @@ function validateBranchName(branch) {
|
|
|
24432
25271
|
}
|
|
24433
25272
|
return branch;
|
|
24434
25273
|
}
|
|
24435
|
-
function
|
|
25274
|
+
function createListCommand2() {
|
|
24436
25275
|
return new Command("list").description("List repositories in your organization").action(async () => {
|
|
24437
25276
|
const organizationId = await resolveOrganizationId();
|
|
24438
25277
|
const result = await authenticatedRequest(
|
|
@@ -24558,19 +25397,13 @@ function createCloneCommand() {
|
|
|
24558
25397
|
}
|
|
24559
25398
|
function createRepoCommand() {
|
|
24560
25399
|
const repo = new Command("repo").description("Manage repositories");
|
|
24561
|
-
repo.addCommand(
|
|
25400
|
+
repo.addCommand(createListCommand2());
|
|
24562
25401
|
repo.addCommand(createCloneCommand());
|
|
24563
25402
|
return repo;
|
|
24564
25403
|
}
|
|
24565
25404
|
|
|
24566
25405
|
// src/vulnerabilities/commands.ts
|
|
24567
25406
|
import { createInterface } from "readline";
|
|
24568
|
-
var SEVERITY_ORDER = {
|
|
24569
|
-
CRITICAL: 0,
|
|
24570
|
-
HIGH: 1,
|
|
24571
|
-
MEDIUM: 2,
|
|
24572
|
-
LOW: 3
|
|
24573
|
-
};
|
|
24574
25407
|
var DEFAULT_PAGE_SIZE = 25;
|
|
24575
25408
|
async function resolveRepositoryIdAuthenticated(organizationId, repoIdentifier) {
|
|
24576
25409
|
const result = await authenticatedRequest(
|
|
@@ -24641,7 +25474,7 @@ function printVulnerabilities(vulnerabilities) {
|
|
|
24641
25474
|
);
|
|
24642
25475
|
for (const vuln of sorted) {
|
|
24643
25476
|
const sev = formatSeverity(vuln.severity);
|
|
24644
|
-
const status = vuln.status
|
|
25477
|
+
const status = formatStatus(vuln.status);
|
|
24645
25478
|
const repo = vuln.repositoryName;
|
|
24646
25479
|
const file2 = vuln.codeSnippet.filePath;
|
|
24647
25480
|
const line = vuln.codeSnippet.startLine;
|
|
@@ -24661,7 +25494,7 @@ async function promptContinue(displayed, total) {
|
|
|
24661
25494
|
});
|
|
24662
25495
|
});
|
|
24663
25496
|
}
|
|
24664
|
-
function
|
|
25497
|
+
function createListCommand3() {
|
|
24665
25498
|
return new Command("list").description("List vulnerabilities for your organization").option("--repo <repo>", "Filter by repository name or owner/repo").option(
|
|
24666
25499
|
"--severity <severity>",
|
|
24667
25500
|
"Filter by severity (CRITICAL, HIGH, MEDIUM, LOW)",
|
|
@@ -24753,7 +25586,7 @@ function createListCommand2() {
|
|
|
24753
25586
|
}
|
|
24754
25587
|
function createVulnerabilitiesCommand() {
|
|
24755
25588
|
const vulnerabilities = new Command("vulnerabilities").description("Manage vulnerabilities");
|
|
24756
|
-
vulnerabilities.addCommand(
|
|
25589
|
+
vulnerabilities.addCommand(createListCommand3());
|
|
24757
25590
|
return vulnerabilities;
|
|
24758
25591
|
}
|
|
24759
25592
|
|
|
@@ -24767,5 +25600,6 @@ program2.action(() => {
|
|
|
24767
25600
|
program2.addCommand(createAuthCommand());
|
|
24768
25601
|
program2.addCommand(createRepoCommand());
|
|
24769
25602
|
program2.addCommand(createVulnerabilitiesCommand());
|
|
25603
|
+
program2.addCommand(createPentestCommand());
|
|
24770
25604
|
program2.addCommand(createCompletionCommand(program2));
|
|
24771
25605
|
program2.parse();
|