mobbdev 1.0.61 → 1.0.64
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/dist/index.mjs +97 -78
- package/package.json +5 -1
package/dist/index.mjs
CHANGED
|
@@ -7,6 +7,7 @@ var __export = (target, all) => {
|
|
|
7
7
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
8
8
|
|
|
9
9
|
// src/index.ts
|
|
10
|
+
import Debug19 from "debug";
|
|
10
11
|
import { hideBin } from "yargs/helpers";
|
|
11
12
|
|
|
12
13
|
// src/types.ts
|
|
@@ -53,6 +54,7 @@ var Language = /* @__PURE__ */ ((Language2) => {
|
|
|
53
54
|
Language2["Python"] = "PYTHON";
|
|
54
55
|
Language2["Sql"] = "SQL";
|
|
55
56
|
Language2["Xml"] = "XML";
|
|
57
|
+
Language2["Yaml"] = "YAML";
|
|
56
58
|
return Language2;
|
|
57
59
|
})(Language || {});
|
|
58
60
|
var ManifestAction = /* @__PURE__ */ ((ManifestAction2) => {
|
|
@@ -104,6 +106,7 @@ var IssueLanguage_Enum = /* @__PURE__ */ ((IssueLanguage_Enum2) => {
|
|
|
104
106
|
IssueLanguage_Enum2["Python"] = "Python";
|
|
105
107
|
IssueLanguage_Enum2["Sql"] = "SQL";
|
|
106
108
|
IssueLanguage_Enum2["Xml"] = "XML";
|
|
109
|
+
IssueLanguage_Enum2["Yaml"] = "YAML";
|
|
107
110
|
return IssueLanguage_Enum2;
|
|
108
111
|
})(IssueLanguage_Enum || {});
|
|
109
112
|
var IssueType_Enum = /* @__PURE__ */ ((IssueType_Enum2) => {
|
|
@@ -124,6 +127,7 @@ var IssueType_Enum = /* @__PURE__ */ ((IssueType_Enum2) => {
|
|
|
124
127
|
IssueType_Enum2["ErroneousStringCompare"] = "ERRONEOUS_STRING_COMPARE";
|
|
125
128
|
IssueType_Enum2["ErrorCondtionWithoutAction"] = "ERROR_CONDTION_WITHOUT_ACTION";
|
|
126
129
|
IssueType_Enum2["FrameableLoginPage"] = "FRAMEABLE_LOGIN_PAGE";
|
|
130
|
+
IssueType_Enum2["GhActionsShellInjection"] = "GH_ACTIONS_SHELL_INJECTION";
|
|
127
131
|
IssueType_Enum2["GraphqlDepthLimit"] = "GRAPHQL_DEPTH_LIMIT";
|
|
128
132
|
IssueType_Enum2["HardcodedDomainInHtml"] = "HARDCODED_DOMAIN_IN_HTML";
|
|
129
133
|
IssueType_Enum2["HardcodedSecrets"] = "HARDCODED_SECRETS";
|
|
@@ -232,6 +236,7 @@ var Vulnerability_Report_Vendor_Enum = /* @__PURE__ */ ((Vulnerability_Report_Ve
|
|
|
232
236
|
Vulnerability_Report_Vendor_Enum3["Checkmarx"] = "checkmarx";
|
|
233
237
|
Vulnerability_Report_Vendor_Enum3["CheckmarxXml"] = "checkmarxXml";
|
|
234
238
|
Vulnerability_Report_Vendor_Enum3["Codeql"] = "codeql";
|
|
239
|
+
Vulnerability_Report_Vendor_Enum3["Datadog"] = "datadog";
|
|
235
240
|
Vulnerability_Report_Vendor_Enum3["Fortify"] = "fortify";
|
|
236
241
|
Vulnerability_Report_Vendor_Enum3["Opengrep"] = "opengrep";
|
|
237
242
|
Vulnerability_Report_Vendor_Enum3["Semgrep"] = "semgrep";
|
|
@@ -1138,7 +1143,8 @@ var issueTypeMap = {
|
|
|
1138
1143
|
["MISSING_SSL_MINVERSION" /* MissingSslMinversion */]: "Missing SSL MinVersion",
|
|
1139
1144
|
["WEBSOCKET_MISSING_ORIGIN_CHECK" /* WebsocketMissingOriginCheck */]: "Missing Websocket Origin Check",
|
|
1140
1145
|
["DUPLICATED_STRINGS" /* DuplicatedStrings */]: "String Literals Should not Be Duplicated",
|
|
1141
|
-
["INSECURE_UUID_VERSION" /* InsecureUuidVersion */]: "Insecure UUID Version"
|
|
1146
|
+
["INSECURE_UUID_VERSION" /* InsecureUuidVersion */]: "Insecure UUID Version",
|
|
1147
|
+
["GH_ACTIONS_SHELL_INJECTION" /* GhActionsShellInjection */]: "GitHub Actions Shell Injection"
|
|
1142
1148
|
};
|
|
1143
1149
|
var issueTypeZ = z5.nativeEnum(IssueType_Enum);
|
|
1144
1150
|
var getIssueTypeFriendlyString = (issueType) => {
|
|
@@ -1590,7 +1596,8 @@ var SCANNERS = {
|
|
|
1590
1596
|
Fortify: "fortify",
|
|
1591
1597
|
Snyk: "snyk",
|
|
1592
1598
|
Sonarqube: "sonarqube",
|
|
1593
|
-
Semgrep: "semgrep"
|
|
1599
|
+
Semgrep: "semgrep",
|
|
1600
|
+
Datadog: "datadog"
|
|
1594
1601
|
};
|
|
1595
1602
|
var scannerToVulnerability_Report_Vendor_Enum = {
|
|
1596
1603
|
[SCANNERS.Checkmarx]: "checkmarx" /* Checkmarx */,
|
|
@@ -1598,14 +1605,17 @@ var scannerToVulnerability_Report_Vendor_Enum = {
|
|
|
1598
1605
|
[SCANNERS.Sonarqube]: "sonarqube" /* Sonarqube */,
|
|
1599
1606
|
[SCANNERS.Codeql]: "codeql" /* Codeql */,
|
|
1600
1607
|
[SCANNERS.Fortify]: "fortify" /* Fortify */,
|
|
1601
|
-
[SCANNERS.Semgrep]: "semgrep" /* Semgrep
|
|
1608
|
+
[SCANNERS.Semgrep]: "semgrep" /* Semgrep */,
|
|
1609
|
+
[SCANNERS.Datadog]: "datadog" /* Datadog */
|
|
1602
1610
|
};
|
|
1603
1611
|
var SupportedScannersZ = z8.enum([SCANNERS.Checkmarx, SCANNERS.Snyk]);
|
|
1604
1612
|
var envVariablesSchema = z8.object({
|
|
1605
1613
|
WEB_APP_URL: z8.string(),
|
|
1606
1614
|
API_URL: z8.string(),
|
|
1607
1615
|
HASURA_ACCESS_KEY: z8.string(),
|
|
1608
|
-
LOCAL_GRAPHQL_ENDPOINT: z8.string()
|
|
1616
|
+
LOCAL_GRAPHQL_ENDPOINT: z8.string(),
|
|
1617
|
+
HTTP_PROXY: z8.string().optional().default(""),
|
|
1618
|
+
HTTPS_PROXY: z8.string().optional().default("")
|
|
1609
1619
|
}).required();
|
|
1610
1620
|
var envVariables = envVariablesSchema.parse(process.env);
|
|
1611
1621
|
debug("config %o", envVariables);
|
|
@@ -1642,6 +1652,8 @@ var WEB_APP_URL = envVariables.WEB_APP_URL;
|
|
|
1642
1652
|
var API_URL = envVariables.API_URL;
|
|
1643
1653
|
var HASURA_ACCESS_KEY = envVariables.HASURA_ACCESS_KEY;
|
|
1644
1654
|
var LOCAL_GRAPHQL_ENDPOINT = envVariables.LOCAL_GRAPHQL_ENDPOINT;
|
|
1655
|
+
var HTTPS_PROXY = envVariables.HTTPS_PROXY;
|
|
1656
|
+
var HTTP_PROXY = envVariables.HTTP_PROXY;
|
|
1645
1657
|
var errorMessages = {
|
|
1646
1658
|
missingCxProjectName: `project name ${chalk.bold(
|
|
1647
1659
|
"(--cx-project-name)"
|
|
@@ -2078,7 +2090,8 @@ var fixDetailsData = {
|
|
|
2078
2090
|
["MISSING_SSL_MINVERSION" /* MissingSslMinversion */]: void 0,
|
|
2079
2091
|
["WEBSOCKET_MISSING_ORIGIN_CHECK" /* WebsocketMissingOriginCheck */]: void 0,
|
|
2080
2092
|
["DUPLICATED_STRINGS" /* DuplicatedStrings */]: void 0,
|
|
2081
|
-
["INSECURE_UUID_VERSION" /* InsecureUuidVersion */]: void 0
|
|
2093
|
+
["INSECURE_UUID_VERSION" /* InsecureUuidVersion */]: void 0,
|
|
2094
|
+
["GH_ACTIONS_SHELL_INJECTION" /* GhActionsShellInjection */]: void 0
|
|
2082
2095
|
};
|
|
2083
2096
|
|
|
2084
2097
|
// src/features/analysis/scm/shared/src/commitDescriptionMarkup.ts
|
|
@@ -5745,13 +5758,16 @@ async function getGitlabIsUserCollaborator({
|
|
|
5745
5758
|
try {
|
|
5746
5759
|
const { projectPath } = parseGitlabOwnerAndRepo(repoUrl);
|
|
5747
5760
|
const api2 = getGitBeaker({ url: repoUrl, gitlabAuthToken: accessToken });
|
|
5748
|
-
const
|
|
5749
|
-
const groupAccess =
|
|
5750
|
-
const projectAccess =
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
5761
|
+
const proj = await api2.Projects.show(projectPath);
|
|
5762
|
+
const groupAccess = proj.permissions?.group_access?.access_level || 0;
|
|
5763
|
+
const projectAccess = proj.permissions?.project_access?.access_level || 0;
|
|
5764
|
+
const accessLevelWithWriteAccess = [
|
|
5765
|
+
AccessLevel.DEVELOPER,
|
|
5766
|
+
AccessLevel.MAINTAINER,
|
|
5767
|
+
AccessLevel.OWNER,
|
|
5768
|
+
AccessLevel.ADMIN
|
|
5769
|
+
];
|
|
5770
|
+
return accessLevelWithWriteAccess.includes(groupAccess) || accessLevelWithWriteAccess.includes(projectAccess);
|
|
5755
5771
|
} catch (e) {
|
|
5756
5772
|
return false;
|
|
5757
5773
|
}
|
|
@@ -6108,16 +6124,7 @@ var GitlabSCMLib = class extends SCMLib {
|
|
|
6108
6124
|
}
|
|
6109
6125
|
async getUserHasAccessToRepo() {
|
|
6110
6126
|
this._validateAccessTokenAndUrl();
|
|
6111
|
-
let username = void 0;
|
|
6112
|
-
try {
|
|
6113
|
-
username = await this.getUsername();
|
|
6114
|
-
} catch (e) {
|
|
6115
|
-
console.warn(
|
|
6116
|
-
"could not get username. this is okay if a project token is used"
|
|
6117
|
-
);
|
|
6118
|
-
}
|
|
6119
6127
|
return getGitlabIsUserCollaborator({
|
|
6120
|
-
username,
|
|
6121
6128
|
accessToken: this.accessToken,
|
|
6122
6129
|
repoUrl: this.url
|
|
6123
6130
|
});
|
|
@@ -7124,7 +7131,8 @@ var scannerToFriendlyString = {
|
|
|
7124
7131
|
fortify: "Fortify",
|
|
7125
7132
|
snyk: "Snyk",
|
|
7126
7133
|
sonarqube: "Sonarqube",
|
|
7127
|
-
semgrep: "Semgrep"
|
|
7134
|
+
semgrep: "Semgrep",
|
|
7135
|
+
datadog: "Datadog"
|
|
7128
7136
|
};
|
|
7129
7137
|
|
|
7130
7138
|
// src/features/analysis/add_fix_comments_for_pr/utils/buildCommentBody.ts
|
|
@@ -7406,32 +7414,6 @@ Refresh the page in order to see the changes.`,
|
|
|
7406
7414
|
comment_id: commentId
|
|
7407
7415
|
});
|
|
7408
7416
|
}
|
|
7409
|
-
function buildAnalysisSummaryComment(params) {
|
|
7410
|
-
const { prVulenrabilities: fixesFromDiff, fixesById } = params;
|
|
7411
|
-
const { vulnerabilityReportIssueCodeNodes, fixablePrVuls } = fixesFromDiff;
|
|
7412
|
-
const title = `# ${MobbIconMarkdown} ${fixablePrVuls} ${fixablePrVuls === 1 ? "fix is" : "fixes are"} ready to be committed`;
|
|
7413
|
-
const summary = Object.entries(
|
|
7414
|
-
// count every issue type
|
|
7415
|
-
vulnerabilityReportIssueCodeNodes.reduce(
|
|
7416
|
-
(result, vulnerabilityReportIssueCodeNode) => {
|
|
7417
|
-
const { vulnerabilityReportIssue } = vulnerabilityReportIssueCodeNode;
|
|
7418
|
-
const fix = fixesById[vulnerabilityReportIssue.fixId];
|
|
7419
|
-
if (!fix) {
|
|
7420
|
-
throw new Error(`fix ${vulnerabilityReportIssue.fixId} not found`);
|
|
7421
|
-
}
|
|
7422
|
-
const issueType = getIssueTypeFriendlyString(fix.safeIssueType);
|
|
7423
|
-
const vulnerabilityReportIssueCount = (result[issueType] || 0) + 1;
|
|
7424
|
-
return {
|
|
7425
|
-
...result,
|
|
7426
|
-
[issueType]: vulnerabilityReportIssueCount
|
|
7427
|
-
};
|
|
7428
|
-
},
|
|
7429
|
-
{}
|
|
7430
|
-
)
|
|
7431
|
-
).map(([issueType, issueTypeCount]) => `**${issueType}** - ${issueTypeCount}`);
|
|
7432
|
-
return `${title}
|
|
7433
|
-
${summary.join("\n")}`;
|
|
7434
|
-
}
|
|
7435
7417
|
async function getRelevantVulenrabilitiesFromDiff(params) {
|
|
7436
7418
|
const { gqlClient, diff, vulnerabilityReportId } = params;
|
|
7437
7419
|
const parsedDiff = parseDiff(diff);
|
|
@@ -7460,20 +7442,6 @@ async function getFixesData(params) {
|
|
|
7460
7442
|
const { fixes } = await gqlClient.getFixes(fixesId);
|
|
7461
7443
|
return keyBy(fixes, "id");
|
|
7462
7444
|
}
|
|
7463
|
-
async function postAnalysisSummary(params) {
|
|
7464
|
-
const { prVulenrabilities, fixesById, pullRequest, scm } = params;
|
|
7465
|
-
if (Object.values(fixesById).length === 0) {
|
|
7466
|
-
return;
|
|
7467
|
-
}
|
|
7468
|
-
const analysisSummaryComment = buildAnalysisSummaryComment({
|
|
7469
|
-
fixesById,
|
|
7470
|
-
prVulenrabilities
|
|
7471
|
-
});
|
|
7472
|
-
await scm.postGeneralPrComment({
|
|
7473
|
-
body: analysisSummaryComment,
|
|
7474
|
-
prNumber: pullRequest
|
|
7475
|
-
});
|
|
7476
|
-
}
|
|
7477
7445
|
async function postAnalysisInsightComment(params) {
|
|
7478
7446
|
const { prVulenrabilities, pullRequest, scanner, scm } = params;
|
|
7479
7447
|
const scanerString = scannerToFriendlyString[scanner];
|
|
@@ -7631,12 +7599,6 @@ async function addFixCommentsForPr({
|
|
|
7631
7599
|
pullRequest,
|
|
7632
7600
|
scanner,
|
|
7633
7601
|
scm
|
|
7634
|
-
}),
|
|
7635
|
-
postAnalysisSummary({
|
|
7636
|
-
fixesById,
|
|
7637
|
-
prVulenrabilities,
|
|
7638
|
-
pullRequest,
|
|
7639
|
-
scm
|
|
7640
7602
|
})
|
|
7641
7603
|
]);
|
|
7642
7604
|
}
|
|
@@ -7736,21 +7698,32 @@ async function getGitInfo(srcDirPath) {
|
|
|
7736
7698
|
}
|
|
7737
7699
|
|
|
7738
7700
|
// src/features/analysis/graphql/gql.ts
|
|
7701
|
+
import fetchOrig from "cross-fetch";
|
|
7739
7702
|
import Debug11 from "debug";
|
|
7740
7703
|
import { GraphQLClient } from "graphql-request";
|
|
7704
|
+
import { HttpProxyAgent as HttpProxyAgent2 } from "http-proxy-agent";
|
|
7705
|
+
import { HttpsProxyAgent as HttpsProxyAgent2 } from "https-proxy-agent";
|
|
7741
7706
|
import { v4 as uuidv4 } from "uuid";
|
|
7742
7707
|
|
|
7743
7708
|
// src/features/analysis/graphql/subscribe.ts
|
|
7744
7709
|
import { createClient } from "graphql-ws";
|
|
7710
|
+
import { HttpProxyAgent } from "http-proxy-agent";
|
|
7711
|
+
import { HttpsProxyAgent } from "https-proxy-agent";
|
|
7745
7712
|
import WebSocket from "ws";
|
|
7746
7713
|
var SUBSCRIPTION_TIMEOUT_MS = 30 * 60 * 1e3;
|
|
7747
7714
|
function createWSClient(options) {
|
|
7715
|
+
const proxy = options.url.startsWith("https://") && process.env["HTTPS_PROXY"] ? new HttpsProxyAgent(process.env["HTTPS_PROXY"]) : options.url.startsWith("http://") && process.env["HTTP_PROXY"] ? new HttpProxyAgent(process.env["HTTP_PROXY"]) : null;
|
|
7716
|
+
const CustomWebSocket = class extends WebSocket {
|
|
7717
|
+
constructor(address, protocols) {
|
|
7718
|
+
super(address, protocols, proxy ? { agent: proxy } : void 0);
|
|
7719
|
+
}
|
|
7720
|
+
};
|
|
7748
7721
|
return createClient({
|
|
7749
7722
|
//this is needed to prevent AWS from killing the connection
|
|
7750
7723
|
//currently our load balancer has a 29s idle timeout
|
|
7751
7724
|
keepAlive: 1e4,
|
|
7752
7725
|
url: options.url,
|
|
7753
|
-
webSocketImpl: options.websocket || WebSocket,
|
|
7726
|
+
webSocketImpl: proxy ? CustomWebSocket : options.websocket || WebSocket,
|
|
7754
7727
|
connectionParams: () => {
|
|
7755
7728
|
return {
|
|
7756
7729
|
headers: options.type === "apiKey" ? {
|
|
@@ -7887,6 +7860,25 @@ var GetVulByNodesMetadataZ = z27.object({
|
|
|
7887
7860
|
var debug11 = Debug11("mobbdev:gql");
|
|
7888
7861
|
var API_KEY_HEADER_NAME = "x-mobb-key";
|
|
7889
7862
|
var REPORT_STATE_CHECK_DELAY = 5 * 1e3;
|
|
7863
|
+
var fetchWithProxy = (url, options = {}) => {
|
|
7864
|
+
try {
|
|
7865
|
+
const parsedUrl = new URL(url.toString());
|
|
7866
|
+
const isHttp = parsedUrl.protocol === "http:";
|
|
7867
|
+
const isHttps = parsedUrl.protocol === "https:";
|
|
7868
|
+
const proxy = isHttps ? HTTPS_PROXY : isHttp ? HTTP_PROXY : null;
|
|
7869
|
+
if (proxy) {
|
|
7870
|
+
const agent = isHttps ? new HttpsProxyAgent2(proxy) : new HttpProxyAgent2(proxy);
|
|
7871
|
+
return fetchOrig(url, {
|
|
7872
|
+
...options,
|
|
7873
|
+
// @ts-expect-error Node-fetch doesn't type 'agent', but it's valid
|
|
7874
|
+
agent
|
|
7875
|
+
});
|
|
7876
|
+
}
|
|
7877
|
+
} catch (err) {
|
|
7878
|
+
debug11(`Skipping proxy for ${url}. Reason: ${err.message}`);
|
|
7879
|
+
}
|
|
7880
|
+
return fetchOrig(url, options);
|
|
7881
|
+
};
|
|
7890
7882
|
var GQLClient = class {
|
|
7891
7883
|
constructor(args) {
|
|
7892
7884
|
__publicField(this, "_client");
|
|
@@ -7898,6 +7890,7 @@ var GQLClient = class {
|
|
|
7898
7890
|
headers: args.type === "apiKey" ? { [API_KEY_HEADER_NAME]: args.apiKey || "" } : {
|
|
7899
7891
|
Authorization: `Bearer ${args.token}`
|
|
7900
7892
|
},
|
|
7893
|
+
fetch: fetchWithProxy,
|
|
7901
7894
|
requestMiddleware: (request) => {
|
|
7902
7895
|
const requestId = uuidv4();
|
|
7903
7896
|
debug11(
|
|
@@ -7925,6 +7918,17 @@ var GQLClient = class {
|
|
|
7925
7918
|
});
|
|
7926
7919
|
return res.insert_cli_login_one?.id || "";
|
|
7927
7920
|
}
|
|
7921
|
+
async verifyConnection() {
|
|
7922
|
+
try {
|
|
7923
|
+
await this.getUserInfo();
|
|
7924
|
+
} catch (e) {
|
|
7925
|
+
if (e?.toString().startsWith("FetchError")) {
|
|
7926
|
+
debug11("verify connection failed %o", e);
|
|
7927
|
+
return false;
|
|
7928
|
+
}
|
|
7929
|
+
}
|
|
7930
|
+
return true;
|
|
7931
|
+
}
|
|
7928
7932
|
async verifyToken() {
|
|
7929
7933
|
await this.createCommunityUser();
|
|
7930
7934
|
let info;
|
|
@@ -8080,7 +8084,7 @@ var GQLClient = class {
|
|
|
8080
8084
|
projectId,
|
|
8081
8085
|
pullRequest,
|
|
8082
8086
|
sha: sha || "",
|
|
8083
|
-
experimentalEnabled,
|
|
8087
|
+
experimentalEnabled: !!experimentalEnabled,
|
|
8084
8088
|
scanSource: params.scanSource
|
|
8085
8089
|
});
|
|
8086
8090
|
}
|
|
@@ -8372,16 +8376,16 @@ function createSpwan({ args, processPath, name }, options) {
|
|
|
8372
8376
|
return createChildProcess({ childProcess: child, name }, options);
|
|
8373
8377
|
}
|
|
8374
8378
|
function createChildProcess({ childProcess, name }, options) {
|
|
8375
|
-
const
|
|
8379
|
+
const debug19 = Debug13(`mobbdev:${name}`);
|
|
8376
8380
|
const { display } = options;
|
|
8377
8381
|
return new Promise((resolve, reject) => {
|
|
8378
8382
|
let out = "";
|
|
8379
8383
|
const onData = (chunk) => {
|
|
8380
|
-
|
|
8384
|
+
debug19(`chunk received from ${name} std ${chunk}`);
|
|
8381
8385
|
out += chunk;
|
|
8382
8386
|
};
|
|
8383
8387
|
if (!childProcess || !childProcess?.stdout || !childProcess?.stderr) {
|
|
8384
|
-
|
|
8388
|
+
debug19(`unable to fork ${name}`);
|
|
8385
8389
|
reject(new Error(`unable to fork ${name}`));
|
|
8386
8390
|
}
|
|
8387
8391
|
childProcess.stdout?.on("data", onData);
|
|
@@ -8391,11 +8395,11 @@ function createChildProcess({ childProcess, name }, options) {
|
|
|
8391
8395
|
childProcess.stderr?.pipe(process2.stderr);
|
|
8392
8396
|
}
|
|
8393
8397
|
childProcess.on("exit", (code) => {
|
|
8394
|
-
|
|
8398
|
+
debug19(`${name} exit code ${code}`);
|
|
8395
8399
|
resolve({ message: out, code });
|
|
8396
8400
|
});
|
|
8397
8401
|
childProcess.on("error", (err) => {
|
|
8398
|
-
|
|
8402
|
+
debug19(`${name} error %o`, err);
|
|
8399
8403
|
reject(err);
|
|
8400
8404
|
});
|
|
8401
8405
|
});
|
|
@@ -8950,7 +8954,7 @@ async function _scan(params, { skipPrompts = false } = {}) {
|
|
|
8950
8954
|
projectId,
|
|
8951
8955
|
vulnerabilityReportFileName: "report.json",
|
|
8952
8956
|
sha,
|
|
8953
|
-
experimentalEnabled,
|
|
8957
|
+
experimentalEnabled: !!experimentalEnabled,
|
|
8954
8958
|
pullRequest: params.pullRequest,
|
|
8955
8959
|
scanSource: _getScanSource(command, ci)
|
|
8956
8960
|
}
|
|
@@ -9105,7 +9109,8 @@ async function _scan(params, { skipPrompts = false } = {}) {
|
|
|
9105
9109
|
reference: ref || gitInfo.reference || "no-branch",
|
|
9106
9110
|
sha: commitHash || gitInfo.hash || "0123456789abcdef",
|
|
9107
9111
|
scanSource: _getScanSource(command, ci),
|
|
9108
|
-
pullRequest: params.pullRequest
|
|
9112
|
+
pullRequest: params.pullRequest,
|
|
9113
|
+
experimentalEnabled: !!experimentalEnabled
|
|
9109
9114
|
}
|
|
9110
9115
|
});
|
|
9111
9116
|
if (command === "review") {
|
|
@@ -9367,6 +9372,18 @@ async function handleMobbLogin({
|
|
|
9367
9372
|
skipPrompts
|
|
9368
9373
|
}) {
|
|
9369
9374
|
const { createSpinner: createSpinner5 } = Spinner({ ci: skipPrompts });
|
|
9375
|
+
const isConnected = await inGqlClient.verifyConnection();
|
|
9376
|
+
if (!isConnected) {
|
|
9377
|
+
createSpinner5().start().error({
|
|
9378
|
+
text: "\u{1F513} Connection to Mobb: failed to connect to the Mobb server"
|
|
9379
|
+
});
|
|
9380
|
+
throw new CliError(
|
|
9381
|
+
"Connection to Mobb: failed to connect to the Mobb server"
|
|
9382
|
+
);
|
|
9383
|
+
}
|
|
9384
|
+
createSpinner5().start().success({
|
|
9385
|
+
text: `\u{1F513} Connection to Mobb: succeeded`
|
|
9386
|
+
});
|
|
9370
9387
|
const userVerify = await inGqlClient.verifyToken();
|
|
9371
9388
|
if (userVerify) {
|
|
9372
9389
|
createSpinner5().start().success({
|
|
@@ -9598,7 +9615,7 @@ function analyzeBuilder(yargs2) {
|
|
|
9598
9615
|
demandOption: true,
|
|
9599
9616
|
type: "string",
|
|
9600
9617
|
describe: chalk8.bold(
|
|
9601
|
-
"Select the vulnerability report to analyze (Checkmarx, Snyk, Fortify, CodeQL, Sonarqube, Semgrep)"
|
|
9618
|
+
"Select the vulnerability report to analyze (Checkmarx, Snyk, Fortify, CodeQL, Sonarqube, Semgrep, Datadog)"
|
|
9602
9619
|
)
|
|
9603
9620
|
}).option("repo", repoOption).option("p", {
|
|
9604
9621
|
alias: "src-path",
|
|
@@ -9818,11 +9835,13 @@ var parseArgs = async (args) => {
|
|
|
9818
9835
|
};
|
|
9819
9836
|
|
|
9820
9837
|
// src/index.ts
|
|
9838
|
+
var debug18 = Debug19("mobbdev:index");
|
|
9821
9839
|
async function run() {
|
|
9822
9840
|
return parseArgs(hideBin(process.argv));
|
|
9823
9841
|
}
|
|
9824
9842
|
(async () => {
|
|
9825
9843
|
try {
|
|
9844
|
+
debug18("Bugsy CLI v%s running...", packageJson.version);
|
|
9826
9845
|
await run();
|
|
9827
9846
|
process.exit(0);
|
|
9828
9847
|
} catch (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mobbdev",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.64",
|
|
4
4
|
"description": "Automated secure code remediation tool",
|
|
5
5
|
"repository": "git+https://github.com/mobb-dev/bugsy.git",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"test:coverage": "GIT_PROXY_HOST=http://tinyproxy:8888 TOKEN=$(../../scripts/login_auth0.sh) vitest run --coverage",
|
|
18
18
|
"test:watch": "TOKEN=$(../../scripts/login_auth0.sh) vitest",
|
|
19
19
|
"test:integration": "GIT_PROXY_HOST=http://tinyproxy:8888 TOKEN=$(../../scripts/login_auth0.sh) vitest watch integration.test",
|
|
20
|
+
"test:integration:proxy": "GIT_PROXY_HOST=http://tinyproxy:8888 HTTP_PROXY=http://localhost:8888 API_URL=http://app-api:8080/v1/graphql TOKEN=$(../../scripts/login_auth0.sh) vitest run integration.test.ts",
|
|
20
21
|
"lint": "eslint --cache --max-warnings 0 --ignore-path .eslintignore --ext .ts,.tsx,.jsx .",
|
|
21
22
|
"lint:fix": "eslint --fix --cache --max-warnings 0 --ignore-path .eslintignore --ext .js,.ts,.tsx,.jsx .",
|
|
22
23
|
"lint:fix:files": "eslint --fix --cache --max-warnings 0 --ignore-path .eslintignore --ext .js,.ts,.tsx,.jsx",
|
|
@@ -45,6 +46,7 @@
|
|
|
45
46
|
"chalk": "5.4.1",
|
|
46
47
|
"chalk-animation": "2.0.3",
|
|
47
48
|
"configstore": "6.0.0",
|
|
49
|
+
"cross-fetch": "4.1.0",
|
|
48
50
|
"debug": "4.4.0",
|
|
49
51
|
"dotenv": "16.4.7",
|
|
50
52
|
"extract-zip": "2.0.1",
|
|
@@ -53,6 +55,8 @@
|
|
|
53
55
|
"graphql-request": "6.1.0",
|
|
54
56
|
"graphql-tag": "2.12.6",
|
|
55
57
|
"graphql-ws": "5.16.2",
|
|
58
|
+
"http-proxy-agent": "7.0.2",
|
|
59
|
+
"https-proxy-agent": "7.0.6",
|
|
56
60
|
"inquirer": "9.2.23",
|
|
57
61
|
"isomorphic-ws": "5.0.0",
|
|
58
62
|
"istextorbinary": "6.0.0",
|