mobbdev 1.0.13 → 1.0.16
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 +152 -67
- package/package.json +8 -8
package/dist/index.mjs
CHANGED
|
@@ -592,8 +592,8 @@ var GitReferenceDocument = `
|
|
|
592
592
|
}
|
|
593
593
|
`;
|
|
594
594
|
var AutoPrAnalysisDocument = `
|
|
595
|
-
mutation autoPrAnalysis($analysisId: String
|
|
596
|
-
autoPrAnalysis(analysisId: $analysisId) {
|
|
595
|
+
mutation autoPrAnalysis($analysisId: String!, $commitDirectly: Boolean) {
|
|
596
|
+
autoPrAnalysis(analysisId: $analysisId, sameBranchCommit: $commitDirectly) {
|
|
597
597
|
__typename
|
|
598
598
|
... on AutoPrSuccess {
|
|
599
599
|
status
|
|
@@ -799,6 +799,45 @@ var IssueTypeSettingsZ = z2.array(IssueTypeSettingZ).transform((issueTypeSetting
|
|
|
799
799
|
});
|
|
800
800
|
|
|
801
801
|
// src/features/analysis/scm/shared/src/types.ts
|
|
802
|
+
var ScmSubmitFixRequestsZ = z3.array(
|
|
803
|
+
z3.object({
|
|
804
|
+
scmSubmitFixRequest: z3.object({
|
|
805
|
+
submitFixRequest: z3.object({
|
|
806
|
+
createdByUser: z3.object({
|
|
807
|
+
email: z3.string()
|
|
808
|
+
}),
|
|
809
|
+
targetBranchName: z3.string().default("")
|
|
810
|
+
}),
|
|
811
|
+
prUrl: z3.string().nullable(),
|
|
812
|
+
prStatus: z3.nativeEnum(Pr_Status_Enum).nullable(),
|
|
813
|
+
commitUrl: z3.string().nullable(),
|
|
814
|
+
scmId: z3.string()
|
|
815
|
+
})
|
|
816
|
+
})
|
|
817
|
+
);
|
|
818
|
+
var FixRatingZ = z3.object({
|
|
819
|
+
voteScore: z3.number(),
|
|
820
|
+
fixRatingTag: z3.nativeEnum(Fix_Rating_Tag_Enum).nullable().default(null),
|
|
821
|
+
comment: z3.string().nullable().default(null),
|
|
822
|
+
updatedDate: z3.string().nullable(),
|
|
823
|
+
user: z3.object({
|
|
824
|
+
email: z3.string(),
|
|
825
|
+
name: z3.string()
|
|
826
|
+
})
|
|
827
|
+
});
|
|
828
|
+
var FixSharedStateZ = z3.object({
|
|
829
|
+
state: z3.nativeEnum(Fix_State_Enum),
|
|
830
|
+
isArchived: z3.boolean(),
|
|
831
|
+
scmSubmitFixRequests: ScmSubmitFixRequestsZ,
|
|
832
|
+
fixRatings: z3.array(FixRatingZ).default([])
|
|
833
|
+
}).nullish().transform(
|
|
834
|
+
(data) => data ? data : {
|
|
835
|
+
state: "Ready" /* Ready */,
|
|
836
|
+
isArchived: false,
|
|
837
|
+
scmSubmitFixRequests: [],
|
|
838
|
+
fixRatings: []
|
|
839
|
+
}
|
|
840
|
+
);
|
|
802
841
|
var OrganizationScreenQueryParamsZ = z3.object({
|
|
803
842
|
organizationId: z3.string().uuid()
|
|
804
843
|
});
|
|
@@ -816,22 +855,6 @@ var FixPageQueryParamsZ = AnalysisPageQueryParamsZ.extend({
|
|
|
816
855
|
var CliLoginPageQueryParamsZ = z3.object({
|
|
817
856
|
loginId: z3.string().uuid()
|
|
818
857
|
});
|
|
819
|
-
var ScmSubmitFixRequestsZ = z3.array(
|
|
820
|
-
z3.object({
|
|
821
|
-
scmSubmitFixRequest: z3.object({
|
|
822
|
-
submitFixRequest: z3.object({
|
|
823
|
-
createdByUser: z3.object({
|
|
824
|
-
email: z3.string()
|
|
825
|
-
}),
|
|
826
|
-
targetBranchName: z3.string().default("")
|
|
827
|
-
}),
|
|
828
|
-
prUrl: z3.string().nullable(),
|
|
829
|
-
prStatus: z3.nativeEnum(Pr_Status_Enum).nullable(),
|
|
830
|
-
commitUrl: z3.string().nullable(),
|
|
831
|
-
scmId: z3.string()
|
|
832
|
-
})
|
|
833
|
-
})
|
|
834
|
-
);
|
|
835
858
|
var AnalysisReportDigestedZ = z3.object({
|
|
836
859
|
id: z3.string().uuid(),
|
|
837
860
|
state: z3.nativeEnum(Fix_Report_State_Enum),
|
|
@@ -854,16 +877,6 @@ var AnalysisReportDigestedZ = z3.object({
|
|
|
854
877
|
})
|
|
855
878
|
})
|
|
856
879
|
});
|
|
857
|
-
var FixRatingZ = z3.object({
|
|
858
|
-
voteScore: z3.number(),
|
|
859
|
-
fixRatingTag: z3.nativeEnum(Fix_Rating_Tag_Enum).nullable().default(null),
|
|
860
|
-
comment: z3.string().nullable().default(null),
|
|
861
|
-
updatedDate: z3.string().nullable(),
|
|
862
|
-
user: z3.object({
|
|
863
|
-
email: z3.string(),
|
|
864
|
-
name: z3.string()
|
|
865
|
-
})
|
|
866
|
-
});
|
|
867
880
|
var ReportQueryResultZ = z3.object({
|
|
868
881
|
fixReport_by_pk: z3.object({
|
|
869
882
|
id: z3.string().uuid(),
|
|
@@ -901,7 +914,7 @@ var ReportQueryResultZ = z3.object({
|
|
|
901
914
|
fileRepoRelativePath: z3.string()
|
|
902
915
|
})
|
|
903
916
|
),
|
|
904
|
-
|
|
917
|
+
sharedState: FixSharedStateZ,
|
|
905
918
|
numberOfVulnerabilityIssues: z3.number(),
|
|
906
919
|
vulnerabilityReportIssues: z3.array(
|
|
907
920
|
z3.object({
|
|
@@ -909,10 +922,8 @@ var ReportQueryResultZ = z3.object({
|
|
|
909
922
|
issueLanguage: z3.string(),
|
|
910
923
|
parsedSeverity: ParsedSeverityZ
|
|
911
924
|
})
|
|
912
|
-
)
|
|
913
|
-
scmSubmitFixRequests: ScmSubmitFixRequestsZ,
|
|
914
|
-
isArchived: z3.boolean().nullable(),
|
|
915
|
-
fixRatings: z3.array(FixRatingZ).default([])
|
|
925
|
+
)
|
|
926
|
+
// scmSubmitFixRequests: ScmSubmitFixRequestsZ,
|
|
916
927
|
})
|
|
917
928
|
),
|
|
918
929
|
repo: z3.object({
|
|
@@ -979,8 +990,7 @@ var ReportQueryResultZ = z3.object({
|
|
|
979
990
|
var ReportFixesQueryZ = z3.array(
|
|
980
991
|
z3.object({
|
|
981
992
|
id: z3.string().uuid(),
|
|
982
|
-
|
|
983
|
-
isArchived: z3.boolean().nullable(),
|
|
993
|
+
sharedState: FixSharedStateZ,
|
|
984
994
|
confidence: z3.number(),
|
|
985
995
|
gitBlameLogin: z3.string().nullable(),
|
|
986
996
|
effortToApplyFix: z3.nativeEnum(Effort_To_Apply_Fix_Enum).nullable(),
|
|
@@ -999,9 +1009,7 @@ var ReportFixesQueryZ = z3.array(
|
|
|
999
1009
|
issueLanguage: z3.string(),
|
|
1000
1010
|
parsedSeverity: ParsedSeverityZ
|
|
1001
1011
|
})
|
|
1002
|
-
).min(1)
|
|
1003
|
-
scmSubmitFixRequests: ScmSubmitFixRequestsZ,
|
|
1004
|
-
fixRatings: z3.array(FixRatingZ).default([])
|
|
1012
|
+
).min(1)
|
|
1005
1013
|
})
|
|
1006
1014
|
);
|
|
1007
1015
|
var ExtraContextInternalZ = z3.object({
|
|
@@ -1052,7 +1060,7 @@ var PatchAndQuestionsZ = z3.object({
|
|
|
1052
1060
|
var FixQueryZ = z3.object({
|
|
1053
1061
|
__typename: z3.literal("fix").optional(),
|
|
1054
1062
|
id: z3.string().uuid(),
|
|
1055
|
-
|
|
1063
|
+
sharedState: FixSharedStateZ,
|
|
1056
1064
|
modifiedBy: z3.string().nullable(),
|
|
1057
1065
|
gitBlameLogin: z3.string().nullable(),
|
|
1058
1066
|
safeIssueLanguage: z3.string(),
|
|
@@ -1060,7 +1068,6 @@ var FixQueryZ = z3.object({
|
|
|
1060
1068
|
confidence: z3.number(),
|
|
1061
1069
|
fixReportId: z3.string().uuid(),
|
|
1062
1070
|
isExpired: z3.boolean().default(false),
|
|
1063
|
-
isArchived: z3.boolean().nullable(),
|
|
1064
1071
|
fixFiles: z3.array(
|
|
1065
1072
|
z3.object({
|
|
1066
1073
|
fileRepoRelativePath: z3.string()
|
|
@@ -1075,9 +1082,7 @@ var FixQueryZ = z3.object({
|
|
|
1075
1082
|
})
|
|
1076
1083
|
),
|
|
1077
1084
|
patchAndQuestions: PatchAndQuestionsZ,
|
|
1078
|
-
|
|
1079
|
-
effortToApplyFix: z3.nativeEnum(Effort_To_Apply_Fix_Enum).nullable(),
|
|
1080
|
-
fixRatings: z3.array(FixRatingZ).default([])
|
|
1085
|
+
effortToApplyFix: z3.nativeEnum(Effort_To_Apply_Fix_Enum).nullable()
|
|
1081
1086
|
});
|
|
1082
1087
|
var FixScreenQueryResultZ = z3.object({
|
|
1083
1088
|
fixReport_by_pk: z3.object({
|
|
@@ -1153,11 +1158,12 @@ var FixScreenQueryResultZ = z3.object({
|
|
|
1153
1158
|
)
|
|
1154
1159
|
})
|
|
1155
1160
|
),
|
|
1156
|
-
fixesWithSameIssueType: z3.
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
+
fixesWithSameIssueType: z3.array(
|
|
1162
|
+
z3.object({
|
|
1163
|
+
id: z3.string().uuid(),
|
|
1164
|
+
sharedState: z3.object({ state: z3.nativeEnum(Fix_State_Enum) }).nullable().default({ state: "Ready" /* Ready */ })
|
|
1165
|
+
})
|
|
1166
|
+
)
|
|
1161
1167
|
});
|
|
1162
1168
|
var FixReportByProjectZ = z3.object({
|
|
1163
1169
|
project_by_pk: z3.object({
|
|
@@ -1742,7 +1748,10 @@ var fixDetailsData = {
|
|
|
1742
1748
|
},
|
|
1743
1749
|
["STRING_FORMAT_MISUSE" /* StringFormatMisuse */]: void 0,
|
|
1744
1750
|
["NON_READONLY_FIELD" /* NonReadonlyField */]: void 0,
|
|
1745
|
-
["CSRF" /* Csrf */]:
|
|
1751
|
+
["CSRF" /* Csrf */]: {
|
|
1752
|
+
issueDescription: "Cross Site Request Forgery is an attack that forces an end user to execute unwanted actions on a web application in which they\u2019re currently authenticated.",
|
|
1753
|
+
fixInstructions: "Configure a CSRF protection mechanism, such as a CSRF token, in your application."
|
|
1754
|
+
},
|
|
1746
1755
|
["WEAK_ENCRYPTION" /* WeakEncryption */]: void 0,
|
|
1747
1756
|
["CODE_IN_COMMENT" /* CodeInComment */]: void 0,
|
|
1748
1757
|
["REGEX_MISSING_TIMEOUT" /* RegexMissingTimeout */]: void 0
|
|
@@ -1873,6 +1882,17 @@ var vulnerabilities2 = {
|
|
|
1873
1882
|
};
|
|
1874
1883
|
var java_default = vulnerabilities2;
|
|
1875
1884
|
|
|
1885
|
+
// src/features/analysis/scm/shared/src/storedFixData/python/csrf.ts
|
|
1886
|
+
var csrf = {
|
|
1887
|
+
guidance: () => `Please make sure the CSRF middleware is activated by default in the MIDDLEWARE setting. If you override that setting, remember that \`django.middleware.csrf.CsrfViewMiddleware\` should come before any view middleware that assume that CSRF attacks have been dealt with.
|
|
1888
|
+
|
|
1889
|
+
|
|
1890
|
+
If you disabled it, which is not recommended, you can use [\`csrf_protect()\`](https://docs.djangoproject.com/en/5.1/ref/csrf/#django.views.decorators.csrf.csrf_protect) annotation on this particular view.
|
|
1891
|
+
|
|
1892
|
+
|
|
1893
|
+
See more information [here](https://docs.djangoproject.com/en/5.1/howto/csrf/).`
|
|
1894
|
+
};
|
|
1895
|
+
|
|
1876
1896
|
// src/features/analysis/scm/shared/src/storedFixData/javascript/hardcodedSecrets.ts
|
|
1877
1897
|
var hardcodedSecrets = {
|
|
1878
1898
|
guidance: ({ questions }) => {
|
|
@@ -1907,7 +1927,8 @@ var vulnerabilities3 = {
|
|
|
1907
1927
|
["SSRF" /* Ssrf */]: ssrf,
|
|
1908
1928
|
["HARDCODED_SECRETS" /* HardcodedSecrets */]: hardcodedSecrets,
|
|
1909
1929
|
["PASSWORD_IN_COMMENT" /* PasswordInComment */]: passwordInComment,
|
|
1910
|
-
["NO_LIMITS_OR_THROTTLING" /* NoLimitsOrThrottling */]: noLimitsOrThrottling
|
|
1930
|
+
["NO_LIMITS_OR_THROTTLING" /* NoLimitsOrThrottling */]: noLimitsOrThrottling,
|
|
1931
|
+
["CSRF" /* Csrf */]: csrf
|
|
1911
1932
|
};
|
|
1912
1933
|
var javascript_default = vulnerabilities3;
|
|
1913
1934
|
|
|
@@ -1936,7 +1957,8 @@ See more information [here](https://jinja.palletsprojects.com/en/3.1.x/templates
|
|
|
1936
1957
|
|
|
1937
1958
|
// src/features/analysis/scm/shared/src/storedFixData/python/index.ts
|
|
1938
1959
|
var vulnerabilities5 = {
|
|
1939
|
-
["AUTO_ESCAPE_FALSE" /* AutoEscapeFalse */]: autoEscapeFalse
|
|
1960
|
+
["AUTO_ESCAPE_FALSE" /* AutoEscapeFalse */]: autoEscapeFalse,
|
|
1961
|
+
["CSRF" /* Csrf */]: csrf
|
|
1940
1962
|
};
|
|
1941
1963
|
var python_default = vulnerabilities5;
|
|
1942
1964
|
|
|
@@ -2740,6 +2762,15 @@ var vulnerabilities9 = {
|
|
|
2740
2762
|
};
|
|
2741
2763
|
var java_default2 = vulnerabilities9;
|
|
2742
2764
|
|
|
2765
|
+
// src/features/analysis/scm/shared/src/storedQuestionData/python/csrf.ts
|
|
2766
|
+
var csrf2 = {
|
|
2767
|
+
isPythonDjangoTemplate: {
|
|
2768
|
+
content: () => "Is the reported file Python Django template?",
|
|
2769
|
+
description: () => "",
|
|
2770
|
+
guidance: () => ""
|
|
2771
|
+
}
|
|
2772
|
+
};
|
|
2773
|
+
|
|
2743
2774
|
// src/features/analysis/scm/shared/src/storedQuestionData/js/commandInjection.ts
|
|
2744
2775
|
var commandInjection2 = {
|
|
2745
2776
|
isCommandExecutable: {
|
|
@@ -3046,10 +3077,44 @@ var vulnerabilities10 = {
|
|
|
3046
3077
|
["UNCHECKED_LOOP_CONDITION" /* UncheckedLoopCondition */]: uncheckedLoopCondition2,
|
|
3047
3078
|
["NO_LIMITS_OR_THROTTLING" /* NoLimitsOrThrottling */]: noLimitsOrThrottling2,
|
|
3048
3079
|
["MISSING_CSP_HEADER" /* MissingCspHeader */]: cspHeaderValue,
|
|
3049
|
-
["HARDCODED_DOMAIN_IN_HTML" /* HardcodedDomainInHtml */]: hardcodedDomainInHtml
|
|
3080
|
+
["HARDCODED_DOMAIN_IN_HTML" /* HardcodedDomainInHtml */]: hardcodedDomainInHtml,
|
|
3081
|
+
["CSRF" /* Csrf */]: csrf2
|
|
3050
3082
|
};
|
|
3051
3083
|
var js_default = vulnerabilities10;
|
|
3052
3084
|
|
|
3085
|
+
// src/features/analysis/scm/shared/src/storedQuestionData/python/logForging.ts
|
|
3086
|
+
var logForging4 = {
|
|
3087
|
+
isHtmlDisplay: {
|
|
3088
|
+
content: () => "Is the text written to the log going to be displayed as HTML?",
|
|
3089
|
+
description: () => "",
|
|
3090
|
+
guidance: ({ userInputValue }) => {
|
|
3091
|
+
switch (userInputValue) {
|
|
3092
|
+
case "yes":
|
|
3093
|
+
return "We use `html.escape` to decode the HTML";
|
|
3094
|
+
default:
|
|
3095
|
+
return "";
|
|
3096
|
+
}
|
|
3097
|
+
}
|
|
3098
|
+
}
|
|
3099
|
+
};
|
|
3100
|
+
|
|
3101
|
+
// src/features/analysis/scm/shared/src/storedQuestionData/python/openRedirect.ts
|
|
3102
|
+
var openRedirect2 = {
|
|
3103
|
+
allowed_hosts: {
|
|
3104
|
+
content: () => "Allowed domains/paths",
|
|
3105
|
+
description: () => "If external, provide a coma separated list of allowed domains. If internal, provide a coma seperated list of allowed paths",
|
|
3106
|
+
guidance: () => ""
|
|
3107
|
+
}
|
|
3108
|
+
};
|
|
3109
|
+
|
|
3110
|
+
// src/features/analysis/scm/shared/src/storedQuestionData/python/index.ts
|
|
3111
|
+
var vulnerabilities11 = {
|
|
3112
|
+
["CSRF" /* Csrf */]: csrf2,
|
|
3113
|
+
["LOG_FORGING" /* LogForging */]: logForging4,
|
|
3114
|
+
["LOG_FORGING" /* LogForging */]: openRedirect2
|
|
3115
|
+
};
|
|
3116
|
+
var python_default2 = vulnerabilities11;
|
|
3117
|
+
|
|
3053
3118
|
// src/features/analysis/scm/shared/src/storedQuestionData/xml/unboundedOccurrences.ts
|
|
3054
3119
|
var unboundedOccurrences = {
|
|
3055
3120
|
maxOccursLimit: {
|
|
@@ -3062,10 +3127,10 @@ A value too high will cause performance issues up to and including denial of ser
|
|
|
3062
3127
|
};
|
|
3063
3128
|
|
|
3064
3129
|
// src/features/analysis/scm/shared/src/storedQuestionData/xml/index.ts
|
|
3065
|
-
var
|
|
3130
|
+
var vulnerabilities12 = {
|
|
3066
3131
|
["WEAK_XML_SCHEMA_UNBOUNDED_OCCURRENCES" /* WeakXmlSchemaUnboundedOccurrences */]: unboundedOccurrences
|
|
3067
3132
|
};
|
|
3068
|
-
var xml_default2 =
|
|
3133
|
+
var xml_default2 = vulnerabilities12;
|
|
3069
3134
|
|
|
3070
3135
|
// src/features/analysis/scm/shared/src/storedQuestionData/index.ts
|
|
3071
3136
|
var StoredQuestionDataItemZ = z7.object({
|
|
@@ -3077,7 +3142,8 @@ var languages2 = {
|
|
|
3077
3142
|
["Java" /* Java */]: java_default2,
|
|
3078
3143
|
["JavaScript" /* JavaScript */]: js_default,
|
|
3079
3144
|
["XML" /* Xml */]: xml_default2,
|
|
3080
|
-
["CSharp" /* CSharp */]: csharp_default2
|
|
3145
|
+
["CSharp" /* CSharp */]: csharp_default2,
|
|
3146
|
+
["Python" /* Python */]: python_default2
|
|
3081
3147
|
};
|
|
3082
3148
|
var storedQuestionData_default = languages2;
|
|
3083
3149
|
|
|
@@ -3205,6 +3271,8 @@ function getGuidances(args) {
|
|
|
3205
3271
|
|
|
3206
3272
|
// src/features/analysis/scm/shared/src/urlParser/urlParser.ts
|
|
3207
3273
|
import { z as z9 } from "zod";
|
|
3274
|
+
var ADO_PREFIX_PATH = "tfs";
|
|
3275
|
+
var NAME_REGEX = /[a-z0-9\-_.+]+/i;
|
|
3208
3276
|
function detectAdoUrl(args) {
|
|
3209
3277
|
const { pathname, hostname, scmType } = args;
|
|
3210
3278
|
const hostnameParts = hostname.split(".");
|
|
@@ -3373,10 +3441,6 @@ function getFixUrl({
|
|
|
3373
3441
|
return `${appBaseUrl}/organization/${organizationId}/project/${projectId}/report/${analysisId}/fix/${fixId}`;
|
|
3374
3442
|
}
|
|
3375
3443
|
|
|
3376
|
-
// src/features/analysis/scm/shared/src/index.ts
|
|
3377
|
-
var NAME_REGEX = /[a-z0-9\-_.+]+/i;
|
|
3378
|
-
var ADO_PREFIX_PATH = "tfs";
|
|
3379
|
-
|
|
3380
3444
|
// src/features/analysis/scm/types.ts
|
|
3381
3445
|
var ReferenceType = /* @__PURE__ */ ((ReferenceType2) => {
|
|
3382
3446
|
ReferenceType2["BRANCH"] = "BRANCH";
|
|
@@ -6959,7 +7023,7 @@ async function addFixCommentsForPr({
|
|
|
6959
7023
|
import Debug8 from "debug";
|
|
6960
7024
|
var debug8 = Debug8("mobbdev:handleAutoPr");
|
|
6961
7025
|
async function handleAutoPr(params) {
|
|
6962
|
-
const { gqlClient, analysisId, createSpinner: createSpinner5 } = params;
|
|
7026
|
+
const { gqlClient, analysisId, commitDirectly, createSpinner: createSpinner5 } = params;
|
|
6963
7027
|
const createAutoPrSpinner = createSpinner5(
|
|
6964
7028
|
"\u{1F504} Waiting for the analysis to finish before initiating automatic pull request creation"
|
|
6965
7029
|
).start();
|
|
@@ -6968,7 +7032,10 @@ async function handleAutoPr(params) {
|
|
|
6968
7032
|
analysisId
|
|
6969
7033
|
},
|
|
6970
7034
|
callback: async (analysisId2) => {
|
|
6971
|
-
const autoPrAnalysisRes = await gqlClient.autoPrAnalysis(
|
|
7035
|
+
const autoPrAnalysisRes = await gqlClient.autoPrAnalysis(
|
|
7036
|
+
analysisId2,
|
|
7037
|
+
commitDirectly
|
|
7038
|
+
);
|
|
6972
7039
|
debug8("auto pr analysis res %o", autoPrAnalysisRes);
|
|
6973
7040
|
if (autoPrAnalysisRes.autoPrAnalysis?.__typename === "AutoPrError") {
|
|
6974
7041
|
createAutoPrSpinner.error({
|
|
@@ -7424,9 +7491,10 @@ var GQLClient = class {
|
|
|
7424
7491
|
}
|
|
7425
7492
|
return res.analysis;
|
|
7426
7493
|
}
|
|
7427
|
-
async autoPrAnalysis(analysisId) {
|
|
7494
|
+
async autoPrAnalysis(analysisId, commitDirectly) {
|
|
7428
7495
|
return this._clientSdk.autoPrAnalysis({
|
|
7429
|
-
analysisId
|
|
7496
|
+
analysisId,
|
|
7497
|
+
commitDirectly
|
|
7430
7498
|
});
|
|
7431
7499
|
}
|
|
7432
7500
|
async getFixes(fixIds) {
|
|
@@ -8050,7 +8118,8 @@ async function _scan(params, { skipPrompts = false } = {}) {
|
|
|
8050
8118
|
githubToken: githubActionToken,
|
|
8051
8119
|
command,
|
|
8052
8120
|
organizationId: userOrganizationId,
|
|
8053
|
-
autoPr
|
|
8121
|
+
autoPr,
|
|
8122
|
+
commitDirectly
|
|
8054
8123
|
} = params;
|
|
8055
8124
|
debug15("start %s %s", dirname, repo);
|
|
8056
8125
|
const { createSpinner: createSpinner5 } = Spinner2({ ci });
|
|
@@ -8189,6 +8258,7 @@ async function _scan(params, { skipPrompts = false } = {}) {
|
|
|
8189
8258
|
await handleAutoPr({
|
|
8190
8259
|
gqlClient,
|
|
8191
8260
|
analysisId: reportUploadInfo.fixReportId,
|
|
8261
|
+
commitDirectly,
|
|
8192
8262
|
createSpinner: createSpinner5
|
|
8193
8263
|
});
|
|
8194
8264
|
}
|
|
@@ -8354,6 +8424,7 @@ async function _scan(params, { skipPrompts = false } = {}) {
|
|
|
8354
8424
|
await handleAutoPr({
|
|
8355
8425
|
gqlClient,
|
|
8356
8426
|
analysisId: reportUploadInfo.fixReportId,
|
|
8427
|
+
commitDirectly,
|
|
8357
8428
|
createSpinner: createSpinner5
|
|
8358
8429
|
});
|
|
8359
8430
|
}
|
|
@@ -8459,7 +8530,8 @@ async function analyze({
|
|
|
8459
8530
|
srcPath,
|
|
8460
8531
|
mobbProjectName,
|
|
8461
8532
|
organizationId,
|
|
8462
|
-
autoPr
|
|
8533
|
+
autoPr,
|
|
8534
|
+
commitDirectly
|
|
8463
8535
|
}, { skipPrompts = false } = {}) {
|
|
8464
8536
|
!ci && await showWelcomeMessage(skipPrompts);
|
|
8465
8537
|
await runAnalysis(
|
|
@@ -8474,7 +8546,8 @@ async function analyze({
|
|
|
8474
8546
|
srcPath,
|
|
8475
8547
|
organizationId,
|
|
8476
8548
|
command: "analyze",
|
|
8477
|
-
autoPr
|
|
8549
|
+
autoPr,
|
|
8550
|
+
commitDirectly
|
|
8478
8551
|
},
|
|
8479
8552
|
{ skipPrompts }
|
|
8480
8553
|
);
|
|
@@ -8675,6 +8748,13 @@ var autoPrOption = {
|
|
|
8675
8748
|
type: "boolean",
|
|
8676
8749
|
default: false
|
|
8677
8750
|
};
|
|
8751
|
+
var commitDirectlyOption = {
|
|
8752
|
+
describe: chalk6.bold(
|
|
8753
|
+
"Commit directly to the scanned branch instead of creating a pull request"
|
|
8754
|
+
),
|
|
8755
|
+
type: "boolean",
|
|
8756
|
+
default: false
|
|
8757
|
+
};
|
|
8678
8758
|
var scmTypeOption = {
|
|
8679
8759
|
demandOption: true,
|
|
8680
8760
|
describe: chalk6.bold("SCM type"),
|
|
@@ -8779,7 +8859,7 @@ function analyzeBuilder(yargs2) {
|
|
|
8779
8859
|
alias: "commit-hash",
|
|
8780
8860
|
describe: chalk8.bold("Hash of the commit"),
|
|
8781
8861
|
type: "string"
|
|
8782
|
-
}).option("mobb-project-name", mobbProjectNameOption).option("y", yesOption).option("ci", ciOption).option("org", organizationIdOptions).option("api-key", apiKeyOption).option("commit-hash", commitHashOption).option("auto-pr", autoPrOption).example(
|
|
8862
|
+
}).option("mobb-project-name", mobbProjectNameOption).option("y", yesOption).option("ci", ciOption).option("org", organizationIdOptions).option("api-key", apiKeyOption).option("commit-hash", commitHashOption).option("auto-pr", autoPrOption).option("commit-directly", commitDirectlyOption).example(
|
|
8783
8863
|
"npx mobbdev@latest analyze -r https://github.com/WebGoat/WebGoat -f <your_vulnerability_report_path>",
|
|
8784
8864
|
"analyze an existing repository"
|
|
8785
8865
|
).help();
|
|
@@ -8799,6 +8879,11 @@ Can't access ${chalk8.bold(argv.f)}`);
|
|
|
8799
8879
|
if (argv.ci && !argv.apiKey) {
|
|
8800
8880
|
throw new CliError("--ci flag requires --api-key to be provided as well");
|
|
8801
8881
|
}
|
|
8882
|
+
if (argv.commitDirectly && !argv["auto-pr"]) {
|
|
8883
|
+
throw new CliError(
|
|
8884
|
+
"--commit-directly flag requires --auto-pr to be provided as well"
|
|
8885
|
+
);
|
|
8886
|
+
}
|
|
8802
8887
|
validateReportFileFormat(argv.f);
|
|
8803
8888
|
}
|
|
8804
8889
|
async function analyzeHandler(args) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mobbdev",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
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",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"author": "",
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@gitbeaker/core": "
|
|
33
|
-
"@gitbeaker/requester-utils": "
|
|
34
|
-
"@gitbeaker/rest": "
|
|
32
|
+
"@gitbeaker/core": "42.0.2",
|
|
33
|
+
"@gitbeaker/requester-utils": "42.0.2",
|
|
34
|
+
"@gitbeaker/rest": "42.0.2",
|
|
35
35
|
"@octokit/core": "5.2.0",
|
|
36
36
|
"@octokit/graphql": "5.0.6",
|
|
37
37
|
"@octokit/plugin-rest-endpoint-methods": "7.2.3",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"graphql": "16.10.0",
|
|
52
52
|
"graphql-request": "6.1.0",
|
|
53
53
|
"graphql-tag": "2.12.6",
|
|
54
|
-
"graphql-ws": "5.16.
|
|
54
|
+
"graphql-ws": "5.16.2",
|
|
55
55
|
"inquirer": "9.2.23",
|
|
56
56
|
"isomorphic-ws": "5.0.0",
|
|
57
57
|
"istextorbinary": "6.0.0",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"parse-diff": "0.11.1",
|
|
64
64
|
"semver": "7.6.3",
|
|
65
65
|
"simple-git": "3.27.0",
|
|
66
|
-
"snyk": "1.
|
|
66
|
+
"snyk": "1.1295.0",
|
|
67
67
|
"supports-color": "9.4.0",
|
|
68
68
|
"tar": "6.2.1",
|
|
69
69
|
"tmp": "0.2.3",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"@graphql-codegen/typescript-graphql-request": "6.2.0",
|
|
80
80
|
"@graphql-codegen/typescript-operations": "4.4.0",
|
|
81
81
|
"@octokit/request-error": "3.0.3",
|
|
82
|
-
"@octokit/types": "13.
|
|
82
|
+
"@octokit/types": "13.7.0",
|
|
83
83
|
"@types/adm-zip": "0.5.7",
|
|
84
84
|
"@types/chalk-animation": "1.6.3",
|
|
85
85
|
"@types/configstore": "6.0.2",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"@vitest/ui": "2.1.8",
|
|
98
98
|
"eslint": "8.57.0",
|
|
99
99
|
"eslint-plugin-import": "2.31.0",
|
|
100
|
-
"eslint-plugin-prettier": "5.2.
|
|
100
|
+
"eslint-plugin-prettier": "5.2.2",
|
|
101
101
|
"eslint-plugin-simple-import-sort": "10.0.0",
|
|
102
102
|
"prettier": "3.4.2",
|
|
103
103
|
"tsup": "7.2.0",
|